diff --git a/SYSTEM_PROMPT.md b/SYSTEM_PROMPT.md index 954b3c1d..2ab80831 100644 --- a/SYSTEM_PROMPT.md +++ b/SYSTEM_PROMPT.md @@ -113,6 +113,39 @@ of the same clone. Git state is shared between you: - Your worktree starts **detached on the baseline tip**; check out your experiment's branch before editing. +### Delegating with `orx agent spawn` + +You can start one of those sessions yourself. `orx agent spawn ""` +creates a **new top-level session** in this project — visible to the user in +the sidebar, on its own worktree, with its own transcript — and hands it the +task. This chat is resumed with the helper's closing reply when it finishes +(pass `--no-wake` if you don't need to hear back). Use `--stdin` for a brief +too long for a command line. You may have {max_spawns} helpers in flight at +once, and a session that was itself spawned cannot spawn helpers of its own — +if `orx agent spawn` tells you that, do the task here instead. + +Delegate work that is genuinely **separate from the node you are on**: a +literature sweep, a survey of an unfamiliar codebase, a write-up of results you +already have. Do it yourself when it is a step in the loop you are running — +the round trip costs more than the step. + +Two rules make a helper safe to start: + +- **Never hand it a branch this session holds.** One branch, one owner (above) + applies across spawned sessions too, and a frozen node may not be edited by + anyone (cardinal rule 1). If the helper needs to change code, tell it to + create its own node with `orx create-experiment {id} --parent ` and + work there. +- **Say which runs it may launch, if any.** The helper reads this same + playbook, so it will otherwise assume the full research loop is open to it + and may launch paid runs you never see. Name them ("one `orx exp run` on + ``, nothing else") or forbid them ("do not run `orx exp run`"). + +The helper starts with an **empty transcript and cannot see this conversation**, +so the brief must stand alone: name the project, the experiment id, the branch, +the metric, and what "done" looks like. Its edits stay in its own worktree; the +wake-up names where. Nothing merges into yours by itself. + ## Cardinal rules Breaking any of these silently invalidates results — they are not style @@ -162,6 +195,7 @@ preferences. | `orx exp cancel ` | Cancel the in-flight run. | | `orx exp wait [--timeout ]` / `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 exp wake ` | Resume this local chat after the experiment's latest run succeeds or fails. Cancelled runs do not wake the chat. | +| `orx agent spawn "" [--title ""] [--stdin] [--no-wake]` | Hand a self-contained task to a helper agent in its own session and worktree. This chat resumes with the helper's reply when it finishes. | | `orx runs {id} [--experiment ]` | Run table, newest first. Run ids come from here. | | `orx logs [--head] [--bytes ] [--range :]` | Read a run's log (tail by default). | | `orx lit "" [--source alphaxiv\|openalex\|biorxiv]` / `orx paper ` | Literature search across alphaXiv, OpenAlex, and bioRxiv (public, no login): **`orx-lit`** skill. Preferred over web search for academic/research queries — start here. | diff --git a/src/commands/agent.rs b/src/commands/agent.rs new file mode 100644 index 00000000..9b4f0ea1 --- /dev/null +++ b/src/commands/agent.rs @@ -0,0 +1,231 @@ +//! The `agent` command group: delegate work to a second agent session. +//! +//! orx agent spawn "" start a helper agent on its own top-level session +//! +//! Only meaningful inside a local `orx up` agent session. `ORX_LOCAL_SESSION` +//! marks the process as one; `ORX_CHAT_SESSION_ID` names the session doing the +//! spawning (see `local::chat::set_chat_session_env`). Both are needed — the +//! cloud opencode plugin exports the session id too, for run attribution. +//! +//! This command only writes the child's session row and a `chat_spawns` record; +//! it never runs the child itself. The resident `orx up` picks the record up, +//! starts the helper's first turn, and (unless `--no-wake`) wakes the parent +//! when the helper is done. Same store-and-watcher split as `orx exp wake`, and for +//! the same reason: the CLI is a short-lived subprocess with no harness of its +//! own to run a turn on. + +use std::io::Read; + +use crate::error::{anyhow, Result}; +use crate::local::harness::PermissionMode; +use crate::store::{now_ms, ChatSpawn, Store, StoredChatSession}; + +use crate::AgentCommand; + +/// Helpers one session may have in flight at once. +pub(crate) const MAX_LIVE_SPAWNS: i64 = 5; + +pub async fn run(args: crate::AgentArgs) -> Result<()> { + let store = Store::open()?; + match args.command { + AgentCommand::Spawn { + task, + stdin, + title, + harness, + model, + no_wake, + } => spawn(&store, task, stdin, title, harness, model, !no_wake), + } +} + +/// Read the task from the positional argument or, with `--stdin`, from the +/// whole of stdin (agents write multi-paragraph briefs as heredocs). +fn task_text(task: Option, stdin: bool) -> Result { + if stdin { + if task.is_some() { + return Err(anyhow!( + "Pass the task as an argument or --stdin, not both." + )); + } + let mut buf = String::new(); + std::io::stdin() + .read_to_string(&mut buf) + .map_err(|e| anyhow!("Could not read the task from stdin: {e}"))?; + return non_empty(buf); + } + non_empty(task.unwrap_or_default()) +} + +fn non_empty(text: String) -> Result { + let trimmed = text.trim(); + if trimmed.is_empty() { + return Err(anyhow!( + "Describe the task for the spawned agent: `orx agent spawn \"\"`." + )); + } + Ok(trimmed.to_string()) +} + +/// Why this session may not spawn right now, if it may not. Depth and breadth +/// are the two ways one request becomes an unbounded tree of paid sessions, and +/// nothing downstream of here bounds either. +fn spawn_refusal(parent: &StoredChatSession, live: i64) -> Option { + if parent.parent_session_id.is_some() { + return Some( + "This session was itself spawned by another agent, and spawned agents cannot spawn \ + their own. Do the task here, or report back so the session that spawned you can \ + delegate it." + .to_string(), + ); + } + (live >= MAX_LIVE_SPAWNS).then(|| { + format!( + "You already have {live} agents in flight, the most one session may run at once. \ + Wait for one to report back before spawning another." + ) + }) +} + +fn spawn( + store: &Store, + task: Option, + stdin: bool, + title: Option, + harness: Option, + model: Option, + wake_parent: bool, +) -> Result<()> { + if !crate::local::chat::in_local_session() { + return Err(anyhow!( + "`orx agent spawn` is only available inside a local `orx up` agent session." + )); + } + let parent_id = crate::local::chat::launching_chat_session() + .ok_or_else(|| anyhow!("This agent session has no chat id to spawn from."))?; + let parent = store + .get_chat_session(&parent_id)? + .ok_or_else(|| anyhow!("The current chat session no longer exists."))?; + let prompt = task_text(task, stdin)?; + if let Some(refusal) = spawn_refusal(&parent, store.count_live_chat_spawns(&parent_id)?) { + return Err(anyhow!(refusal)); + } + let harness = harness.unwrap_or_else(|| parent.harness.clone()); + if !crate::local::harness::is_chat_harness(&harness) { + return Err(anyhow!("unknown harness: {harness}")); + } + // Settings only carry over when the child runs the same harness; a model or + // permission-mode id from one CLI is meaningless to another. + let inherits = harness == parent.harness; + // Claude activates Plan through its permission mode, not the plan axis, so + // clearing `plan_mode` alone would still hand a planning parent's helper a + // mode that only ever produces a plan. + let plan_permission = + crate::local::harness::permission_id_for_mode(&harness, PermissionMode::Plan); + let title = title + .map(|t| t.trim().to_string()) + .filter(|t| !t.is_empty()); + let session = StoredChatSession { + id: format!("chat_{}", uuid::Uuid::new_v4()), + project_id: parent.project_id.clone(), + harness, + native_session_id: None, + // "user" = explicitly chosen, so auto-titling leaves it alone. + title_source: title.is_some().then(|| "user".to_string()), + title, + model: model.or_else(|| inherits.then(|| parent.model.clone()).flatten()), + permission_mode: inherits + .then(|| parent.permission_mode.clone()) + .flatten() + .filter(|mode| Some(mode) != plan_permission.as_ref()), + plan_mode: false, + plan_reset_pending: false, + reasoning_level: inherits.then(|| parent.reasoning_level.clone()).flatten(), + archived: false, + context_usage_json: None, + bootstrap_context: None, + active_leaf_id: None, + parent_session_id: Some(parent_id.clone()), + created_at: now_ms(), + updated_at: now_ms(), + }; + // One transaction: a session row without its spawn row is an empty session + // in the user's sidebar that nothing will ever start. + let tx = store.begin()?; + store.create_chat_session(&session)?; + store.create_chat_spawn(&ChatSpawn { + session_id: session.id.clone(), + parent_session_id: parent_id, + prompt, + wake_parent, + attempts: 0, + finished_at: None, + })?; + tx.commit()?; + println!("Spawned agent session {}.", session.id); + println!("It starts within a few seconds and works in its own git worktree."); + if wake_parent { + println!("This chat will be resumed with its result when it finishes."); + } else { + println!("You will NOT be told when it finishes; check its session yourself."); + } + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::{spawn_refusal, task_text, MAX_LIVE_SPAWNS}; + use crate::store::StoredChatSession; + + fn parent(parent_session_id: Option<&str>) -> StoredChatSession { + StoredChatSession { + id: "chat_parent".into(), + project_id: "p1".into(), + harness: "codex".into(), + native_session_id: None, + title: None, + title_source: None, + model: None, + permission_mode: None, + plan_mode: false, + plan_reset_pending: false, + reasoning_level: None, + archived: false, + context_usage_json: None, + bootstrap_context: None, + active_leaf_id: None, + parent_session_id: parent_session_id.map(str::to_string), + created_at: 1, + updated_at: 1, + } + } + + #[test] + fn a_spawned_session_may_not_spawn_its_own() { + let refusal = spawn_refusal(&parent(Some("chat_grandparent")), 0) + .expect("a spawned session must be refused"); + assert!(refusal.contains("cannot spawn"), "{refusal}"); + // Depth is refused regardless of how few helpers are in flight. + assert!(spawn_refusal(&parent(None), 0).is_none()); + } + + #[test] + fn one_session_may_only_run_so_many_helpers_at_once() { + assert!(spawn_refusal(&parent(None), MAX_LIVE_SPAWNS - 1).is_none()); + let refusal = + spawn_refusal(&parent(None), MAX_LIVE_SPAWNS).expect("the cap must refuse one more"); + assert!(refusal.contains("in flight"), "{refusal}"); + } + + #[test] + fn a_task_is_required_and_comes_from_one_place() { + assert_eq!( + task_text(Some(" Sweep the literature ".into()), false).unwrap(), + "Sweep the literature" + ); + assert!(task_text(None, false).is_err()); + assert!(task_text(Some(" ".into()), false).is_err()); + // --stdin and a positional together are ambiguous, so neither is used. + assert!(task_text(Some("from the args".into()), true).is_err()); + } +} diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 22cd1180..cdc60cf5 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -15,6 +15,7 @@ //! return `Err(anyhow!(...))` (clap already enforces required positionals, so //! most of those usage guards are unnecessary in the Rust port). +pub mod agent; pub mod app; pub mod compute; pub mod create_experiment; diff --git a/src/commands/up.rs b/src/commands/up.rs index 8681755a..7ad04e6c 100644 --- a/src/commands/up.rs +++ b/src/commands/up.rs @@ -4575,6 +4575,7 @@ async fn create_chat_session( context_usage_json: None, bootstrap_context: None, active_leaf_id: None, + parent_session_id: None, created_at: now_ms(), updated_at: now_ms(), }; diff --git a/src/local/chat/mod.rs b/src/local/chat/mod.rs index 37112fc7..bd457b19 100644 --- a/src/local/chat/mod.rs +++ b/src/local/chat/mod.rs @@ -23,7 +23,7 @@ use crate::error::{anyhow, Result}; use crate::local::harness::ResumeAction; use crate::local::model::LocalProject; use crate::local::opencode::AgentHost; -use crate::store::{now_ms, Store, StoredChatMessage, StoredChatSession}; +use crate::store::{now_ms, ChatSpawnState, Store, StoredChatMessage, StoredChatSession}; /// Min interval between mid-turn persist+broadcast flushes (streaming parts /// can update many times a second; the final flush is always unconditional). @@ -1100,6 +1100,7 @@ pub fn session_json(s: &StoredChatSession, busy: bool) -> Value { "busy": busy, "contextUsage": context_usage, "activeLeafId": s.active_leaf_id, + "parentSessionId": s.parent_session_id, }) } @@ -2734,6 +2735,36 @@ impl ChatHost { .await } + /// Deliver a spawned helper's brief as the opening message of its session. + /// Visible, unlike a wake-up: the brief *is* that transcript's starting + /// point, and hiding it would leave the helper apparently working unbidden. + /// `record_brief` is false on a retry, where it is already in the + /// transcript — this persists the bubble before it can report a failure. + async fn send_spawn_task( + self: &Arc, + session_id: &str, + text: String, + record_brief: bool, + guard: TurnGuard, + ) -> Result { + self.send_message_showing( + session_id, + vec![AnnotatedText { + text: text.clone(), + annotations: Vec::new(), + }], + TranscriptDisplay { + text: Some(text), + annotations: None, + record_user_message: record_brief, + }, + TurnOverrides::default(), + TurnAttachments::Uploaded(Vec::new()), + TurnAdmission::Preclaimed(guard), + ) + .await + } + /// Persists one displayed user turn, then expands and contextualizes each /// raw annotated message separately for the harness. `transcript_text` /// overrides the displayed text; an empty override records no user message. @@ -3208,6 +3239,9 @@ impl ChatHost { self.cancel_pending_permissions(session_id); let session = if let Ok(store) = Store::open() { let _ = store.touch_chat_session(session_id); + // Without this a crash mid-turn is indistinguishable from a + // completed one once the turn lease lapses. + let _ = store.mark_chat_spawn_finished(session_id); store.get_chat_session(session_id).ok().flatten() } else { None @@ -4745,6 +4779,330 @@ async fn process_run_wakeups( Ok(()) } +// --- spawned agents ------------------------------------------------------------- + +/// How much of a helper's closing reply, and of the brief echoed back with it, +/// rides into the parent's context. Both are agent-authored and unbounded; the +/// user can open the helper's session for the rest. +const SPAWN_REPORT_LIMIT: usize = 4000; +const SPAWN_BRIEF_LIMIT: usize = 500; + +/// Give up starting a helper after this many failed attempts, so a permanently +/// failing spawn reports once instead of retrying every tick forever. +const SPAWN_START_ATTEMPTS: i64 = 3; + +fn truncated(text: &str, limit: usize) -> String { + if text.chars().count() <= limit { + return text.to_string(); + } + text.chars().take(limit).collect::() + "… (truncated)" +} + +/// What the helper left behind on the branch on screen. +enum SpawnOutcome { + Reply(String), + Failed(String), + /// The turn was stopped — by the user, or by an `orx up` that died holding + /// it. Whatever text is there is half-written, not an answer. + Interrupted, + Silent, +} + +/// Read the helper's closing words. Walks back from the tip rather than reading +/// only the last assistant row: an answered prompt card rides its own +/// text-less assistant message and would otherwise mask the real reply. +fn spawn_outcome(store: &Store, session: &StoredChatSession) -> Result { + let messages = store.list_chat_messages(&session.id)?; + let path = active_path(&messages, session.active_leaf_id.as_deref()); + let mut failure = None; + // Stop at the newest user message: anything above it belongs to an earlier + // turn and is not this task's answer. + for message in path.iter().rev().take_while(|m| m.role != "user") { + let parts: Vec = serde_json::from_str(&message.parts_json)?; + // A user Stop persists this marker and no text; the half-written text + // above it must not be handed back as a closing reply. + if parts + .iter() + .any(|part| part.tool.as_deref() == Some("interrupted")) + { + return Ok(SpawnOutcome::Interrupted); + } + let text = parts + .iter() + .filter(|part| part.kind == "text") + .filter_map(|part| part.text.as_deref()) + .map(str::trim) + .filter(|text| !text.is_empty()) + .collect::>() + .join("\n\n"); + if !text.is_empty() { + return Ok(SpawnOutcome::Reply(truncated(&text, SPAWN_REPORT_LIMIT))); + } + // Keep the newest error, but keep looking: a harness that errors after + // answering should still hand the answer back. + if failure.is_none() { + failure = parts + .iter() + .find(|part| part.tool.as_deref() == Some("error")) + .and_then(|part| part.state.as_ref()) + .and_then(|state| state.error.clone().or_else(|| state.output.clone())); + } + } + Ok(match failure { + Some(error) => SpawnOutcome::Failed(truncated(error.trim(), SPAWN_REPORT_LIMIT)), + None => SpawnOutcome::Silent, + }) +} + +/// Where the helper's work is. Deliberately claims no branch: session worktrees +/// start detached, so a helper only has one if it ran `orx create-experiment`. +fn spawn_workspace(store: &Store, session: &StoredChatSession) -> String { + let Ok(Some(project)) = store.get_local_project(&session.project_id) else { + return String::new(); + }; + let path = crate::local::git::existing_session_worktree_path(&project, &session.id); + if !path.exists() { + return String::new(); + } + format!( + "\n\nIts edits are in its own worktree at `{}` — read them there. Nothing was merged \ + into yours.", + path.display() + ) +} + +fn spawn_report_text( + store: &Store, + spawn: &crate::store::ChatSpawn, + interrupted: bool, +) -> Result { + let child = store + .get_chat_session(&spawn.session_id)? + .ok_or_else(|| anyhow!("spawned session disappeared"))?; + let named = child + .title + .as_deref() + .map(|title| format!(" (\"{title}\")")) + .unwrap_or_default(); + let brief = truncated(spawn.prompt.trim(), SPAWN_BRIEF_LIMIT); + let stopped = "Its session holds however far it got. Re-delegate it if you still need the \ + task done."; + let (headline, closing) = if interrupted { + ("was interrupted before it finished", stopped.to_string()) + } else { + match spawn_outcome(store, &child)? { + SpawnOutcome::Reply(reply) => { + ("has finished", format!("Its closing reply:\n\n{reply}")) + } + SpawnOutcome::Failed(error) => ( + "failed", + format!("It ended on an error and did NOT do the task:\n\n{error}"), + ), + SpawnOutcome::Interrupted => ("was stopped before it finished", stopped.to_string()), + SpawnOutcome::Silent => ( + "has finished", + "It wrote no reply, so treat the task as unconfirmed and check its session." + .to_string(), + ), + } + }; + Ok(format!( + "[orx] The agent you spawned for `{}`{named} {headline}.\n\nIt was asked to: {brief}\n\n\ + {closing}{}", + spawn.session_id, + spawn_workspace(store, &child), + )) +} + +fn spawn_start_failure_text(spawn: &crate::store::ChatSpawn) -> String { + format!( + "[orx] The agent you spawned for `{}` could NOT be started, so the task was not done. \ + It was asked to: {}\n\nDo the task here, or delegate it again.", + spawn.session_id, + truncated(spawn.prompt.trim(), SPAWN_BRIEF_LIMIT), + ) +} + +/// Start the first turn of every freshly spawned helper, then wake the parent +/// that asked for each finished one. +/// +/// Both halves are claim-guarded in the store rather than in memory: the CLI +/// that wrote the row is long gone, and a crash between claiming and delivering +/// has to be recoverable by the next `orx up`. +async fn process_chat_spawns( + chat: &Arc, + mut store: Store, + data_dir_move_in_progress: Option<&std::sync::atomic::AtomicBool>, +) -> Result<()> { + let moving = || { + data_dir_move_in_progress.is_some_and(|flag| flag.load(std::sync::atomic::Ordering::SeqCst)) + }; + if moving() { + return Ok(()); + } + store.prune_chat_spawns()?; + for spawn in store.list_chat_spawns(ChatSpawnState::Pending)? { + if moving() { + return Ok(()); + } + // Out of retries: the helper will never run, and all that is left is + // telling the parent so. Retried like any other wake-up rather than + // fired once — the parent is usually still mid-turn from delegating. + if spawn.attempts >= SPAWN_START_ATTEMPTS { + if !spawn.wake_parent { + let Some(token) = store.claim_chat_spawn( + &spawn.session_id, + ChatSpawnState::Pending, + ChatSpawnState::Waking, + )? + else { + continue; + }; + store.settle_chat_spawn(&spawn.session_id, &token, ChatSpawnState::Done)?; + continue; + } + store = deliver_wake_up( + chat, + store, + &spawn, + ChatSpawnState::Pending, + spawn_start_failure_text(&spawn), + ) + .await?; + continue; + } + let Some(mut guard) = TurnGuard::claim_hidden(chat, &spawn.session_id).await else { + continue; + }; + let Some(token) = store.claim_chat_spawn( + &spawn.session_id, + ChatSpawnState::Pending, + ChatSpawnState::Starting, + )? + else { + guard.release().await; + continue; + }; + // Broadcast before the turn so the session appears in every open + // dashboard's Recents as it starts working, not after its first flush. + chat.emit_session(store.get_chat_session(&spawn.session_id)?) + .await; + // A retry must not re-record the brief: `send_message_showing` persists + // the user message before it can report the turn didn't start. + let record_brief = store.list_chat_messages(&spawn.session_id)?.is_empty(); + let started = chat + .send_spawn_task(&spawn.session_id, spawn.prompt.clone(), record_brief, guard) + .await; + // Running even for a fire-and-forget spawn: the second loop retires it + // once the helper is actually idle, so `--no-wake` cannot slip past the + // in-flight cap by retiring the instant its turn starts. + let next = match started { + Ok(TurnSubmission::Started) => ChatSpawnState::Running, + outcome => { + if let Err(err) = &outcome { + eprintln!( + "orx up: could not start spawned agent {}: {err}", + spawn.session_id + ); + } + store.record_chat_spawn_attempt(&spawn.session_id)?; + ChatSpawnState::Pending + } + }; + store.settle_chat_spawn(&spawn.session_id, &token, next)?; + } + for spawn in store.list_chat_spawns(ChatSpawnState::Running)? { + if moving() { + return Ok(()); + } + // The durable lease, not just this process's turn map: a helper running + // under another `orx up` (or under one that has since restarted) is + // still working, and reporting it finished would abandon the task. + if chat.is_busy(&spawn.session_id).await || store.chat_turn_leased(&spawn.session_id)? { + continue; + } + if !spawn.wake_parent || store.get_chat_session(&spawn.parent_session_id)?.is_none() { + // Nobody to tell — fire-and-forget, or a deleted parent. The + // helper's own session stays either way. + let Some(token) = store.claim_chat_spawn( + &spawn.session_id, + ChatSpawnState::Running, + ChatSpawnState::Waking, + )? + else { + continue; + }; + store.settle_chat_spawn(&spawn.session_id, &token, ChatSpawnState::Done)?; + continue; + } + // Re-read rather than trusting the listing: earlier iterations await + // whole turns, and a helper that finished cleanly during that window + // would otherwise be reported as interrupted and its reply discarded. + let interrupted = store + .get_chat_spawn(&spawn.session_id)? + .is_some_and(|row| row.finished_at.is_none()); + let text = match spawn_report_text(&store, &spawn, interrupted) { + Ok(text) => text, + Err(err) => { + eprintln!("orx up: could not summarize spawned agent: {err}"); + let Some(token) = store.claim_chat_spawn( + &spawn.session_id, + ChatSpawnState::Running, + ChatSpawnState::Waking, + )? + else { + continue; + }; + store.settle_chat_spawn(&spawn.session_id, &token, ChatSpawnState::Done)?; + continue; + } + }; + store = deliver_wake_up(chat, store, &spawn, ChatSpawnState::Running, text).await?; + } + Ok(()) +} + +/// Wake the parent and retire the row, but only together: a row that stays in +/// `from` is retried next tick, which is what keeps a busy parent from costing +/// the delegation its report. +/// Takes the `Store` by value and hands it back: it is `!Sync`, so a borrow +/// held across these awaits would make the watcher future non-`Send`. +async fn deliver_wake_up( + chat: &Arc, + store: Store, + spawn: &crate::store::ChatSpawn, + from: ChatSpawnState, + text: String, +) -> Result { + let Some(guard) = TurnGuard::claim_hidden(chat, &spawn.parent_session_id).await else { + return Ok(store); + }; + let Some(token) = store.claim_chat_spawn(&spawn.session_id, from, ChatSpawnState::Waking)? + else { + return Ok(store); + }; + let next = match chat + .send_hidden_message(&spawn.parent_session_id, text, guard) + .await + { + Ok(TurnSubmission::Started) => ChatSpawnState::Done, + outcome => { + if let Err(err) = &outcome { + if !chat.is_busy(&spawn.parent_session_id).await { + eprintln!("orx up: could not wake a spawned agent's parent: {err}"); + } + } + from + } + }; + if !store.settle_chat_spawn(&spawn.session_id, &token, next)? { + return Err(anyhow!( + "spawn claim expired before the parent wake-up was recorded" + )); + } + Ok(store) +} + /// Resume explicitly subscribed agent sessions after a run finishes. Busy and /// draining sessions retain their durable wake-up until they become idle. pub async fn watch_runs( @@ -4770,6 +5128,12 @@ pub async fn watch_runs( { eprintln!("orx up: run watcher: {err}"); } + let Ok(store) = Store::open() else { continue }; + if let Err(err) = + process_chat_spawns(&chat, store, Some(data_dir_move_in_progress.as_ref())).await + { + eprintln!("orx up: spawn watcher: {err}"); + } } } @@ -5747,6 +6111,7 @@ mod bridge_tests { context_usage_json: None, bootstrap_context: None, active_leaf_id: None, + parent_session_id: None, created_at: 1, updated_at: 1, } @@ -5880,6 +6245,7 @@ mod run_wakeup_tests { context_usage_json: None, bootstrap_context: None, active_leaf_id: None, + parent_session_id: None, created_at: 1, updated_at: 1, }) @@ -5929,6 +6295,384 @@ with other project runs using `orx runs p1` and inspect this run's logs using `o assert!(run_wakeup_text(&run("cancelled")).is_none()); } + fn assistant_message(id: &str, parent: Option<&str>, text: &str) -> StoredChatMessage { + StoredChatMessage { + id: id.into(), + session_id: "child".into(), + role: "assistant".into(), + parts_json: serde_json::to_string(&[WirePart::text(format!("{id}-part"), text)]) + .unwrap(), + created_at: 1, + parent_id: parent.map(str::to_string), + base_native_session_id: None, + result_native_session_id: None, + } + } + + /// `create_chat_spawn` always inserts `pending`, so a test that needs a + /// later state advances the row the way the watcher would. + fn spawn_row(store: &Store, child: &str, parent: &str, state: ChatSpawnState) { + store + .create_chat_spawn(&crate::store::ChatSpawn { + session_id: child.into(), + parent_session_id: parent.into(), + prompt: "Sweep the literature".into(), + wake_parent: true, + attempts: 0, + finished_at: None, + }) + .unwrap(); + if matches!(state, ChatSpawnState::Running) { + let token = store + .claim_chat_spawn(child, ChatSpawnState::Pending, ChatSpawnState::Starting) + .unwrap() + .unwrap(); + store + .settle_chat_spawn(child, &token, ChatSpawnState::Running) + .unwrap(); + // A Running row stands for a turn that reached `finish_turn`; the + // crash and Stop cases are exercised in the report-text tests. + store.mark_chat_spawn_finished(child).unwrap(); + } + } + + fn spawn_fixture(child: &str, parent: &str) -> crate::store::ChatSpawn { + crate::store::ChatSpawn { + session_id: child.into(), + parent_session_id: parent.into(), + prompt: "Sweep the literature".into(), + wake_parent: true, + attempts: 0, + finished_at: Some(1), + } + } + + fn bare_host() -> Arc { + Arc::new(ChatHost::new( + Arc::new(crate::local::opencode::AgentHost::new(None)), + Arc::new(crate::local::codex::CodexHost::new()), + Arc::new(crate::local::claude::ClaudeHost::new()), + )) + } + + #[tokio::test] + async fn a_helper_whose_turn_is_already_held_keeps_its_row_pending() { + let (store, dir) = temp_store("spawn-busy"); + session(&store, "child"); + spawn_row(&store, "child", "parent", ChatSpawnState::Pending); + let host = bare_host(); + host.turns + .lock() + .await + .insert("child".into(), TurnState::Draining); + + drop(store); + process_chat_spawns(&host, Store::open_at(dir.clone()).unwrap(), None) + .await + .unwrap(); + + let store = Store::open_at(dir.clone()).unwrap(); + assert_eq!( + store + .list_chat_spawns(ChatSpawnState::Pending) + .unwrap() + .len(), + 1 + ); + drop(store); + std::fs::remove_dir_all(dir).unwrap(); + } + + #[tokio::test] + async fn a_working_helper_is_not_reported_until_it_goes_idle() { + let (store, dir) = temp_store("spawn-working"); + session(&store, "child"); + session(&store, "parent"); + spawn_row(&store, "child", "parent", ChatSpawnState::Running); + let host = bare_host(); + host.turns + .lock() + .await + .insert("child".into(), TurnState::Reserved); + + drop(store); + process_chat_spawns(&host, Store::open_at(dir.clone()).unwrap(), None) + .await + .unwrap(); + + let store = Store::open_at(dir.clone()).unwrap(); + assert_eq!( + store + .list_chat_spawns(ChatSpawnState::Running) + .unwrap() + .len(), + 1 + ); + assert!(!host.is_busy("parent").await); + drop(store); + std::fs::remove_dir_all(dir).unwrap(); + } + + #[tokio::test] + async fn a_helper_still_running_under_another_orx_up_is_not_reported_finished() { + let (store, dir) = temp_store("spawn-leased"); + session(&store, "child"); + session(&store, "parent"); + spawn_row(&store, "child", "parent", ChatSpawnState::Running); + // Another process holds the turn: this one's `turns` map knows nothing + // about it, so only the durable lease can stop a false completion. + store + .claim_chat_turn("child", "other-process-token") + .unwrap(); + let host = bare_host(); + + drop(store); + process_chat_spawns(&host, Store::open_at(dir.clone()).unwrap(), None) + .await + .unwrap(); + + let store = Store::open_at(dir.clone()).unwrap(); + assert_eq!( + store + .list_chat_spawns(ChatSpawnState::Running) + .unwrap() + .len(), + 1, + "a leased helper must stay Running" + ); + assert!(!host.is_busy("parent").await); + drop(store); + let _ = std::fs::remove_dir_all(dir); + } + + #[test] + fn an_interrupted_helper_is_not_reported_as_finished() { + let (store, dir) = temp_store("spawn-interrupted"); + session(&store, "child"); + store + .upsert_chat_message(&assistant_message("a1", None, "halfway through")) + .unwrap(); + let spawn = crate::store::ChatSpawn { + session_id: "child".into(), + parent_session_id: "parent".into(), + prompt: "Sweep the literature".into(), + wake_parent: true, + attempts: 0, + finished_at: None, + }; + + let text = spawn_report_text(&store, &spawn, true).unwrap(); + assert!( + text.contains("was interrupted before it finished"), + "{text}" + ); + assert!(!text.contains("has finished"), "{text}"); + // The partial text must not be handed back as a closing answer. + assert!(!text.contains("halfway through"), "{text}"); + + let _ = std::fs::remove_dir_all(&dir); + } + + #[test] + fn a_helper_that_errored_is_reported_as_failed_not_silent() { + let (store, dir) = temp_store("spawn-errored"); + session(&store, "child"); + // Exactly what `TurnCtx::push_error` writes. + let parts = vec![WirePart::tool( + "err-0", + "error", + "error", + Some("model 'gpt-5' is not supported".into()), + )]; + store + .upsert_chat_message(&StoredChatMessage { + id: "a1".into(), + session_id: "child".into(), + role: "assistant".into(), + parts_json: serde_json::to_string(&parts).unwrap(), + created_at: 1, + parent_id: None, + base_native_session_id: None, + result_native_session_id: None, + }) + .unwrap(); + + let child = store.get_chat_session("child").unwrap().unwrap(); + let SpawnOutcome::Failed(error) = spawn_outcome(&store, &child).unwrap() else { + panic!("an error part must not read as a silent turn"); + }; + assert!(error.contains("not supported"), "{error}"); + + let _ = std::fs::remove_dir_all(&dir); + } + + #[test] + fn an_answered_prompt_card_does_not_mask_the_real_reply() { + let (store, dir) = temp_store("spawn-card"); + session(&store, "child"); + store + .upsert_chat_message(&assistant_message("a1", None, "the answer")) + .unwrap(); + // A resolved card rides its own text-less assistant message and becomes + // the branch tip; reading only the tip would lose the answer above it. + store + .upsert_chat_message(&StoredChatMessage { + id: "a2".into(), + session_id: "child".into(), + role: "assistant".into(), + parts_json: "[]".into(), + created_at: 2, + parent_id: Some("a1".into()), + base_native_session_id: None, + result_native_session_id: None, + }) + .unwrap(); + store + .set_chat_session_active_leaf("child", Some("a2")) + .unwrap(); + + let child = store.get_chat_session("child").unwrap().unwrap(); + let SpawnOutcome::Reply(reply) = spawn_outcome(&store, &child).unwrap() else { + panic!("expected the reply above the card"); + }; + assert_eq!(reply, "the answer"); + + let _ = std::fs::remove_dir_all(&dir); + } + + #[test] + fn a_long_reply_and_a_long_brief_are_both_bounded() { + let (store, dir) = temp_store("spawn-truncate"); + session(&store, "child"); + store + .upsert_chat_message(&assistant_message("a1", None, &"x".repeat(9000))) + .unwrap(); + let spawn = crate::store::ChatSpawn { + session_id: "child".into(), + parent_session_id: "parent".into(), + prompt: "y".repeat(9000), + wake_parent: true, + attempts: 0, + finished_at: Some(1), + }; + + let text = spawn_report_text(&store, &spawn, false).unwrap(); + assert_eq!(text.matches("… (truncated)").count(), 2, "{text}"); + assert!(text.chars().count() < SPAWN_REPORT_LIMIT + SPAWN_BRIEF_LIMIT + 600); + + let _ = std::fs::remove_dir_all(&dir); + } + + #[tokio::test] + async fn a_finished_helper_whose_parent_is_gone_retires_quietly() { + let (store, dir) = temp_store("spawn-orphan"); + session(&store, "child"); + spawn_row(&store, "child", "deleted_parent", ChatSpawnState::Running); + let host = bare_host(); + + drop(store); + process_chat_spawns(&host, Store::open_at(dir.clone()).unwrap(), None) + .await + .unwrap(); + + let store = Store::open_at(dir.clone()).unwrap(); + assert!(store + .list_chat_spawns(ChatSpawnState::Running) + .unwrap() + .is_empty()); + assert_eq!( + store.list_chat_spawns(ChatSpawnState::Done).unwrap().len(), + 1 + ); + drop(store); + std::fs::remove_dir_all(dir).unwrap(); + } + + #[test] + fn a_spawned_agent_reports_its_last_reply_on_the_branch_on_screen() { + let (store, dir) = temp_store("spawn-report"); + session(&store, "child"); + store + .upsert_chat_message(&assistant_message("a1", None, "first pass")) + .unwrap(); + store + .upsert_chat_message(&assistant_message("a2", Some("a1"), "the answer")) + .unwrap(); + // A re-sampled sibling that is *not* the branch on screen must not win. + store + .upsert_chat_message(&assistant_message("a3", Some("a1"), "discarded fork")) + .unwrap(); + store + .set_chat_session_active_leaf("child", Some("a2")) + .unwrap(); + + let child = store.get_chat_session("child").unwrap().unwrap(); + let SpawnOutcome::Reply(reply) = spawn_outcome(&store, &child).unwrap() else { + panic!("expected a written reply"); + }; + assert_eq!(reply, "the answer"); + + let _ = std::fs::remove_dir_all(&dir); + } + + #[test] + fn the_parent_is_told_what_it_asked_for_and_what_came_back() { + let (store, dir) = temp_store("spawn-text"); + session(&store, "child"); + store + .set_chat_session_title("child", "Lit sweep", "user") + .unwrap(); + store + .upsert_chat_message(&assistant_message("a1", None, "Rank 8 wins.")) + .unwrap(); + let spawn = spawn_fixture("child", "parent"); + + let text = spawn_report_text(&store, &spawn, false).unwrap(); + // No workspace clause: the fixture's project has no checkout on disk, + // which is also what a helper that never wrote anything looks like. + assert_eq!( + text, + "[orx] The agent you spawned for `child` (\"Lit sweep\") has finished.\n\n\ + It was asked to: Sweep the literature\n\nIts closing reply:\n\nRank 8 wins." + ); + + // An untitled helper still reads as a sentence. + session(&store, "untitled"); + store + .upsert_chat_message(&StoredChatMessage { + id: "b1".into(), + session_id: "untitled".into(), + role: "assistant".into(), + parts_json: serde_json::to_string(&[WirePart::text("p", "Rank 8 wins.")]).unwrap(), + created_at: 1, + parent_id: None, + base_native_session_id: None, + result_native_session_id: None, + }) + .unwrap(); + assert!( + spawn_report_text(&store, &spawn_fixture("untitled", "parent"), false) + .unwrap() + .starts_with("[orx] The agent you spawned for `untitled` has finished.") + ); + + let _ = std::fs::remove_dir_all(&dir); + } + + #[test] + fn a_helper_that_wrote_nothing_reads_as_silent_not_as_a_reply() { + let (store, dir) = temp_store("spawn-silent"); + session(&store, "child"); + + let child = store.get_chat_session("child").unwrap().unwrap(); + assert!(matches!( + spawn_outcome(&store, &child).unwrap(), + SpawnOutcome::Silent + )); + + let _ = std::fs::remove_dir_all(&dir); + } + #[test] fn hidden_transcript_override_creates_no_user_parts() { assert!(transcript_parts("", &[], &[]).is_empty()); diff --git a/src/local/demo.rs b/src/local/demo.rs index addbff48..979a9c2f 100644 --- a/src/local/demo.rs +++ b/src/local/demo.rs @@ -330,6 +330,7 @@ fn seed_at( context_usage_json: None, bootstrap_context: Some(BOOTSTRAP_CONTEXT.into()), active_leaf_id: Some(ASSISTANT_MESSAGE_ID.into()), + parent_session_id: None, created_at: 1_785_824_322_614, updated_at: 1_785_879_263_859, }; @@ -369,6 +370,7 @@ fn seed_at( context_usage_json: None, bootstrap_context: Some(FIGURE_BOOTSTRAP_CONTEXT.into()), active_leaf_id: Some(FIGURE_ASSISTANT_MESSAGE_ID.into()), + parent_session_id: None, created_at: 1_785_824_322_630, updated_at: 1_785_879_263_858, }; @@ -411,6 +413,7 @@ fn seed_at( context_usage_json: None, bootstrap_context: Some(LITERATURE_BOOTSTRAP_CONTEXT.into()), active_leaf_id: Some(LITERATURE_ASSISTANT_MESSAGE_ID.into()), + parent_session_id: None, created_at: 1_785_824_322_634, updated_at: 1_785_879_263_857, }; diff --git a/src/local/opencode.rs b/src/local/opencode.rs index d1ee4f07..f20214f2 100644 --- a/src/local/opencode.rs +++ b/src/local/opencode.rs @@ -276,6 +276,10 @@ fn playbook_md(project: &LocalProject) -> String { .replace("{run_guidance}", run_guidance) .replace("{compute_guidance}", compute_guidance) .replace("{skills_scope}", skills_scope) + .replace( + "{max_spawns}", + &crate::commands::agent::MAX_LIVE_SPAWNS.to_string(), + ) } /// Keep the files we drop into the checkout out of `git status` / accidental @@ -688,26 +692,22 @@ mod tests { #[test] fn playbook_has_no_unresolved_placeholders() { let md = sample_playbook(); - // Every current token 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}", - "{artifacts}", - "{skills_list}", - "{launch_step}", - "{backends_intro}", - "{run_invocation}", - "{run_guidance}", - "{compute_guidance}", - "{skills_scope}", - ] { - assert!(!md.contains(token), "unresolved placeholder {token}"); - } + // Scanned, not listed: a NEWLY ADDED token playbook_md doesn't know + // about is exactly the case a hardcoded list cannot catch, and the + // agent would read the literal `{token}` as instruction. + let leftover: Vec<&str> = md + .lines() + .flat_map(|line| { + line.match_indices('{').filter_map(move |(i, _)| { + let rest = &line[i + 1..]; + let end = rest.find('}')?; + let token = &rest[..end]; + (!token.is_empty() && token.chars().all(|c| c.is_ascii_lowercase() || c == '_')) + .then_some(&line[i..=i + end + 1]) + }) + }) + .collect(); + assert!(leftover.is_empty(), "unresolved placeholders: {leftover:?}"); for retired in ["{files}", "{memory}"] { assert!(!md.contains(retired), "retired placeholder {retired}"); } diff --git a/src/main.rs b/src/main.rs index 67adbdb6..d810d121 100644 --- a/src/main.rs +++ b/src/main.rs @@ -73,6 +73,9 @@ enum Command { /// Operate on one local project. Project(ProjectArgs), + /// Delegate a task to a second agent session. + Agent(AgentArgs), + /// List a project's runs. Runs(RunsArgs), @@ -370,6 +373,37 @@ pub struct InstanceDeleteArgs { pub sandbox_id: String, } +#[derive(Args, Debug)] +pub struct AgentArgs { + #[command(subcommand)] + pub command: AgentCommand, +} + +#[derive(Subcommand, Debug)] +pub enum AgentCommand { + /// Hand a task to a helper agent running in its own top-level session. + Spawn { + /// What the helper agent should do. Write it as a self-contained brief: + /// the helper starts with an empty transcript and cannot see this chat. + task: Option, + /// Read the task from stdin instead, for long multi-paragraph briefs. + #[arg(long)] + stdin: bool, + /// Name the session in the sidebar. Defaults to an auto-generated title. + #[arg(long)] + title: Option, + /// Harness for the helper (defaults to this session's). + #[arg(long)] + harness: Option, + /// Model for the helper (defaults to this session's). + #[arg(long)] + model: Option, + /// Do not resume this chat when the helper finishes. + #[arg(long)] + no_wake: bool, + }, +} + #[derive(Args, Debug)] pub struct ExpArgs { #[command(subcommand)] @@ -785,6 +819,7 @@ fn command_name(command: &Command) -> &'static str { Command::Projects(_) => "projects", Command::Orgs(_) => "orgs", Command::Project(_) => "project", + Command::Agent(_) => "agent", Command::Runs(_) => "runs", Command::Logs(_) => "logs", Command::CreateExperiment(_) => "create-experiment", @@ -825,6 +860,7 @@ async fn dispatch(command: Command) -> error::Result<()> { Command::Projects(args) => commands::projects::run(args).await, Command::Orgs(args) => commands::orgs::run(args).await, Command::Project(args) => commands::project::run(args).await, + Command::Agent(args) => commands::agent::run(args).await, Command::Runs(args) => commands::runs::run(args).await, Command::Logs(args) => commands::logs::run(args).await, Command::CreateExperiment(args) => commands::create_experiment::run(args).await, diff --git a/src/store.rs b/src/store.rs index 63f8d5df..19b11586 100644 --- a/src/store.rs +++ b/src/store.rs @@ -235,7 +235,55 @@ pub enum RunWakeupRegistration { AlreadyDelivered, } +/// A helper session an agent created with `orx agent spawn`, and the task it +/// was spawned to do. The CLI only writes the row; the resident `orx up` +/// watcher is what starts the child's first turn and reports back. +#[derive(Debug, Clone)] +pub struct ChatSpawn { + pub session_id: String, + pub parent_session_id: String, + pub prompt: String, + /// Whether the parent gets a wake-up once the helper finishes. + pub wake_parent: bool, + /// Failed attempts to start the helper's first turn. + pub attempts: i64, + /// Set by `finish_turn` when the helper's turn ends. Absent on a row whose + /// turn is still running — or whose `orx up` died mid-turn, which is how a + /// crash is told from a completion. + pub finished_at: Option, +} + +/// Lifecycle of a [`ChatSpawn`]: `Pending → Starting → Running → Waking → +/// Done`. The two `-ing` states are claims — one watcher owns the transition +/// and holds a token, so a crash mid-step is reclaimable rather than lost. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum ChatSpawnState { + /// Row written; the child's first turn has not been delivered yet. + Pending, + /// Claimed for delivery of the brief to the helper. + Starting, + /// The helper is working on its task. + Running, + /// Claimed for delivery of the wake-up to the parent. + Waking, + /// Terminal: the parent has been told, or never asked to be. + Done, +} + +impl ChatSpawnState { + pub fn as_str(self) -> &'static str { + match self { + Self::Pending => "pending", + Self::Starting => "starting", + Self::Running => "running", + Self::Waking => "waking", + Self::Done => "done", + } + } +} + const RUN_WAKEUP_CLAIM_TTL_MS: i64 = 60 * 1000; +const CHAT_SPAWN_CLAIM_TTL_MS: i64 = 60 * 1000; const CHAT_TURN_LEASE_TTL_MS: i64 = 60 * 1000; pub struct Store { @@ -323,6 +371,7 @@ impl Store { archived INTEGER NOT NULL DEFAULT 0, context_usage_json TEXT, bootstrap_context TEXT, + parent_session_id TEXT, created_at INTEGER NOT NULL, updated_at INTEGER NOT NULL ); @@ -350,6 +399,20 @@ impl Store { ); CREATE INDEX IF NOT EXISTS idx_chat_run_wakeups_requested ON chat_run_wakeups(requested_at); + CREATE TABLE IF NOT EXISTS chat_spawns ( + session_id TEXT PRIMARY KEY, + parent_session_id TEXT NOT NULL, + prompt TEXT NOT NULL, + wake_parent INTEGER NOT NULL DEFAULT 1, + state TEXT NOT NULL DEFAULT 'pending', + requested_at INTEGER NOT NULL, + claim_token TEXT, + claimed_at INTEGER, + attempts INTEGER NOT NULL DEFAULT 0, + finished_at INTEGER + ); + CREATE INDEX IF NOT EXISTS idx_chat_spawns_state + ON chat_spawns(state, requested_at); CREATE TABLE IF NOT EXISTS chat_turn_leases ( chat_session_id TEXT PRIMARY KEY, claim_token TEXT NOT NULL, @@ -405,6 +468,10 @@ impl Store { "ALTER TABLE chat_messages ADD COLUMN base_native_session_id TEXT", "ALTER TABLE chat_messages ADD COLUMN result_native_session_id TEXT", "ALTER TABLE chat_sessions ADD COLUMN active_leaf_id TEXT", + "ALTER TABLE chat_sessions ADD COLUMN parent_session_id TEXT", + "ALTER TABLE chat_spawns ADD COLUMN wake_parent INTEGER NOT NULL DEFAULT 1", + "ALTER TABLE chat_spawns ADD COLUMN attempts INTEGER NOT NULL DEFAULT 0", + "ALTER TABLE chat_spawns ADD COLUMN finished_at INTEGER", ] { let _ = conn.execute(ddl, []); } @@ -935,6 +1002,150 @@ impl Store { Ok(delivered == 1) } + pub fn create_chat_spawn(&self, spawn: &ChatSpawn) -> Result<()> { + self.conn.execute( + "INSERT INTO chat_spawns + (session_id, parent_session_id, prompt, wake_parent, state, requested_at) + VALUES (?1, ?2, ?3, ?4, 'pending', ?5)", + params![ + spawn.session_id, + spawn.parent_session_id, + spawn.prompt, + spawn.wake_parent, + now_ms(), + ], + )?; + Ok(()) + } + + /// Return abandoned claims to their prior state and drop rows whose child + /// session is gone. A missing *parent* is not pruned here: the child keeps + /// working, and the wake step retires the row on its own. + pub fn prune_chat_spawns(&self) -> Result<()> { + self.clear_stale_data_dir_move_lease()?; + let stale = now_ms() - CHAT_SPAWN_CLAIM_TTL_MS; + self.conn.execute( + "UPDATE chat_spawns + SET state = CASE state WHEN 'starting' THEN 'pending' ELSE 'running' END, + attempts = attempts + CASE state WHEN 'starting' THEN 1 ELSE 0 END, + claim_token = NULL, claimed_at = NULL + WHERE state IN ('starting', 'waking') AND claimed_at < ?1 + AND NOT EXISTS (SELECT 1 FROM data_dir_move_lease WHERE id = 1)", + params![stale], + )?; + self.conn.execute( + "DELETE FROM chat_spawns + WHERE NOT EXISTS (SELECT 1 FROM data_dir_move_lease WHERE id = 1) + AND NOT EXISTS ( + SELECT 1 FROM chat_sessions WHERE chat_sessions.id = chat_spawns.session_id + )", + [], + )?; + Ok(()) + } + + /// Spawns sitting in one state, oldest request first. + pub fn list_chat_spawns(&self, state: ChatSpawnState) -> Result> { + let mut stmt = self.conn.prepare( + "SELECT session_id, parent_session_id, prompt, wake_parent, attempts, finished_at + FROM chat_spawns WHERE state = ?1 ORDER BY requested_at, session_id", + )?; + let rows = stmt.query_map(params![state.as_str()], row_to_chat_spawn)?; + Ok(rows.collect::, _>>()?) + } + + pub fn get_chat_spawn(&self, session_id: &str) -> Result> { + let mut stmt = self.conn.prepare( + "SELECT session_id, parent_session_id, prompt, wake_parent, attempts, finished_at + FROM chat_spawns WHERE session_id = ?1", + )?; + let mut rows = stmt.query_map(params![session_id], row_to_chat_spawn)?; + Ok(rows.next().transpose()?) + } + + /// Take ownership of a spawn's next step, moving it into the claimed state + /// and returning the token that proves the claim. `None` means another + /// watcher got there first. + pub fn claim_chat_spawn( + &self, + session_id: &str, + from: ChatSpawnState, + to: ChatSpawnState, + ) -> Result> { + let token = uuid::Uuid::new_v4().to_string(); + let claimed = self.conn.execute( + "UPDATE chat_spawns SET state = ?3, claim_token = ?4, claimed_at = ?5 + WHERE session_id = ?1 AND state = ?2", + params![session_id, from.as_str(), to.as_str(), token, now_ms()], + )?; + Ok((claimed == 1).then_some(token)) + } + + /// Finish (or hand back) a claimed step. `false` means the claim expired + /// and someone else reclaimed the row, so the caller's work is NOT recorded + /// and must not be treated as done. + pub fn settle_chat_spawn( + &self, + session_id: &str, + token: &str, + to: ChatSpawnState, + ) -> Result { + let settled = self.conn.execute( + "UPDATE chat_spawns SET state = ?3, claim_token = NULL, claimed_at = NULL + WHERE session_id = ?1 AND claim_token = ?2", + params![session_id, token, to.as_str()], + )?; + Ok(settled == 1) + } + + /// Whether any `orx up` currently holds a turn lease on this session. + /// + /// The durable counterpart to `ChatHost::is_busy`, which reads a map this + /// process owns: a helper started by a different `orx up` — or by one that + /// has since restarted — is busy without this process knowing it. + pub fn chat_turn_leased(&self, chat_session_id: &str) -> Result { + let leased = self.conn.query_row( + "SELECT 1 FROM chat_turn_leases WHERE chat_session_id = ?1 AND heartbeat_at >= ?2", + params![chat_session_id, now_ms() - CHAT_TURN_LEASE_TTL_MS], + |_| Ok(()), + ); + Ok(matches!(leased, Ok(()))) + } + + /// Record that a spawned helper's turn ended. An unstamped row whose lease + /// has lapsed is how the watcher recognizes an `orx up` that died mid-turn, + /// so the parent hears "interrupted" rather than a false completion. + pub fn mark_chat_spawn_finished(&self, chat_session_id: &str) -> Result<()> { + self.conn.execute( + "UPDATE chat_spawns SET finished_at = ?2 + WHERE session_id = ?1 AND finished_at IS NULL", + params![chat_session_id, now_ms()], + )?; + Ok(()) + } + + pub fn record_chat_spawn_attempt(&self, chat_session_id: &str) -> Result { + self.conn.execute( + "UPDATE chat_spawns SET attempts = attempts + 1 WHERE session_id = ?1", + params![chat_session_id], + )?; + Ok(self.conn.query_row( + "SELECT attempts FROM chat_spawns WHERE session_id = ?1", + params![chat_session_id], + |row| row.get(0), + )?) + } + + /// Helpers this parent has in flight, for the fan-out cap. + pub fn count_live_chat_spawns(&self, parent_session_id: &str) -> Result { + Ok(self.conn.query_row( + "SELECT count(*) FROM chat_spawns + WHERE parent_session_id = ?1 AND state != 'done'", + params![parent_session_id], + |row| row.get(0), + )?) + } + pub fn claim_chat_turn(&self, chat_session_id: &str, token: &str) -> Result { self.clear_stale_data_dir_move_lease()?; self.conn.execute( @@ -1227,6 +1438,11 @@ impl Store { /// experiments) in one transaction. GitHub repo and cache clone are kept. pub fn delete_local_project(&self, id: &str) -> Result<()> { let tx = self.begin()?; + self.conn.execute( + "DELETE FROM chat_spawns WHERE session_id IN + (SELECT id FROM chat_sessions WHERE project_id = ?1)", + params![id], + )?; self.conn.execute( "DELETE FROM chat_messages WHERE session_id IN (SELECT id FROM chat_sessions WHERE project_id = ?1)", @@ -1339,8 +1555,8 @@ impl Store { self.conn.execute( "INSERT INTO chat_sessions (id, project_id, harness, native_session_id, title, title_source, model, permission_mode, plan_mode, plan_reset_pending, reasoning_level, archived, bootstrap_context, - active_leaf_id, created_at, updated_at) - VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16)", + active_leaf_id, parent_session_id, created_at, updated_at) + VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17)", params![ s.id, s.project_id, @@ -1356,6 +1572,7 @@ impl Store { s.archived, s.bootstrap_context, s.active_leaf_id, + s.parent_session_id, s.created_at, s.updated_at, ], @@ -1388,6 +1605,8 @@ impl Store { "DELETE FROM chat_messages WHERE session_id = ?1", params![id], )?; + self.conn + .execute("DELETE FROM chat_spawns WHERE session_id = ?1", params![id])?; self.conn .execute("DELETE FROM chat_sessions WHERE id = ?1", params![id])?; Ok(()) @@ -1679,8 +1898,10 @@ pub struct StoredChatSession { pub native_session_id: Option, pub title: Option, /// Who wrote `title`: `"fallback"` (first-line placeholder), `"generated"` - /// (harness auto-title), `"user"` (Rename). NULL on legacy rows, which the - /// conditional setter treats as "unknown, don't overwrite". + /// (harness auto-title), `"user"` (explicitly chosen — a rename, or an + /// agent's `orx agent spawn --title`, neither of which auto-titling may + /// overwrite). NULL on legacy rows, which the conditional setter treats as + /// "unknown, don't overwrite". pub title_source: Option, pub model: Option, /// Permission-mode wire id (`"auto"` / `"plan"` / …); None = harness default. @@ -1703,6 +1924,9 @@ pub struct StoredChatSession { /// Tip of the branch the UI is currently showing. Forked turns make the /// transcript a tree; this picks which path through it is live. pub active_leaf_id: Option, + /// Session that spawned this one with `orx agent spawn`. `None` for + /// sessions the user started from the dashboard. + pub parent_session_id: Option, pub created_at: i64, pub updated_at: i64, } @@ -1775,7 +1999,18 @@ fn upsert_chat_message_with(conn: &Connection, m: &StoredChatMessage) -> Result< const CHAT_SESSION_COLS: &str = "id, project_id, harness, native_session_id, title, model, \ permission_mode, plan_mode, plan_reset_pending, reasoning_level, archived, context_usage_json, \ - created_at, updated_at, title_source, bootstrap_context, active_leaf_id"; + created_at, updated_at, title_source, bootstrap_context, active_leaf_id, parent_session_id"; + +fn row_to_chat_spawn(row: &rusqlite::Row<'_>) -> std::result::Result { + Ok(ChatSpawn { + session_id: row.get(0)?, + parent_session_id: row.get(1)?, + prompt: row.get(2)?, + wake_parent: row.get(3)?, + attempts: row.get(4)?, + finished_at: row.get(5)?, + }) +} fn row_to_chat_session( row: &rusqlite::Row<'_>, @@ -1798,6 +2033,7 @@ fn row_to_chat_session( title_source: row.get(14)?, bootstrap_context: row.get(15)?, active_leaf_id: row.get(16)?, + parent_session_id: row.get(17)?, }) } @@ -2195,11 +2431,150 @@ mod tests { context_usage_json: None, bootstrap_context: None, active_leaf_id: None, + parent_session_id: None, created_at: 1, updated_at: 1, } } + fn chat_spawn_fixture(session_id: &str, parent: &str) -> ChatSpawn { + ChatSpawn { + session_id: session_id.into(), + parent_session_id: parent.into(), + prompt: "Sweep the literature for LoRA rank ablations".into(), + wake_parent: true, + attempts: 0, + finished_at: None, + } + } + + #[test] + fn spawned_sessions_record_their_parent() { + let dir = std::env::temp_dir().join(format!("orx-store-spawnrow-{}", uuid::Uuid::new_v4())); + let store = Store::open_at(dir.clone()).unwrap(); + + store + .create_chat_session(&chat_session_fixture("chat_parent")) + .unwrap(); + let mut child = chat_session_fixture("chat_child"); + child.parent_session_id = Some("chat_parent".into()); + store.create_chat_session(&child).unwrap(); + + assert!(store + .get_chat_session("chat_parent") + .unwrap() + .unwrap() + .parent_session_id + .is_none()); + assert_eq!( + store + .get_chat_session("chat_child") + .unwrap() + .unwrap() + .parent_session_id + .as_deref(), + Some("chat_parent") + ); + + let _ = std::fs::remove_dir_all(&dir); + } + + #[test] + fn only_one_claimant_advances_a_spawn() { + let dir = + std::env::temp_dir().join(format!("orx-store-spawnclaim-{}", uuid::Uuid::new_v4())); + let store = Store::open_at(dir.clone()).unwrap(); + store + .create_chat_session(&chat_session_fixture("chat_child")) + .unwrap(); + store + .create_chat_spawn(&chat_spawn_fixture("chat_child", "chat_parent")) + .unwrap(); + + let pending = store.list_chat_spawns(ChatSpawnState::Pending).unwrap(); + assert_eq!(pending.len(), 1); + assert_eq!(pending[0].parent_session_id, "chat_parent"); + assert!(pending[0].wake_parent); + + let token = store + .claim_chat_spawn( + "chat_child", + ChatSpawnState::Pending, + ChatSpawnState::Starting, + ) + .unwrap() + .expect("first claim wins"); + assert!(store + .claim_chat_spawn( + "chat_child", + ChatSpawnState::Pending, + ChatSpawnState::Starting + ) + .unwrap() + .is_none()); + // A settle under the wrong token must not move the row. + assert!(!store + .settle_chat_spawn("chat_child", "not-the-token", ChatSpawnState::Running) + .unwrap()); + assert!(store + .settle_chat_spawn("chat_child", &token, ChatSpawnState::Running) + .unwrap()); + assert_eq!( + store + .list_chat_spawns(ChatSpawnState::Running) + .unwrap() + .len(), + 1 + ); + + let _ = std::fs::remove_dir_all(&dir); + } + + #[test] + fn pruning_reclaims_stale_spawns_and_drops_deleted_sessions() { + let dir = + std::env::temp_dir().join(format!("orx-store-spawnprune-{}", uuid::Uuid::new_v4())); + let store = Store::open_at(dir.clone()).unwrap(); + for id in ["chat_stuck", "chat_gone"] { + store + .create_chat_session(&chat_session_fixture(id)) + .unwrap(); + store + .create_chat_spawn(&chat_spawn_fixture(id, "chat_parent")) + .unwrap(); + } + + // A watcher that claimed the start and then died. + store + .claim_chat_spawn( + "chat_stuck", + ChatSpawnState::Pending, + ChatSpawnState::Starting, + ) + .unwrap() + .unwrap(); + store + .conn + .execute( + "UPDATE chat_spawns SET claimed_at = ?1 WHERE session_id = 'chat_stuck'", + params![now_ms() - CHAT_SPAWN_CLAIM_TTL_MS - 1], + ) + .unwrap(); + // A session removed WITHOUT its spawn row (the `delete_local_project` + // path) is what prune's orphan sweep is actually for. + store + .conn + .execute("DELETE FROM chat_sessions WHERE id = 'chat_gone'", []) + .unwrap(); + + store.prune_chat_spawns().unwrap(); + let pending = store.list_chat_spawns(ChatSpawnState::Pending).unwrap(); + assert_eq!(pending.len(), 1); + assert_eq!(pending[0].session_id, "chat_stuck"); + + let _ = std::fs::remove_dir_all(&dir); + } + #[test] fn title_source_roundtrips_and_defaults_to_none() { let dir = std::env::temp_dir().join(format!("orx-store-titlesrc-{}", uuid::Uuid::new_v4())); diff --git a/ui/dist/assets/index-Bx_pvhOP.js b/ui/dist/assets/index-Bx_pvhOP.js deleted file mode 100644 index 77c99172..00000000 --- a/ui/dist/assets/index-Bx_pvhOP.js +++ /dev/null @@ -1,1034 +0,0 @@ -var F5=e=>{throw TypeError(e)};var P5=(e,t,n)=>t.has(e)||F5("Cannot "+n);var kn=(e,t,n)=>(P5(e,t,"read from private field"),n?n.call(e):t.get(e)),Ti=(e,t,n)=>t.has(e)?F5("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),wr=(e,t,n,r)=>(P5(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var U5=(e,t,n,r)=>({set _(i){wr(e,t,i,n)},get _(){return kn(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function rp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J1={exports:{}},Wu={};/** - * @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 q5;function fj(){if(q5)return Wu;q5=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var l in i)l!=="key"&&(a[l]=i[l])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:a}}return Wu.Fragment=t,Wu.jsx=n,Wu.jsxs=n,Wu}var G5;function pj(){return G5||(G5=1,J1.exports=fj()),J1.exports}var h=pj(),eg={exports:{}},wt={};/** - * @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 V5;function mj(){if(V5)return wt;V5=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),g=Symbol.iterator;function b(H){return H===null||typeof H!="object"?null:(H=g&&H[g]||H["@@iterator"],typeof H=="function"?H:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,x={};function v(H,V,W){this.props=H,this.context=V,this.refs=x,this.updater=W||S}v.prototype.isReactComponent={},v.prototype.setState=function(H,V){if(typeof H!="object"&&typeof H!="function"&&H!=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,H,V,"setState")},v.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function w(){}w.prototype=v.prototype;function y(H,V,W){this.props=H,this.context=V,this.refs=x,this.updater=W||S}var C=y.prototype=new w;C.constructor=y,k(C,v.prototype),C.isPureReactComponent=!0;var N=Array.isArray;function E(){}var j={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function D(H,V,W){var re=W.ref;return{$$typeof:e,type:H,key:V,ref:re!==void 0?re:null,props:W}}function I(H,V){return D(H.type,V,H.props)}function $(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function F(H){var V={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(W){return V[W]})}var U=/\/+/g;function G(H,V){return typeof H=="object"&&H!==null&&H.key!=null?F(""+H.key):V.toString(36)}function X(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(E,E):(H.status="pending",H.then(function(V){H.status==="pending"&&(H.status="fulfilled",H.value=V)},function(V){H.status==="pending"&&(H.status="rejected",H.reason=V)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function Y(H,V,W,re,le){var pe=typeof H;(pe==="undefined"||pe==="boolean")&&(H=null);var te=!1;if(H===null)te=!0;else switch(pe){case"bigint":case"string":case"number":te=!0;break;case"object":switch(H.$$typeof){case e:case t:te=!0;break;case p:return te=H._init,Y(te(H._payload),V,W,re,le)}}if(te)return le=le(H),te=re===""?"."+G(H,0):re,N(le)?(W="",te!=null&&(W=te.replace(U,"$&/")+"/"),Y(le,V,W,"",function(oe){return oe})):le!=null&&($(le)&&(le=I(le,W+(le.key==null||H&&H.key===le.key?"":(""+le.key).replace(U,"$&/")+"/")+te)),V.push(le)),1;te=0;var B=re===""?".":re+":";if(N(H))for(var ie=0;ie>>1,O=Y[z];if(0>>1;zi(W,Q))rei(le,W)?(Y[z]=le,Y[re]=Q,z=re):(Y[z]=W,Y[V]=Q,z=V);else if(rei(le,Q))Y[z]=le,Y[re]=Q,z=re;else break e}}return Z}function i(Y,Z){var Q=Y.sortIndex-Z.sortIndex;return Q!==0?Q:Y.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var u=[],d=[],p=1,f=null,g=3,b=!1,S=!1,k=!1,x=!1,v=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function C(Y){for(var Z=n(d);Z!==null;){if(Z.callback===null)r(d);else if(Z.startTime<=Y)r(d),Z.sortIndex=Z.expirationTime,t(u,Z);else break;Z=n(d)}}function N(Y){if(k=!1,C(Y),!S)if(n(u)!==null)S=!0,E||(E=!0,F());else{var Z=n(d);Z!==null&&X(N,Z.startTime-Y)}}var E=!1,j=-1,T=5,D=-1;function I(){return x?!0:!(e.unstable_now()-DY&&I());){var z=f.callback;if(typeof z=="function"){f.callback=null,g=f.priorityLevel;var O=z(f.expirationTime<=Y);if(Y=e.unstable_now(),typeof O=="function"){f.callback=O,C(Y),Z=!0;break t}f===n(u)&&r(u),C(Y)}else r(u);f=n(u)}if(f!==null)Z=!0;else{var H=n(d);H!==null&&X(N,H.startTime-Y),Z=!1}}break e}finally{f=null,g=Q,b=!1}Z=void 0}}finally{Z?F():E=!1}}}var F;if(typeof y=="function")F=function(){y($)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,G=U.port2;U.port1.onmessage=$,F=function(){G.postMessage(null)}}else F=function(){v($,0)};function X(Y,Z){j=v(function(){Y(e.unstable_now())},Z)}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(Y){Y.callback=null},e.unstable_forceFrameRate=function(Y){0>Y||125z?(Y.sortIndex=Q,t(d,Y),n(u)===null&&Y===n(d)&&(k?(w(j),j=-1):k=!0,X(N,Q-z))):(Y.sortIndex=O,t(u,Y),S||b||(S=!0,E||(E=!0,F()))),Y},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(Y){var Z=g;return function(){var Q=g;g=Z;try{return Y.apply(this,arguments)}finally{g=Q}}}})(rg)),rg}var X5;function vj(){return X5||(X5=1,ng.exports=bj()),ng.exports}var ig={exports:{}},jr={};/** - * @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 K5;function _j(){if(K5)return jr;K5=1;var e=eh();function t(u){var d="https://react.dev/errors/"+u;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ig.exports=_j(),ig.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 Q5;function xj(){if(Q5)return Yu;Q5=1;var e=vj(),t=eh(),n=q8();function r(s){var c="https://react.dev/errors/"+s;if(1O||(s.current=z[O],z[O]=null,O--)}function W(s,c){O++,z[O]=s.current,s.current=c}var re=H(null),le=H(null),pe=H(null),te=H(null);function B(s,c){switch(W(pe,c),W(le,s),W(re,null),c.nodeType){case 9:case 11:s=(s=c.documentElement)&&(s=s.namespaceURI)?u5(s):0;break;default:if(s=c.tagName,c=c.namespaceURI)c=u5(c),s=d5(c,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}V(re),W(re,s)}function ie(){V(re),V(le),V(pe)}function oe(s){s.memoizedState!==null&&W(te,s);var c=re.current,m=d5(c,s.type);c!==m&&(W(le,s),W(re,m))}function be(s){le.current===s&&(V(re),V(le)),te.current===s&&(V(te),Uu._currentValue=Q)}var ge,Ce;function Le(s){if(ge===void 0)try{throw Error()}catch(m){var c=m.stack.trim().match(/\n( *(at )?)/);ge=c&&c[1]||"",Ce=-1)":-1A||ue[_]!==_e[A]){var Ae=` -`+ue[_].replace(" at new "," at ");return s.displayName&&Ae.includes("")&&(Ae=Ae.replace("",s.displayName)),Ae}while(1<=_&&0<=A);break}}}finally{Ue=!1,Error.prepareStackTrace=m}return(m=s?s.displayName||s.name:"")?Le(m):""}function Fe(s,c){switch(s.tag){case 26:case 27:case 5:return Le(s.type);case 16:return Le("Lazy");case 13:return s.child!==c&&c!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return We(s.type,!1);case 11:return We(s.type.render,!1);case 1:return We(s.type,!0);case 31:return Le("Activity");default:return""}}function mt(s){try{var c="",m=null;do c+=Fe(s,m),m=s,s=s.return;while(s);return c}catch(_){return` -Error generating stack: `+_.message+` -`+_.stack}}var De=Object.prototype.hasOwnProperty,ot=e.unstable_scheduleCallback,Bt=e.unstable_cancelCallback,on=e.unstable_shouldYield,Ze=e.unstable_requestPaint,ct=e.unstable_now,st=e.unstable_getCurrentPriorityLevel,xe=e.unstable_ImmediatePriority,Me=e.unstable_UserBlockingPriority,Ge=e.unstable_NormalPriority,Qe=e.unstable_LowPriority,Oe=e.unstable_IdlePriority,tt=e.log,it=e.unstable_setDisableYieldValue,jt=null,_t=null;function Tt(s){if(typeof tt=="function"&&it(s),_t&&typeof _t.setStrictMode=="function")try{_t.setStrictMode(jt,s)}catch{}}var ut=Math.clz32?Math.clz32:Or,xn=Math.log,dr=Math.LN2;function Or(s){return s>>>=0,s===0?32:31-(xn(s)/dr|0)|0}var os=256,ls=262144,gi=4194304;function pr(s){var c=s&42;if(c!==0)return c;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Ts(s,c,m){var _=s.pendingLanes;if(_===0)return 0;var A=0,M=s.suspendedLanes,q=s.pingedLanes;s=s.warmLanes;var J=_&134217727;return J!==0?(_=J&~M,_!==0?A=pr(_):(q&=J,q!==0?A=pr(q):m||(m=J&~s,m!==0&&(A=pr(m))))):(J=_&~M,J!==0?A=pr(J):q!==0?A=pr(q):m||(m=_&~s,m!==0&&(A=pr(m)))),A===0?0:c!==0&&c!==A&&(c&M)===0&&(M=A&-A,m=c&-c,M>=m||M===32&&(m&4194048)!==0)?c:A}function Jn(s,c){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&c)===0}function Xr(s,c){switch(s){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 Kr(){var s=gi;return gi<<=1,(gi&62914560)===0&&(gi=4194304),s}function yn(s){for(var c=[],m=0;31>m;m++)c.push(s);return c}function mn(s,c){s.pendingLanes|=c,c!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function bi(s,c,m,_,A,M){var q=s.pendingLanes;s.pendingLanes=m,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=m,s.entangledLanes&=m,s.errorRecoveryDisabledLanes&=m,s.shellSuspendCounter=0;var J=s.entanglements,ue=s.expirationTimes,_e=s.hiddenUpdates;for(m=q&~m;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var Ga=/[\n"\\]/g;function ir(s){return s.replace(Ga,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function aa(s,c,m,_,A,M,q,J){s.name="",q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?s.type=q:s.removeAttribute("type"),c!=null?q==="number"?(c===0&&s.value===""||s.value!=c)&&(s.value=""+rr(c)):s.value!==""+rr(c)&&(s.value=""+rr(c)):q!=="submit"&&q!=="reset"||s.removeAttribute("value"),c!=null?Ms(s,q,rr(c)):m!=null?Ms(s,q,rr(m)):_!=null&&s.removeAttribute("value"),A==null&&M!=null&&(s.defaultChecked=!!M),A!=null&&(s.checked=A&&typeof A!="function"&&typeof A!="symbol"),J!=null&&typeof J!="function"&&typeof J!="symbol"&&typeof J!="boolean"?s.name=""+rr(J):s.removeAttribute("name")}function cn(s,c,m,_,A,M,q,J){if(M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(s.type=M),c!=null||m!=null){if(!(M!=="submit"&&M!=="reset"||c!=null)){sa(s);return}m=m!=null?""+rr(m):"",c=c!=null?""+rr(c):m,J||c===s.value||(s.value=c),s.defaultValue=c}_=_??A,_=typeof _!="function"&&typeof _!="symbol"&&!!_,s.checked=J?s.checked:!!_,s.defaultChecked=!!_,q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"&&(s.name=q),sa(s)}function Ms(s,c,m){c==="number"&&ti(s.ownerDocument)===s||s.defaultValue===""+m||(s.defaultValue=""+m)}function gn(s,c,m,_){if(s=s.options,c){c={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_i=!1;if(St)try{var Wi={};Object.defineProperty(Wi,"passive",{get:function(){_i=!0}}),window.addEventListener("test",Wi,Wi),window.removeEventListener("test",Wi,Wi)}catch{_i=!1}var Yi=null,Wa=null,ds=null;function se(){if(ds)return ds;var s,c=Wa,m=c.length,_,A="value"in Yi?Yi.value:Yi.textContent,M=A.length;for(s=0;s=uu),bx=" ",vx=!1;function _x(s,c){switch(s){case"keyup":return OT.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xx(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var ql=!1;function zT(s,c){switch(s){case"compositionend":return xx(c);case"keypress":return c.which!==32?null:(vx=!0,bx);case"textInput":return s=c.data,s===bx&&vx?null:s;default:return null}}function BT(s,c){if(ql)return s==="compositionend"||!sm&&_x(s,c)?(s=se(),ds=Wa=Yi=null,ql=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:m,offset:c-s};s=_}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=Tx(m)}}function jx(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?jx(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function Mx(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var c=ti(s.document);c instanceof s.HTMLIFrameElement;){try{var m=typeof c.contentWindow.location.href=="string"}catch{m=!1}if(m)s=c.contentWindow;else break;c=ti(s.document)}return c}function lm(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}var VT=St&&"documentMode"in document&&11>=document.documentMode,Gl=null,cm=null,pu=null,um=!1;function Rx(s,c,m){var _=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;um||Gl==null||Gl!==ti(_)||(_=Gl,"selectionStart"in _&&lm(_)?_={start:_.selectionStart,end:_.selectionEnd}:(_=(_.ownerDocument&&_.ownerDocument.defaultView||window).getSelection(),_={anchorNode:_.anchorNode,anchorOffset:_.anchorOffset,focusNode:_.focusNode,focusOffset:_.focusOffset}),pu&&fu(pu,_)||(pu=_,_=p0(cm,"onSelect"),0<_.length&&(c=new ne("onSelect","select",null,c,m),s.push({event:c,listeners:_}),c.target=Gl)))}function qo(s,c){var m={};return m[s.toLowerCase()]=c.toLowerCase(),m["Webkit"+s]="webkit"+c,m["Moz"+s]="moz"+c,m}var Vl={animationend:qo("Animation","AnimationEnd"),animationiteration:qo("Animation","AnimationIteration"),animationstart:qo("Animation","AnimationStart"),transitionrun:qo("Transition","TransitionRun"),transitionstart:qo("Transition","TransitionStart"),transitioncancel:qo("Transition","TransitionCancel"),transitionend:qo("Transition","TransitionEnd")},dm={},Dx={};St&&(Dx=document.createElement("div").style,"AnimationEvent"in window||(delete Vl.animationend.animation,delete Vl.animationiteration.animation,delete Vl.animationstart.animation),"TransitionEvent"in window||delete Vl.transitionend.transition);function Go(s){if(dm[s])return dm[s];if(!Vl[s])return s;var c=Vl[s],m;for(m in c)if(c.hasOwnProperty(m)&&m in Dx)return dm[s]=c[m];return s}var Lx=Go("animationend"),Ox=Go("animationiteration"),Ix=Go("animationstart"),WT=Go("transitionrun"),YT=Go("transitionstart"),XT=Go("transitioncancel"),zx=Go("transitionend"),Bx=new Map,hm="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(" ");hm.push("scrollEnd");function ps(s,c){Bx.set(s,c),Hn(c,[s])}var Ah=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Xi=[],Wl=0,fm=0;function Th(){for(var s=Wl,c=fm=Wl=0;c>=q,A-=q,Os=1<<32-ut(c)+A|m<Ct?(It=rt,rt=null):It=rt.sibling;var Vt=ye(me,rt,ve[Ct],Ne);if(Vt===null){rt===null&&(rt=It);break}s&&rt&&Vt.alternate===null&&c(me,rt),de=M(Vt,de,Ct),Gt===null?ht=Vt:Gt.sibling=Vt,Gt=Vt,rt=It}if(Ct===ve.length)return m(me,rt),Ht&&ca(me,Ct),ht;if(rt===null){for(;CtCt?(It=rt,rt=null):It=rt.sibling;var bo=ye(me,rt,Vt.value,Ne);if(bo===null){rt===null&&(rt=It);break}s&&rt&&bo.alternate===null&&c(me,rt),de=M(bo,de,Ct),Gt===null?ht=bo:Gt.sibling=bo,Gt=bo,rt=It}if(Vt.done)return m(me,rt),Ht&&ca(me,Ct),ht;if(rt===null){for(;!Vt.done;Ct++,Vt=ve.next())Vt=je(me,Vt.value,Ne),Vt!==null&&(de=M(Vt,de,Ct),Gt===null?ht=Vt:Gt.sibling=Vt,Gt=Vt);return Ht&&ca(me,Ct),ht}for(rt=_(rt);!Vt.done;Ct++,Vt=ve.next())Vt=ke(rt,me,Ct,Vt.value,Ne),Vt!==null&&(s&&Vt.alternate!==null&&rt.delete(Vt.key===null?Ct:Vt.key),de=M(Vt,de,Ct),Gt===null?ht=Vt:Gt.sibling=Vt,Gt=Vt);return s&&rt.forEach(function(hj){return c(me,hj)}),Ht&&ca(me,Ct),ht}function an(me,de,ve,Ne){if(typeof ve=="object"&&ve!==null&&ve.type===k&&ve.key===null&&(ve=ve.props.children),typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case b:e:{for(var ht=ve.key;de!==null;){if(de.key===ht){if(ht=ve.type,ht===k){if(de.tag===7){m(me,de.sibling),Ne=A(de,ve.props.children),Ne.return=me,me=Ne;break e}}else if(de.elementType===ht||typeof ht=="object"&&ht!==null&&ht.$$typeof===T&&Qo(ht)===de.type){m(me,de.sibling),Ne=A(de,ve.props),xu(Ne,ve),Ne.return=me,me=Ne;break e}m(me,de);break}else c(me,de);de=de.sibling}ve.type===k?(Ne=Wo(ve.props.children,me.mode,Ne,ve.key),Ne.return=me,me=Ne):(Ne=Mh(ve.type,ve.key,ve.props,null,me.mode,Ne),xu(Ne,ve),Ne.return=me,me=Ne)}return q(me);case S:e:{for(ht=ve.key;de!==null;){if(de.key===ht)if(de.tag===4&&de.stateNode.containerInfo===ve.containerInfo&&de.stateNode.implementation===ve.implementation){m(me,de.sibling),Ne=A(de,ve.children||[]),Ne.return=me,me=Ne;break e}else{m(me,de);break}else c(me,de);de=de.sibling}Ne=bm(ve,me.mode,Ne),Ne.return=me,me=Ne}return q(me);case T:return ve=Qo(ve),an(me,de,ve,Ne)}if(X(ve))return et(me,de,ve,Ne);if(F(ve)){if(ht=F(ve),typeof ht!="function")throw Error(r(150));return ve=ht.call(ve),gt(me,de,ve,Ne)}if(typeof ve.then=="function")return an(me,de,Bh(ve),Ne);if(ve.$$typeof===y)return an(me,de,Lh(me,ve),Ne);Hh(me,ve)}return typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint"?(ve=""+ve,de!==null&&de.tag===6?(m(me,de.sibling),Ne=A(de,ve),Ne.return=me,me=Ne):(m(me,de),Ne=gm(ve,me.mode,Ne),Ne.return=me,me=Ne),q(me)):m(me,de)}return function(me,de,ve,Ne){try{_u=0;var ht=an(me,de,ve,Ne);return nc=null,ht}catch(rt){if(rt===tc||rt===Ih)throw rt;var Gt=wi(29,rt,null,me.mode);return Gt.lanes=Ne,Gt.return=me,Gt}finally{}}}var el=ty(!0),ny=ty(!1),Ja=!1;function Nm(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function jm(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function eo(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function to(s,c,m){var _=s.updateQueue;if(_===null)return null;if(_=_.shared,(Wt&2)!==0){var A=_.pending;return A===null?c.next=c:(c.next=A.next,A.next=c),_.pending=c,c=jh(s),Hx(s,null,m),c}return Nh(s,_,c,m),jh(s)}function yu(s,c,m){if(c=c.updateQueue,c!==null&&(c=c.shared,(m&4194048)!==0)){var _=c.lanes;_&=s.pendingLanes,m|=_,c.lanes=m,Ui(s,m)}}function Mm(s,c){var m=s.updateQueue,_=s.alternate;if(_!==null&&(_=_.updateQueue,m===_)){var A=null,M=null;if(m=m.firstBaseUpdate,m!==null){do{var q={lane:m.lane,tag:m.tag,payload:m.payload,callback:null,next:null};M===null?A=M=q:M=M.next=q,m=m.next}while(m!==null);M===null?A=M=c:M=M.next=c}else A=M=c;m={baseState:_.baseState,firstBaseUpdate:A,lastBaseUpdate:M,shared:_.shared,callbacks:_.callbacks},s.updateQueue=m;return}s=m.lastBaseUpdate,s===null?m.firstBaseUpdate=c:s.next=c,m.lastBaseUpdate=c}var Rm=!1;function wu(){if(Rm){var s=ec;if(s!==null)throw s}}function Su(s,c,m,_){Rm=!1;var A=s.updateQueue;Ja=!1;var M=A.firstBaseUpdate,q=A.lastBaseUpdate,J=A.shared.pending;if(J!==null){A.shared.pending=null;var ue=J,_e=ue.next;ue.next=null,q===null?M=_e:q.next=_e,q=ue;var Ae=s.alternate;Ae!==null&&(Ae=Ae.updateQueue,J=Ae.lastBaseUpdate,J!==q&&(J===null?Ae.firstBaseUpdate=_e:J.next=_e,Ae.lastBaseUpdate=ue))}if(M!==null){var je=A.baseState;q=0,Ae=_e=ue=null,J=M;do{var ye=J.lane&-536870913,ke=ye!==J.lane;if(ke?(Ot&ye)===ye:(_&ye)===ye){ye!==0&&ye===Jl&&(Rm=!0),Ae!==null&&(Ae=Ae.next={lane:0,tag:J.tag,payload:J.payload,callback:null,next:null});e:{var et=s,gt=J;ye=c;var an=m;switch(gt.tag){case 1:if(et=gt.payload,typeof et=="function"){je=et.call(an,je,ye);break e}je=et;break e;case 3:et.flags=et.flags&-65537|128;case 0:if(et=gt.payload,ye=typeof et=="function"?et.call(an,je,ye):et,ye==null)break e;je=f({},je,ye);break e;case 2:Ja=!0}}ye=J.callback,ye!==null&&(s.flags|=64,ke&&(s.flags|=8192),ke=A.callbacks,ke===null?A.callbacks=[ye]:ke.push(ye))}else ke={lane:ye,tag:J.tag,payload:J.payload,callback:J.callback,next:null},Ae===null?(_e=Ae=ke,ue=je):Ae=Ae.next=ke,q|=ye;if(J=J.next,J===null){if(J=A.shared.pending,J===null)break;ke=J,J=ke.next,ke.next=null,A.lastBaseUpdate=ke,A.shared.pending=null}}while(!0);Ae===null&&(ue=je),A.baseState=ue,A.firstBaseUpdate=_e,A.lastBaseUpdate=Ae,M===null&&(A.shared.lanes=0),ao|=q,s.lanes=q,s.memoizedState=je}}function ry(s,c){if(typeof s!="function")throw Error(r(191,s));s.call(c)}function iy(s,c){var m=s.callbacks;if(m!==null)for(s.callbacks=null,s=0;sM?M:8;var q=Y.T,J={};Y.T=J,Zm(s,!1,c,m);try{var ue=A(),_e=Y.S;if(_e!==null&&_e(J,ue),ue!==null&&typeof ue=="object"&&typeof ue.then=="function"){var Ae=tN(ue,_);Eu(s,c,Ae,Ai(s))}else Eu(s,c,_,Ai(s))}catch(je){Eu(s,c,{then:function(){},status:"rejected",reason:je},Ai())}finally{Z.p=M,q!==null&&J.types!==null&&(q.types=J.types),Y.T=q}}function oN(){}function Xm(s,c,m,_){if(s.tag!==5)throw Error(r(476));var A=Iy(s).queue;Oy(s,A,c,Q,m===null?oN:function(){return zy(s),m(_)})}function Iy(s){var c=s.memoizedState;if(c!==null)return c;c={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:Q},next:null};var m={};return c.next={memoizedState:m,baseState:m,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:m},next:null},s.memoizedState=c,s=s.alternate,s!==null&&(s.memoizedState=c),c}function zy(s){var c=Iy(s);c.next===null&&(c=s.alternate.memoizedState),Eu(s,c.next.queue,{},Ai())}function Km(){return _r(Uu)}function By(){return Bn().memoizedState}function Hy(){return Bn().memoizedState}function lN(s){for(var c=s.return;c!==null;){switch(c.tag){case 24:case 3:var m=Ai();s=eo(m);var _=to(c,s,m);_!==null&&(li(_,c,m),yu(_,c,m)),c={cache:Cm()},s.payload=c;return}c=c.return}}function cN(s,c,m){var _=Ai();m={lane:_,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Xh(s)?Fy(c,m):(m=pm(s,c,m,_),m!==null&&(li(m,s,_),Py(m,c,_)))}function $y(s,c,m){var _=Ai();Eu(s,c,m,_)}function Eu(s,c,m,_){var A={lane:_,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null};if(Xh(s))Fy(c,A);else{var M=s.alternate;if(s.lanes===0&&(M===null||M.lanes===0)&&(M=c.lastRenderedReducer,M!==null))try{var q=c.lastRenderedState,J=M(q,m);if(A.hasEagerState=!0,A.eagerState=J,yi(J,q))return Nh(s,c,A,0),un===null&&Th(),!1}catch{}finally{}if(m=pm(s,c,A,_),m!==null)return li(m,s,_),Py(m,c,_),!0}return!1}function Zm(s,c,m,_){if(_={lane:2,revertLane:N1(),gesture:null,action:_,hasEagerState:!1,eagerState:null,next:null},Xh(s)){if(c)throw Error(r(479))}else c=pm(s,m,_,2),c!==null&&li(c,s,2)}function Xh(s){var c=s.alternate;return s===kt||c!==null&&c===kt}function Fy(s,c){ic=Ph=!0;var m=s.pending;m===null?c.next=c:(c.next=m.next,m.next=c),s.pending=c}function Py(s,c,m){if((m&4194048)!==0){var _=c.lanes;_&=s.pendingLanes,m|=_,c.lanes=m,Ui(s,m)}}var Au={readContext:_r,use:Gh,useCallback:Dn,useContext:Dn,useEffect:Dn,useImperativeHandle:Dn,useLayoutEffect:Dn,useInsertionEffect:Dn,useMemo:Dn,useReducer:Dn,useRef:Dn,useState:Dn,useDebugValue:Dn,useDeferredValue:Dn,useTransition:Dn,useSyncExternalStore:Dn,useId:Dn,useHostTransitionStatus:Dn,useFormState:Dn,useActionState:Dn,useOptimistic:Dn,useMemoCache:Dn,useCacheRefresh:Dn};Au.useEffectEvent=Dn;var Uy={readContext:_r,use:Gh,useCallback:function(s,c){return Fr().memoizedState=[s,c===void 0?null:c],s},useContext:_r,useEffect:Ey,useImperativeHandle:function(s,c,m){m=m!=null?m.concat([s]):null,Wh(4194308,4,jy.bind(null,c,s),m)},useLayoutEffect:function(s,c){return Wh(4194308,4,s,c)},useInsertionEffect:function(s,c){Wh(4,2,s,c)},useMemo:function(s,c){var m=Fr();c=c===void 0?null:c;var _=s();if(tl){Tt(!0);try{s()}finally{Tt(!1)}}return m.memoizedState=[_,c],_},useReducer:function(s,c,m){var _=Fr();if(m!==void 0){var A=m(c);if(tl){Tt(!0);try{m(c)}finally{Tt(!1)}}}else A=c;return _.memoizedState=_.baseState=A,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:A},_.queue=s,s=s.dispatch=cN.bind(null,kt,s),[_.memoizedState,s]},useRef:function(s){var c=Fr();return s={current:s},c.memoizedState=s},useState:function(s){s=qm(s);var c=s.queue,m=$y.bind(null,kt,c);return c.dispatch=m,[s.memoizedState,m]},useDebugValue:Wm,useDeferredValue:function(s,c){var m=Fr();return Ym(m,s,c)},useTransition:function(){var s=qm(!1);return s=Oy.bind(null,kt,s.queue,!0,!1),Fr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,c,m){var _=kt,A=Fr();if(Ht){if(m===void 0)throw Error(r(407));m=m()}else{if(m=c(),un===null)throw Error(r(349));(Ot&127)!==0||uy(_,c,m)}A.memoizedState=m;var M={value:m,getSnapshot:c};return A.queue=M,Ey(hy.bind(null,_,M,s),[s]),_.flags|=2048,ac(9,{destroy:void 0},dy.bind(null,_,M,m,c),null),m},useId:function(){var s=Fr(),c=un.identifierPrefix;if(Ht){var m=Is,_=Os;m=(_&~(1<<32-ut(_)-1)).toString(32)+m,c="_"+c+"R_"+m,m=Uh++,0<\/script>",M=M.removeChild(M.firstChild);break;case"select":M=typeof _.is=="string"?q.createElement("select",{is:_.is}):q.createElement("select"),_.multiple?M.multiple=!0:_.size&&(M.size=_.size);break;default:M=typeof _.is=="string"?q.createElement(A,{is:_.is}):q.createElement(A)}}M[ft]=c,M[In]=_;e:for(q=c.child;q!==null;){if(q.tag===5||q.tag===6)M.appendChild(q.stateNode);else if(q.tag!==4&&q.tag!==27&&q.child!==null){q.child.return=q,q=q.child;continue}if(q===c)break e;for(;q.sibling===null;){if(q.return===null||q.return===c)break e;q=q.return}q.sibling.return=q.return,q=q.sibling}c.stateNode=M;e:switch(yr(M,A,_),A){case"button":case"input":case"select":case"textarea":_=!!_.autoFocus;break e;case"img":_=!0;break e;default:_=!1}_&&ma(c)}}return vn(c),d1(c,c.type,s===null?null:s.memoizedProps,c.pendingProps,m),null;case 6:if(s&&c.stateNode!=null)s.memoizedProps!==_&&ma(c);else{if(typeof _!="string"&&c.stateNode===null)throw Error(r(166));if(s=pe.current,Zl(c)){if(s=c.stateNode,m=c.memoizedProps,_=null,A=vr,A!==null)switch(A.tag){case 27:case 5:_=A.memoizedProps}s[ft]=c,s=!!(s.nodeValue===m||_!==null&&_.suppressHydrationWarning===!0||l5(s.nodeValue,m)),s||Za(c,!0)}else s=m0(s).createTextNode(_),s[ft]=c,c.stateNode=s}return vn(c),null;case 31:if(m=c.memoizedState,s===null||s.memoizedState!==null){if(_=Zl(c),m!==null){if(s===null){if(!_)throw Error(r(318));if(s=c.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[ft]=c}else Yo(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;vn(c),s=!1}else m=ym(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=m),s=!0;if(!s)return c.flags&256?(ki(c),c):(ki(c),null);if((c.flags&128)!==0)throw Error(r(558))}return vn(c),null;case 13:if(_=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(A=Zl(c),_!==null&&_.dehydrated!==null){if(s===null){if(!A)throw Error(r(318));if(A=c.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[ft]=c}else Yo(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;vn(c),A=!1}else A=ym(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=A),A=!0;if(!A)return c.flags&256?(ki(c),c):(ki(c),null)}return ki(c),(c.flags&128)!==0?(c.lanes=m,c):(m=_!==null,s=s!==null&&s.memoizedState!==null,m&&(_=c.child,A=null,_.alternate!==null&&_.alternate.memoizedState!==null&&_.alternate.memoizedState.cachePool!==null&&(A=_.alternate.memoizedState.cachePool.pool),M=null,_.memoizedState!==null&&_.memoizedState.cachePool!==null&&(M=_.memoizedState.cachePool.pool),M!==A&&(_.flags|=2048)),m!==s&&m&&(c.child.flags|=8192),e0(c,c.updateQueue),vn(c),null);case 4:return ie(),s===null&&D1(c.stateNode.containerInfo),vn(c),null;case 10:return da(c.type),vn(c),null;case 19:if(V(zn),_=c.memoizedState,_===null)return vn(c),null;if(A=(c.flags&128)!==0,M=_.rendering,M===null)if(A)Nu(_,!1);else{if(Ln!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(M=Fh(s),M!==null){for(c.flags|=128,Nu(_,!1),s=M.updateQueue,c.updateQueue=s,e0(c,s),c.subtreeFlags=0,s=m,m=c.child;m!==null;)$x(m,s),m=m.sibling;return W(zn,zn.current&1|2),Ht&&ca(c,_.treeForkCount),c.child}s=s.sibling}_.tail!==null&&ct()>s0&&(c.flags|=128,A=!0,Nu(_,!1),c.lanes=4194304)}else{if(!A)if(s=Fh(M),s!==null){if(c.flags|=128,A=!0,s=s.updateQueue,c.updateQueue=s,e0(c,s),Nu(_,!0),_.tail===null&&_.tailMode==="hidden"&&!M.alternate&&!Ht)return vn(c),null}else 2*ct()-_.renderingStartTime>s0&&m!==536870912&&(c.flags|=128,A=!0,Nu(_,!1),c.lanes=4194304);_.isBackwards?(M.sibling=c.child,c.child=M):(s=_.last,s!==null?s.sibling=M:c.child=M,_.last=M)}return _.tail!==null?(s=_.tail,_.rendering=s,_.tail=s.sibling,_.renderingStartTime=ct(),s.sibling=null,m=zn.current,W(zn,A?m&1|2:m&1),Ht&&ca(c,_.treeForkCount),s):(vn(c),null);case 22:case 23:return ki(c),Lm(),_=c.memoizedState!==null,s!==null?s.memoizedState!==null!==_&&(c.flags|=8192):_&&(c.flags|=8192),_?(m&536870912)!==0&&(c.flags&128)===0&&(vn(c),c.subtreeFlags&6&&(c.flags|=8192)):vn(c),m=c.updateQueue,m!==null&&e0(c,m.retryQueue),m=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),_=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(_=c.memoizedState.cachePool.pool),_!==m&&(c.flags|=2048),s!==null&&V(Zo),null;case 24:return m=null,s!==null&&(m=s.memoizedState.cache),c.memoizedState.cache!==m&&(c.flags|=2048),da(Pn),vn(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function pN(s,c){switch(_m(c),c.tag){case 1:return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return da(Pn),ie(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 26:case 27:case 5:return be(c),null;case 31:if(c.memoizedState!==null){if(ki(c),c.alternate===null)throw Error(r(340));Yo()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 13:if(ki(c),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Yo()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return V(zn),null;case 4:return ie(),null;case 10:return da(c.type),null;case 22:case 23:return ki(c),Lm(),s!==null&&V(Zo),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 24:return da(Pn),null;case 25:return null;default:return null}}function f4(s,c){switch(_m(c),c.tag){case 3:da(Pn),ie();break;case 26:case 27:case 5:be(c);break;case 4:ie();break;case 31:c.memoizedState!==null&&ki(c);break;case 13:ki(c);break;case 19:V(zn);break;case 10:da(c.type);break;case 22:case 23:ki(c),Lm(),s!==null&&V(Zo);break;case 24:da(Pn)}}function ju(s,c){try{var m=c.updateQueue,_=m!==null?m.lastEffect:null;if(_!==null){var A=_.next;m=A;do{if((m.tag&s)===s){_=void 0;var M=m.create,q=m.inst;_=M(),q.destroy=_}m=m.next}while(m!==A)}}catch(J){en(c,c.return,J)}}function io(s,c,m){try{var _=c.updateQueue,A=_!==null?_.lastEffect:null;if(A!==null){var M=A.next;_=M;do{if((_.tag&s)===s){var q=_.inst,J=q.destroy;if(J!==void 0){q.destroy=void 0,A=c;var ue=m,_e=J;try{_e()}catch(Ae){en(A,ue,Ae)}}}_=_.next}while(_!==M)}}catch(Ae){en(c,c.return,Ae)}}function p4(s){var c=s.updateQueue;if(c!==null){var m=s.stateNode;try{iy(c,m)}catch(_){en(s,s.return,_)}}}function m4(s,c,m){m.props=nl(s.type,s.memoizedProps),m.state=s.memoizedState;try{m.componentWillUnmount()}catch(_){en(s,c,_)}}function Mu(s,c){try{var m=s.ref;if(m!==null){switch(s.tag){case 26:case 27:case 5:var _=s.stateNode;break;case 30:_=s.stateNode;break;default:_=s.stateNode}typeof m=="function"?s.refCleanup=m(_):m.current=_}}catch(A){en(s,c,A)}}function zs(s,c){var m=s.ref,_=s.refCleanup;if(m!==null)if(typeof _=="function")try{_()}catch(A){en(s,c,A)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof m=="function")try{m(null)}catch(A){en(s,c,A)}else m.current=null}function g4(s){var c=s.type,m=s.memoizedProps,_=s.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":m.autoFocus&&_.focus();break e;case"img":m.src?_.src=m.src:m.srcSet&&(_.srcset=m.srcSet)}}catch(A){en(s,s.return,A)}}function h1(s,c,m){try{var _=s.stateNode;IN(_,s.type,m,c),_[In]=c}catch(A){en(s,s.return,A)}}function b4(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ho(s.type)||s.tag===4}function f1(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||b4(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&ho(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function p1(s,c,m){var _=s.tag;if(_===5||_===6)s=s.stateNode,c?(m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m).insertBefore(s,c):(c=m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m,c.appendChild(s),m=m._reactRootContainer,m!=null||c.onclick!==null||(c.onclick=nn));else if(_!==4&&(_===27&&ho(s.type)&&(m=s.stateNode,c=null),s=s.child,s!==null))for(p1(s,c,m),s=s.sibling;s!==null;)p1(s,c,m),s=s.sibling}function t0(s,c,m){var _=s.tag;if(_===5||_===6)s=s.stateNode,c?m.insertBefore(s,c):m.appendChild(s);else if(_!==4&&(_===27&&ho(s.type)&&(m=s.stateNode),s=s.child,s!==null))for(t0(s,c,m),s=s.sibling;s!==null;)t0(s,c,m),s=s.sibling}function v4(s){var c=s.stateNode,m=s.memoizedProps;try{for(var _=s.type,A=c.attributes;A.length;)c.removeAttributeNode(A[0]);yr(c,_,m),c[ft]=s,c[In]=m}catch(M){en(s,s.return,M)}}var ga=!1,Gn=!1,m1=!1,_4=typeof WeakSet=="function"?WeakSet:Set,hr=null;function mN(s,c){if(s=s.containerInfo,I1=w0,s=Mx(s),lm(s)){if("selectionStart"in s)var m={start:s.selectionStart,end:s.selectionEnd};else e:{m=(m=s.ownerDocument)&&m.defaultView||window;var _=m.getSelection&&m.getSelection();if(_&&_.rangeCount!==0){m=_.anchorNode;var A=_.anchorOffset,M=_.focusNode;_=_.focusOffset;try{m.nodeType,M.nodeType}catch{m=null;break e}var q=0,J=-1,ue=-1,_e=0,Ae=0,je=s,ye=null;t:for(;;){for(var ke;je!==m||A!==0&&je.nodeType!==3||(J=q+A),je!==M||_!==0&&je.nodeType!==3||(ue=q+_),je.nodeType===3&&(q+=je.nodeValue.length),(ke=je.firstChild)!==null;)ye=je,je=ke;for(;;){if(je===s)break t;if(ye===m&&++_e===A&&(J=q),ye===M&&++Ae===_&&(ue=q),(ke=je.nextSibling)!==null)break;je=ye,ye=je.parentNode}je=ke}m=J===-1||ue===-1?null:{start:J,end:ue}}else m=null}m=m||{start:0,end:0}}else m=null;for(z1={focusedElem:s,selectionRange:m},w0=!1,hr=c;hr!==null;)if(c=hr,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,hr=s;else for(;hr!==null;){switch(c=hr,M=c.alternate,s=c.flags,c.tag){case 0:if((s&4)!==0&&(s=c.updateQueue,s=s!==null?s.events:null,s!==null))for(m=0;m title"))),yr(M,_,m),M[ft]=s,Qt(M),_=M;break e;case"link":var q=C5("link","href",A).get(_+(m.href||""));if(q){for(var J=0;Jan&&(q=an,an=gt,gt=q);var me=Nx(J,gt),de=Nx(J,an);if(me&&de&&(ke.rangeCount!==1||ke.anchorNode!==me.node||ke.anchorOffset!==me.offset||ke.focusNode!==de.node||ke.focusOffset!==de.offset)){var ve=je.createRange();ve.setStart(me.node,me.offset),ke.removeAllRanges(),gt>an?(ke.addRange(ve),ke.extend(de.node,de.offset)):(ve.setEnd(de.node,de.offset),ke.addRange(ve))}}}}for(je=[],ke=J;ke=ke.parentNode;)ke.nodeType===1&&je.push({element:ke,left:ke.scrollLeft,top:ke.scrollTop});for(typeof J.focus=="function"&&J.focus(),J=0;Jm?32:m,Y.T=null,m=w1,w1=null;var M=lo,q=ya;if(ar=0,dc=lo=null,ya=0,(Wt&6)!==0)throw Error(r(331));var J=Wt;if(Wt|=4,j4(M.current),A4(M,M.current,q,m),Wt=J,zu(0,!1),_t&&typeof _t.onPostCommitFiberRoot=="function")try{_t.onPostCommitFiberRoot(jt,M)}catch{}return!0}finally{Z.p=A,Y.T=_,Y4(s,c)}}function K4(s,c,m){c=Ki(m,c),c=t1(s.stateNode,c,2),s=to(s,c,2),s!==null&&(mn(s,2),Bs(s))}function en(s,c,m){if(s.tag===3)K4(s,s,m);else for(;c!==null;){if(c.tag===3){K4(c,s,m);break}else if(c.tag===1){var _=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof _.componentDidCatch=="function"&&(oo===null||!oo.has(_))){s=Ki(m,s),m=Zy(2),_=to(c,m,2),_!==null&&(Qy(m,_,c,s),mn(_,2),Bs(_));break}}c=c.return}}function E1(s,c,m){var _=s.pingCache;if(_===null){_=s.pingCache=new vN;var A=new Set;_.set(c,A)}else A=_.get(c),A===void 0&&(A=new Set,_.set(c,A));A.has(m)||(v1=!0,A.add(m),s=SN.bind(null,s,c,m),c.then(s,s))}function SN(s,c,m){var _=s.pingCache;_!==null&&_.delete(c),s.pingedLanes|=s.suspendedLanes&m,s.warmLanes&=~m,un===s&&(Ot&m)===m&&(Ln===4||Ln===3&&(Ot&62914560)===Ot&&300>ct()-i0?(Wt&2)===0&&hc(s,0):_1|=m,uc===Ot&&(uc=0)),Bs(s)}function Z4(s,c){c===0&&(c=Kr()),s=Vo(s,c),s!==null&&(mn(s,c),Bs(s))}function kN(s){var c=s.memoizedState,m=0;c!==null&&(m=c.retryLane),Z4(s,m)}function CN(s,c){var m=0;switch(s.tag){case 31:case 13:var _=s.stateNode,A=s.memoizedState;A!==null&&(m=A.retryLane);break;case 19:_=s.stateNode;break;case 22:_=s.stateNode._retryCache;break;default:throw Error(r(314))}_!==null&&_.delete(c),Z4(s,m)}function EN(s,c){return ot(s,c)}var d0=null,pc=null,A1=!1,h0=!1,T1=!1,uo=0;function Bs(s){s!==pc&&s.next===null&&(pc===null?d0=pc=s:pc=pc.next=s),h0=!0,A1||(A1=!0,TN())}function zu(s,c){if(!T1&&h0){T1=!0;do for(var m=!1,_=d0;_!==null;){if(s!==0){var A=_.pendingLanes;if(A===0)var M=0;else{var q=_.suspendedLanes,J=_.pingedLanes;M=(1<<31-ut(42|s)+1)-1,M&=A&~(q&~J),M=M&201326741?M&201326741|1:M?M|2:0}M!==0&&(m=!0,t5(_,M))}else M=Ot,M=Ts(_,_===un?M:0,_.cancelPendingCommit!==null||_.timeoutHandle!==-1),(M&3)===0||Jn(_,M)||(m=!0,t5(_,M));_=_.next}while(m);T1=!1}}function AN(){Q4()}function Q4(){h0=A1=!1;var s=0;uo!==0&&BN()&&(s=uo);for(var c=ct(),m=null,_=d0;_!==null;){var A=_.next,M=J4(_,c);M===0?(_.next=null,m===null?d0=A:m.next=A,A===null&&(pc=m)):(m=_,(s!==0||(M&3)!==0)&&(h0=!0)),_=A}ar!==0&&ar!==5||zu(s),uo!==0&&(uo=0)}function J4(s,c){for(var m=s.suspendedLanes,_=s.pingedLanes,A=s.expirationTimes,M=s.pendingLanes&-62914561;0J)break;var Ae=ue.transferSize,je=ue.initiatorType;Ae&&c5(je)&&(ue=ue.responseEnd,q+=Ae*(ue"u"?null:document;function y5(s,c,m){var _=mc;if(_&&typeof c=="string"&&c){var A=ir(c);A='link[rel="'+s+'"][href="'+A+'"]',typeof m=="string"&&(A+='[crossorigin="'+m+'"]'),x5.has(A)||(x5.add(A),s={rel:s,crossOrigin:m,href:c},_.querySelector(A)===null&&(c=_.createElement("link"),yr(c,"link",s),Qt(c),_.head.appendChild(c)))}}function WN(s){wa.D(s),y5("dns-prefetch",s,null)}function YN(s,c){wa.C(s,c),y5("preconnect",s,c)}function XN(s,c,m){wa.L(s,c,m);var _=mc;if(_&&s&&c){var A='link[rel="preload"][as="'+ir(c)+'"]';c==="image"&&m&&m.imageSrcSet?(A+='[imagesrcset="'+ir(m.imageSrcSet)+'"]',typeof m.imageSizes=="string"&&(A+='[imagesizes="'+ir(m.imageSizes)+'"]')):A+='[href="'+ir(s)+'"]';var M=A;switch(c){case"style":M=gc(s);break;case"script":M=bc(s)}ns.has(M)||(s=f({rel:"preload",href:c==="image"&&m&&m.imageSrcSet?void 0:s,as:c},m),ns.set(M,s),_.querySelector(A)!==null||c==="style"&&_.querySelector(Fu(M))||c==="script"&&_.querySelector(Pu(M))||(c=_.createElement("link"),yr(c,"link",s),Qt(c),_.head.appendChild(c)))}}function KN(s,c){wa.m(s,c);var m=mc;if(m&&s){var _=c&&typeof c.as=="string"?c.as:"script",A='link[rel="modulepreload"][as="'+ir(_)+'"][href="'+ir(s)+'"]',M=A;switch(_){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":M=bc(s)}if(!ns.has(M)&&(s=f({rel:"modulepreload",href:s},c),ns.set(M,s),m.querySelector(A)===null)){switch(_){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(m.querySelector(Pu(M)))return}_=m.createElement("link"),yr(_,"link",s),Qt(_),m.head.appendChild(_)}}}function ZN(s,c,m){wa.S(s,c,m);var _=mc;if(_&&s){var A=Ir(_).hoistableStyles,M=gc(s);c=c||"default";var q=A.get(M);if(!q){var J={loading:0,preload:null};if(q=_.querySelector(Fu(M)))J.loading=5;else{s=f({rel:"stylesheet",href:s,"data-precedence":c},m),(m=ns.get(M))&&q1(s,m);var ue=q=_.createElement("link");Qt(ue),yr(ue,"link",s),ue._p=new Promise(function(_e,Ae){ue.onload=_e,ue.onerror=Ae}),ue.addEventListener("load",function(){J.loading|=1}),ue.addEventListener("error",function(){J.loading|=2}),J.loading|=4,b0(q,c,_)}q={type:"stylesheet",instance:q,count:1,state:J},A.set(M,q)}}}function QN(s,c){wa.X(s,c);var m=mc;if(m&&s){var _=Ir(m).hoistableScripts,A=bc(s),M=_.get(A);M||(M=m.querySelector(Pu(A)),M||(s=f({src:s,async:!0},c),(c=ns.get(A))&&G1(s,c),M=m.createElement("script"),Qt(M),yr(M,"link",s),m.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},_.set(A,M))}}function JN(s,c){wa.M(s,c);var m=mc;if(m&&s){var _=Ir(m).hoistableScripts,A=bc(s),M=_.get(A);M||(M=m.querySelector(Pu(A)),M||(s=f({src:s,async:!0,type:"module"},c),(c=ns.get(A))&&G1(s,c),M=m.createElement("script"),Qt(M),yr(M,"link",s),m.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},_.set(A,M))}}function w5(s,c,m,_){var A=(A=pe.current)?g0(A):null;if(!A)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof m.precedence=="string"&&typeof m.href=="string"?(c=gc(m.href),m=Ir(A).hoistableStyles,_=m.get(c),_||(_={type:"style",instance:null,count:0,state:null},m.set(c,_)),_):{type:"void",instance:null,count:0,state:null};case"link":if(m.rel==="stylesheet"&&typeof m.href=="string"&&typeof m.precedence=="string"){s=gc(m.href);var M=Ir(A).hoistableStyles,q=M.get(s);if(q||(A=A.ownerDocument||A,q={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},M.set(s,q),(M=A.querySelector(Fu(s)))&&!M._p&&(q.instance=M,q.state.loading=5),ns.has(s)||(m={rel:"preload",as:"style",href:m.href,crossOrigin:m.crossOrigin,integrity:m.integrity,media:m.media,hrefLang:m.hrefLang,referrerPolicy:m.referrerPolicy},ns.set(s,m),M||ej(A,s,m,q.state))),c&&_===null)throw Error(r(528,""));return q}if(c&&_!==null)throw Error(r(529,""));return null;case"script":return c=m.async,m=m.src,typeof m=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=bc(m),m=Ir(A).hoistableScripts,_=m.get(c),_||(_={type:"script",instance:null,count:0,state:null},m.set(c,_)),_):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function gc(s){return'href="'+ir(s)+'"'}function Fu(s){return'link[rel="stylesheet"]['+s+"]"}function S5(s){return f({},s,{"data-precedence":s.precedence,precedence:null})}function ej(s,c,m,_){s.querySelector('link[rel="preload"][as="style"]['+c+"]")?_.loading=1:(c=s.createElement("link"),_.preload=c,c.addEventListener("load",function(){return _.loading|=1}),c.addEventListener("error",function(){return _.loading|=2}),yr(c,"link",m),Qt(c),s.head.appendChild(c))}function bc(s){return'[src="'+ir(s)+'"]'}function Pu(s){return"script[async]"+s}function k5(s,c,m){if(c.count++,c.instance===null)switch(c.type){case"style":var _=s.querySelector('style[data-href~="'+ir(m.href)+'"]');if(_)return c.instance=_,Qt(_),_;var A=f({},m,{"data-href":m.href,"data-precedence":m.precedence,href:null,precedence:null});return _=(s.ownerDocument||s).createElement("style"),Qt(_),yr(_,"style",A),b0(_,m.precedence,s),c.instance=_;case"stylesheet":A=gc(m.href);var M=s.querySelector(Fu(A));if(M)return c.state.loading|=4,c.instance=M,Qt(M),M;_=S5(m),(A=ns.get(A))&&q1(_,A),M=(s.ownerDocument||s).createElement("link"),Qt(M);var q=M;return q._p=new Promise(function(J,ue){q.onload=J,q.onerror=ue}),yr(M,"link",_),c.state.loading|=4,b0(M,m.precedence,s),c.instance=M;case"script":return M=bc(m.src),(A=s.querySelector(Pu(M)))?(c.instance=A,Qt(A),A):(_=m,(A=ns.get(M))&&(_=f({},m),G1(_,A)),s=s.ownerDocument||s,A=s.createElement("script"),Qt(A),yr(A,"link",_),s.head.appendChild(A),c.instance=A);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(_=c.instance,c.state.loading|=4,b0(_,m.precedence,s));return c.instance}function b0(s,c,m){for(var _=m.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=_.length?_[_.length-1]:null,M=A,q=0;q<_.length;q++){var J=_[q];if(J.dataset.precedence===c)M=J;else if(M!==A)break}M?M.parentNode.insertBefore(s,M.nextSibling):(c=m.nodeType===9?m.head:m,c.insertBefore(s,c.firstChild))}function q1(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.title==null&&(s.title=c.title)}function G1(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.integrity==null&&(s.integrity=c.integrity)}var v0=null;function C5(s,c,m){if(v0===null){var _=new Map,A=v0=new Map;A.set(m,_)}else A=v0,_=A.get(m),_||(_=new Map,A.set(m,_));if(_.has(s))return _;for(_.set(s,null),m=m.getElementsByTagName(s),A=0;A title"):null)}function tj(s,c,m){if(m===1||c.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return s=c.disabled,typeof c.precedence=="string"&&s==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function A5(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function nj(s,c,m,_){if(m.type==="stylesheet"&&(typeof _.media!="string"||matchMedia(_.media).matches!==!1)&&(m.state.loading&4)===0){if(m.instance===null){var A=gc(_.href),M=c.querySelector(Fu(A));if(M){c=M._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(s.count++,s=_0.bind(s),c.then(s,s)),m.state.loading|=4,m.instance=M,Qt(M);return}M=c.ownerDocument||c,_=S5(_),(A=ns.get(A))&&q1(_,A),M=M.createElement("link"),Qt(M);var q=M;q._p=new Promise(function(J,ue){q.onload=J,q.onerror=ue}),yr(M,"link",_),m.instance=M}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(m,c),(c=m.state.preload)&&(m.state.loading&3)===0&&(s.count++,m=_0.bind(s),c.addEventListener("load",m),c.addEventListener("error",m))}}var V1=0;function rj(s,c){return s.stylesheets&&s.count===0&&y0(s,s.stylesheets),0V1?50:800)+c);return s.unsuspend=m,function(){s.unsuspend=null,clearTimeout(_),clearTimeout(A)}}:null}function _0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)y0(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var x0=null;function y0(s,c){s.stylesheets=null,s.unsuspend!==null&&(s.count++,x0=new Map,c.forEach(ij,s),x0=null,_0.call(s))}function ij(s,c){if(!(c.state.loading&4)){var m=x0.get(s);if(m)var _=m.get(null);else{m=new Map,x0.set(s,m);for(var A=s.querySelectorAll("link[data-precedence],style[data-precedence]"),M=0;M"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),tg.exports=xj(),tg.exports}var wj=yj();/** - * @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 G8=(...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 Sj=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 kj=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 e3=e=>{const t=kj(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 sg={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 Cj=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Ej=R.createContext({}),Aj=()=>R.useContext(Ej),Tj=R.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...l},u)=>{const{size:d=24,strokeWidth:p=2,absoluteStrokeWidth:f=!1,color:g="currentColor",className:b=""}=Aj()??{},S=r??f?Number(n??p)*24/Number(t??d):n??p;return R.createElement("svg",{ref:u,...sg,width:t??d??sg.width,height:t??d??sg.height,stroke:e??g,strokeWidth:S,className:G8("lucide",b,i),...!a&&!Cj(l)&&{"aria-hidden":"true"},...l},[...o.map(([k,x])=>R.createElement(k,x)),...Array.isArray(a)?a:[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 Xe=(e,t)=>{const n=R.forwardRef(({className:r,...i},a)=>R.createElement(Tj,{ref:a,iconNode:t,className:G8(`lucide-${Sj(e3(e))}`,`lucide-${e}`,r),...i}));return n.displayName=e3(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 Nj=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Cf=Xe("arrow-left",Nj);/** - * @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 jj=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],ag=Xe("arrow-right",jj);/** - * @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 Mj=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Rj=Xe("arrow-up-right",Mj);/** - * @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 Dj=[["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"}]],Lj=Xe("blocks",Dj);/** - * @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 Oj=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],V8=Xe("book-open",Oj);/** - * @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 Ij=[["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"}]],zj=Xe("boxes",Ij);/** - * @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 Bj=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],Hj=Xe("calendar-days",Bj);/** - * @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 $j=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16c.5-2 1.5-7 4-7 2 0 2 3 4 3 2.5 0 4.5-5 5-7",key:"lw07rv"}]],W8=Xe("chart-spline",$j);/** - * @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 Fj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Di=Xe("check",Fj);/** - * @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 Pj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Rl=Xe("chevron-down",Pj);/** - * @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 Uj=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Y8=Xe("chevron-left",Uj);/** - * @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 qj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xs=Xe("chevron-right",qj);/** - * @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 Gj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Vj=Xe("circle-alert",Gj);/** - * @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 Wj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Yj=Xe("circle-question-mark",Wj);/** - * @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 Xj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],X8=Xe("circle-stop",Xj);/** - * @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 Kj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],K8=Xe("circle-x",Kj);/** - * @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 Zj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],Qj=Xe("clock-3",Zj);/** - * @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 Jj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],eM=Xe("clock",Jj);/** - * @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 tM=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Z8=Xe("code",tM);/** - * @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 nM=[["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"}]],n_=Xe("copy",nM);/** - * @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 rM=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],Q8=Xe("corner-down-left",rM);/** - * @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 iM=[["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"}]],sM=Xe("cpu",iM);/** - * @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 aM=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],oM=Xe("download",aM);/** - * @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 lM=[["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"}]],J8=Xe("ellipsis",lM);/** - * @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 cM=[["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"}]],xd=Xe("external-link",cM);/** - * @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 uM=[["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"}]],eS=Xe("file-code",uM);/** - * @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 dM=[["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"}]],th=Xe("file-text",dM);/** - * @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 hM=[["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:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]],fM=Xe("file-up",hM);/** - * @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 pM=[["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"}]],Eb=Xe("flask-conical",pM);/** - * @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 mM=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 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.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],tS=Xe("folder-git-2",mM);/** - * @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 gM=[["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"}]],yd=Xe("folder-open",gM);/** - * @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 bM=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["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"}]],vM=Xe("folder-plus",bM);/** - * @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 _M=[["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"}]],ip=Xe("folder-tree",_M);/** - * @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 xM=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],yM=Xe("funnel",xM);/** - * @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 wM=[["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"}]],nh=Xe("git-branch",wM);/** - * @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 SM=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],kM=Xe("git-commit-horizontal",SM);/** - * @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 CM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],EM=Xe("globe",CM);/** - * @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 AM=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],TM=Xe("history",AM);/** - * @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 NM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],jM=Xe("info",NM);/** - * @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 MM=[["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"}]],RM=Xe("laptop",MM);/** - * @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 DM=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],LM=Xe("lightbulb",DM);/** - * @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 OM=[["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"}]],t3=Xe("lock",OM);/** - * @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 IM=[["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"}]],zM=Xe("maximize-2",IM);/** - * @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 BM=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],nS=Xe("message-square-quote",BM);/** - * @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 HM=[["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"}]],$M=Xe("minimize-2",HM);/** - * @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 FM=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],PM=Xe("monitor",FM);/** - * @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 UM=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],qM=Xe("moon",UM);/** - * @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 GM=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],VM=Xe("mouse-pointer-click",GM);/** - * @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 WM=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],r_=Xe("package",WM);/** - * @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 YM=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],rS=Xe("panel-left",YM);/** - * @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 XM=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],KM=Xe("paperclip",XM);/** - * @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 ZM=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],sp=Xe("pencil",ZM);/** - * @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 QM=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],i_=Xe("plus",QM);/** - * @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 JM=[["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"}]],rh=Xe("refresh-cw",JM);/** - * @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 eR=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],tR=Xe("rotate-ccw",eR);/** - * @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 nR=[["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"}]],iS=Xe("rotate-cw",nR);/** - * @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 rR=[["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"}]],s_=Xe("scroll-text",rR);/** - * @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 iR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],sR=Xe("search",iR);/** - * @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 aR=[["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"}]],n3=Xe("server",aR);/** - * @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 oR=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],lR=Xe("settings-2",oR);/** - * @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 cR=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],uR=Xe("settings",cR);/** - * @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 dR=[["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"}]],hR=Xe("sliders-horizontal",dR);/** - * @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 fR=[["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"}]],sS=Xe("square-terminal",fR);/** - * @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 pR=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],mR=Xe("sun",pR);/** - * @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 gR=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Uc=Xe("terminal",gR);/** - * @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 bR=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],vR=Xe("toggle-right",bR);/** - * @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 _R=[["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"}]],ih=Xe("trash-2",_R);/** - * @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 xR=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],yR=Xe("triangle-alert",xR);/** - * @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 wR=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],SR=Xe("upload",wR);/** - * @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 kR=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],aS=Xe("users",kR);/** - * @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 CR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],qr=Xe("x",CR),og="demo_nanochat_v1",Ef="PROJECT.md",lg=e=>e.startsWith("demo_"),cd="chat_demo_nanochat_v1",oS="chat_demo_nanochat_figures_v1",lS="chat_demo_nanochat_literature_v1";function ss(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}async function Ba(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 At=e=>fetch(e).then(t=>Ba(t)),zt=(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=>Ba(n)),ap=(e,t)=>fetch(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(n=>Ba(n)),cS=(e,t)=>fetch(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(n=>Ba(n)),ER=()=>At("/api/projects").then(e=>e.projects),AR=()=>At("/api/settings/ui-state"),r3=e=>zt("/api/settings/ui-state",e),TR=(e,t)=>zt("/api/onboarding/complete",{...e,...t}),uS=(e="")=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return At(`/api/project-path/status${t}`)},NR=()=>zt("/api/project-path/pick").then(e=>e.path),jR=e=>zt("/api/projects",e),dS=e=>At(`/api/papers/search?q=${encodeURIComponent(e)}`).then(t=>t.papers),MR=()=>At("/api/github/account"),RR=e=>At(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`),DR=(e,t)=>At(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(t)}`),Ab=e=>At(`/api/papers/resolve?id=${encodeURIComponent(e)}`).then(t=>t.paper),LR=e=>zt(`/api/projects/${e}/open`).then(t=>t.project),OR=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})`)}}),IR=e=>At(`/api/projects/${e}/experiments`).then(t=>t.experiments),zR=e=>At(`/api/projects/${e}/runs`).then(t=>t.runs),hS=()=>At("/api/instances").then(e=>e.instances),fS=e=>zt(`/api/runs/${e}/cancel`).then(()=>{}),BR=(e,t)=>At(`/api/runs/${e}/log?offset=${t}`),HR=e=>At(`/api/runs/${e}/diff`),$R=e=>At(`/api/experiments/${e}/diff`),a_=(e,t=new URLSearchParams)=>(e.sessionId&&t.set("sessionId",e.sessionId),e.ref&&t.set("ref",e.ref),t),i3=(e,t,n={})=>At(`/api/projects/${e}/file?${a_(n,new URLSearchParams({path:t}))}`),FR=(e,t,n={})=>`/api/projects/${e}/file/raw?${a_(n,new URLSearchParams({path:t}))}`,PR=e=>At(`/api/files/abs?path=${encodeURIComponent(e)}`),UR=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,qR=(e,t,n,r={})=>cS(`/api/projects/${e}/file`,{path:t,content:n,sessionId:r.sessionId}),GR=(e,t,n={})=>zt(`/api/projects/${e}/file/open`,{path:t,sessionId:n.sessionId}),Tb=(e,t={})=>{const n=a_(t).toString();return At(`/api/projects/${e}/code-tree${n?`?${n}`:""}`)},pS=e=>At(`/api/chat/sessions/${e}/worktree`),op=(e,t,n)=>`https://github.com/${e}/${t}/tree/${n.split("/").map(encodeURIComponent).join("/")}`,VR=()=>At("/api/settings/hf"),WR=e=>zt("/api/settings/hf",{token:e}),YR=()=>At("/api/update"),XR=()=>zt("/api/update/apply"),KR=e=>zt("/api/update/auto",{enabled:e}),ZR=(e=!1)=>zt("/api/update/install-cli",{force:e}),QR=()=>At("/api/settings/k8s"),JR=e=>zt("/api/settings/k8s",e),eD=()=>At("/api/settings/modal"),tD=()=>zt("/api/settings/modal/provision"),nD=()=>At("/api/settings/env").then(e=>e.vars),mS=(e,t)=>zt("/api/settings/env",{key:e,value:t}).then(n=>n.vars),rD=e=>fetch(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(t=>Ba(t)).then(t=>t.vars),iD=()=>At("/api/settings/data-dir"),sD=e=>zt("/api/settings/data-dir/validate",{path:e}),aD=e=>zt("/api/settings/data-dir/move",{path:e}),oD=()=>At("/api/settings/ssh").then(e=>e.hosts),lD=e=>zt("/api/settings/ssh/preflight",{host:e}),cD=()=>At("/api/settings/slurm"),uD=e=>zt("/api/settings/slurm",e),dD=e=>zt("/api/settings/slurm/preflight",{host:e}),hD=()=>At("/api/settings/ray"),fD=e=>zt("/api/settings/ray",e),pD=e=>zt("/api/settings/ray/preflight",{address:e??null}),mD=e=>At(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`),gS=e=>zt("/api/settings/compute/default",e),gD=()=>At("/api/settings/local"),bD=()=>At("/api/settings/openresearch"),s3=e=>At(`/api/projects/${e}/files`),vD=(e,t)=>fetch(`/api/projects/${e}/files?path=${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>Ba(n)),sh=(e,t)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(t)}`,bS=512e3,_D=(e,t)=>{const n=new Uint8Array(e);if(n.includes(0))return{content:"",binary:!0,truncated:t};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(n,{stream:t}),binary:!1,truncated:t}}catch{return{content:"",binary:!0,truncated:t}}},vS=(e,t)=>fetch(sh(e,t),{headers:{Range:`bytes=0-${bS-1}`}}).then(n=>{var i;if(n.status===404)return null;if(n.status===416&&n.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!n.ok)throw new Error(`HTTP ${n.status}`);const r=Number((i=n.headers.get("content-range"))==null?void 0:i.split("/").pop());return n.arrayBuffer().then(a=>_D(a,Number.isFinite(r)&&r>a.byteLength))}),xD=(e,t)=>cS(`/api/projects/${e}/brief`,{content:t}),yD=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",wD=(e,t)=>fetch(sh(e,t),{method:"HEAD"}).then(n=>{if(n.status===404)return null;if(!n.ok)throw new Error(`HTTP ${n.status}`);const r=n.headers.get("x-openresearch-presentation");return{size:Number(n.headers.get("content-length"))||0,presentation:yD(r)?r:"download"}}),SD=e=>zt("/api/settings/git/token",{token:e}),kD=()=>At("/api/settings/profile"),CD=()=>At("/api/settings/lit-sources"),ED=e=>zt("/api/settings/lit-sources",e),o_=()=>At("/api/settings/projects"),_S=(e,t)=>zt("/api/settings/projects",{githubForNewProjects:e,githubDefaultPromptSeen:t}),AD=e=>At(`/api/projects/${e}/git`),TD=e=>zt(`/api/projects/${e}/git/init`),ND=e=>zt(`/api/projects/${e}/github`),jD=e=>zt(`/api/projects/${e}/github/disable`),Af=e=>e.displayName??yS(e.id),Nb="default";function lp(e,t){var o,l,u;const n=e==null?void 0:e.models.find(d=>d.id===t),r=(n==null?void 0:n.reasoningLevels)??((o=e==null?void 0:e.options)==null?void 0:o.reasoningLevels)??[],i=n==null?void 0:n.defaultReasoningLevel,a=i&&r.some(d=>d.id===i)?i:r.some(d=>d.id===Nb)?Nb:((l=e==null?void 0:e.options)==null?void 0:l.defaultReasoningLevel)??((u=r[0])==null?void 0:u.id)??null;return{choices:r,defaultId:a}}function xS(e,t,n){if(!e)return n;const{choices:r,defaultId:i}=lp(e,t);return r.length===0?Nb:n&&r.some(a=>a.id===n)?n:i}const Tf=(e=!1,t=!1)=>{const n=new URLSearchParams;e&&n.set("refresh","1"),t&&n.set("retry","1");const r=n.size>0?`?${n.toString()}`:"";return At(`/api/harnesses${r}`).then(i=>i.harnesses)},MD=e=>At(`/api/skills${e?`?project=${encodeURIComponent(e)}`:""}`).then(t=>t.skills),RD=e=>At(`/api/user-skills${e?`?project=${encodeURIComponent(e)}`:""}`).then(t=>t.skills),DD=e=>zt("/api/user-skills",e).then(t=>t.skill),LD=e=>{const t=new URLSearchParams({scope:e.scope,name:e.name});return e.projectId&&t.set("project",e.projectId),fetch(`/api/user-skills?${t.toString()}`,{method:"DELETE"}).then(n=>Ba(n))},OD=()=>At("/api/harness-skills").then(e=>e.skills),ID=e=>zt("/api/user-skills/import",e).then(t=>t.skill);function yS(e){const t=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),n=[],r=[];for(const i of t.split("-"))/^\d+(\.\d+)?$/.test(i)?r.push(i):(r.length&&n.push(r.splice(0).join(".")),n.push(i==="gpt"?"GPT":i.charAt(0).toUpperCase()+i.slice(1)));return r.length&&n.push(r.join(".")),n.join(" ")}const lf=e=>At(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`).then(t=>t.sessions),zD=(e,t,n={})=>zt("/api/chat/sessions",{projectId:e,harness:t,...n}).then(r=>r.session),BD=e=>fetch(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(t=>Ba(t)),HD=(e,t)=>ap(`/api/chat/sessions/${e}`,{archived:t}).then(n=>n.session),$D=(e,t)=>ap(`/api/chat/sessions/${e}`,{title:t}).then(n=>n.session),FD=(e,t)=>ap(`/api/chat/sessions/${e}`,{planMode:t}).then(n=>n.session),PD=(e,t)=>ap(`/api/chat/sessions/${e}`,{permissionMode:t}).then(n=>n.session),ud=e=>At(`/api/chat/sessions/${e}/messages`).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),UD=(e,t)=>fetch(`/api/chat/sessions/${e}/queue/${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>Ba(n)),qD=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,a3=(e,t,n={},r,i,a)=>zt(`/api/chat/sessions/${e}/message`,{text:t,model:n.model,permissionMode:n.permissionMode,planMode:n.planMode,reasoningLevel:n.reasoningLevel,images:r,annotations:i,mode:a}),GD=(e,t,n)=>zt(`/api/chat/sessions/${e}/fork`,{messageId:t,text:n}),VD=(e,t)=>zt(`/api/chat/sessions/${e}/branch`,{leafId:t}),WD=e=>zt(`/api/chat/sessions/${e}/interrupt`),YD=(e,t)=>zt(`/api/chat/sessions/${e}/respond`,t);function Gs(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 Nf(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 Ao(e){const t=["B","KB","MB","GB","TB"];let n=e,r=0;for(;n>=1024&&r10?`${e.slice(0,10)}…`:e}function l_(e){return e?typeof e.kind=="string"?e.kind:typeof e.type=="string"?e.type:"":""}function KD(e){return e?typeof e.flavor=="string"&&e.flavor?e.flavor:typeof e.manifest=="string"&&e.manifest?e.manifest:l_(e)==="ray_job"?"":typeof e.namespace=="string"&&e.namespace?e.namespace:"":""}function c_(){return h.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[h.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),h.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function cf(){return h.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[h.jsx(c_,{}),"OpenResearch"]})}function ZD(e,t){if(!t)return e;const n=new Map(e.map(a=>[a.id,a]));let r=n.get(t);if(!r)return e;const i=[];for(;r;)i.push(r),r=r.parentId?n.get(r.parentId):void 0;return i.reverse()}function QD(e,t,n){var o;let r=e;for(;r&&r.role!=="user";)r=r.parentId?t.get(r.parentId):void 0;const i=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,a=(o=n.get(i))==null?void 0:o.filter(l=>l.role===e.role);return a!=null&&a.length?a:[e]}function JD(e,t,n,r){const i=e.filter(d=>!r(d.id)),a=new Map(i.map(d=>[d.id,d])),o=new Map;for(const d of i){const p=d.parentId??null,f=o.get(p);f?f.push(d):o.set(p,[d])}const l=new Set(t.map(d=>d.id)),u=new Map;for(const d of n){const p=QD(d,a,o),f=p.findIndex(g=>l.has(g.id));u.set(d.id,{count:p.length,index:f,prevId:f>0?p[f-1].id:void 0,nextId:f{n.delete(t),n.size===0&&uf.delete(e)}}function tL(e){var t;(t=uf.get(e.runId))==null||t.forEach(n=>n(e))}const jb=new Set;function wd(e){return jb.add(e),()=>{jb.delete(e)}}function vo(e){jb.forEach(t=>t(e))}const Mb=new Set;function u_(e){return Mb.add(e),()=>{Mb.delete(e)}}function l3(e){Mb.forEach(t=>t(e))}const Rb=new Set;function nL(e){return Rb.add(e),()=>{Rb.delete(e)}}function cg(e){Rb.forEach(t=>t(e))}const Db=new Set;function rL(e){return Db.add(e),()=>{Db.delete(e)}}function iL(e){Db.forEach(t=>t(e))}function sL(e){const t=R.useRef(e);t.current=e,R.useEffect(()=>{const n=new EventSource("/api/events");let r=!1;n.onerror=()=>{r=!0},n.onopen=()=>{var a,o;r&&(vo({type:"reconnected"}),l3({harness:"*",authState:"unknown"}),(o=(a=t.current).onReconnect)==null||o.call(a)),r=!0};const i=a=>{try{return JSON.parse(a.data)}catch{return null}};return n.addEventListener("run.updated",a=>{const o=i(a);o!=null&&o.run&&t.current.onRun(o.run)}),n.addEventListener("experiment.updated",a=>{const o=i(a);o!=null&&o.experiment&&t.current.onExperiment(o.experiment)}),n.addEventListener("project.updated",a=>{const o=i(a);o!=null&&o.project&&t.current.onProject(o.project)}),n.addEventListener("files.updated",a=>{var l,u;const o=i(a);o!=null&&o.projectId&&((u=(l=t.current).onArtifacts)==null||u.call(l,o.projectId))}),n.addEventListener("run.log",a=>{const o=i(a);o!=null&&o.runId&&tL(o)}),n.addEventListener("chat.session",a=>{const o=i(a);o!=null&&o.session&&vo({type:"session",session:o.session})}),n.addEventListener("chat.session.deleted",a=>{const o=i(a);o!=null&&o.sessionId&&vo({type:"sessionDeleted",sessionId:o.sessionId})}),n.addEventListener("chat.message",a=>{const o=i(a);o!=null&&o.message&&vo({type:"message",sessionId:o.sessionId,message:o.message})}),n.addEventListener("chat.busy",a=>{const o=i(a);o!=null&&o.sessionId&&vo({type:"busy",sessionId:o.sessionId,busy:o.busy})}),n.addEventListener("chat.usage",a=>{const o=i(a);o!=null&&o.sessionId&&o.usage&&vo({type:"usage",sessionId:o.sessionId,usage:o.usage})}),n.addEventListener("chat.queued",a=>{const o=i(a);o!=null&&o.sessionId&&vo({type:"queued",sessionId:o.sessionId,items:o.items??[]})}),n.addEventListener("chat.branch",a=>{const o=i(a);o!=null&&o.sessionId&&vo({type:"branch",sessionId:o.sessionId,activeLeafId:o.activeLeafId??null})}),n.addEventListener("harness.auth",a=>{const o=i(a);o!=null&&o.harness&&o.authState&&l3(o)}),n.addEventListener("datadir.move.progress",a=>{const o=i(a);o&&cg({type:"progress",...o})}),n.addEventListener("datadir.move.done",a=>{const o=i(a);o&&cg({type:"done",path:o.path,oldPathLeft:o.oldPathLeft})}),n.addEventListener("datadir.move.error",a=>{const o=i(a);o&&cg({type:"error",error:o.error})}),n.addEventListener("update.status",a=>{const o=i(a);o&&iL(o)}),()=>n.close()},[])}const aL=` - - - - -`,oL='',lL=` - - -`,d_={alphaxiv:"alphaXiv",openalex:"OpenAlex",biorxiv:"bioRxiv"},cL={alphaxiv:aL,openalex:lL,biorxiv:oL};function h_({source:e,size:t=16,decorative:n=!1,className:r=""}){return h.jsx("span",{className:`lit-logo flex-none inline-flex items-center justify-center p-[1.5px] box-border bg-white rounded-[3px] shadow-[0_0_0_1px_rgba(0,_0,_0,_0.08)] [&_svg]:w-full [&_svg]:h-full [&_svg]:block ${r}`,style:{width:t,height:t},...n?{"aria-hidden":!0}:{role:"img","aria-label":d_[e]},dangerouslySetInnerHTML:{__html:cL[e]}})}function c3(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function uL(e){const t=e.trim(),n=t.toLowerCase();if(n.includes("biorxiv.org"))return"biorxiv";if(n.includes("openalex.org"))return"openalex";const r=t.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const i=t.split("/").pop()??"";return/^W\d+$/i.test(i)?"openalex":"alphaxiv"}function dL(e){const n=e.trim().replace(/^https?:\/\/doi\.org\//i,"").replace(/^doi:/i,"").match(/10\.\d+\/[^\s?#]+/);return n?n[0].replace(/[.,)]+$/,"").replace(/v\d+(\.[a-z][a-z-]*)*$/i,""):null}function hL(e,t){const n=t.trim();if(e==="alphaxiv"){const a=(n.split(/[?#]/)[0].split("/").pop()||n).replace(/\.(pdf|md)$/i,"");return`https://www.alphaxiv.org/abs/${encodeURIComponent(a)}`}const r=dL(n);if(r)return`https://doi.org/${r}`;if(e==="openalex"){const i=n.split("/").pop()||n;return`https://openalex.org/${encodeURIComponent(i)}`}return`https://doi.org/${n}`}function fL(e){const t=[];let n="",r=!1,i=null;for(const a of e){if(i){a===i?i=null:n+=a,r=!0;continue}if(a==='"'||a==="'"){i=a,r=!0;continue}if(a===" "||a===" "||a===` -`){r&&(t.push(n),n="",r=!1);continue}if(a==="|"||a===";"||a===">"||a==="&")break;n+=a,r=!0}return r&&t.push(n),t}function pL(e){const t=e.match(/(?:^|[\s;&|(])orx\s+(lit|paper)\b/);if(!t)return null;const n=t[1],r=e.slice((t.index??0)+t[0].length),i=fL(r);let a,o;for(let l=0;l_&:first-child]:mr-3 [&.active]:text-primary","[&.active]:bg-surface"].join(" "),Xn=[ah,"w-7 h-7"].join(" "),hi=["model-item [&.danger]:text-accent-red [&.danger:hover]:text-accent-red flex","items-center justify-between gap-2 w-full text-left py-1.5 px-2","text-md rounded-sm [&:hover]:bg-surface","[&_.model-id]:block [&_.model-id]:font-mono [&_.model-id]:text-2xs","[&_.model-id]:text-muted"].join(" "),ur=["settings-loading flex items-center gap-2 text-subtext text-md","py-1 px-0"].join(" "),qt=["spinner w-[13px] h-[13px] border-2 border-border border-t-primary","rounded-full animate-[spin_0.8s_linear_infinite] shrink-0"].join(" "),tn="mono font-mono text-sm",Aa="tab-body flex-1 min-h-0 relative flex flex-col",Dc="code-tab-body flex-1 min-h-0 overflow-auto bg-background",vs=["code-tab-note py-2 px-4 text-sm text-muted","border-b border-b-border-variant shrink-0"].join(" "),Sd=["title [.chat-header_&]:text-base [.chat-header_&]:font-semibold","[.chat-header_&]:text-text [.chat-header_&]:flex-1 [.chat-header_&]:min-w-0","[.chat-header_&]:overflow-hidden [.chat-header_&]:text-ellipsis","[.chat-header_&]:whitespace-nowrap"].join(" "),fi=["btn inline-flex items-center justify-center gap-1.5 py-1.5 px-3.5","text-sm font-semibold border border-border","rounded-md bg-background text-text whitespace-nowrap","transition-[background,border-color,color] duration-120 ease-standard","[&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight","[&:disabled]:opacity-45 [&:disabled]:cursor-default [&.primary]:bg-primary","[&.primary]:border-primary [&.primary]:text-background","[&.primary:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))]","[&.primary:hover:not(:disabled)]:border-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))]","[&.primary:active:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_80%,_var(--text))]","[&.primary:active:not(:disabled)]:border-[color-mix(in_oklab,_var(--primary)_80%,_var(--text))]","[&.danger]:text-accent-red","[&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_8%,_transparent)]","[&.danger:active:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_14%,_transparent)]","[&.ghost]:border-transparent [&.ghost]:text-text","[&.ghost:hover:not(:disabled)]:text-text [&.ghost:hover:not(:disabled)]:bg-surface","[&.sm]:py-[3px] [&.sm]:px-[9px] [&.sm]:text-xs [&.sm]:rounded-sm"].join(" "),Kn=`${fi} sm`,Wr=`${fi} primary`,ug=`${fi} ghost`,mL=`${Kn} primary`,lr=["badge inline-flex items-center font-sans text-xs","font-medium py-px px-[7px] border border-border","rounded-sm text-text [&.ok]:text-accent-green","[&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle","[&.err]:text-accent-red [&.err]:border-accent-red","[&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber","[&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle"].join(" "),Li=`${lr} err`,Cs=`${lr} ok`,f_=`${lr} warn`,p_=["status-badge inline-flex items-center gap-1.5 text-sm","font-medium text-text whitespace-nowrap [&_.dot]:w-[7px]","[&_.dot]:h-[7px] [&_.dot]:rounded-full [&_.dot]:bg-current","[&_.dot]:shrink-0 [&.live_.dot]:animate-[or-pulse_1.2s_ease-in-out_infinite]","[&.st-done_.dot]:text-accent-green [&.st-done_>_svg]:text-accent-green","[&.st-failed_.dot]:text-accent-red [&.st-running_.dot]:text-accent-teal","[&.st-starting_.dot]:text-accent-amber [&.st-cancelling_.dot]:text-accent-orange","[&.st-cancelled_.dot]:text-accent-orange [&.st-editing_.dot]:text-accent-purple","[&.st-idle_.dot]:text-muted"].join(" "),m_=["settings-switch relative flex-none w-9.5 h-5.5 border border-border rounded-full","bg-surface transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:top-[3px] [&_span]:left-[3px] [&_span]:w-3.5 [&_span]:h-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background]","[&_span]:duration-120 [&_span]:ease-standard [&.on]:border-primary [&.on]:bg-primary","[&.on_span]:bg-background [&.on_span]:translate-x-4 [&:disabled]:opacity-45","[&:disabled]:cursor-default [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid","[&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2"].join(" "),gL=["alphaxiv","openalex","biorxiv"];let u3=null;function bL(){const[e,t]=R.useState(u3),[n,r]=R.useState(!1),i=o=>{u3=o,t(o)};R.useEffect(()=>{CD().then(i).catch(()=>{})},[]);const a=o=>{!e||n||(r(!0),ED({...e,[o]:!e[o]}).then(i).catch(()=>{}).finally(()=>r(!1)))};return e?h.jsx("div",{className:"flex flex-col",children:gL.map(o=>{const l=e[o];return h.jsxs("button",{type:"button",role:"switch","aria-checked":l,className:hi,disabled:n,onClick:()=>a(o),children:[h.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[h.jsx(h_,{source:o,size:16,decorative:!0}),d_[o]]}),h.jsx("span",{className:`${m_} ${l?"on":""}`,"aria-hidden":"true",children:h.jsx("span",{})})]},o)})}):h.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:"Loading…"})}function dg(e,t){if(!e)throw new Error("Assertion Error")}function sl(e,t){if(e==null)throw new Error(`Unexpected ${e}`);return e}function vL(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 _L(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` -`}]}function xL(e,t){const n=t.value?t.value+` -`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function yL(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wL(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Gr=Io(/[A-Za-z]/),Rr=Io(/[\dA-Za-z]/),SL=Io(/[#-'*+\--9=?A-Z^-~]/);function jf(e){return e!==null&&(e<32||e===127)}const Lb=Io(/\d/),kL=Io(/[\dA-Fa-f]/),CL=Io(/[!-/:-@[-`{-~]/);function at(e){return e!==null&&e<-2}function hn(e){return e!==null&&(e<0||e===32)}function Lt(e){return e===-2||e===-1||e===32}const cp=Io(new RegExp("\\p{P}|\\p{S}","u")),Cl=Io(/\s/);function Io(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function nu(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function EL(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=nu(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,d),e.applyData(t,d)}function AL(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 TL(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function wS(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 i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function NL(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return wS(e,t);const i={src:nu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function jL(e,t){const n={src:nu(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 ML(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 RL(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return wS(e,t);const i={href:nu(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function DL(e,t){const n={href:nu(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 LL(e,t,n){const r=e.all(t),i=n?OL(n):SS(t),a={},o=[];if(typeof t.checked=="boolean"){const p=r[0];let f;p&&p.type==="element"&&p.tagName==="p"?f=p:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l1}function IL(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0&&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 $L(e){const t=g_(e),n=kS(e);if(t&&n)return{start:t,end:n}}function FL(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=g_(t.children[1]),u=kS(t.children[t.children.length-1]);l&&u&&(o.position={start:l,end:u}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function PL(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let u=-1;const d=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(f3(t.slice(i),i>0,!1)),a.join("")}function f3(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===d3||a===h3;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===d3||a===h3;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function GL(e,t){const n={type:"text",value:qL(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function VL(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const WL={blockquote:vL,break:_L,code:xL,delete:yL,emphasis:wL,footnoteReference:EL,heading:AL,html:TL,imageReference:NL,image:jL,inlineCode:ML,linkReference:RL,link:DL,listItem:LL,list:IL,paragraph:zL,root:BL,strong:HL,table:FL,tableCell:UL,tableRow:PL,text:GL,thematicBreak:VL,toml:j0,yaml:j0,definition:j0,footnoteDefinition:j0};function j0(){}const ES=-1,up=0,dd=1,Mf=2,b_=3,v_=4,__=5,x_=6,AS=7,TS=8,YL=typeof self=="object"?self:globalThis,p3=(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 YL[e](t)},XL=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case up:case ES:return n(o,i);case dd:{const l=n([],i);for(const u of o)l.push(r(u));return l}case Mf:{const l=n({},i);for(const[u,d]of o)l[r(u)]=r(d);return l}case b_:return n(new Date(o),i);case v_:{const{source:l,flags:u}=o;return n(new RegExp(l,u),i)}case __:{const l=n(new Map,i);for(const[u,d]of o)l.set(r(u),r(d));return l}case x_:{const l=n(new Set,i);for(const u of o)l.add(r(u));return l}case AS:{const{name:l,message:u}=o;return n(p3(l,u),i)}case TS:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(p3(a,o),i)};return r},m3=e=>XL(new Map,e)(0),ul="",{toString:KL}={},{keys:ZL}=Object,Xu=e=>{const t=typeof e;if(t!=="object"||!e)return[up,t];const n=KL.call(e).slice(8,-1);switch(n){case"Array":return[dd,ul];case"Object":return[Mf,ul];case"Date":return[b_,ul];case"RegExp":return[v_,ul];case"Map":return[__,ul];case"Set":return[x_,ul];case"DataView":return[dd,n]}return n.includes("Array")?[dd,n]:n.includes("Error")?[AS,n]:[Mf,n]},M0=([e,t])=>e===up&&(t==="function"||t==="symbol"),QL=(e,t,n,r)=>{const i=(o,l)=>{const u=r.push(o)-1;return n.set(l,u),u},a=o=>{if(n.has(o))return n.get(o);let[l,u]=Xu(o);switch(l){case up:{let p=o;switch(u){case"bigint":l=TS,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);p=null;break;case"undefined":return i([ES],o)}return i([l,p],o)}case dd:{if(u){let g=o;return u==="DataView"?g=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(g=new Uint8Array(o)),i([u,[...g]],o)}const p=[],f=i([l,p],o);for(const g of o)p.push(a(g));return f}case Mf:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const p=[],f=i([l,p],o);for(const g of ZL(o))(e||!M0(Xu(o[g])))&&p.push([a(g),a(o[g])]);return f}case b_:return i([l,isNaN(o.getTime())?ul:o.toISOString()],o);case v_:{const{source:p,flags:f}=o;return i([l,{source:p,flags:f}],o)}case __:{const p=[],f=i([l,p],o);for(const[g,b]of o)(e||!(M0(Xu(g))||M0(Xu(b))))&&p.push([a(g),a(b)]);return f}case x_:{const p=[],f=i([l,p],o);for(const g of o)(e||!M0(Xu(g)))&&p.push(a(g));return f}}const{message:d}=o;return i([l,{name:u,message:d}],o)};return a},g3=(e,{json:t,lossy:n}={})=>{const r=[];return QL(!(t||n),!!t,new Map,r)(e),r},Rf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?m3(g3(e,t)):structuredClone(e):(e,t)=>m3(g3(e,t));function JL(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 eO(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function tO(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||JL,r=e.options.footnoteBackLabel||eO,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u0&&S.push({type:"text",value:" "});let w=typeof n=="string"?n:n(u,b);typeof w=="string"&&(w={type:"text",value:w}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,b),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const x=p[p.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const w=x.children[x.children.length-1];w&&w.type==="text"?w.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...S)}else p.push(...S);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(p,!0)};e.patch(d,v),l.push(v)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Rf(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const oh=(function(e){if(e==null)return sO;if(typeof e=="function")return dp(e);if(typeof e=="object")return Array.isArray(e)?nO(e):rO(e);if(typeof e=="string")return iO(e);throw new Error("Expected function, string, or object as test")});function nO(e){const t=[];let n=-1;for(;++n":""))+")"})}return g;function g(){let b=NS,S,k,x;if((!t||a(u,d,p[p.length-1]||void 0))&&(b=lO(n(u,p)),b[0]===Ob))return b;if("children"in u&&u.children){const v=u;if(v.children&&b[0]!==jS)for(k=(r?v.children.length:-1)+o,x=p.concat(v);k>-1&&k0&&n.push({type:"text",value:` -`}),n}function b3(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function v3(e,t){const n=uO(e,t),r=n.one(e,void 0),i=tO(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:` -`},i),a}function Df(e,t){return e&&"run"in e?async function(n,r){const i=v3(n,{file:r,...t});await e.run(i,r)}:function(n,r){return v3(n,{file:r,...e||t})}}function _3(e){if(e)throw e}var hg,x3;function mO(){if(x3)return hg;x3=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},a=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),f=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!f)return!1;var g;for(g in d);return typeof g>"u"||e.call(d,g)},o=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},l=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(r)return r(d,p).value}else return;return d[p]};return hg=function u(){var d,p,f,g,b,S,k=arguments[0],x=1,v=arguments.length,w=!1;for(typeof k=="boolean"&&(w=k,k=arguments[1]||{},x=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});xo.length;let u;l&&o.push(i);try{u=e.apply(this,o)}catch(d){const p=d;if(l&&n)throw p;return i(p)}l||(u&&u.then&&typeof u.then=="function"?u.then(a,i):u instanceof Error?i(u):a(u))}function i(o,...l){n||(n=!0,t(o,...l))}function a(o){i(null,o)}}function hd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?y3(e.position):"start"in e||"end"in e?y3(e):"line"in e||"column"in e?Bb(e):""}function Bb(e){return w3(e&&e.line)+":"+w3(e&&e.column)}function y3(e){return Bb(e&&e.start)+"-"+Bb(e&&e.end)}function w3(e){return e&&typeof e=="number"?e:1}class Lr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?a.ruleId=r:(a.source=r.slice(0,u),a.ruleId=r.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=hd(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Lr.prototype.file="";Lr.prototype.name="";Lr.prototype.reason="";Lr.prototype.message="";Lr.prototype.stack="";Lr.prototype.column=void 0;Lr.prototype.line=void 0;Lr.prototype.ancestors=void 0;Lr.prototype.cause=void 0;Lr.prototype.fatal=void 0;Lr.prototype.place=void 0;Lr.prototype.ruleId=void 0;Lr.prototype.source=void 0;const $s={basename:_O,dirname:xO,extname:yO,join:wO,sep:"/"};function _O(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');lh(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function xO(e){if(lh(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 yO(e){lh(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function wO(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function kO(e,t){let n="",r=0,i=-1,a=0,o=-1,l,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function lh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const CO={cwd:EO};function EO(){return"/"}function Hb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function AO(e){if(typeof e=="string")e=new URL(e);else if(!Hb(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 TO(e)}function TO(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(;++n0){let[b,...S]=p;const k=r[g][1];zb(k)&&zb(b)&&(b=fg(!0,k,b)),r[g]=[d,b,...S]}}}}const k_=new S_().freeze();function bg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function vg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function _g(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 k3(e){if(!zb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function C3(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function R0(e){return RO(e)?e:new MS(e)}function RO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function DO(e){return typeof e=="string"||LO(e)}function LO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var E3=Object.prototype.hasOwnProperty;function A3(e,t,n){for(n of e.keys())if(fd(n,t))return n}function fd(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&fd(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i=="object"&&(i=A3(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i=="object"&&(i=A3(t,i),!i)||!fd(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(E3.call(e,n)&&++r&&!E3.call(t,n)||!(n in t)||!fd(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function T3(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const o=n.slice(i,r).trim();(o||!a)&&t.push(o),i=r+1,r=n.indexOf(",",i)}return t}function OO(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const IO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,BO={};function N3(e,t){return(BO.jsx?zO:IO).test(e)}const HO=/[ \t\n\f\r]/g;function $O(e){return typeof e=="object"?e.type==="text"?j3(e.value):!1:j3(e)}function j3(e){return e.replace(HO,"")===""}class ch{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ch.prototype.normal={};ch.prototype.property={};ch.prototype.space=void 0;function RS(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ch(n,r,t)}function kd(e){return e.toLowerCase()}class mi{constructor(t,n){this.attribute=n,this.property=t}}mi.prototype.attribute="";mi.prototype.booleanish=!1;mi.prototype.boolean=!1;mi.prototype.commaOrSpaceSeparated=!1;mi.prototype.commaSeparated=!1;mi.prototype.defined=!1;mi.prototype.mustUseProperty=!1;mi.prototype.number=!1;mi.prototype.overloadedBoolean=!1;mi.prototype.property="";mi.prototype.spaceSeparated=!1;mi.prototype.space=void 0;let FO=0;const xt=Dl(),Vn=Dl(),$b=Dl(),Be=Dl(),dn=Dl(),yl=Dl(),Ni=Dl();function Dl(){return 2**++FO}const Fb=Object.freeze(Object.defineProperty({__proto__:null,boolean:xt,booleanish:Vn,commaOrSpaceSeparated:Ni,commaSeparated:yl,number:Be,overloadedBoolean:$b,spaceSeparated:dn},Symbol.toStringTag,{value:"Module"})),xg=Object.keys(Fb);class C_ extends mi{constructor(t,n,r,i){let a=-1;if(super(t,n),M3(this,"space",i),typeof r=="number")for(;++a4&&n.slice(0,4)==="data"&&VO.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(R3,YO);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!R3.test(a)){let o=a.replace(GO,WO);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=C_}return new i(r,t)}function WO(e){return"-"+e.toLowerCase()}function YO(e){return e.charAt(1).toUpperCase()}const $S=RS([DS,PO,IS,zS,BS],"html"),hp=RS([DS,UO,IS,zS,BS],"svg");function D3(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function XO(e){return e.join(" ").trim()}var _c={},yg,L3;function KO(){if(L3)return yg;L3=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,u=` -`,d="/",p="*",f="",g="comment",b="declaration";function S(x,v){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];v=v||{};var w=1,y=1;function C(G){var X=G.match(t);X&&(w+=X.length);var Y=G.lastIndexOf(u);y=~Y?G.length-Y:y+G.length}function N(){var G={line:w,column:y};return function(X){return X.position=new E(G),D(),X}}function E(G){this.start=G,this.end={line:w,column:y},this.source=v.source}E.prototype.content=x;function j(G){var X=new Error(v.source+":"+w+":"+y+": "+G);if(X.reason=G,X.filename=v.source,X.line=w,X.column=y,X.source=x,!v.silent)throw X}function T(G){var X=G.exec(x);if(X){var Y=X[0];return C(Y),x=x.slice(Y.length),X}}function D(){T(n)}function I(G){var X;for(G=G||[];X=$();)X!==!1&&G.push(X);return G}function $(){var G=N();if(!(d!=x.charAt(0)||p!=x.charAt(1))){for(var X=2;f!=x.charAt(X)&&(p!=x.charAt(X)||d!=x.charAt(X+1));)++X;if(X+=2,f===x.charAt(X-1))return j("End of comment missing");var Y=x.slice(2,X-2);return y+=2,C(Y),x=x.slice(X),y+=2,G({type:g,comment:Y})}}function F(){var G=N(),X=T(r);if(X){if($(),!T(i))return j("property missing ':'");var Y=T(a),Z=G({type:b,property:k(X[0].replace(e,f)),value:Y?k(Y[0].replace(e,f)):f});return T(o),Z}}function U(){var G=[];I(G);for(var X;X=F();)X!==!1&&(G.push(X),I(G));return G}return D(),U()}function k(x){return x?x.replace(l,f):f}return yg=S,yg}var O3;function ZO(){if(O3)return _c;O3=1;var e=_c&&_c.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_c,"__esModule",{value:!0}),_c.default=n;const t=e(KO());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),l=typeof i=="function";return o.forEach(u=>{if(u.type!=="declaration")return;const{property:d,value:p}=u;l?i(d,p,u):p&&(a=a||{},a[d]=p)}),a}return _c}var Ku={},I3;function QO(){if(I3)return Ku;I3=1,Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(d){return!d||n.test(d)||e.test(d)},o=function(d,p){return p.toUpperCase()},l=function(d,p){return"".concat(p,"-")},u=function(d,p){return p===void 0&&(p={}),a(d)?d:(d=d.toLowerCase(),p.reactCompat?d=d.replace(i,l):d=d.replace(r,l),d.replace(t,o))};return Ku.camelCase=u,Ku}var Zu,z3;function JO(){if(z3)return Zu;z3=1;var e=Zu&&Zu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(ZO()),n=QO();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(l,u){l&&u&&(o[(0,n.camelCase)(l,a)]=u)}),o}return r.default=r,Zu=r,Zu}var eI=JO();const tI=rp(eI),E_={}.hasOwnProperty,nI=new Map,rI=/[A-Z]/g,iI=new Set(["table","tbody","thead","tfoot","tr"]),sI=new Set(["td","th"]),FS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function PS(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=fI(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=hI(n,t.jsx,t.jsxs)}const i={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"?hp:$S,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=US(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function US(e,t,n){if(t.type==="element")return aI(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return oI(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return cI(e,t,n);if(t.type==="mdxjsEsm")return lI(e,t);if(t.type==="root")return uI(e,t,n);if(t.type==="text")return dI(e,t)}function aI(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=hp,e.schema=i),e.ancestors.push(t);const a=GS(e,t.tagName,!1),o=pI(e,t);let l=T_(e,t);return iI.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!$O(u):!0})),qS(e,o,a,t),A_(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function oI(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)}Cd(e,t.position)}function lI(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Cd(e,t.position)}function cI(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=hp,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:GS(e,t.name,!0),o=mI(e,t),l=T_(e,t);return qS(e,o,a,t),A_(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function uI(e,t,n){const r={};return A_(r,T_(e,t)),e.create(t,e.Fragment,r,n)}function dI(e,t){return t.value}function qS(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function A_(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function hI(e,t,n){return r;function r(i,a,o,l){const d=Array.isArray(o.children)?n:t;return l?d(a,o,l):d(a,o)}}function fI(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),u=g_(r);return t(i,a,o,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function pI(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&E_.call(t.properties,i)){const a=gI(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&sI.has(t.tagName)?r=l:n[o]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function mI(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Cd(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else Cd(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function T_(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:nI;for(;++ry.key).filter(y=>y!==void 0));let d=0;for(;d=e.children.length-p&&(E=i.length-(e.children.length-y)),E>=0&&(N=((v=i[E])==null?void 0:v.key)??N);N&&u.has(N)&&((w=i[E])==null?void 0:w.key)!==N;)N=`${N}+`;N&&u.add(N);const j=VS(C,i[E]??null,n,N);a.push(j),j.react!==void 0&&o.push(j.react)}const f=t!==null&&kI(e,t.node);if(t&&t.key===r&&f&&i.length===a.length&&a.every((y,C)=>y===i[C]))return t;const g=e.type==="element"&&yI.has(e.tagName)?o.filter(y=>typeof y!="string"||!wI.test(y)):o,b=g.length>0?g.length===1?g[0]:g:null;let S=f?t==null?void 0:t.shell:null;if(!S){const y=PS({...e,children:[]},n);S={props:y.props,type:y.type}}return{children:a,key:r,node:e,react:h.jsx(S.type,{...S.props,children:b},r),shell:S}}function kI(e,t){if(e===t)return!0;const{children:n,position:r,...i}=e,{children:a,position:o,...l}=t;return fd(i,l)}function Lc(e,t){if(e===t)return!0;if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let o=0;oi?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(Oi(e,e.length,0,t),e):t}const $3={}.hasOwnProperty;function YS(e){const t={};let n=-1;for(;++n13&&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 ws(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function Mt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(u){return Lt(u)?(e.enter(n),l(u)):t(u)}function l(u){return Lt(u)&&a++o))return;const j=t.events.length;let T=j,D,I;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(D){I=t.events[T][1].end;break}D=!0}for(v(r),E=j;Ey;){const N=n[C];t.containerState=N[1],N[0].exit.call(t,e)}n.length=y}function w(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function DI(e,t,n){return Mt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qc(e){if(e===null||hn(e)||Cl(e))return 1;if(cp(e))return 2}function fp(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},g={...e[n][1].start};P3(f,-u),P3(g,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},a={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=rs(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=rs(d,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),d=rs(d,fp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=rs(d,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=rs(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Oi(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n0&&Lt(E)?Mt(e,w,"linePrefix",a+1)(E):w(E)}function w(E){return E===null||at(E)?e.check(U3,k,C)(E):(e.enter("codeFlowValue"),y(E))}function y(E){return E===null||at(E)?(e.exit("codeFlowValue"),w(E)):(e.consume(E),y)}function C(E){return e.exit("codeFenced"),t(E)}function N(E,j,T){let D=0;return I;function I(X){return E.enter("lineEnding"),E.consume(X),E.exit("lineEnding"),$}function $(X){return E.enter("codeFencedFence"),Lt(X)?Mt(E,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):F(X)}function F(X){return X===l?(E.enter("codeFencedFenceSequence"),U(X)):T(X)}function U(X){return X===l?(D++,E.consume(X),U):D>=o?(E.exit("codeFencedFenceSequence"),Lt(X)?Mt(E,G,"whitespace")(X):G(X)):T(X)}function G(X){return X===null||at(X)?(E.exit("codeFencedFence"),j(X)):T(X)}}}function GI(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const wg={name:"codeIndented",tokenize:WI},VI={partial:!0,tokenize:YI};function WI(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),Mt(e,a,"linePrefix",5)(d)}function a(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(d):n(d)}function o(d){return d===null?u(d):at(d)?e.attempt(VI,o,u)(d):(e.enter("codeFlowValue"),l(d))}function l(d){return d===null||at(d)?(e.exit("codeFlowValue"),o(d)):(e.consume(d),l)}function u(d){return e.exit("codeIndented"),t(d)}}function YI(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):at(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Mt(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):at(o)?i(o):n(o)}}const XI={name:"codeText",previous:ZI,resolve:KI,tokenize:QI};function KI(e){let t=e.length-4,n=3,r,i;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=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 tthis.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 i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Qu(this.left,r),a.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),Qu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Qu(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=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function e9(e,t,n,r,i,a,o,l,u){const d=u||Number.POSITIVE_INFINITY;let p=0;return f;function f(v){return v===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(v),e.exit(a),g):v===null||v===32||v===41||jf(v)?n(v):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),k(v))}function g(v){return v===62?(e.enter(a),e.consume(v),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),b(v))}function b(v){return v===62?(e.exit("chunkString"),e.exit(l),g(v)):v===null||v===60||at(v)?n(v):(e.consume(v),v===92?S:b)}function S(v){return v===60||v===62||v===92?(e.consume(v),b):b(v)}function k(v){return!p&&(v===null||v===41||hn(v))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(v)):p999||b===null||b===91||b===93&&!u||b===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(b):b===93?(e.exit(a),e.enter(i),e.consume(b),e.exit(i),e.exit(r),t):at(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===null||b===91||b===93||at(b)||l++>999?(e.exit("chunkString"),p(b)):(e.consume(b),u||(u=!Lt(b)),b===92?g:f)}function g(b){return b===91||b===92||b===93?(e.consume(b),l++,f):f(b)}}function n9(e,t,n,r,i,a){let o;return l;function l(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),o=g===40?41:g,u):n(g)}function u(g){return g===o?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(a),d(g))}function d(g){return g===o?(e.exit(a),u(o)):g===null?n(g):at(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Mt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===o||g===null||at(g)?(e.exit("chunkString"),d(g)):(e.consume(g),g===92?f:p)}function f(g){return g===o||g===92?(e.consume(g),p):p(g)}}function pd(e,t){let n;return r;function r(i){return at(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Lt(i)?Mt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const az={name:"definition",tokenize:lz},oz={partial:!0,tokenize:cz};function lz(e,t,n){const r=this;let i;return a;function a(b){return e.enter("definition"),o(b)}function o(b){return t9.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function l(b){return i=ws(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),u):n(b)}function u(b){return hn(b)?pd(e,d)(b):d(b)}function d(b){return e9(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function p(b){return e.attempt(oz,f,f)(b)}function f(b){return Lt(b)?Mt(e,g,"whitespace")(b):g(b)}function g(b){return b===null||at(b)?(e.exit("definition"),r.parser.defined.push(i),t(b)):n(b)}}function cz(e,t,n){return r;function r(l){return hn(l)?pd(e,i)(l):n(l)}function i(l){return n9(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Lt(l)?Mt(e,o,"whitespace")(l):o(l)}function o(l){return l===null||at(l)?t(l):n(l)}}const uz={name:"hardBreakEscape",tokenize:dz};function dz(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return at(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const hz={name:"headingAtx",resolve:fz,tokenize:pz};function fz(e,t){let n=e.length-2,r=3,i,a;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&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Oi(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function pz(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&r++<6?(e.consume(p),o):p===null||hn(p)?(e.exit("atxHeadingSequence"),l(p)):n(p)}function l(p){return p===35?(e.enter("atxHeadingSequence"),u(p)):p===null||at(p)?(e.exit("atxHeading"),t(p)):Lt(p)?Mt(e,l,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function u(p){return p===35?(e.consume(p),u):(e.exit("atxHeadingSequence"),l(p))}function d(p){return p===null||p===35||hn(p)?(e.exit("atxHeadingText"),l(p)):(e.consume(p),d)}}const mz=["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"],G3=["pre","script","style","textarea"],gz={concrete:!0,name:"htmlFlow",resolveTo:_z,tokenize:xz},bz={partial:!0,tokenize:wz},vz={partial:!0,tokenize:yz};function _z(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 xz(e,t,n){const r=this;let i,a,o,l,u;return d;function d(W){return p(W)}function p(W){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(W),f}function f(W){return W===33?(e.consume(W),g):W===47?(e.consume(W),a=!0,k):W===63?(e.consume(W),i=3,r.interrupt?t:O):Gr(W)?(e.consume(W),o=String.fromCharCode(W),x):n(W)}function g(W){return W===45?(e.consume(W),i=2,b):W===91?(e.consume(W),i=5,l=0,S):Gr(W)?(e.consume(W),i=4,r.interrupt?t:O):n(W)}function b(W){return W===45?(e.consume(W),r.interrupt?t:O):n(W)}function S(W){const re="CDATA[";return W===re.charCodeAt(l++)?(e.consume(W),l===re.length?r.interrupt?t:F:S):n(W)}function k(W){return Gr(W)?(e.consume(W),o=String.fromCharCode(W),x):n(W)}function x(W){if(W===null||W===47||W===62||hn(W)){const re=W===47,le=o.toLowerCase();return!re&&!a&&G3.includes(le)?(i=1,r.interrupt?t(W):F(W)):mz.includes(o.toLowerCase())?(i=6,re?(e.consume(W),v):r.interrupt?t(W):F(W)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(W):a?w(W):y(W))}return W===45||Rr(W)?(e.consume(W),o+=String.fromCharCode(W),x):n(W)}function v(W){return W===62?(e.consume(W),r.interrupt?t:F):n(W)}function w(W){return Lt(W)?(e.consume(W),w):I(W)}function y(W){return W===47?(e.consume(W),I):W===58||W===95||Gr(W)?(e.consume(W),C):Lt(W)?(e.consume(W),y):I(W)}function C(W){return W===45||W===46||W===58||W===95||Rr(W)?(e.consume(W),C):N(W)}function N(W){return W===61?(e.consume(W),E):Lt(W)?(e.consume(W),N):y(W)}function E(W){return W===null||W===60||W===61||W===62||W===96?n(W):W===34||W===39?(e.consume(W),u=W,j):Lt(W)?(e.consume(W),E):T(W)}function j(W){return W===u?(e.consume(W),u=null,D):W===null||at(W)?n(W):(e.consume(W),j)}function T(W){return W===null||W===34||W===39||W===47||W===60||W===61||W===62||W===96||hn(W)?N(W):(e.consume(W),T)}function D(W){return W===47||W===62||Lt(W)?y(W):n(W)}function I(W){return W===62?(e.consume(W),$):n(W)}function $(W){return W===null||at(W)?F(W):Lt(W)?(e.consume(W),$):n(W)}function F(W){return W===45&&i===2?(e.consume(W),Y):W===60&&i===1?(e.consume(W),Z):W===62&&i===4?(e.consume(W),H):W===63&&i===3?(e.consume(W),O):W===93&&i===5?(e.consume(W),z):at(W)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(bz,V,U)(W)):W===null||at(W)?(e.exit("htmlFlowData"),U(W)):(e.consume(W),F)}function U(W){return e.check(vz,G,V)(W)}function G(W){return e.enter("lineEnding"),e.consume(W),e.exit("lineEnding"),X}function X(W){return W===null||at(W)?U(W):(e.enter("htmlFlowData"),F(W))}function Y(W){return W===45?(e.consume(W),O):F(W)}function Z(W){return W===47?(e.consume(W),o="",Q):F(W)}function Q(W){if(W===62){const re=o.toLowerCase();return G3.includes(re)?(e.consume(W),H):F(W)}return Gr(W)&&o.length<8?(e.consume(W),o+=String.fromCharCode(W),Q):F(W)}function z(W){return W===93?(e.consume(W),O):F(W)}function O(W){return W===62?(e.consume(W),H):W===45&&i===2?(e.consume(W),O):F(W)}function H(W){return W===null||at(W)?(e.exit("htmlFlowData"),V(W)):(e.consume(W),H)}function V(W){return e.exit("htmlFlow"),t(W)}}function yz(e,t,n){const r=this;return i;function i(o){return at(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function wz(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(uh,t,n)}}const Sz={name:"htmlText",tokenize:kz};function kz(e,t,n){const r=this;let i,a,o;return l;function l(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),u}function u(O){return O===33?(e.consume(O),d):O===47?(e.consume(O),N):O===63?(e.consume(O),y):Gr(O)?(e.consume(O),T):n(O)}function d(O){return O===45?(e.consume(O),p):O===91?(e.consume(O),a=0,S):Gr(O)?(e.consume(O),w):n(O)}function p(O){return O===45?(e.consume(O),b):n(O)}function f(O){return O===null?n(O):O===45?(e.consume(O),g):at(O)?(o=f,Z(O)):(e.consume(O),f)}function g(O){return O===45?(e.consume(O),b):f(O)}function b(O){return O===62?Y(O):O===45?g(O):f(O)}function S(O){const H="CDATA[";return O===H.charCodeAt(a++)?(e.consume(O),a===H.length?k:S):n(O)}function k(O){return O===null?n(O):O===93?(e.consume(O),x):at(O)?(o=k,Z(O)):(e.consume(O),k)}function x(O){return O===93?(e.consume(O),v):k(O)}function v(O){return O===62?Y(O):O===93?(e.consume(O),v):k(O)}function w(O){return O===null||O===62?Y(O):at(O)?(o=w,Z(O)):(e.consume(O),w)}function y(O){return O===null?n(O):O===63?(e.consume(O),C):at(O)?(o=y,Z(O)):(e.consume(O),y)}function C(O){return O===62?Y(O):y(O)}function N(O){return Gr(O)?(e.consume(O),E):n(O)}function E(O){return O===45||Rr(O)?(e.consume(O),E):j(O)}function j(O){return at(O)?(o=j,Z(O)):Lt(O)?(e.consume(O),j):Y(O)}function T(O){return O===45||Rr(O)?(e.consume(O),T):O===47||O===62||hn(O)?D(O):n(O)}function D(O){return O===47?(e.consume(O),Y):O===58||O===95||Gr(O)?(e.consume(O),I):at(O)?(o=D,Z(O)):Lt(O)?(e.consume(O),D):Y(O)}function I(O){return O===45||O===46||O===58||O===95||Rr(O)?(e.consume(O),I):$(O)}function $(O){return O===61?(e.consume(O),F):at(O)?(o=$,Z(O)):Lt(O)?(e.consume(O),$):D(O)}function F(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),i=O,U):at(O)?(o=F,Z(O)):Lt(O)?(e.consume(O),F):(e.consume(O),G)}function U(O){return O===i?(e.consume(O),i=void 0,X):O===null?n(O):at(O)?(o=U,Z(O)):(e.consume(O),U)}function G(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||hn(O)?D(O):(e.consume(O),G)}function X(O){return O===47||O===62||hn(O)?D(O):n(O)}function Y(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function Z(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Q}function Q(O){return Lt(O)?Mt(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):z(O)}function z(O){return e.enter("htmlTextData"),o(O)}}const j_={name:"labelEnd",resolveAll:Tz,resolveTo:Nz,tokenize:jz},Cz={tokenize:Mz},Ez={tokenize:Rz},Az={tokenize:Dz};function Tz(e){let t=-1;const n=[];for(;++t=3&&(d===null||at(d))?(e.exit("thematicBreak"),t(d)):n(d)}function u(d){return d===i?(e.consume(d),r++,u):(e.exit("thematicBreakSequence"),Lt(d)?Mt(e,l,"whitespace")(d):l(d))}}const ci={continuation:{tokenize:Uz},exit:Gz,name:"list",tokenize:Pz},$z={partial:!0,tokenize:Vz},Fz={partial:!0,tokenize:qz};function Pz(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(b){const S=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:Lb(b)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(df,n,d)(b):d(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(b)}return n(b)}function u(b){return Lb(b)&&++o<10?(e.consume(b),u):(!r.interrupt||o<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):n(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(uh,r.interrupt?n:p,e.attempt($z,g,f))}function p(b){return r.containerState.initialBlankLine=!0,a++,g(b)}function f(b){return Lt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),g):n(b)}function g(b){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function Uz(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(uh,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Mt(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!Lt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Fz,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Mt(e,e.attempt(ci,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function qz(e,t,n){const r=this;return Mt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function Gz(e){e.exit(this.containerState.type)}function Vz(e,t,n){const r=this;return Mt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!Lt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const V3={name:"setextUnderline",resolveTo:Wz,tokenize:Yz};function Wz(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Yz(e,t,n){const r=this;let i;return a;function a(d){let p=r.events.length,f;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){f=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=d,o(d)):n(d)}function o(d){return e.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===i?(e.consume(d),l):(e.exit("setextHeadingLineSequence"),Lt(d)?Mt(e,u,"lineSuffix")(d):u(d))}function u(d){return d===null||at(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const Xz={tokenize:Kz};function Kz(e){const t=this,n=e.attempt(uh,r,e.attempt(this.parser.constructs.flowInitial,i,Mt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(tz,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Zz={resolveAll:i9()},Qz=r9("string"),Jz=r9("text");function r9(e){return{resolveAll:i9(e==="text"?eB:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,l);return o;function o(p){return d(p)?a(p):l(p)}function l(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),u}function u(p){return d(p)?(n.exit("data"),a(p)):(n.consume(p),u)}function d(p){if(p===null)return!0;const f=i[p];let g=-1;if(f)for(;++g-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function fB(e,t){let n=-1;const r=[];let i;for(;++n0){const tt=Ge.tokenStack[Ge.tokenStack.length-1];(tt[1]||Y3).call(Ge,void 0,tt[0])}for(Me.position={start:_o(xe.length>0?xe[0][1].start:{line:1,column:1,offset:0}),end:_o(xe.length>0?xe[xe.length-2][1].end:{line:1,column:1,offset:0})},Oe=-1;++Oe0&&(wr(this,Eo,kn(this,Eo)+n.slice(0,r.commitIndex)),n=n.slice(r.commitIndex),r=X3(n)),kn(this,Eo)+OB(n,r)}}Eo=new WeakMap;const kB=new Set(["*","**","_","__"]);function X3(e){const t={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let n=0;nn){n=i-1;continue}if(t.exclusive)continue;if(LB(t)){K3(t,n,r);continue}const a=NB(t,e,n);if(a>n){n=a-1;continue}const o=jB(t,e,n);if(o>n){n=o-1;continue}Ss(e,n)||K3(t,n,r)}return t}function CB(e,t,n){const r=t[n];return r==="`"?EB(e,t,n):r==="$"?AB(e,t,n):r==="~"?TB(e,t,n):n}function EB(e,t,n){const r=R_(t,n),i="`".repeat(r),a=e.exclusive;return(a==null?void 0:a.kind)==="fence"?(a.token[0]==="`"&&Lf(t,n)&&!Ss(t,n)&&r>=a.token.length&&(e.exclusive=null),n+r):(a==null?void 0:a.kind)==="code"?(!Ss(t,n)&&r>=a.token.length&&(e.exclusive=null),n+r):a||Ss(t,n)?n+r:r>=3&&Lf(t,n)?(e.exclusive={kind:"fence",start:n,token:i},n+r):(e.exclusive={kind:"code",start:n,token:i},n+r)}function AB(e,t,n){const r=R_(t,n),i=e.exclusive;return(i==null?void 0:i.kind)==="math"?(!Ss(t,n)&&r>=i.token.length&&(e.exclusive=null),n+r):(i||Ss(t,n)||(e.exclusive={kind:"math",start:n,token:r>=2?"$$":"$"}),n+r)}function TB(e,t,n){const r=R_(t,n),i=e.exclusive;return(i==null?void 0:i.kind)==="fence"&&i.token[0]==="~"?(Lf(t,n)&&!Ss(t,n)&&r>=i.token.length&&(e.exclusive=null),n+r):i||r<3||!Lf(t,n)||Ss(t,n)?n:(e.exclusive={kind:"fence",start:n,token:"~".repeat(r)},n+r)}function NB(e,t,n){if(t[n]!=="<"||Ss(t,n))return n;const r=t[n+1];if(r!==void 0&&!c9(r))return n;e.pendingHtml=n;for(let i=n+1;i"||t[i]===` -`)return e.pendingHtml=null,i+1;return t.length}function jB(e,t,n){const r=MB(t,n);if(!r)return n;if(Ss(t,n))return n+r.length;const i=e.delims.findLastIndex(a=>a.token===r);return i!==-1?(e.delims.splice(i,1),n+r.length):n+r.length===t.length?(e.pendingDelim={start:n,token:r},n+r.length):(RB(t,n,r)&&e.delims.push({start:n,token:r}),n+r.length)}function MB(e,t){const n=e[t];if(n==="*")return e.startsWith("***",t)?"***":e.startsWith("**",t)?"**":"*";if(n==="_")return e.startsWith("__",t)?"__":"_";if(n==="~"&&e.startsWith("~~",t))return"~~"}function RB(e,t,n){const r=e[t+n.length];if(!r||/\s/.test(r))return!1;const i=e[t-1];return!J3(i)||!J3(r)}function K3(e,t,n){const r=e.links.at(-1);if(n==="["){e.links.push({phase:"text",start:t});return}if(n==="]"&&(r==null?void 0:r.phase)==="text"){e.links[e.links.length-1]={phase:"url_wait",start:r.start,textEnd:t};return}if(n==="("&&(r==null?void 0:r.phase)==="url_wait"){e.links[e.links.length-1]={phase:"url",start:r.start,textEnd:r.textEnd,parenDepth:0};return}if(n==="("&&(r==null?void 0:r.phase)==="url"){r.parenDepth+=1;return}if(n===")"&&(r==null?void 0:r.phase)==="url"){if(r.parenDepth>0){r.parenDepth-=1;return}e.links.pop()}}function DB(e){var t,n;e.delims.length=0,e.links.length=0,((t=e.exclusive)==null?void 0:t.kind)!=="fence"&&(((n=e.exclusive)==null?void 0:n.kind)==="math"&&e.exclusive.token==="$$"||(e.exclusive=null))}function LB(e){var n;const t=(n=e.links.at(-1))==null?void 0:n.phase;return t==="url_wait"||t==="url"}function OB(e,t){t.pendingHtml!==null&&(e=e.slice(0,BB(e,t.pendingHtml)));const n=t.links.at(-1);if(n)return Hs(IB(e,n));const r=zB(t);if(r)return Hs(Nc(e,r));const i=FB(t);return i?i.kind==="delim"?Hs(Ub(e,i.start,i.token.length)?o9(e,i.token):e.slice(0,i.start)):Ub(e,i.start,i.token.length)?i.kind==="fence"?Hs(e):i.kind==="code"?Hs(Nc(e,i.token)):i.token==="$$"?Hs(Nc(e,(e.endsWith(` -`)?"":` -`)+"$$")):/\s/.test(e[e.length-1]??"")?Hs(e):Hs(Nc(e,"$")):Hs(i.kind==="fence"?e:e.slice(0,i.start)):Hs(t.pendingDelim?e.slice(0,t.pendingDelim.start):e)}function IB(e,t){const n=e.slice(0,t.start);if(t.phase==="text")return Ub(e,t.start,1)?n+e.slice(t.start+1):n;const r=e.slice(t.start+1,t.textEnd);return t.phase==="url_wait"?n+r+e.slice(t.textEnd+1):n+r}function zB(e){const t=[];if(e.exclusive){if(e.exclusive.kind!=="code")return;t.push(e.exclusive.token)}for(let n=e.delims.length-1;n>=0;n--){const r=e.delims[n].token;if(!kB.has(r))return;t.push(r)}if(!(t.length<2))return t.join("")}function BB(e,t){let n=t,r=t;for(;r>0;){const i=e.lastIndexOf("<",r-1);if(i===-1||!HB(e,i,r))break;n=i,r=i}return n}function HB(e,t,n){if(e[n-1]!==">"||Ss(e,t))return!1;const r=e[t+1];if(r!==void 0&&!c9(r))return!1;for(let i=t+1;i"||a===` -`)return!1}return!0}function Hs(e){var x;const t=e.lastIndexOf(` - -`),n=t===-1?0:t+2,r=e.slice(0,n),i=e.slice(n),a=i.indexOf(` -`),o=a===-1?i:i.slice(0,a),l=(x=o.match(/^( *)\|/))==null?void 0:x[1];if(l===void 0)return e;if(Z3(o)<2&&!PB(o,l))return r;const u=o.trimEnd().endsWith("|")?o:o9(o," |"),d=Z3(u),p=d<2?0:u.trimEnd().endsWith("|")?d-1:d;if(p===0)return e;const f=a===-1?"":i.slice(a+1),g=Q3(l,Array.from({length:p},()=>"-"));if(f.length===0)return r+u+` -`+g;const b=f.indexOf(` -`),S=b===-1?f:f.slice(0,b),k=b===-1?"":f.slice(b);if(UB(S,l,p))return e;if(S.startsWith(l+"|")&&/^[ |:\-\t]*$/.test(S.slice(l.length))){const v=l9(S,l).map(w=>{const y=w.trim();if(y.length===0)return"-";let C=0;for(let N=0;N1&&y.endsWith(":")?":":"")});for(;v.length0;n-=1)if(e.endsWith(t.slice(0,n)))return n;return 0}function FB(e){const t=e.delims.at(-1);return e.exclusive&&(!t||e.exclusive.start>t.start)?e.exclusive:t?{kind:"delim",start:t.start,token:t.token}:e.exclusive}function Z3(e){let t=0;for(let n=0;n0}function Q3(e,t){return e+"|"+t.map(n=>` ${n} |`).join("")}function l9(e,t){const n=e.slice(t.length+1).split("|");return e.trimEnd().endsWith("|")&&n.pop(),n}function UB(e,t,n){if(!e.startsWith(t))return!1;const r=e.slice(t.length).trim();if(!r.startsWith("|")||!r.endsWith("|"))return!1;const i=l9(r,"").map(a=>a.trim());return i.length===n&&i.every(a=>/^:?-+:?$/.test(a))}function R_(e,t){let n=t+1;for(;nt+n}function Lf(e,t){return t===0||e[t-1]===` -`}function Ss(e,t){let n=0;for(let r=t-1;r>=0&&e[r]==="\\";r--)n+=1;return n%2===1}function J3(e){return!!e&&/[A-Za-z0-9]/.test(e)}function c9(e){return!!e&&/[A-Za-z]/.test(e)}const u9=k_().use(M_);var Xd,$c,Fc,vl,Pc,Kd,Zd,Qd,_l,Jd,xl;class qB{constructor(){Ti(this,Xd,u9);Ti(this,$c,null);Ti(this,Fc,{});Ti(this,vl,null);Ti(this,Pc,"");Ti(this,Kd,[]);Ti(this,Zd,[]);Ti(this,Qd,[]);Ti(this,_l,0);Ti(this,Jd,[]);Ti(this,xl,[])}reconfigure(t,n,r){kn(this,$c)!==null&&kn(this,Xd)===t&&d9(kn(this,Fc),r)&&!!kn(this,vl)===n||(wr(this,Xd,t),t.attachers.some(i=>i[0]===Df)||(t=t(),t.use(Df),t.freeze()),wr(this,$c,t),wr(this,Fc,r),wr(this,Pc,""),wr(this,Kd,[]),wr(this,Zd,[]),wr(this,Qd,[]),wr(this,_l,0),wr(this,Jd,[]),wr(this,vl,n?new SB:null))}update(t){kn(this,vl)&&(t=kn(this,vl).update(t));let n=kn(this,Pc);if(t===n)return kn(this,xl);const r=kn(this,Kd),i=GB(t,n);let a=r.length-1;for(;a>=0&&!(i>=r[a]);a-=1);let o=r[a]??0;a===-1&&(a=0);const l=sl(kn(this,$c)),u=kn(this,Zd),d=u.slice(a).some(E=>E.some(qb));let p=l.parse(t.slice(o)),f=p.children.map(E=>sl(sl(E.position).start.offset)+o);wr(this,Pc,t),dg(r.length===u.length),r.splice(a,r.length-a,...f);{const E=kg(p,f,o);dg(E.length===f.length),u.splice(a,u.length-a,...E)}if(d||qb(p)){a=0,o=0,p=l.parse(t),f=p.children.map(j=>sl(sl(j.position).start.offset)+o),r.splice(0,r.length,...f);const E=kg(p,f,o);dg(E.length===f.length),u.splice(0,u.length,...E)}const g=kg(l.runSync(p),f,o),b=kn(this,Qd),S=kn(this,Jd),k=kn(this,xl),x=S.length;let v=null,w=0;for(;wx&&(b.length=S.length=r.length);for(let E=r.length=C?D=x-(r.length-j):j=x){b[j]=String(kn(this,_l)),wr(this,_l,kn(this,_l)+1),S[j]=null,v&&(v[j]=void 0);continue}b[j]=b[D]??String(U5(this,_l)._++),S[j]=S[D]??null,v&&(v[j]=k[D])}r.length[]);let i=0;for(const o of e.children){const l=(a=o.position)==null?void 0:a.start.offset;if(l!==void 0){for(;i+1i||n!==-1&&t>n||r!==-1&&t>r||QB.test(e.slice(0,t))?e:""}const r6=/[#.]/g;function iH(e,t){const n=e||"",r={};let i=0,a,o;for(;id&&(d=p):p&&(d!==void 0&&d>-1&&u.push(` -`.repeat(d)||" "),d=-1,u.push(p))}return u.join("")}function v9(e,t,n){return e.type==="element"?EH(e,t,n):e.type==="text"?n.whitespace==="normal"?_9(e,n):AH(e):[]}function EH(e,t,n){const r=x9(e,n),i=e.children||[];let a=-1,o=[];if(kH(e))return o;let l,u;for(Vb(e)||u6(e)&&a6(t,e,u6)?u=` -`:SH(e)?(l=2,u=2):b9(e)&&(l=1,u=1);++a15?d="…"+l.slice(i-15,i):d=l.slice(0,i);var p;a+15e.replace(RH,"-$1").toLowerCase(),LH={"&":"&",">":">","<":"<",'"':""","'":"'"},OH=/[&><"']/g,Dr=e=>String(e).replace(OH,t=>LH[t]),hf=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?hf(e.body[0]):e:e.type==="font"?hf(e.body):e,IH=new Set(["mathord","textord","atom"]),Ha=e=>IH.has(hf(e).type),zH=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},Wb={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function BH(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function HH(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return BH(t)}function $H(e,t,n,r){var i=n[t];e[t]=i!==void 0?r.processor?r.processor(i):i:HH(r)}class L_{constructor(t){t===void 0&&(t={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n of Object.keys(Wb)){var r=Wb[n];r&&$H(this,n,t,r)}}reportNonstrict(t,n,r){var i=this.strict;if(typeof i=="function"&&(i=i(t,n,r)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new He("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),r);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,r){var i=this.strict;if(typeof i=="function")try{i=i(t,n,r)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=zH(t.url);if(n==null)return!1;t.protocol=n}var r=typeof this.trust=="function"?this.trust(t):this.trust;return!!r}}class xo{constructor(t,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=r}sup(){return Fs[FH[this.id]]}sub(){return Fs[PH[this.id]]}fracNum(){return Fs[UH[this.id]]}fracDen(){return Fs[qH[this.id]]}cramp(){return Fs[GH[this.id]]}text(){return Fs[VH[this.id]]}isTight(){return this.size>=2}}var O_=0,Of=1,Oc=2,ja=3,Ad=4,is=5,Gc=6,Vr=7,Fs=[new xo(O_,0,!1),new xo(Of,0,!0),new xo(Oc,1,!1),new xo(ja,1,!0),new xo(Ad,2,!1),new xo(is,2,!0),new xo(Gc,3,!1),new xo(Vr,3,!0)],FH=[Ad,is,Ad,is,Gc,Vr,Gc,Vr],PH=[is,is,is,is,Vr,Vr,Vr,Vr],UH=[Oc,ja,Ad,is,Gc,Vr,Gc,Vr],qH=[ja,ja,is,is,Vr,Vr,Vr,Vr],GH=[Of,Of,ja,ja,is,is,Vr,Vr],VH=[O_,Of,Oc,ja,Oc,ja,Oc,ja],yt={DISPLAY:Fs[O_],TEXT:Fs[Oc],SCRIPT:Fs[Ad],SCRIPTSCRIPT:Fs[Gc]},Yb=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function WH(e){for(var t=0;t=i[0]&&e<=i[1])return n.name}return null}var ff=[];Yb.forEach(e=>e.blocks.forEach(t=>ff.push(...t)));function y9(e){for(var t=0;t=ff[t]&&e<=ff[t+1])return!0;return!1}var or=e=>e+" "+e,xc=80,YH=function(t,n){return"M95,"+(622+t+n)+` -c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 -c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 -c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 -s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 -c69,-144,104.5,-217.7,106.5,-221 -l`+t/2.075+" -"+t+` -c5.3,-9.3,12,-14,20,-14 -H400000v`+(40+t)+`H845.2724 -s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 -c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},XH=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119 -c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 -c340,-704.7,510.7,-1060.3,512,-1067 -l`+t/2.084+" -"+t+` -c4.7,-7.3,11,-11,19,-11 -H40000v`+(40+t)+`H1012.3 -s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 -c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 -s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 -c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},KH=function(t,n){return"M983 "+(10+t+n)+` -l`+t/3.13+" -"+t+` -c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+` -H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 -s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 -c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 -c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 -c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 -c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},ZH=function(t,n){return"M424,"+(2398+t+n)+` -c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 -c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 -s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 -s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 -l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000 -v`+(40+t)+`H1014.6 -s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 -c-2,6,-10,9,-24,9 -c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+` -h400000v`+(40+t)+"h-400000z"},QH=function(t,n){return"M473,"+(2713+t+n)+` -c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+` -c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7 -s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 -c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 -c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 -s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, -606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},JH=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},e$=function(t,n,r){var i=r-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+` -H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 -h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 -c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 -219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},t$=function(t,n,r){n=1e3*n;var i="";switch(t){case"sqrtMain":i=YH(n,xc);break;case"sqrtSize1":i=XH(n,xc);break;case"sqrtSize2":i=KH(n,xc);break;case"sqrtSize3":i=ZH(n,xc);break;case"sqrtSize4":i=QH(n,xc);break;case"sqrtTall":i=e$(n,xc,r)}return i},n$=function(t,n){switch(t){case"⎜":return or("M291 0 H417 V"+n+" H291z");case"∣":return or("M145 0 H188 V"+n+" H145z");case"∥":return or("M145 0 H188 V"+n+" H145z")+or("M367 0 H410 V"+n+" H367z");case"⎟":return or("M457 0 H583 V"+n+" H457z");case"⎢":return or("M319 0 H403 V"+n+" H319z");case"⎥":return or("M263 0 H347 V"+n+" H263z");case"⎪":return or("M384 0 H504 V"+n+" H384z");case"⏐":return or("M312 0 H355 V"+n+" H312z");case"‖":return or("M257 0 H300 V"+n+" H257z")+or("M478 0 H521 V"+n+" H478z");default:return""}},d6={doubleleftarrow:`M262 157 -l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 - 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 - 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 -c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 - 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 --86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 --2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z -m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l --10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 - 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 --33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 --17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 --13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 -c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 --107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 - 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 --5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 -c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 - 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 - 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 - l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 --45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 - 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 - 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 - 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 --331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 -H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 - 435 0h399565z`,leftgroupunder:`M400000 262 -H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 - 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 --3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 --18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 --196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 - 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 --4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 --10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z -m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 - 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 - 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 --152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 - 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 --2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 -v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 --83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 --68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 - 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:or("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:or("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:or("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:or("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 --.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 -c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 - 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:or("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 -c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 --53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 - 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 - 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 -c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 - 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 - 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 --5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 --320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z -m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 -60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 --451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z -m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 -c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 --480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z -m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 -85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 --707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z -m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 -c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 --16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 - 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 - 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 --40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 --12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 - 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l --6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 -s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 -c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 - 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 --174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 - 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 - 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 --3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 --10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 - 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 --18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 - 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z -m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 - 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 --7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 --27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 - 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 - 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 --64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z -m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 - 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 --13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 - 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:or("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:or("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:or("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 - 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 --52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 --167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 - 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 --70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 --40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 --37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 - 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 -c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 - 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 - 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 --19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 - 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 --2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 - 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 - 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 --68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 --8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 - 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 -c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 - 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 --11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 - 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 - 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 - -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 --11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 - 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 - 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 - -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 -3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 -10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 --1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 --7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 -H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 -c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 -c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, --5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 -c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 -c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 -s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 -121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 -s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 -c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z -M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 --27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 -13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 --84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 --119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 --12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 -151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 -c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 -c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 -c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 -c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z -M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 -c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, --231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 -c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 -c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, -1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, --152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z -M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 -c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, --231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 -c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},r$=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84 -H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z -M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z -M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z -MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z -MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z -M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z -M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 -c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, --36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, -949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 -c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, --544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 -l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, --210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, -63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 -c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+` -c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 -c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 -c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 -c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 -l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function i$(e){return"toText"in e}class iu{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n{if(i$(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var Xb={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},s$={ex:!0,em:!0,mu:!0},w9=function(t){return typeof t!="string"&&(t=t.unit),t in Xb||t in s$||t==="ex"},Mn=function(t,n){var r;if(t.unit in Xb)r=Xb[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var i;if(n.style.isTight()?i=n.havingStyle(n.style.text()):i=n,t.unit==="ex")r=i.fontMetrics().xHeight;else if(t.unit==="em")r=i.fontMetrics().quad;else throw new He("Invalid unit: '"+t.unit+"'");i!==n&&(r*=i.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*r,n.maxSize)},Pe=function(t){return+t.toFixed(4)+"em"},jo=function(t){return t.filter(n=>n).join(" ")},I_=function(t){var n="";for(var r of Object.keys(t)){var i=t[r];i!==void 0&&(n+=DH(r)+":"+i+";")}return n},S9=function(t,n,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var i=n.getColor();i&&(this.style.color=i)}},k9=function(t){var n=document.createElement(t);n.className=jo(this.classes),Object.assign(n.style,this.style);for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i/=\x00-\x1f]/,C9=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+Dr(jo(this.classes))+'"');var r=I_(this.style);r&&(n+=' style="'+Dr(r)+'"');for(var i of Object.keys(this.attributes)){if(a$.test(i))throw new He("Invalid attribute name '"+i+"'");n+=" "+i+'="'+Dr(this.attributes[i])+'"'}n+=">";for(var a=0;a",n};class su{constructor(t,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,S9.call(this,t,r,i),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return k9.call(this,"span")}toMarkup(){return C9.call(this,"span")}}class pp{constructor(t,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,S9.call(this,n,i),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return k9.call(this,"a")}toMarkup(){return C9.call(this,"a")}}class o${constructor(t,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t=''+Dr(this.alt)+'0&&(n=document.createElement("span"),n.style.marginRight=Pe(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=jo(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="0&&(r+="margin-right:"+Pe(this.italic)+";"),r+=I_(this.style),r&&(t=!0,n+=' style="'+Dr(r)+'"');var i=Dr(this.text);return t?(n+=">",n+=i,n+="",n):i}}class Da{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i':''}}class Kb{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var t=" but got "+String(e)+".")}var d$=e=>e instanceof su||e instanceof pp||e instanceof iu,Us={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},D0={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},h6={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function h$(e,t){Us[e]=t}function z_(e,t,n){if(!Us[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=Us[t][r];if(!i&&e[0]in h6&&(r=h6[e[0]].charCodeAt(0),i=Us[t][r]),!i&&n==="text"&&y9(r)&&(i=Us[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Ag={};function f$(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!Ag[t]){var n=Ag[t]={cssEmPerMu:D0.quad[t]/18};for(var r in D0)D0.hasOwnProperty(r)&&(n[r]=D0[r][t])}return Ag[t]}var En={math:{},text:{}};function L(e,t,n,r,i,a){En[e][i]={font:t,group:n,replace:r},a&&r&&(En[e][r]=En[e][i])}var P="math",Re="text",K="main",ae="ams",Tn="accent-token",Ke="bin",Yr="close",au="inner",pt="mathord",Zn="op-token",Fi="open",dh="punct",ce="rel",$a="spacing",he="textord";L(P,K,ce,"≡","\\equiv",!0);L(P,K,ce,"≺","\\prec",!0);L(P,K,ce,"≻","\\succ",!0);L(P,K,ce,"∼","\\sim",!0);L(P,K,ce,"⊥","\\perp");L(P,K,ce,"⪯","\\preceq",!0);L(P,K,ce,"⪰","\\succeq",!0);L(P,K,ce,"≃","\\simeq",!0);L(P,K,ce,"∣","\\mid",!0);L(P,K,ce,"≪","\\ll",!0);L(P,K,ce,"≫","\\gg",!0);L(P,K,ce,"≍","\\asymp",!0);L(P,K,ce,"∥","\\parallel");L(P,K,ce,"⋈","\\bowtie",!0);L(P,K,ce,"⌣","\\smile",!0);L(P,K,ce,"⊑","\\sqsubseteq",!0);L(P,K,ce,"⊒","\\sqsupseteq",!0);L(P,K,ce,"≐","\\doteq",!0);L(P,K,ce,"⌢","\\frown",!0);L(P,K,ce,"∋","\\ni",!0);L(P,K,ce,"∝","\\propto",!0);L(P,K,ce,"⊢","\\vdash",!0);L(P,K,ce,"⊣","\\dashv",!0);L(P,K,ce,"∋","\\owns");L(P,K,dh,".","\\ldotp");L(P,K,dh,"⋅","\\cdotp");L(P,K,dh,"⋅","·");L(Re,K,he,"⋅","·");L(P,K,he,"#","\\#");L(Re,K,he,"#","\\#");L(P,K,he,"&","\\&");L(Re,K,he,"&","\\&");L(P,K,he,"ℵ","\\aleph",!0);L(P,K,he,"∀","\\forall",!0);L(P,K,he,"ℏ","\\hbar",!0);L(P,K,he,"∃","\\exists",!0);L(P,K,he,"∇","\\nabla",!0);L(P,K,he,"♭","\\flat",!0);L(P,K,he,"ℓ","\\ell",!0);L(P,K,he,"♮","\\natural",!0);L(P,K,he,"♣","\\clubsuit",!0);L(P,K,he,"℘","\\wp",!0);L(P,K,he,"♯","\\sharp",!0);L(P,K,he,"♢","\\diamondsuit",!0);L(P,K,he,"ℜ","\\Re",!0);L(P,K,he,"♡","\\heartsuit",!0);L(P,K,he,"ℑ","\\Im",!0);L(P,K,he,"♠","\\spadesuit",!0);L(P,K,he,"§","\\S",!0);L(Re,K,he,"§","\\S");L(P,K,he,"¶","\\P",!0);L(Re,K,he,"¶","\\P");L(P,K,he,"†","\\dag");L(Re,K,he,"†","\\dag");L(Re,K,he,"†","\\textdagger");L(P,K,he,"‡","\\ddag");L(Re,K,he,"‡","\\ddag");L(Re,K,he,"‡","\\textdaggerdbl");L(P,K,Yr,"⎱","\\rmoustache",!0);L(P,K,Fi,"⎰","\\lmoustache",!0);L(P,K,Yr,"⟯","\\rgroup",!0);L(P,K,Fi,"⟮","\\lgroup",!0);L(P,K,Ke,"∓","\\mp",!0);L(P,K,Ke,"⊖","\\ominus",!0);L(P,K,Ke,"⊎","\\uplus",!0);L(P,K,Ke,"⊓","\\sqcap",!0);L(P,K,Ke,"∗","\\ast");L(P,K,Ke,"⊔","\\sqcup",!0);L(P,K,Ke,"◯","\\bigcirc",!0);L(P,K,Ke,"∙","\\bullet",!0);L(P,K,Ke,"‡","\\ddagger");L(P,K,Ke,"≀","\\wr",!0);L(P,K,Ke,"⨿","\\amalg");L(P,K,Ke,"&","\\And");L(P,K,ce,"⟵","\\longleftarrow",!0);L(P,K,ce,"⇐","\\Leftarrow",!0);L(P,K,ce,"⟸","\\Longleftarrow",!0);L(P,K,ce,"⟶","\\longrightarrow",!0);L(P,K,ce,"⇒","\\Rightarrow",!0);L(P,K,ce,"⟹","\\Longrightarrow",!0);L(P,K,ce,"↔","\\leftrightarrow",!0);L(P,K,ce,"⟷","\\longleftrightarrow",!0);L(P,K,ce,"⇔","\\Leftrightarrow",!0);L(P,K,ce,"⟺","\\Longleftrightarrow",!0);L(P,K,ce,"↦","\\mapsto",!0);L(P,K,ce,"⟼","\\longmapsto",!0);L(P,K,ce,"↗","\\nearrow",!0);L(P,K,ce,"↩","\\hookleftarrow",!0);L(P,K,ce,"↪","\\hookrightarrow",!0);L(P,K,ce,"↘","\\searrow",!0);L(P,K,ce,"↼","\\leftharpoonup",!0);L(P,K,ce,"⇀","\\rightharpoonup",!0);L(P,K,ce,"↙","\\swarrow",!0);L(P,K,ce,"↽","\\leftharpoondown",!0);L(P,K,ce,"⇁","\\rightharpoondown",!0);L(P,K,ce,"↖","\\nwarrow",!0);L(P,K,ce,"⇌","\\rightleftharpoons",!0);L(P,ae,ce,"≮","\\nless",!0);L(P,ae,ce,"","\\@nleqslant");L(P,ae,ce,"","\\@nleqq");L(P,ae,ce,"⪇","\\lneq",!0);L(P,ae,ce,"≨","\\lneqq",!0);L(P,ae,ce,"","\\@lvertneqq");L(P,ae,ce,"⋦","\\lnsim",!0);L(P,ae,ce,"⪉","\\lnapprox",!0);L(P,ae,ce,"⊀","\\nprec",!0);L(P,ae,ce,"⋠","\\npreceq",!0);L(P,ae,ce,"⋨","\\precnsim",!0);L(P,ae,ce,"⪹","\\precnapprox",!0);L(P,ae,ce,"≁","\\nsim",!0);L(P,ae,ce,"","\\@nshortmid");L(P,ae,ce,"∤","\\nmid",!0);L(P,ae,ce,"⊬","\\nvdash",!0);L(P,ae,ce,"⊭","\\nvDash",!0);L(P,ae,ce,"⋪","\\ntriangleleft");L(P,ae,ce,"⋬","\\ntrianglelefteq",!0);L(P,ae,ce,"⊊","\\subsetneq",!0);L(P,ae,ce,"","\\@varsubsetneq");L(P,ae,ce,"⫋","\\subsetneqq",!0);L(P,ae,ce,"","\\@varsubsetneqq");L(P,ae,ce,"≯","\\ngtr",!0);L(P,ae,ce,"","\\@ngeqslant");L(P,ae,ce,"","\\@ngeqq");L(P,ae,ce,"⪈","\\gneq",!0);L(P,ae,ce,"≩","\\gneqq",!0);L(P,ae,ce,"","\\@gvertneqq");L(P,ae,ce,"⋧","\\gnsim",!0);L(P,ae,ce,"⪊","\\gnapprox",!0);L(P,ae,ce,"⊁","\\nsucc",!0);L(P,ae,ce,"⋡","\\nsucceq",!0);L(P,ae,ce,"⋩","\\succnsim",!0);L(P,ae,ce,"⪺","\\succnapprox",!0);L(P,ae,ce,"≆","\\ncong",!0);L(P,ae,ce,"","\\@nshortparallel");L(P,ae,ce,"∦","\\nparallel",!0);L(P,ae,ce,"⊯","\\nVDash",!0);L(P,ae,ce,"⋫","\\ntriangleright");L(P,ae,ce,"⋭","\\ntrianglerighteq",!0);L(P,ae,ce,"","\\@nsupseteqq");L(P,ae,ce,"⊋","\\supsetneq",!0);L(P,ae,ce,"","\\@varsupsetneq");L(P,ae,ce,"⫌","\\supsetneqq",!0);L(P,ae,ce,"","\\@varsupsetneqq");L(P,ae,ce,"⊮","\\nVdash",!0);L(P,ae,ce,"⪵","\\precneqq",!0);L(P,ae,ce,"⪶","\\succneqq",!0);L(P,ae,ce,"","\\@nsubseteqq");L(P,ae,Ke,"⊴","\\unlhd");L(P,ae,Ke,"⊵","\\unrhd");L(P,ae,ce,"↚","\\nleftarrow",!0);L(P,ae,ce,"↛","\\nrightarrow",!0);L(P,ae,ce,"⇍","\\nLeftarrow",!0);L(P,ae,ce,"⇏","\\nRightarrow",!0);L(P,ae,ce,"↮","\\nleftrightarrow",!0);L(P,ae,ce,"⇎","\\nLeftrightarrow",!0);L(P,ae,ce,"△","\\vartriangle");L(P,ae,he,"ℏ","\\hslash");L(P,ae,he,"▽","\\triangledown");L(P,ae,he,"◊","\\lozenge");L(P,ae,he,"Ⓢ","\\circledS");L(P,ae,he,"®","\\circledR");L(Re,ae,he,"®","\\circledR");L(P,ae,he,"∡","\\measuredangle",!0);L(P,ae,he,"∄","\\nexists");L(P,ae,he,"℧","\\mho");L(P,ae,he,"Ⅎ","\\Finv",!0);L(P,ae,he,"⅁","\\Game",!0);L(P,ae,he,"‵","\\backprime");L(P,ae,he,"▲","\\blacktriangle");L(P,ae,he,"▼","\\blacktriangledown");L(P,ae,he,"■","\\blacksquare");L(P,ae,he,"⧫","\\blacklozenge");L(P,ae,he,"★","\\bigstar");L(P,ae,he,"∢","\\sphericalangle",!0);L(P,ae,he,"∁","\\complement",!0);L(P,ae,he,"ð","\\eth",!0);L(Re,K,he,"ð","ð");L(P,ae,he,"╱","\\diagup");L(P,ae,he,"╲","\\diagdown");L(P,ae,he,"□","\\square");L(P,ae,he,"□","\\Box");L(P,ae,he,"◊","\\Diamond");L(P,ae,he,"¥","\\yen",!0);L(Re,ae,he,"¥","\\yen",!0);L(P,ae,he,"✓","\\checkmark",!0);L(Re,ae,he,"✓","\\checkmark");L(P,ae,he,"ℶ","\\beth",!0);L(P,ae,he,"ℸ","\\daleth",!0);L(P,ae,he,"ℷ","\\gimel",!0);L(P,ae,he,"ϝ","\\digamma",!0);L(P,ae,he,"ϰ","\\varkappa");L(P,ae,Fi,"┌","\\@ulcorner",!0);L(P,ae,Yr,"┐","\\@urcorner",!0);L(P,ae,Fi,"└","\\@llcorner",!0);L(P,ae,Yr,"┘","\\@lrcorner",!0);L(P,ae,ce,"≦","\\leqq",!0);L(P,ae,ce,"⩽","\\leqslant",!0);L(P,ae,ce,"⪕","\\eqslantless",!0);L(P,ae,ce,"≲","\\lesssim",!0);L(P,ae,ce,"⪅","\\lessapprox",!0);L(P,ae,ce,"≊","\\approxeq",!0);L(P,ae,Ke,"⋖","\\lessdot");L(P,ae,ce,"⋘","\\lll",!0);L(P,ae,ce,"≶","\\lessgtr",!0);L(P,ae,ce,"⋚","\\lesseqgtr",!0);L(P,ae,ce,"⪋","\\lesseqqgtr",!0);L(P,ae,ce,"≑","\\doteqdot");L(P,ae,ce,"≓","\\risingdotseq",!0);L(P,ae,ce,"≒","\\fallingdotseq",!0);L(P,ae,ce,"∽","\\backsim",!0);L(P,ae,ce,"⋍","\\backsimeq",!0);L(P,ae,ce,"⫅","\\subseteqq",!0);L(P,ae,ce,"⋐","\\Subset",!0);L(P,ae,ce,"⊏","\\sqsubset",!0);L(P,ae,ce,"≼","\\preccurlyeq",!0);L(P,ae,ce,"⋞","\\curlyeqprec",!0);L(P,ae,ce,"≾","\\precsim",!0);L(P,ae,ce,"⪷","\\precapprox",!0);L(P,ae,ce,"⊲","\\vartriangleleft");L(P,ae,ce,"⊴","\\trianglelefteq");L(P,ae,ce,"⊨","\\vDash",!0);L(P,ae,ce,"⊪","\\Vvdash",!0);L(P,ae,ce,"⌣","\\smallsmile");L(P,ae,ce,"⌢","\\smallfrown");L(P,ae,ce,"≏","\\bumpeq",!0);L(P,ae,ce,"≎","\\Bumpeq",!0);L(P,ae,ce,"≧","\\geqq",!0);L(P,ae,ce,"⩾","\\geqslant",!0);L(P,ae,ce,"⪖","\\eqslantgtr",!0);L(P,ae,ce,"≳","\\gtrsim",!0);L(P,ae,ce,"⪆","\\gtrapprox",!0);L(P,ae,Ke,"⋗","\\gtrdot");L(P,ae,ce,"⋙","\\ggg",!0);L(P,ae,ce,"≷","\\gtrless",!0);L(P,ae,ce,"⋛","\\gtreqless",!0);L(P,ae,ce,"⪌","\\gtreqqless",!0);L(P,ae,ce,"≖","\\eqcirc",!0);L(P,ae,ce,"≗","\\circeq",!0);L(P,ae,ce,"≜","\\triangleq",!0);L(P,ae,ce,"∼","\\thicksim");L(P,ae,ce,"≈","\\thickapprox");L(P,ae,ce,"⫆","\\supseteqq",!0);L(P,ae,ce,"⋑","\\Supset",!0);L(P,ae,ce,"⊐","\\sqsupset",!0);L(P,ae,ce,"≽","\\succcurlyeq",!0);L(P,ae,ce,"⋟","\\curlyeqsucc",!0);L(P,ae,ce,"≿","\\succsim",!0);L(P,ae,ce,"⪸","\\succapprox",!0);L(P,ae,ce,"⊳","\\vartriangleright");L(P,ae,ce,"⊵","\\trianglerighteq");L(P,ae,ce,"⊩","\\Vdash",!0);L(P,ae,ce,"∣","\\shortmid");L(P,ae,ce,"∥","\\shortparallel");L(P,ae,ce,"≬","\\between",!0);L(P,ae,ce,"⋔","\\pitchfork",!0);L(P,ae,ce,"∝","\\varpropto");L(P,ae,ce,"◀","\\blacktriangleleft");L(P,ae,ce,"∴","\\therefore",!0);L(P,ae,ce,"∍","\\backepsilon");L(P,ae,ce,"▶","\\blacktriangleright");L(P,ae,ce,"∵","\\because",!0);L(P,ae,ce,"⋘","\\llless");L(P,ae,ce,"⋙","\\gggtr");L(P,ae,Ke,"⊲","\\lhd");L(P,ae,Ke,"⊳","\\rhd");L(P,ae,ce,"≂","\\eqsim",!0);L(P,K,ce,"⋈","\\Join");L(P,ae,ce,"≑","\\Doteq",!0);L(P,ae,Ke,"∔","\\dotplus",!0);L(P,ae,Ke,"∖","\\smallsetminus");L(P,ae,Ke,"⋒","\\Cap",!0);L(P,ae,Ke,"⋓","\\Cup",!0);L(P,ae,Ke,"⩞","\\doublebarwedge",!0);L(P,ae,Ke,"⊟","\\boxminus",!0);L(P,ae,Ke,"⊞","\\boxplus",!0);L(P,ae,Ke,"⋇","\\divideontimes",!0);L(P,ae,Ke,"⋉","\\ltimes",!0);L(P,ae,Ke,"⋊","\\rtimes",!0);L(P,ae,Ke,"⋋","\\leftthreetimes",!0);L(P,ae,Ke,"⋌","\\rightthreetimes",!0);L(P,ae,Ke,"⋏","\\curlywedge",!0);L(P,ae,Ke,"⋎","\\curlyvee",!0);L(P,ae,Ke,"⊝","\\circleddash",!0);L(P,ae,Ke,"⊛","\\circledast",!0);L(P,ae,Ke,"⋅","\\centerdot");L(P,ae,Ke,"⊺","\\intercal",!0);L(P,ae,Ke,"⋒","\\doublecap");L(P,ae,Ke,"⋓","\\doublecup");L(P,ae,Ke,"⊠","\\boxtimes",!0);L(P,ae,ce,"⇢","\\dashrightarrow",!0);L(P,ae,ce,"⇠","\\dashleftarrow",!0);L(P,ae,ce,"⇇","\\leftleftarrows",!0);L(P,ae,ce,"⇆","\\leftrightarrows",!0);L(P,ae,ce,"⇚","\\Lleftarrow",!0);L(P,ae,ce,"↞","\\twoheadleftarrow",!0);L(P,ae,ce,"↢","\\leftarrowtail",!0);L(P,ae,ce,"↫","\\looparrowleft",!0);L(P,ae,ce,"⇋","\\leftrightharpoons",!0);L(P,ae,ce,"↶","\\curvearrowleft",!0);L(P,ae,ce,"↺","\\circlearrowleft",!0);L(P,ae,ce,"↰","\\Lsh",!0);L(P,ae,ce,"⇈","\\upuparrows",!0);L(P,ae,ce,"↿","\\upharpoonleft",!0);L(P,ae,ce,"⇃","\\downharpoonleft",!0);L(P,K,ce,"⊶","\\origof",!0);L(P,K,ce,"⊷","\\imageof",!0);L(P,ae,ce,"⊸","\\multimap",!0);L(P,ae,ce,"↭","\\leftrightsquigarrow",!0);L(P,ae,ce,"⇉","\\rightrightarrows",!0);L(P,ae,ce,"⇄","\\rightleftarrows",!0);L(P,ae,ce,"↠","\\twoheadrightarrow",!0);L(P,ae,ce,"↣","\\rightarrowtail",!0);L(P,ae,ce,"↬","\\looparrowright",!0);L(P,ae,ce,"↷","\\curvearrowright",!0);L(P,ae,ce,"↻","\\circlearrowright",!0);L(P,ae,ce,"↱","\\Rsh",!0);L(P,ae,ce,"⇊","\\downdownarrows",!0);L(P,ae,ce,"↾","\\upharpoonright",!0);L(P,ae,ce,"⇂","\\downharpoonright",!0);L(P,ae,ce,"⇝","\\rightsquigarrow",!0);L(P,ae,ce,"⇝","\\leadsto");L(P,ae,ce,"⇛","\\Rrightarrow",!0);L(P,ae,ce,"↾","\\restriction");L(P,K,he,"‘","`");L(P,K,he,"$","\\$");L(Re,K,he,"$","\\$");L(Re,K,he,"$","\\textdollar");L(P,K,he,"%","\\%");L(Re,K,he,"%","\\%");L(P,K,he,"_","\\_");L(Re,K,he,"_","\\_");L(Re,K,he,"_","\\textunderscore");L(P,K,he,"∠","\\angle",!0);L(P,K,he,"∞","\\infty",!0);L(P,K,he,"′","\\prime");L(P,K,he,"△","\\triangle");L(P,K,he,"Γ","\\Gamma",!0);L(P,K,he,"Δ","\\Delta",!0);L(P,K,he,"Θ","\\Theta",!0);L(P,K,he,"Λ","\\Lambda",!0);L(P,K,he,"Ξ","\\Xi",!0);L(P,K,he,"Π","\\Pi",!0);L(P,K,he,"Σ","\\Sigma",!0);L(P,K,he,"Υ","\\Upsilon",!0);L(P,K,he,"Φ","\\Phi",!0);L(P,K,he,"Ψ","\\Psi",!0);L(P,K,he,"Ω","\\Omega",!0);L(P,K,he,"A","Α");L(P,K,he,"B","Β");L(P,K,he,"E","Ε");L(P,K,he,"Z","Ζ");L(P,K,he,"H","Η");L(P,K,he,"I","Ι");L(P,K,he,"K","Κ");L(P,K,he,"M","Μ");L(P,K,he,"N","Ν");L(P,K,he,"O","Ο");L(P,K,he,"P","Ρ");L(P,K,he,"T","Τ");L(P,K,he,"X","Χ");L(P,K,he,"¬","\\neg",!0);L(P,K,he,"¬","\\lnot");L(P,K,he,"⊤","\\top");L(P,K,he,"⊥","\\bot");L(P,K,he,"∅","\\emptyset");L(P,ae,he,"∅","\\varnothing");L(P,K,pt,"α","\\alpha",!0);L(P,K,pt,"β","\\beta",!0);L(P,K,pt,"γ","\\gamma",!0);L(P,K,pt,"δ","\\delta",!0);L(P,K,pt,"ϵ","\\epsilon",!0);L(P,K,pt,"ζ","\\zeta",!0);L(P,K,pt,"η","\\eta",!0);L(P,K,pt,"θ","\\theta",!0);L(P,K,pt,"ι","\\iota",!0);L(P,K,pt,"κ","\\kappa",!0);L(P,K,pt,"λ","\\lambda",!0);L(P,K,pt,"μ","\\mu",!0);L(P,K,pt,"ν","\\nu",!0);L(P,K,pt,"ξ","\\xi",!0);L(P,K,pt,"ο","\\omicron",!0);L(P,K,pt,"π","\\pi",!0);L(P,K,pt,"ρ","\\rho",!0);L(P,K,pt,"σ","\\sigma",!0);L(P,K,pt,"τ","\\tau",!0);L(P,K,pt,"υ","\\upsilon",!0);L(P,K,pt,"ϕ","\\phi",!0);L(P,K,pt,"χ","\\chi",!0);L(P,K,pt,"ψ","\\psi",!0);L(P,K,pt,"ω","\\omega",!0);L(P,K,pt,"ε","\\varepsilon",!0);L(P,K,pt,"ϑ","\\vartheta",!0);L(P,K,pt,"ϖ","\\varpi",!0);L(P,K,pt,"ϱ","\\varrho",!0);L(P,K,pt,"ς","\\varsigma",!0);L(P,K,pt,"φ","\\varphi",!0);L(P,K,Ke,"∗","*",!0);L(P,K,Ke,"+","+");L(P,K,Ke,"−","-",!0);L(P,K,Ke,"⋅","\\cdot",!0);L(P,K,Ke,"∘","\\circ",!0);L(P,K,Ke,"÷","\\div",!0);L(P,K,Ke,"±","\\pm",!0);L(P,K,Ke,"×","\\times",!0);L(P,K,Ke,"∩","\\cap",!0);L(P,K,Ke,"∪","\\cup",!0);L(P,K,Ke,"∖","\\setminus",!0);L(P,K,Ke,"∧","\\land");L(P,K,Ke,"∨","\\lor");L(P,K,Ke,"∧","\\wedge",!0);L(P,K,Ke,"∨","\\vee",!0);L(P,K,he,"√","\\surd");L(P,K,Fi,"⟨","\\langle",!0);L(P,K,Fi,"∣","\\lvert");L(P,K,Fi,"∥","\\lVert");L(P,K,Yr,"?","?");L(P,K,Yr,"!","!");L(P,K,Yr,"⟩","\\rangle",!0);L(P,K,Yr,"∣","\\rvert");L(P,K,Yr,"∥","\\rVert");L(P,K,ce,"=","=");L(P,K,ce,":",":");L(P,K,ce,"≈","\\approx",!0);L(P,K,ce,"≅","\\cong",!0);L(P,K,ce,"≥","\\ge");L(P,K,ce,"≥","\\geq",!0);L(P,K,ce,"←","\\gets");L(P,K,ce,">","\\gt",!0);L(P,K,ce,"∈","\\in",!0);L(P,K,ce,"","\\@not");L(P,K,ce,"⊂","\\subset",!0);L(P,K,ce,"⊃","\\supset",!0);L(P,K,ce,"⊆","\\subseteq",!0);L(P,K,ce,"⊇","\\supseteq",!0);L(P,ae,ce,"⊈","\\nsubseteq",!0);L(P,ae,ce,"⊉","\\nsupseteq",!0);L(P,K,ce,"⊨","\\models");L(P,K,ce,"←","\\leftarrow",!0);L(P,K,ce,"≤","\\le");L(P,K,ce,"≤","\\leq",!0);L(P,K,ce,"<","\\lt",!0);L(P,K,ce,"→","\\rightarrow",!0);L(P,K,ce,"→","\\to");L(P,ae,ce,"≱","\\ngeq",!0);L(P,ae,ce,"≰","\\nleq",!0);L(P,K,$a," ","\\ ");L(P,K,$a," ","\\space");L(P,K,$a," ","\\nobreakspace");L(Re,K,$a," ","\\ ");L(Re,K,$a," "," ");L(Re,K,$a," ","\\space");L(Re,K,$a," ","\\nobreakspace");L(P,K,$a,"","\\nobreak");L(P,K,$a,"","\\allowbreak");L(P,K,dh,",",",");L(P,K,dh,";",";");L(P,ae,Ke,"⊼","\\barwedge",!0);L(P,ae,Ke,"⊻","\\veebar",!0);L(P,K,Ke,"⊙","\\odot",!0);L(P,K,Ke,"⊕","\\oplus",!0);L(P,K,Ke,"⊗","\\otimes",!0);L(P,K,he,"∂","\\partial",!0);L(P,K,Ke,"⊘","\\oslash",!0);L(P,ae,Ke,"⊚","\\circledcirc",!0);L(P,ae,Ke,"⊡","\\boxdot",!0);L(P,K,Ke,"△","\\bigtriangleup");L(P,K,Ke,"▽","\\bigtriangledown");L(P,K,Ke,"†","\\dagger");L(P,K,Ke,"⋄","\\diamond");L(P,K,Ke,"⋆","\\star");L(P,K,Ke,"◃","\\triangleleft");L(P,K,Ke,"▹","\\triangleright");L(P,K,Fi,"{","\\{");L(Re,K,he,"{","\\{");L(Re,K,he,"{","\\textbraceleft");L(P,K,Yr,"}","\\}");L(Re,K,he,"}","\\}");L(Re,K,he,"}","\\textbraceright");L(P,K,Fi,"{","\\lbrace");L(P,K,Yr,"}","\\rbrace");L(P,K,Fi,"[","\\lbrack",!0);L(Re,K,he,"[","\\lbrack",!0);L(P,K,Yr,"]","\\rbrack",!0);L(Re,K,he,"]","\\rbrack",!0);L(P,K,Fi,"(","\\lparen",!0);L(P,K,Yr,")","\\rparen",!0);L(Re,K,he,"<","\\textless",!0);L(Re,K,he,">","\\textgreater",!0);L(P,K,Fi,"⌊","\\lfloor",!0);L(P,K,Yr,"⌋","\\rfloor",!0);L(P,K,Fi,"⌈","\\lceil",!0);L(P,K,Yr,"⌉","\\rceil",!0);L(P,K,he,"\\","\\backslash");L(P,K,he,"∣","|");L(P,K,he,"∣","\\vert");L(Re,K,he,"|","\\textbar",!0);L(P,K,he,"∥","\\|");L(P,K,he,"∥","\\Vert");L(Re,K,he,"∥","\\textbardbl");L(Re,K,he,"~","\\textasciitilde");L(Re,K,he,"\\","\\textbackslash");L(Re,K,he,"^","\\textasciicircum");L(P,K,ce,"↑","\\uparrow",!0);L(P,K,ce,"⇑","\\Uparrow",!0);L(P,K,ce,"↓","\\downarrow",!0);L(P,K,ce,"⇓","\\Downarrow",!0);L(P,K,ce,"↕","\\updownarrow",!0);L(P,K,ce,"⇕","\\Updownarrow",!0);L(P,K,Zn,"∐","\\coprod");L(P,K,Zn,"⋁","\\bigvee");L(P,K,Zn,"⋀","\\bigwedge");L(P,K,Zn,"⨄","\\biguplus");L(P,K,Zn,"⋂","\\bigcap");L(P,K,Zn,"⋃","\\bigcup");L(P,K,Zn,"∫","\\int");L(P,K,Zn,"∫","\\intop");L(P,K,Zn,"∬","\\iint");L(P,K,Zn,"∭","\\iiint");L(P,K,Zn,"∏","\\prod");L(P,K,Zn,"∑","\\sum");L(P,K,Zn,"⨂","\\bigotimes");L(P,K,Zn,"⨁","\\bigoplus");L(P,K,Zn,"⨀","\\bigodot");L(P,K,Zn,"∮","\\oint");L(P,K,Zn,"∯","\\oiint");L(P,K,Zn,"∰","\\oiiint");L(P,K,Zn,"⨆","\\bigsqcup");L(P,K,Zn,"∫","\\smallint");L(Re,K,au,"…","\\textellipsis");L(P,K,au,"…","\\mathellipsis");L(Re,K,au,"…","\\ldots",!0);L(P,K,au,"…","\\ldots",!0);L(P,K,au,"⋯","\\@cdots",!0);L(P,K,au,"⋱","\\ddots",!0);L(P,K,he,"⋮","\\varvdots");L(Re,K,he,"⋮","\\varvdots");L(P,K,Tn,"ˊ","\\acute");L(P,K,Tn,"ˋ","\\grave");L(P,K,Tn,"¨","\\ddot");L(P,K,Tn,"~","\\tilde");L(P,K,Tn,"ˉ","\\bar");L(P,K,Tn,"˘","\\breve");L(P,K,Tn,"ˇ","\\check");L(P,K,Tn,"^","\\hat");L(P,K,Tn,"⃗","\\vec");L(P,K,Tn,"˙","\\dot");L(P,K,Tn,"˚","\\mathring");L(P,K,pt,"","\\@imath");L(P,K,pt,"","\\@jmath");L(P,K,he,"ı","ı");L(P,K,he,"ȷ","ȷ");L(Re,K,he,"ı","\\i",!0);L(Re,K,he,"ȷ","\\j",!0);L(Re,K,he,"ß","\\ss",!0);L(Re,K,he,"æ","\\ae",!0);L(Re,K,he,"œ","\\oe",!0);L(Re,K,he,"ø","\\o",!0);L(Re,K,he,"Æ","\\AE",!0);L(Re,K,he,"Œ","\\OE",!0);L(Re,K,he,"Ø","\\O",!0);L(Re,K,Tn,"ˊ","\\'");L(Re,K,Tn,"ˋ","\\`");L(Re,K,Tn,"ˆ","\\^");L(Re,K,Tn,"˜","\\~");L(Re,K,Tn,"ˉ","\\=");L(Re,K,Tn,"˘","\\u");L(Re,K,Tn,"˙","\\.");L(Re,K,Tn,"¸","\\c");L(Re,K,Tn,"˚","\\r");L(Re,K,Tn,"ˇ","\\v");L(Re,K,Tn,"¨",'\\"');L(Re,K,Tn,"˝","\\H");L(Re,K,Tn,"◯","\\textcircled");var E9={"--":!0,"---":!0,"``":!0,"''":!0};L(Re,K,he,"–","--",!0);L(Re,K,he,"–","\\textendash");L(Re,K,he,"—","---",!0);L(Re,K,he,"—","\\textemdash");L(Re,K,he,"‘","`",!0);L(Re,K,he,"‘","\\textquoteleft");L(Re,K,he,"’","'",!0);L(Re,K,he,"’","\\textquoteright");L(Re,K,he,"“","``",!0);L(Re,K,he,"“","\\textquotedblleft");L(Re,K,he,"”","''",!0);L(Re,K,he,"”","\\textquotedblright");L(P,K,he,"°","\\degree",!0);L(Re,K,he,"°","\\degree");L(Re,K,he,"°","\\textdegree",!0);L(P,K,he,"£","\\pounds");L(P,K,he,"£","\\mathsterling",!0);L(Re,K,he,"£","\\pounds");L(Re,K,he,"£","\\textsterling",!0);L(P,ae,he,"✠","\\maltese");L(Re,ae,he,"✠","\\maltese");var f6='0123456789/@."';for(var Tg=0;Tg{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484){var i=Math.floor((r-119808)/26);return S6[i]}else if(120782<=r&&r<=120831){var a=Math.floor((r-120782)/10);return m$[a]}else{if(r===120485||r===120486)return S6[0];if(120486{if(jo(e.classes)!==jo(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},A9=e=>{for(var t=0;tn&&(n=o.height),o.depth>r&&(r=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}t.height=n,t.depth=r,t.maxFontSize=i},Ie=function(t,n,r,i){var a=new su(t,n,r,i);return H_(a),a},Ro=(e,t,n,r)=>new su(e,t,n,r),Vc=function(t,n,r){var i=Ie([t],[],n);return i.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),i.style.borderBottomWidth=Pe(i.height),i.maxFontSize=1,i},_$=function(t,n,r,i){var a=new pp(t,n,r,i);return H_(a),a},Fa=function(t){var n=new iu(t);return H_(n),n},Wc=function(t,n){return t instanceof iu?Ie([],[t],n):t},x$=function(t){if(t.positionType==="individualShift"){for(var n=t.children,r=[n[0]],i=-n[0].shift-n[0].elem.depth,a=i,o=1;o{var n=Ie(["mspace"],[],t),r=Mn(e,t);return n.style.marginRight=Pe(r),n},I0=(e,t,n)=>{var r,i;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return t==="textbf"&&n==="textit"?i="BoldItalic":t==="textbf"?i="Bold":n==="textit"?i="Italic":i="Regular",r+"-"+i},nv={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},N9={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},j9=function(t,n){var[r,i,a]=N9[t],o=new Mo(r),l=new Da([o],{width:Pe(i),height:Pe(a),style:"width:"+Pe(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),u=Ro(["overlay"],[l],n);return u.height=a,u.style.height=Pe(a),u.style.width=Pe(i),u},jn={number:3,unit:"mu"},ol={number:4,unit:"mu"},Sa={number:5,unit:"mu"},y$={mord:{mop:jn,mbin:ol,mrel:Sa,minner:jn},mop:{mord:jn,mop:jn,mrel:Sa,minner:jn},mbin:{mord:ol,mop:ol,mopen:ol,minner:ol},mrel:{mord:Sa,mop:Sa,mopen:Sa,minner:Sa},mopen:{},mclose:{mop:jn,mbin:ol,mrel:Sa,minner:jn},mpunct:{mord:jn,mop:jn,mrel:Sa,mopen:jn,mclose:jn,mpunct:jn,minner:jn},minner:{mord:jn,mop:jn,mbin:ol,mrel:Sa,mopen:jn,mpunct:jn,minner:jn}},w$={mord:{mop:jn},mop:{mord:jn,mop:jn},mbin:{},mrel:{},mopen:{},mclose:{mop:jn},mpunct:{},minner:{mop:jn}},M9={},zf={},Bf={};function Ye(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,l={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},u=0;u{var x=k.classes[0],v=S.classes[0];x==="mbin"&&k$.has(v)?k.classes[0]="mord":v==="mbin"&&S$.has(x)&&(S.classes[0]="mord")},{node:f},g,b),rv(a,(S,k)=>{var x,v,w=sv(k),y=sv(S),C=w&&y?S.hasClass("mtight")?(x=w$[w])==null?void 0:x[y]:(v=y$[w])==null?void 0:v[y]:null;if(C)return T9(C,d)},{node:f},g,b),a},rv=function(t,n,r,i,a){i&&t.push(i);for(var o=0;og=>{t.splice(f+1,0,g),o++})(o)}i&&t.pop()},R9=function(t){return t instanceof iu||t instanceof pp||t instanceof su&&t.hasClass("enclosing")?t:null},iv=function(t,n){var r=R9(t);if(r){var i=r.children;if(i.length){if(n==="right")return iv(i[i.length-1],"right");if(n==="left")return iv(i[0],"left")}}return t},sv=function(t,n){if(!t)return null;n&&(t=iv(t,n));var r=t.classes[0];return E$[r]||null},Td=function(t,n){var r=["nulldelimiter"].concat(t.baseSizingClasses());return Ie(n.concat(r))},Kt=function(t,n,r){if(!t)return Ie();if(zf[t.type]){var i=zf[t.type](t,n);if(r&&n.size!==r.size){i=Ie(n.sizingClasses(r),[i],n);var a=n.sizeMultiplier/r.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new He("Got group of unknown type: '"+t.type+"'")};function z0(e,t){var n=Ie(["base"],e,t),r=Ie(["strut"]);return r.style.height=Pe(n.height+n.depth),n.depth&&(r.style.verticalAlign=Pe(-n.depth)),n.children.unshift(r),n}function av(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var r=cr(e,t,"root"),i;r.length===2&&r[1].hasClass("tag")&&(i=r.pop());for(var a=[],o=[],l=0;l0&&(a.push(z0(o,t)),o=[]),a.push(r[l]));o.length>0&&a.push(z0(o,t));var d;n?(d=z0(cr(n,t,!0),t),d.classes=["tag"],a.push(d)):i&&a.push(i);var p=Ie(["katex-html"],a);if(p.setAttribute("aria-hidden","true"),d){var f=d.children[0];f.style.height=Pe(p.height+p.depth),p.depth&&(f.style.verticalAlign=Pe(-p.depth))}return p}function D9(e){return new iu(e)}class $e{constructor(t,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=jo(this.classes));for(var r=0;r0&&(t+=' class ="'+Dr(jo(this.classes))+'"'),t+=">";for(var r=0;r",t}toText(){return this.children.map(t=>t.toText()).join("")}}class Yn{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return Dr(this.toText())}toText(){return this.text}}class L9{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character="  ":t>=-.05556&&t<=-.05555?this.character=" ⁣":t>=-.1667&&t<=-.1666?this.character=" ⁣":t>=-.2223&&t<=-.2222?this.character=" ⁣":t>=-.2778&&t<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",Pe(this.width)),t}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var A$=new Set(["\\imath","\\jmath"]),T$=new Set(["mrow","mtable"]),as=function(t,n,r){return En[n][t]&&En[n][t].replace&&t.charCodeAt(0)!==55349&&!(E9.hasOwnProperty(t)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(t=En[n][t].replace),new Yn(t)},$_=function(t){return t.length===1?t[0]:new $e("mrow",t)},N$={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},F_=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var r=e.mode,i=N$[n];if(i)return typeof i=="function"?i(e):i;var a=e.text;if(A$.has(a))return null;if(En[r][a]){var o=En[r][a].replace;o&&(a=o)}var l=nv[n].fontName;return z_(a,l,r)?nv[n].variant:null};function Rg(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof Yn&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof Yn&&n.text===","}else return!1}var Pi=function(t,n,r){if(t.length===1){var i=fn(t[0],n);return r&&i instanceof $e&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],o,l=0;l=1&&(o.type==="mn"||Rg(o))){var d=u.children[0];d instanceof $e&&d.type==="mn"&&(d.children=[...o.children,...d.children],a.pop())}else if(o.type==="mi"&&o.children.length===1){var p=o.children[0];if(p instanceof Yn&&p.text==="̸"&&(u.type==="mo"||u.type==="mi"||u.type==="mn")){var f=u.children[0];f instanceof Yn&&f.text.length>0&&(f.text=f.text.slice(0,1)+"̸"+f.text.slice(1),a.pop())}}}a.push(u),o=u}return a},Do=function(t,n,r){return $_(Pi(t,n,r))},fn=function(t,n){if(!t)return new $e("mrow");if(Bf[t.type])return Bf[t.type](t,n);throw new He("Got group of unknown type: '"+t.type+"'")};function k6(e,t,n,r,i){var a=Pi(e,n),o;a.length===1&&a[0]instanceof $e&&T$.has(a[0].type)?o=a[0]:o=new $e("mrow",a);var l=new $e("annotation",[new Yn(t)]);l.setAttribute("encoding","application/x-tex");var u=new $e("semantics",[o,l]),d=new $e("math",[u]);d.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&d.setAttribute("display","block");var p=i?"katex":"katex-mathml";return Ie([p],[d])}var j$=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],C6=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],E6=function(t,n){return n.size<2?t:j$[t-1][n.size-1]};class Ta{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||Ta.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=C6[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new Ta(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:E6(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:C6[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=E6(Ta.BASESIZE,t);return this.size===n&&this.textSize===Ta.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Ta.BASESIZE?["sizing","reset-size"+this.size,"size"+Ta.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=f$(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Ta.BASESIZE=6;var O9=function(t){return new Ta({style:t.displayMode?yt.DISPLAY:yt.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},I9=function(t,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),t=Ie(r,[t])}return t},M$=function(t,n,r){var i=O9(r),a;if(r.output==="mathml")return k6(t,n,i,r.displayMode,!0);if(r.output==="html"){var o=av(t,i);a=Ie(["katex"],[o])}else{var l=k6(t,n,i,r.displayMode,!1),u=av(t,i);a=Ie(["katex"],[l,u])}return I9(a,r)},R$=function(t,n,r){var i=O9(r),a=av(t,i),o=Ie(["katex"],[a]);return I9(o,r)},D$={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},bp=function(t){var n=new $e("mo",[new Yn(D$[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},L$={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},O$=new Set(["widehat","widecheck","widetilde","utilde"]),vp=function(t,n){function r(){var l=4e5,u=t.label.slice(1);if(O$.has(u)&&"base"in t){var d=t.base.type==="ordgroup"?t.base.body.length:1,p,f,g;if(d>5)u==="widehat"||u==="widecheck"?(p=420,l=2364,g=.42,f=u+"4"):(p=312,l=2340,g=.34,f="tilde4");else{var b=[1,1,2,2,3,3][d];u==="widehat"||u==="widecheck"?(l=[0,1062,2364,2364,2364][b],p=[0,239,300,360,420][b],g=[0,.24,.3,.3,.36,.42][b],f=u+b):(l=[0,600,1033,2339,2340][b],p=[0,260,286,306,312][b],g=[0,.26,.286,.3,.306,.34][b],f="tilde"+b)}var S=new Mo(f),k=new Da([S],{width:"100%",height:Pe(g),viewBox:"0 0 "+l+" "+p,preserveAspectRatio:"none"});return{span:Ro([],[k],n),minWidth:0,height:g}}else{var x=[],v=L$[u];if(!v)throw new Error('No SVG data for "'+u+'".');var[w,y,C]=v,N=C/1e3,E=w.length,j,T;if(E===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+u+'".');j=["hide-tail"],T=[v[3]]}else if(E===2)j=["halfarrow-left","halfarrow-right"],T=["xMinYMin","xMaxYMin"];else if(E===3)j=["brace-left","brace-center","brace-right"],T=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+E+" children.");for(var D=0;D0&&(i.style.minWidth=Pe(a)),i},I$=function(t,n,r,i,a){var o,l=t.height+t.depth+r+i;if(/fbox|color|angl/.test(n)){if(o=Ie(["stretchy",n],[],a),n==="fbox"){var u=a.color&&a.getColor();u&&(o.style.borderColor=u)}}else{var d=[];/^[bx]cancel$/.test(n)&&d.push(new Kb({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&d.push(new Kb({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var p=new Da(d,{width:"100%",height:Pe(l)});o=Ro([],[p],a)}return o.height=l,o.style.height=Pe(l),o},z$={bin:1,close:1,inner:1,open:1,punct:1,rel:1},B$={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function H$(e){return e in z$}function Et(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function _p(e){var t=xp(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function xp(e){return e&&(e.type==="atom"||B$.hasOwnProperty(e.type))?e:null}var z9=e=>{if(e instanceof Bi)return e;if(d$(e)&&e.children.length===1)return z9(e.children[0])},P_=(e,t)=>{var n,r,i;e&&e.type==="supsub"?(r=Et(e.base,"accent"),n=r.base,e.base=n,i=u$(Kt(e,t)),e.base=r):(r=Et(e,"accent"),n=r.base);var a=Kt(n,t.havingCrampedStyle()),o=r.isShifty&&Ha(n),l=0;if(o){var u,d;l=(u=(d=z9(a))==null?void 0:d.skew)!=null?u:0}var p=r.label==="\\c",f=p?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),g;if(r.isStretchy)g=vp(r,t),g=Yt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:g,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+Pe(2*l)+")",marginLeft:Pe(2*l)}:void 0}]});else{var b,S;r.label==="\\vec"?(b=j9("vec",t),S=N9.vec[1]):(b=gp({mode:r.mode,text:r.label},t,"textord"),b=c$(b),b.italic=0,S=b.width,p&&(f+=b.depth)),g=Ie(["accent-body"],[b]);var k=r.label==="\\textcircled";k&&(g.classes.push("accent-full"),f=a.height);var x=l;k||(x-=S/2),g.style.left=Pe(x),r.label==="\\textcircled"&&(g.style.top=".2em"),g=Yt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-f},{type:"elem",elem:g}]})}var v=Ie(["mord","accent"],[g],t);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},B9=(e,t)=>{var n=e.isStretchy?bp(e.label):new $e("mo",[as(e.label,e.mode)]),r=new $e("mover",[fn(e.base,t),n]);return r.setAttribute("accent","true"),r},$$=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Ye({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=Hf(t[0]),r=!$$.test(e.funcName),i=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:P_,mathmlBuilder:B9});Ye({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:P_,mathmlBuilder:B9});Ye({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=Kt(e.base,t),r=vp(e,t),i=e.label==="\\utilde"?.12:0,a=Yt({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]});return Ie(["mord","accentunder"],[a],t)},mathmlBuilder:(e,t)=>{var n=bp(e.label),r=new $e("munder",[fn(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var B0=e=>{var t=new $e("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Ye({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=Wc(Kt(e.body,r,t),t),a=e.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var o;e.below&&(r=t.havingStyle(n.sub()),o=Wc(Kt(e.below,r,t),t),o.classes.push(a+"-arrow-pad"));var l=vp(e,t),u=-t.fontMetrics().axisHeight+.5*l.height,d=-t.fontMetrics().axisHeight-.5*l.height-.111;(i.depth>.25||e.label==="\\xleftequilibrium")&&(d-=i.depth);var p;if(o){var f=-t.fontMetrics().axisHeight+o.height+.5*l.height+.111;p=Yt({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:u,wrapperClasses:["svg-align"]},{type:"elem",elem:o,shift:f}]})}else p=Yt({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:u,wrapperClasses:["svg-align"]}]});return Ie(["mrel","x-arrow"],[p],t)},mathmlBuilder(e,t){var n=bp(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var i=B0(fn(e.body,t));if(e.below){var a=B0(fn(e.below,t));r=new $e("munderover",[n,a,i])}else r=new $e("mover",[n,i])}else if(e.below){var o=B0(fn(e.below,t));r=new $e("munder",[n,o])}else r=B0(),r=new $e("mover",[n,r]);return r}});function H9(e,t){var n=cr(e.body,t,!0);return Ie([e.mclass],n,t)}function $9(e,t){var n,r=Pi(e.body,t);return e.mclass==="minner"?n=new $e("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(n=r[0],n.type="mi"):n=new $e("mi",r):(e.isCharacterBox?(n=r[0],n.type="mo"):n=new $e("mo",r),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Ye({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:Wn(i),isCharacterBox:Ha(i)}},htmlBuilder:H9,mathmlBuilder:$9});var yp=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};Ye({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:yp(t[0]),body:Wn(t[1]),isCharacterBox:Ha(t[1])}}});Ye({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],o;r!=="\\stackrel"?o=yp(i):o="mrel";var l={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:Wn(i)},u={type:"supsub",mode:a.mode,base:l,sup:r==="\\underset"?null:a,sub:r==="\\underset"?a:null};return{type:"mclass",mode:n.mode,mclass:o,body:[u],isCharacterBox:Ha(u)}},htmlBuilder:H9,mathmlBuilder:$9});Ye({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:yp(t[0]),body:Wn(t[0])}},htmlBuilder(e,t){var n=cr(e.body,t,!0),r=Ie([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=Pi(e.body,t),r=new $e("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var F$={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},A6=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),T6=e=>e.type==="textord"&&e.text==="@",P$=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function U$(e,t,n){var r=F$[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var i=n.callFunction("\\\\cdleft",[t[0]],[]),a={type:"atom",text:r,mode:"math",family:"rel"},o=n.callFunction("\\Big",[a],[]),l=n.callFunction("\\\\cdright",[t[1]],[]),u={type:"ordgroup",mode:"math",body:[i,o,l]};return n.callFunction("\\\\cdparent",[u],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var d={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[d],[])}default:return{type:"textord",text:" ",mode:"math"}}}function q$(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new He("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],i=[r],a=0;aAV".includes(d))for(var f=0;f<2;f++){for(var g=!0,b=u+1;bAV=|." after @',o[u]);var S=U$(d,p,e),k={type:"styling",body:[S],mode:"math",style:"display",resetFont:!0};r.push(k),l=A6()}a%2===0?r.push(l):r.shift(),r=[],i.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var x=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:x,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Ye({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=Wc(Kt(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=Pe(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new $e("mrow",[fn(e.label,t)]);return n=new $e("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new $e("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Ye({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=Wc(Kt(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new $e("mrow",[fn(e.fragment,t)])}});Ye({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=Et(t[0],"ordgroup"),i=r.body,a="",o=0;o=1114111)throw new He("\\@char with invalid code point "+a);return u<=65535?d=String.fromCharCode(u):(u-=65536,d=String.fromCharCode((u>>10)+55296,(u&1023)+56320)),{type:"textord",mode:n.mode,text:d}}});var F9=(e,t)=>{var n=cr(e.body,t.withColor(e.color),!1);return Fa(n)},P9=(e,t)=>{var n=Pi(e.body,t.withColor(e.color)),r=new $e("mstyle",n);return r.setAttribute("mathcolor",e.color),r};Ye({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=Et(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:Wn(i)}},htmlBuilder:F9,mathmlBuilder:P9});Ye({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=Et(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var a=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:a}},htmlBuilder:F9,mathmlBuilder:P9});Ye({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:a,size:i&&Et(i,"size").value}},htmlBuilder(e,t){var n=Ie(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Pe(Mn(e.size,t)))),n},mathmlBuilder(e,t){var n=new $e("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Pe(Mn(e.size,t)))),n}});var ov={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},U9=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new He("Expected a control sequence",e);return t},G$=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},q9=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i==null&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};Ye({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(ov[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=ov[r.text]),Et(t.parseFunction(),"internal");throw new He("Invalid token after macro prefix",r)}});Ye({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new He("Expected a control sequence",r);for(var a=0,o,l=[[]];t.gullet.future().text!=="{";)if(r=t.gullet.popToken(),r.text==="#"){if(t.gullet.future().text==="{"){o=t.gullet.future(),l[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new He('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new He('Argument number "'+r.text+'" out of order');a++,l.push([])}else{if(r.text==="EOF")throw new He("Expected a macro definition");l[a].push(r.text)}var{tokens:u}=t.gullet.consumeArg();return o&&u.unshift(o),(n==="\\edef"||n==="\\xdef")&&(u=t.gullet.expandTokens(u),u.reverse()),t.gullet.macros.set(i,{tokens:u,numArgs:a,delimiters:l},n===ov[n]),{type:"internal",mode:t.mode}}});Ye({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=U9(t.gullet.popToken());t.gullet.consumeSpaces();var i=G$(t);return q9(t,r,i,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});Ye({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=U9(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return q9(t,r,a,n==="\\\\globalfuture"),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var sd=function(t,n,r){var i=En.math[t]&&En.math[t].replace,a=z_(i||t,n,r);if(!a)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return a},U_=function(t,n,r,i){var a=r.havingBaseStyle(n),o=Ie(i.concat(a.sizingClasses(r)),[t],r),l=a.sizeMultiplier/r.sizeMultiplier;return o.height*=l,o.depth*=l,o.maxFontSize=a.sizeMultiplier,o},G9=function(t,n,r){var i=n.havingBaseStyle(r),a=(1-n.sizeMultiplier/i.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=Pe(a),t.height-=a,t.depth+=a},V$=function(t,n,r,i,a,o){var l=Ur(t,"Main-Regular",a,i),u=U_(l,n,i,o);return G9(u,i,n),u},W$=function(t,n,r,i){return Ur(t,"Size"+n+"-Regular",r,i)},V9=function(t,n,r,i,a,o){var l=W$(t,n,a,i),u=U_(Ie(["delimsizing","size"+n],[l],i),yt.TEXT,i,o);return r&&G9(u,i,yt.TEXT),u},Dg=function(t,n,r){var i;n==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Ie(["delimsizinginner",i],[Ie([],[Ur(t,n,r)])]);return{type:"elem",elem:a}},Lg=function(t,n,r){var i=Us["Size4-Regular"][t.charCodeAt(0)]?Us["Size4-Regular"][t.charCodeAt(0)][4]:Us["Size1-Regular"][t.charCodeAt(0)][4],a=new Mo("inner",n$(t,Math.round(1e3*n))),o=new Da([a],{width:Pe(i),height:Pe(n),style:"width:"+Pe(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),l=Ro([],[o],r);return l.height=n,l.style.height=Pe(n),l.style.width=Pe(i),{type:"elem",elem:l}},lv=.008,H0={type:"kern",size:-1*lv},Y$=new Set(["|","\\lvert","\\rvert","\\vert"]),X$=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),W9=function(t,n,r,i,a,o){var l,u,d,p,f="",g=0;l=d=p=t,u=null;var b="Size1-Regular";t==="\\uparrow"?d=p="⏐":t==="\\Uparrow"?d=p="‖":t==="\\downarrow"?l=d="⏐":t==="\\Downarrow"?l=d="‖":t==="\\updownarrow"?(l="\\uparrow",d="⏐",p="\\downarrow"):t==="\\Updownarrow"?(l="\\Uparrow",d="‖",p="\\Downarrow"):Y$.has(t)?(d="∣",f="vert",g=333):X$.has(t)?(d="∥",f="doublevert",g=556):t==="["||t==="\\lbrack"?(l="⎡",d="⎢",p="⎣",b="Size4-Regular",f="lbrack",g=667):t==="]"||t==="\\rbrack"?(l="⎤",d="⎥",p="⎦",b="Size4-Regular",f="rbrack",g=667):t==="\\lfloor"||t==="⌊"?(d=l="⎢",p="⎣",b="Size4-Regular",f="lfloor",g=667):t==="\\lceil"||t==="⌈"?(l="⎡",d=p="⎢",b="Size4-Regular",f="lceil",g=667):t==="\\rfloor"||t==="⌋"?(d=l="⎥",p="⎦",b="Size4-Regular",f="rfloor",g=667):t==="\\rceil"||t==="⌉"?(l="⎤",d=p="⎥",b="Size4-Regular",f="rceil",g=667):t==="("||t==="\\lparen"?(l="⎛",d="⎜",p="⎝",b="Size4-Regular",f="lparen",g=875):t===")"||t==="\\rparen"?(l="⎞",d="⎟",p="⎠",b="Size4-Regular",f="rparen",g=875):t==="\\{"||t==="\\lbrace"?(l="⎧",u="⎨",p="⎩",d="⎪",b="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(l="⎫",u="⎬",p="⎭",d="⎪",b="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(l="⎧",p="⎩",d="⎪",b="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(l="⎫",p="⎭",d="⎪",b="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(l="⎧",p="⎭",d="⎪",b="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(l="⎫",p="⎩",d="⎪",b="Size4-Regular");var S=sd(l,b,a),k=S.height+S.depth,x=sd(d,b,a),v=x.height+x.depth,w=sd(p,b,a),y=w.height+w.depth,C=0,N=1;if(u!==null){var E=sd(u,b,a);C=E.height+E.depth,N=2}var j=k+y+C,T=Math.max(0,Math.ceil((n-j)/(N*v))),D=j+T*N*v,I=i.fontMetrics().axisHeight;r&&(I*=i.sizeMultiplier);var $=D/2-I,F=[];if(f.length>0){var U=D-k-y,G=Math.round(D*1e3),X=r$(f,Math.round(U*1e3)),Y=new Mo(f,X),Z=Pe(g/1e3),Q=Pe(G/1e3),z=new Da([Y],{width:Z,height:Q,viewBox:"0 0 "+g+" "+G}),O=Ro([],[z],i);O.height=G/1e3,O.style.width=Z,O.style.height=Q,F.push({type:"elem",elem:O})}else{if(F.push(Dg(p,b,a)),F.push(H0),u===null){var H=D-k-y+2*lv;F.push(Lg(d,H,i))}else{var V=(D-k-y-C)/2+2*lv;F.push(Lg(d,V,i)),F.push(H0),F.push(Dg(u,b,a)),F.push(H0),F.push(Lg(d,V,i))}F.push(H0),F.push(Dg(l,b,a))}var W=i.havingBaseStyle(yt.TEXT),re=Yt({positionType:"bottom",positionData:$,children:F});return U_(Ie(["delimsizing","mult"],[re],W),yt.TEXT,i,o)},Og=80,Ig=.08,zg=function(t,n,r,i,a){var o=t$(t,i,r),l=new Mo(t,o),u=new Da([l],{width:"400em",height:Pe(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return Ro(["hide-tail"],[u],a)},K$=function(t,n){var r=n.havingBaseSizing(),i=Q9("\\surd",t*r.sizeMultiplier,Z9,r),a=r.sizeMultiplier,o=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),l,u,d,p,f;return i.type==="small"?(p=1e3+1e3*o+Og,t<1?a=1:t<1.4&&(a=.7),u=(1+o+Ig)/a,d=(1+o)/a,l=zg("sqrtMain",u,p,o,n),l.style.minWidth="0.853em",f=.833/a):i.type==="large"?(p=(1e3+Og)*md[i.size],d=(md[i.size]+o)/a,u=(md[i.size]+o+Ig)/a,l=zg("sqrtSize"+i.size,u,p,o,n),l.style.minWidth="1.02em",f=1/a):(u=t+o+Ig,d=t+o,p=Math.floor(1e3*t+o)+Og,l=zg("sqrtTall",u,p,o,n),l.style.minWidth="0.742em",f=1.056),l.height=d,l.style.height=Pe(u),{span:l,advanceWidth:f,ruleWidth:(n.fontMetrics().sqrtRuleThickness+o)*a}},Y9=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),Z$=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),X9=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),md=[0,1.2,1.8,2.4,3],K9=function(t,n,r,i,a){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),Y9.has(t)||X9.has(t))return V9(t,n,!1,r,i,a);if(Z$.has(t))return W9(t,md[n],!1,r,i,a);throw new He("Illegal delimiter: '"+t+"'")},Q$=[{type:"small",style:yt.SCRIPTSCRIPT},{type:"small",style:yt.SCRIPT},{type:"small",style:yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],J$=[{type:"small",style:yt.SCRIPTSCRIPT},{type:"small",style:yt.SCRIPT},{type:"small",style:yt.TEXT},{type:"stack"}],Z9=[{type:"small",style:yt.SCRIPTSCRIPT},{type:"small",style:yt.SCRIPT},{type:"small",style:yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],eF=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")},Q9=function(t,n,r,i){for(var a=Math.min(2,3-i.style.size),o=a;on)return l}return r[r.length-1]},cv=function(t,n,r,i,a,o){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var l;X9.has(t)?l=Q$:Y9.has(t)?l=Z9:l=J$;var u=Q9(t,n,l,i);return u.type==="small"?V$(t,u.style,r,i,a,o):u.type==="large"?V9(t,u.size,r,i,a,o):W9(t,n,r,i,a,o)},Bg=function(t,n,r,i,a,o){var l=i.fontMetrics().axisHeight*i.sizeMultiplier,u=901,d=5/i.fontMetrics().ptPerEm,p=Math.max(n-l,r+l),f=Math.max(p/500*u,2*p-d);return cv(t,f,!0,i,a,o)},N6={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},tF=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function j6(e){return"isMiddle"in e}function wp(e,t){var n=xp(e);if(n&&tF.has(n.text))return n;throw n?new He("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new He("Invalid delimiter type '"+e.type+"'",e)}Ye({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=wp(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:N6[e.funcName].size,mclass:N6[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?Ie([e.mclass]):K9(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(as(e.delim,e.mode));var n=new $e("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Pe(md[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function M6(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ye({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new He("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:wp(t[0],e).text,color:n}}});Ye({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=wp(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var a=Et(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{M6(e);for(var n=cr(e.body,t,!0,["mopen","mclose"]),r=0,i=0,a=!1,o=0;o{M6(e);var n=Pi(e.body,t);if(e.left!=="."){var r=new $e("mo",[as(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(e.right!=="."){var i=new $e("mo",[as(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return $_(n)}});Ye({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=wp(t[0],e);if(!e.parser.leftrightDepth)throw new He("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=Td(t,[]):(n=K9(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?as("|","text"):as(e.delim,e.mode),r=new $e("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Sp=(e,t)=>{var n=Wc(Kt(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,l=Ha(e.body);if(r==="sout")a=Ie(["stretchy","sout"]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r==="phase"){var u=Mn({number:.6,unit:"pt"},t),d=Mn({number:.35,unit:"ex"},t),p=t.havingBaseSizing();i=i/p.sizeMultiplier;var f=n.height+n.depth+u+d;n.style.paddingLeft=Pe(f/2+u);var g=Math.floor(1e3*f*i),b=JH(g),S=new Da([new Mo("phase",b)],{width:"400em",height:Pe(g/1e3),viewBox:"0 0 400000 "+g,preserveAspectRatio:"xMinYMin slice"});a=Ro(["hide-tail"],[S],t),a.style.height=Pe(f),o=n.depth+u+d}else{/cancel/.test(r)?l||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var k,x,v=0;/box/.test(r)?(v=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),k=t.fontMetrics().fboxsep+(r==="colorbox"?0:v),x=k):r==="angl"?(v=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),k=4*v,x=Math.max(0,.25-n.depth)):(k=l?.2:0,x=k),a=I$(n,r,k,x,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle="solid",a.style.borderWidth=Pe(v)):r==="angl"&&v!==.049&&(a.style.borderTopWidth=Pe(v),a.style.borderRightWidth=Pe(v)),o=n.depth+x,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=Yt({positionType:"individualShift",children:[{type:"elem",elem:a,shift:o},{type:"elem",elem:n,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];w=Yt({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:a,shift:o,wrapperClasses:y}]})}return/cancel/.test(r)&&(w.height=n.height,w.depth=n.depth),/cancel/.test(r)&&!l?Ie(["mord","cancel-lap"],[w],t):Ie(["mord"],[w],t)},kp=(e,t)=>{var n,r=new $e(e.label.includes("colorbox")?"mpadded":"menclose",[fn(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+Pe(i)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};Ye({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Et(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:Sp,mathmlBuilder:kp});Ye({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Et(t[0],"color-token").color,o=Et(t[1],"color-token").color,l=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:l}},htmlBuilder:Sp,mathmlBuilder:kp});Ye({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});Ye({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:Sp,mathmlBuilder:kp});Ye({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:Sp,mathmlBuilder:kp});Ye({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var J9={};function Ks(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,l={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},u=0;u{var t=e.parser.settings;if(!t.displayMode)throw new He("{"+e.envName+"} can be used only in display mode.")},nF=new Set(["gather","gather*"]);function q_(e){if(!e.includes("ed"))return!e.includes("*")}function zo(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:l,autoTag:u,singleRow:d,emptySingleRow:p,maxNumCols:f,leqno:g}=t;if(e.gullet.beginGroup(),d||e.gullet.macros.set("\\cr","\\\\\\relax"),!o){var b=e.gullet.expandMacroAsText("\\arraystretch");if(b==null)o=1;else if(o=parseFloat(b),!o||o<0)throw new He("Invalid \\arraystretch: "+b)}e.gullet.beginGroup();var S=[],k=[S],x=[],v=[],w=u!=null?[]:void 0;function y(){u&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){w&&(e.gullet.macros.get("\\df@tag")?(w.push(e.subparse([new ks("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!u&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),v.push(R6(e));;){var N=e.parseExpression(!1,d?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var E={type:"ordgroup",mode:e.mode,body:N};n&&(E={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[E]}),S.push(E);var j=e.fetch().text;if(j==="&"){if(f&&S.length===f){if(d||l)throw new He("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(j==="\\end"){C(),S.length===1&&E.type==="styling"&&E.body.length===1&&E.body[0].type==="ordgroup"&&E.body[0].body.length===0&&(k.length>1||!p)&&k.pop(),v.length0&&(y+=.25),d.push({pos:y,isDashed:Ge[Qe]})}for(C(o[0]),r=0;r0&&($+=w,j<$&&(j=$),$=0)),t.addJot&&rGe))for(r=0;r=l)){var ie=void 0;if(i>0||t.hskipBeforeAndAfter){var oe,be;ie=(oe=(be=W)==null?void 0:be.pregap)!=null?oe:g,ie!==0&&(X=Ie(["arraycolsep"],[]),X.style.width=Pe(ie),G.push(X))}var ge=[];for(r=0;r0){for(var Bt=Vc("hline",n,p),on=Vc("hdashline",n,p),Ze=[{type:"elem",elem:ot,shift:0}];d.length>0;){var ct=d.pop(),st=ct.pos-F;ct.isDashed?Ze.push({type:"elem",elem:on,shift:st}):Ze.push({type:"elem",elem:Bt,shift:st})}ot=Yt({positionType:"individualShift",children:Ze})}if(Z.length===0)return Ie(["mord"],[ot],n);var xe=Yt({positionType:"individualShift",children:Z}),Me=Ie(["tag"],[xe],n);return Fa([ot,Me])},rF={c:"center ",l:"left ",r:"right "},Qs=function(t,n){for(var r=[],i=new $e("mtd",[],["mtr-glue"]),a=new $e("mtd",[],["mml-eqn-num"]),o=0;o0){var S=t.cols,k="",x=!1,v=0,w=S.length;S[0].type==="separator"&&(g+="top ",v=1),S[S.length-1].type==="separator"&&(g+="bottom ",w-=1);for(var y=v;y0?"left ":"",g+=D[D.length-1].length>0?"right ":"";for(var I=1;I0&&b&&(x=1),r[S]={type:"align",align:k,pregap:x,postgap:0}}return o.colSeparationType=b?"align":"alignat",o};Ks({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=xp(t[0]),r=n?[t[0]]:Et(t[0],"ordgroup").body,i=r.map(function(o){var l=_p(o),u=l.text;if("lcr".includes(u))return{type:"align",align:u};if(u==="|")return{type:"separator",separator:"|"};if(u===":")return{type:"separator",separator:":"};throw new He("Unknown column alignment: "+u,o)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return zo(e.parser,a,G_(e.envName))},htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var i=e.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!"lcr".includes(n))throw new He("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var a=zo(e.parser,r,G_(e.envName)),o=Math.max(0,...a.body.map(l=>l.length));return a.cols=new Array(o).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=zo(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=xp(t[0]),r=n?[t[0]]:Et(t[0],"ordgroup").body,i=r.map(function(l){var u=_p(l),d=u.text;if("lc".includes(d))return{type:"align",align:d};throw new He("Unknown column alignment: "+d,l)});if(i.length>1)throw new He("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},o=zo(e.parser,a,"script");if(o.body.length>0&&o.body[0].length>1)throw new He("{subarray} can contain only one column");return o},htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=zo(e.parser,t,G_(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:nk,htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){nF.has(e.envName)&&Cp(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:q_(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return zo(e.parser,t,"display")},htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:nk,htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Cp(e);var t={autoTag:q_(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return zo(e.parser,t,"display")},htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Cp(e),q$(e.parser)},htmlBuilder:Zs,mathmlBuilder:Qs});ee("\\nonumber","\\gdef\\@eqnsw{0}");ee("\\notag","\\nonumber");Ye({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new He(e.funcName+" valid only within array environment")}});var D6=J9;Ye({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!=="ordgroup")throw new He("Invalid environment name",i);for(var a="",o=0;o{var n=e.font,r=t.withFont(n);return Kt(e.body,r)},ik=(e,t)=>{var n=e.font,r=t.withFont(n);return fn(e.body,r)},L6={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Ye({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=Hf(t[0]),a=r;return a in L6&&(a=L6[a]),{type:"font",mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:rk,mathmlBuilder:ik});Ye({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:yp(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:Ha(r)}}});Ye({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,o=n.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:rk,mathmlBuilder:ik});var iF=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a;a=t.havingStyle(r);var o=Kt(e.numer,a,t);if(e.continued){var l=8.5/t.fontMetrics().ptPerEm,u=3.5/t.fontMetrics().ptPerEm;o.height=o.height0?S=3*g:S=7*g,k=t.fontMetrics().denom1):(f>0?(b=t.fontMetrics().num2,S=g):(b=t.fontMetrics().num3,S=3*g),k=t.fontMetrics().denom2);var x;if(p){var w=t.fontMetrics().axisHeight;b-o.depth-(w+.5*f){var n=new $e("mfrac",[fn(e.numer,t),fn(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var r=Mn(e.barSize,t);n.setAttribute("linethickness",Pe(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new $e("mo",[new Yn(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new $e("mo",[new Yn(e.rightDelim.replace("\\",""))]);o.setAttribute("fence","true"),i.push(o)}return $_(i)}return n},sk=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};Ye({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1],o,l=null,u=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,l="(",u=")";break;case"\\\\bracefrac":o=!1,l="\\{",u="\\}";break;case"\\\\brackfrac":o=!1,l="[",u="]";break;default:throw new Error("Unrecognized genfrac command")}var d=r==="\\cfrac",p=null;return d||r.startsWith("\\d")?p="display":r.startsWith("\\t")&&(p="text"),sk({type:"genfrac",mode:n.mode,numer:i,denom:a,continued:d,hasBarLine:o,leftDelim:l,rightDelim:u,barSize:null},p)},htmlBuilder:iF,mathmlBuilder:sF});Ye({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:i,token:r}}});var O6=["display","text","script","scriptscript"],I6=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};Ye({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=Hf(t[0]),o=a.type==="atom"&&a.family==="open"?I6(a.text):null,l=Hf(t[1]),u=l.type==="atom"&&l.family==="close"?I6(l.text):null,d=Et(t[2],"size"),p,f=null;d.isBlank?p=!0:(f=d.value,p=f.number>0);var g=null,b=t[3];if(b.type==="ordgroup"){if(b.body.length>0){var S=Et(b.body[0],"textord");g=O6[Number(S.text)]}}else b=Et(b,"textord"),g=O6[Number(b.text)];return sk({type:"genfrac",mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:p,barSize:f,leftDelim:o,rightDelim:u},g)}});Ye({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Et(t[0],"size").value,token:i}}});Ye({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=Et(t[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var o=t[2],l=a.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:l,barSize:a,leftDelim:null,rightDelim:null}}});var ak=(e,t)=>{var n=t.style,r,i;e.type==="supsub"?(r=e.sup?Kt(e.sup,t.havingStyle(n.sup()),t):Kt(e.sub,t.havingStyle(n.sub()),t),i=Et(e.base,"horizBrace")):i=Et(e,"horizBrace");var a=Kt(i.base,t.havingBaseStyle(yt.DISPLAY)),o=vp(i,t),l;if(i.isOver?l=Yt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:o,wrapperClasses:["svg-align"]}]}):l=Yt({positionType:"bottom",positionData:a.depth+.1+o.height,children:[{type:"elem",elem:o,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),r){var u=Ie(["minner",i.isOver?"mover":"munder"],[l],t);i.isOver?l=Yt({positionType:"firstBaseline",children:[{type:"elem",elem:u},{type:"kern",size:.2},{type:"elem",elem:r}]}):l=Yt({positionType:"bottom",positionData:u.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:u}]})}return Ie(["minner",i.isOver?"mover":"munder"],[l],t)},aF=(e,t)=>{var n=bp(e.label);return new $e(e.isOver?"mover":"munder",[fn(e.base,t),n])};Ye({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:t[0]}},htmlBuilder:ak,mathmlBuilder:aF});Ye({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=Et(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:Wn(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=cr(e.body,t,!1);return _$(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Do(e.body,t);return n instanceof $e||(n=new $e("mrow",[n])),n.setAttribute("href",e.href),n}});Ye({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=Et(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:n,funcName:r,token:i}=e,a=Et(t[0],"raw").string,o=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,u={};switch(r){case"\\htmlClass":u.class=a,l={command:"\\htmlClass",class:a};break;case"\\htmlId":u.id=a,l={command:"\\htmlId",id:a};break;case"\\htmlStyle":u.style=a,l={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var d=a.split(","),p=0;p{var n=cr(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=Ie(r,n,t);for(var a in e.attributes)a!=="class"&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>Do(e.body,t)});Ye({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Wn(t[0]),mathml:Wn(t[1])}},htmlBuilder:(e,t)=>{var n=cr(e.html,t,!1);return Fa(n)},mathmlBuilder:(e,t)=>Do(e.mathml,t)});var Hg=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new He("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!w9(r))throw new He("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};Ye({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},a={number:.9,unit:"em"},o={number:0,unit:"em"},l="";if(n[0])for(var u=Et(n[0],"raw").string,d=u.split(","),p=0;p{var n=Mn(e.height,t),r=0;e.totalheight.number>0&&(r=Mn(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=Mn(e.width,t));var a={height:Pe(n+r)};i>0&&(a.width=Pe(i)),r>0&&(a.verticalAlign=Pe(-r));var o=new o$(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new $e("mglyph",[]);n.setAttribute("alt",e.alt);var r=Mn(e.height,t),i=0;if(e.totalheight.number>0&&(i=Mn(e.totalheight,t)-r,n.setAttribute("valign",Pe(-i))),n.setAttribute("height",Pe(r+i)),e.width.number>0){var a=Mn(e.width,t);n.setAttribute("width",Pe(a))}return n.setAttribute("src",e.src),n}});Ye({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=Et(t[0],"size");if(n.settings.strict){var a=r[1]==="m",o=i.value.unit==="mu";a?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+i.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return T9(e.dimension,t)},mathmlBuilder(e,t){var n=Mn(e.dimension,t);return new L9(n)}});Ye({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=Ie([],[Kt(e.body,t)]),n=Ie(["inner"],[n],t)):n=Ie(["inner"],[Kt(e.body,t)]);var r=Ie(["fix"],[]),i=Ie([e.alignment],[n,r],t),a=Ie(["strut"]);return a.style.height=Pe(i.height+i.depth),i.depth&&(a.style.verticalAlign=Pe(-i.depth)),i.children.unshift(a),i=Ie(["thinbox"],[i],t),Ie(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new $e("mpadded",[fn(e.body,t)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});Ye({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var a=n==="\\("?"\\)":"$",o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:o}}});Ye({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new He("Mismatched "+e.funcName)}});var z6=(e,t)=>{switch(t.style.size){case yt.DISPLAY.size:return e.display;case yt.TEXT.size:return e.text;case yt.SCRIPT.size:return e.script;case yt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Ye({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Wn(t[0]),text:Wn(t[1]),script:Wn(t[2]),scriptscript:Wn(t[3])}},htmlBuilder:(e,t)=>{var n=z6(e,t),r=cr(n,t,!1);return Fa(r)},mathmlBuilder:(e,t)=>{var n=z6(e,t);return Do(n,t)}});var ok=(e,t,n,r,i,a,o)=>{e=Ie([],[e]);var l=n&&Ha(n),u,d;if(t){var p=Kt(t,r.havingStyle(i.sup()),r);d={elem:p,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-p.depth)}}if(n){var f=Kt(n,r.havingStyle(i.sub()),r);u={elem:f,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-f.height)}}var g;if(d&&u){var b=r.fontMetrics().bigOpSpacing5+u.elem.height+u.elem.depth+u.kern+e.depth+o;g=Yt({positionType:"bottom",positionData:b,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:Pe(-a)},{type:"kern",size:u.kern},{type:"elem",elem:e},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Pe(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(u){var S=e.height-o;g=Yt({positionType:"top",positionData:S,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:Pe(-a)},{type:"kern",size:u.kern},{type:"elem",elem:e}]})}else if(d){var k=e.depth+o;g=Yt({positionType:"bottom",positionData:k,children:[{type:"elem",elem:e},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Pe(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var x=[g];if(u&&a!==0&&!l){var v=Ie(["mspace"],[],r);v.style.marginRight=Pe(a),x.unshift(v)}return Ie(["mop","op-limits"],x,r)},lk=new Set(["\\smallint"]),ou=(e,t)=>{var n,r,i=!1,a;e.type==="supsub"?(n=e.sup,r=e.sub,a=Et(e.base,"op"),i=!0):a=Et(e,"op");var o=t.style,l=!1;o.size===yt.DISPLAY.size&&a.symbol&&!lk.has(a.name)&&(l=!0);var u,d;if(a.symbol){var p=l?"Size2-Regular":"Size1-Regular",f="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(f=a.name.slice(1),a.name=f==="oiint"?"\\iint":"\\iiint"),u=Ur(a.name,p,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),d=u.italic,f.length>0){var g=j9(f+"Size"+(l?"2":"1"),t);u=Yt({positionType:"individualShift",children:[{type:"elem",elem:u,shift:0},{type:"elem",elem:g,shift:l?.08:0}]}),a.name="\\"+f,u.classes.unshift("mop"),u.italic=d}}else if(a.body){var b=cr(a.body,t,!0);b.length===1&&b[0]instanceof Bi?(u=b[0],u.classes[0]="mop"):u=Ie(["mop"],b,t)}else{for(var S=[],k=1;k{var n;if(e.symbol)n=new $e("mo",[as(e.name,e.mode)]),lk.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new $e("mo",Pi(e.body,t));else{n=new $e("mi",[new Yn(e.name.slice(1))]);var r=new $e("mo",[as("⁡","text")]);e.parentIsSupSub?n=new $e("mrow",[n,r]):n=D9([n,r])}return n},oF={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ye({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=oF[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:ou,mathmlBuilder:hh});Ye({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Wn(r)}},htmlBuilder:ou,mathmlBuilder:hh});var lF={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ye({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:ou,mathmlBuilder:hh});Ye({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:ou,mathmlBuilder:hh});Ye({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=lF[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:ou,mathmlBuilder:hh});var ck=(e,t)=>{var n,r,i=!1,a;e.type==="supsub"?(n=e.sup,r=e.sub,a=Et(e.base,"operatorname"),i=!0):a=Et(e,"operatorname");var o;if(a.body.length>0){for(var l=a.body.map(f=>{var g="text"in f?f.text:void 0;return typeof g=="string"?{type:"textord",mode:f.mode,text:g}:f}),u=cr(l,t.withFont("mathrm"),!0),d=0;d{for(var n=Pi(e.body,t.withFont("mathrm")),r=!0,i=0;ip.toText()).join("");n=[new Yn(l)]}var u=new $e("mi",n);u.setAttribute("mathvariant","normal");var d=new $e("mo",[as("⁡","text")]);return e.parentIsSupSub?new $e("mrow",[u,d]):D9([u,d])};Ye({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:Wn(i),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:ck,mathmlBuilder:cF});ee("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Ol({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?Fa(cr(e.body,t,!1)):Ie(["mord"],cr(e.body,t,!0),t)},mathmlBuilder(e,t){return Do(e.body,t,!0)}});Ye({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=Kt(e.body,t.havingCrampedStyle()),r=Vc("overline-line",t),i=t.fontMetrics().defaultRuleThickness,a=Yt({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]});return Ie(["mord","overline"],[a],t)},mathmlBuilder(e,t){var n=new $e("mo",[new Yn("‾")]);n.setAttribute("stretchy","true");var r=new $e("mover",[fn(e.body,t),n]);return r.setAttribute("accent","true"),r}});Ye({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:Wn(r)}},htmlBuilder:(e,t)=>{var n=cr(e.body,t.withPhantom(),!1);return Fa(n)},mathmlBuilder:(e,t)=>{var n=Pi(e.body,t);return new $e("mphantom",n)}});ee("\\hphantom","\\smash{\\phantom{#1}}");Ye({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Ie(["inner"],[Kt(e.body,t.withPhantom())]),r=Ie(["fix"],[]);return Ie(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=Pi(Wn(e.body),t),r=new $e("mphantom",n),i=new $e("mpadded",[r]);return i.setAttribute("width","0px"),i}});Ye({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=Et(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=Kt(e.body,t),r=Mn(e.dy,t);return Yt({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new $e("mpadded",[fn(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}});Ye({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Ye({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,i=n[0],a=Et(t[0],"size"),o=Et(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&Et(i,"size").value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=Ie(["mord","rule"],[],t),r=Mn(e.width,t),i=Mn(e.height,t),a=e.shift?Mn(e.shift,t):0;return n.style.borderRightWidth=Pe(r),n.style.borderTopWidth=Pe(i),n.style.bottom=Pe(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=Mn(e.width,t),r=Mn(e.height,t),i=e.shift?Mn(e.shift,t):0,a=t.color&&t.getColor()||"black",o=new $e("mspace");o.setAttribute("mathbackground",a),o.setAttribute("width",Pe(n)),o.setAttribute("height",Pe(r));var l=new $e("mpadded",[o]);return i>=0?l.setAttribute("height",Pe(i)):(l.setAttribute("height",Pe(i)),l.setAttribute("depth",Pe(-i))),l.setAttribute("voffset",Pe(i)),l}});function uk(e,t,n){for(var r=cr(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a{var n=t.havingSize(e.size);return uk(e.body,n,t)};Ye({type:"sizing",names:B6,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:B6.indexOf(r)+1,body:a}},htmlBuilder:uF,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=Pi(e.body,n),i=new $e("mstyle",r);return i.setAttribute("mathsize",Pe(n.sizeMultiplier)),i}});Ye({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,o=n[0]&&Et(n[0],"ordgroup");if(o)for(var l,u=0;u{var n=Ie([],[Kt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return Ie(["mord","smash"],[n],t);if(n.children)for(var r=0;r{var n=new $e("mpadded",[fn(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});Ye({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:"sqrt",mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=Kt(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=Wc(n,t);var r=t.fontMetrics(),i=r.defaultRuleThickness,a=i;t.style.idn.height+n.depth+o&&(o=(o+f-n.height-n.depth)/2);var g=u.height-n.height-o-d;n.style.paddingLeft=Pe(p);var b=Yt({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+g)},{type:"elem",elem:u},{type:"kern",size:d}]});if(e.index){var S=t.havingStyle(yt.SCRIPTSCRIPT),k=Kt(e.index,S,t),x=.6*(b.height-b.depth),v=Yt({positionType:"shift",positionData:-x,children:[{type:"elem",elem:k}]}),w=Ie(["root"],[v]);return Ie(["mord","sqrt"],[w,b],t)}else return Ie(["mord","sqrt"],[b],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new $e("mroot",[fn(n,t),fn(r,t)]):new $e("msqrt",[fn(n,t)])}});var uv={display:yt.DISPLAY,text:yt.TEXT,script:yt.SCRIPT,scriptscript:yt.SCRIPTSCRIPT};function dF(e){return e in uv}Ye({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!dF(o))throw new Error("Unknown style: "+o);return{type:"styling",mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=uv[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont("")),uk(e.body,r,t)},mathmlBuilder(e,t){var n=uv[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(""));var i=Pi(e.body,r),a=new $e("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=o[e.style];return a.setAttribute("scriptlevel",l[0]),a.setAttribute("displaystyle",l[1]),a}});var hF=function(t,n){var r=t.base;if(r)if(r.type==="op"){var i=r.limits&&(n.style.size===yt.DISPLAY.size||r.alwaysHandleSupSub);return i?ou:null}else if(r.type==="operatorname"){var a=r.alwaysHandleSupSub&&(n.style.size===yt.DISPLAY.size||r.limits);return a?ck:null}else{if(r.type==="accent")return Ha(r.base)?P_:null;if(r.type==="horizBrace"){var o=!t.sub;return o===r.isOver?ak:null}else return null}else return null};Ol({type:"supsub",htmlBuilder(e,t){var n=hF(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,o=Kt(r,t),l,u,d=t.fontMetrics(),p=0,f=0,g=r&&Ha(r);if(i){var b=t.havingStyle(t.style.sup());l=Kt(i,b,t),g||(p=o.height-b.fontMetrics().supDrop*b.sizeMultiplier/t.sizeMultiplier)}if(a){var S=t.havingStyle(t.style.sub());u=Kt(a,S,t),g||(f=o.depth+S.fontMetrics().subDrop*S.sizeMultiplier/t.sizeMultiplier)}var k;t.style===yt.DISPLAY?k=d.sup1:t.style.cramped?k=d.sup3:k=d.sup2;var x=t.sizeMultiplier,v=Pe(.5/d.ptPerEm/x),w=null;if(u){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(o instanceof Bi||y){var C;w=Pe(-((C=o.italic)!=null?C:0))}}var N;if(l&&u){p=Math.max(p,k,l.depth+.25*d.xHeight),f=Math.max(f,d.sub2);var E=d.defaultRuleThickness,j=4*E;if(p-l.depth-(u.height-f)0&&(p+=T,f-=T)}var D=[{type:"elem",elem:u,shift:f,marginRight:v,marginLeft:w},{type:"elem",elem:l,shift:-p,marginRight:v}];N=Yt({positionType:"individualShift",children:D})}else if(u){f=Math.max(f,d.sub1,u.height-.8*d.xHeight);var I=[{type:"elem",elem:u,marginLeft:w,marginRight:v}];N=Yt({positionType:"shift",positionData:f,children:I})}else if(l)p=Math.max(p,k,l.depth+.25*d.xHeight),N=Yt({positionType:"shift",positionData:-p,children:[{type:"elem",elem:l,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var $=sv(o,"right")||"mord";return Ie([$],[o,Ie(["msupsub"],[N])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type==="horizBrace"&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var a=[fn(e.base,t)];e.sub&&a.push(fn(e.sub,t)),e.sup&&a.push(fn(e.sup,t));var o;if(n)o=r?"mover":"munder";else if(e.sub)if(e.sup){var d=e.base;d&&d.type==="op"&&d.limits&&t.style===yt.DISPLAY||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(t.style===yt.DISPLAY||d.limits)?o="munderover":o="msubsup"}else{var u=e.base;u&&u.type==="op"&&u.limits&&(t.style===yt.DISPLAY||u.alwaysHandleSupSub)||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(u.limits||t.style===yt.DISPLAY)?o="munder":o="msub"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(t.style===yt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===yt.DISPLAY)?o="mover":o="msup"}return new $e(o,a)}});Ol({type:"atom",htmlBuilder(e,t){return B_(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new $e("mo",[as(e.text,e.mode)]);if(e.family==="bin"){var r=F_(e,t);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var dk={mi:"italic",mn:"normal",mtext:"normal"};Ol({type:"mathord",htmlBuilder(e,t){return gp(e,t,"mathord")},mathmlBuilder(e,t){var n=new $e("mi",[as(e.text,e.mode,t)]),r=F_(e,t)||"italic";return r!==dk[n.type]&&n.setAttribute("mathvariant",r),n}});Ol({type:"textord",htmlBuilder(e,t){return gp(e,t,"textord")},mathmlBuilder(e,t){var n=as(e.text,e.mode,t),r=F_(e,t)||"normal",i;return e.mode==="text"?i=new $e("mtext",[n]):/[0-9]/.test(e.text)?i=new $e("mn",[n]):e.text==="\\prime"?i=new $e("mo",[n]):i=new $e("mi",[n]),r!==dk[i.type]&&i.setAttribute("mathvariant",r),i}});var $g={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Fg={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Ol({type:"spacing",htmlBuilder(e,t){if(Fg.hasOwnProperty(e.text)){var n=Fg[e.text].className||"";if(e.mode==="text"){var r=gp(e,t,"textord");return r.classes.push(n),r}else return Ie(["mspace",n],[B_(e.text,e.mode,t)],t)}else{if($g.hasOwnProperty(e.text))return Ie(["mspace",$g[e.text]],[],t);throw new He('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(Fg.hasOwnProperty(e.text))n=new $e("mtext",[new Yn(" ")]);else{if($g.hasOwnProperty(e.text))return new $e("mspace");throw new He('Unknown type of space "'+e.text+'"')}return n}});var H6=()=>{var e=new $e("mtd",[]);return e.setAttribute("width","50%"),e};Ol({type:"tag",mathmlBuilder(e,t){var n=new $e("mtable",[new $e("mtr",[H6(),new $e("mtd",[Do(e.body,t)]),H6(),new $e("mtd",[Do(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var $6={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},F6={"\\textbf":"textbf","\\textmd":"textmd"},fF={"\\textit":"textit","\\textup":"textup"},P6=(e,t)=>{var n=e.font;if(n){if($6[n])return t.withTextFontFamily($6[n]);if(F6[n])return t.withTextFontWeight(F6[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(fF[n])};Ye({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"text",mode:n.mode,body:Wn(i),font:r}},htmlBuilder(e,t){var n=P6(e,t),r=cr(e.body,n,!0);return Ie(["mord","text"],r,n)},mathmlBuilder(e,t){var n=P6(e,t);return Do(e.body,n)}});Ye({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Kt(e.body,t),r=Vc("underline-line",t),i=t.fontMetrics().defaultRuleThickness,a=Yt({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]});return Ie(["mord","underline"],[a],t)},mathmlBuilder(e,t){var n=new $e("mo",[new Yn("‾")]);n.setAttribute("stretchy","true");var r=new $e("munder",[fn(e.body,t),n]);return r.setAttribute("accentunder","true"),r}});Ye({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Kt(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return Yt({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new $e("mpadded",[fn(e.body,t)],["vcenter"]);return new $e("mrow",[n])}});Ye({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new He("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=U6(e),r=[],i=t.havingStyle(t.style.text()),a=0;ae.body.replace(/ /g,e.star?"␣":" "),To=M9,hk=`[ \r - ]`,pF="\\\\[a-zA-Z@]+",mF="\\\\[^\uD800-\uDFFF]",gF="("+pF+")"+hk+"*",bF=`\\\\( -|[ \r ]+ -?)[ \r ]*`,dv="[̀-ͯ]",vF=new RegExp(dv+"+$"),_F="("+hk+"+)|"+(bF+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(dv+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(dv+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+gF)+("|"+mF+")");class q6{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(_F,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new ks("EOF",new di(this,n,n));var r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new He("Unexpected character: '"+t[n]+"'",new ks(t[n],new di(this,n,n+1)));var i=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=t.indexOf(` -`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new ks(i,new di(this,n,this.tokenRegex.lastIndex))}}class xF{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new He("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,r){if(r===void 0&&(r=!1),r){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(t)&&(a[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var yF=ek;ee("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});ee("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});ee("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});ee("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});ee("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});ee("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ee("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var G6={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ee("\\char",function(e){var t=e.popToken(),n,r=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new He("\\char` missing argument");r=t.text.charCodeAt(0)}else n=10;if(n){if(r=G6[t.text],r==null||r>=n)throw new He("Invalid base-"+n+" digit "+t.text);for(var i;(i=G6[e.future().text])!=null&&i{var i=e.consumeArg().tokens;if(i.length!==1)throw new He("\\newcommand's first argument must be a macro name");var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new He("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!o&&!n)throw new He("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var l=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var u="",d=e.expandNextToken();d.text!=="]"&&d.text!=="EOF";)u+=d.text,d=e.expandNextToken();if(!u.match(/^\s*[0-9]+\s*$/))throw new He("Invalid number of arguments: "+u);l=parseInt(u),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:l}),""};ee("\\newcommand",e=>V_(e,!1,!0,!1));ee("\\renewcommand",e=>V_(e,!0,!1,!1));ee("\\providecommand",e=>V_(e,!0,!0,!0));ee("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});ee("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});ee("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),To[n],En.math[n],En.text[n]),""});ee("\\bgroup","{");ee("\\egroup","}");ee("~","\\nobreakspace");ee("\\lq","`");ee("\\rq","'");ee("\\aa","\\r a");ee("\\AA","\\r A");ee("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ee("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ee("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ee("ℬ","\\mathscr{B}");ee("ℰ","\\mathscr{E}");ee("ℱ","\\mathscr{F}");ee("ℋ","\\mathscr{H}");ee("ℐ","\\mathscr{I}");ee("ℒ","\\mathscr{L}");ee("ℳ","\\mathscr{M}");ee("ℛ","\\mathscr{R}");ee("ℭ","\\mathfrak{C}");ee("ℌ","\\mathfrak{H}");ee("ℨ","\\mathfrak{Z}");ee("\\Bbbk","\\Bbb{k}");ee("\\llap","\\mathllap{\\textrm{#1}}");ee("\\rlap","\\mathrlap{\\textrm{#1}}");ee("\\clap","\\mathclap{\\textrm{#1}}");ee("\\mathstrut","\\vphantom{(}");ee("\\underbar","\\underline{\\text{#1}}");ee("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ee("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ee("\\ne","\\neq");ee("≠","\\neq");ee("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ee("∉","\\notin");ee("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ee("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ee("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ee("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ee("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ee("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ee("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ee("⟂","\\perp");ee("‼","\\mathclose{!\\mkern-0.8mu!}");ee("∌","\\notni");ee("⌜","\\ulcorner");ee("⌝","\\urcorner");ee("⌞","\\llcorner");ee("⌟","\\lrcorner");ee("©","\\copyright");ee("®","\\textregistered");ee("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ee("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ee("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ee("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ee("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ee("⋮","\\vdots");ee("\\varGamma","\\mathit{\\Gamma}");ee("\\varDelta","\\mathit{\\Delta}");ee("\\varTheta","\\mathit{\\Theta}");ee("\\varLambda","\\mathit{\\Lambda}");ee("\\varXi","\\mathit{\\Xi}");ee("\\varPi","\\mathit{\\Pi}");ee("\\varSigma","\\mathit{\\Sigma}");ee("\\varUpsilon","\\mathit{\\Upsilon}");ee("\\varPhi","\\mathit{\\Phi}");ee("\\varPsi","\\mathit{\\Psi}");ee("\\varOmega","\\mathit{\\Omega}");ee("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ee("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ee("\\boxed","\\fbox{$\\displaystyle{#1}$}");ee("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ee("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ee("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ee("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ee("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var V6={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},wF=new Set(["bin","rel"]);ee("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in V6?t=V6[n]:(n.slice(0,4)==="\\not"||n in En.math&&wF.has(En.math[n].group))&&(t="\\dotsb"),t});var W_={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ee("\\dotso",function(e){var t=e.future().text;return t in W_?"\\ldots\\,":"\\ldots"});ee("\\dotsc",function(e){var t=e.future().text;return t in W_&&t!==","?"\\ldots\\,":"\\ldots"});ee("\\cdots",function(e){var t=e.future().text;return t in W_?"\\@cdots\\,":"\\@cdots"});ee("\\dotsb","\\cdots");ee("\\dotsm","\\cdots");ee("\\dotsi","\\!\\cdots");ee("\\dotsx","\\ldots\\,");ee("\\DOTSI","\\relax");ee("\\DOTSB","\\relax");ee("\\DOTSX","\\relax");ee("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ee("\\,","\\tmspace+{3mu}{.1667em}");ee("\\thinspace","\\,");ee("\\>","\\mskip{4mu}");ee("\\:","\\tmspace+{4mu}{.2222em}");ee("\\medspace","\\:");ee("\\;","\\tmspace+{5mu}{.2777em}");ee("\\thickspace","\\;");ee("\\!","\\tmspace-{3mu}{.1667em}");ee("\\negthinspace","\\!");ee("\\negmedspace","\\tmspace-{4mu}{.2222em}");ee("\\negthickspace","\\tmspace-{5mu}{.277em}");ee("\\enspace","\\kern.5em ");ee("\\enskip","\\hskip.5em\\relax");ee("\\quad","\\hskip1em\\relax");ee("\\qquad","\\hskip2em\\relax");ee("\\tag","\\@ifstar\\tag@literal\\tag@paren");ee("\\tag@paren","\\tag@literal{({#1})}");ee("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new He("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ee("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ee("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ee("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ee("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ee("\\newline","\\\\\\relax");ee("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var fk=Pe(Us["Main-Regular"][84][1]-.7*Us["Main-Regular"][65][1]);ee("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+fk+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ee("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+fk+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ee("\\hspace","\\@ifstar\\@hspacer\\@hspace");ee("\\@hspace","\\hskip #1\\relax");ee("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ee("\\ordinarycolon",":");ee("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ee("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ee("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ee("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ee("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ee("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ee("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ee("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ee("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ee("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ee("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ee("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ee("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ee("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ee("∷","\\dblcolon");ee("∹","\\eqcolon");ee("≔","\\coloneqq");ee("≕","\\eqqcolon");ee("⩴","\\Coloneqq");ee("\\ratio","\\vcentcolon");ee("\\coloncolon","\\dblcolon");ee("\\colonequals","\\coloneqq");ee("\\coloncolonequals","\\Coloneqq");ee("\\equalscolon","\\eqqcolon");ee("\\equalscoloncolon","\\Eqqcolon");ee("\\colonminus","\\coloneq");ee("\\coloncolonminus","\\Coloneq");ee("\\minuscolon","\\eqcolon");ee("\\minuscoloncolon","\\Eqcolon");ee("\\coloncolonapprox","\\Colonapprox");ee("\\coloncolonsim","\\Colonsim");ee("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ee("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ee("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ee("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ee("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ee("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ee("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ee("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ee("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ee("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ee("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ee("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ee("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ee("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ee("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ee("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ee("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ee("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ee("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ee("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ee("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ee("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ee("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ee("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ee("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ee("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ee("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ee("\\imath","\\html@mathml{\\@imath}{ı}");ee("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ee("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ee("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ee("⟦","\\llbracket");ee("⟧","\\rrbracket");ee("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ee("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ee("⦃","\\lBrace");ee("⦄","\\rBrace");ee("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ee("⦵","\\minuso");ee("\\darr","\\downarrow");ee("\\dArr","\\Downarrow");ee("\\Darr","\\Downarrow");ee("\\lang","\\langle");ee("\\rang","\\rangle");ee("\\uarr","\\uparrow");ee("\\uArr","\\Uparrow");ee("\\Uarr","\\Uparrow");ee("\\N","\\mathbb{N}");ee("\\R","\\mathbb{R}");ee("\\Z","\\mathbb{Z}");ee("\\alef","\\aleph");ee("\\alefsym","\\aleph");ee("\\Alpha","\\mathrm{A}");ee("\\Beta","\\mathrm{B}");ee("\\bull","\\bullet");ee("\\Chi","\\mathrm{X}");ee("\\clubs","\\clubsuit");ee("\\cnums","\\mathbb{C}");ee("\\Complex","\\mathbb{C}");ee("\\Dagger","\\ddagger");ee("\\diamonds","\\diamondsuit");ee("\\empty","\\emptyset");ee("\\Epsilon","\\mathrm{E}");ee("\\Eta","\\mathrm{H}");ee("\\exist","\\exists");ee("\\harr","\\leftrightarrow");ee("\\hArr","\\Leftrightarrow");ee("\\Harr","\\Leftrightarrow");ee("\\hearts","\\heartsuit");ee("\\image","\\Im");ee("\\infin","\\infty");ee("\\Iota","\\mathrm{I}");ee("\\isin","\\in");ee("\\Kappa","\\mathrm{K}");ee("\\larr","\\leftarrow");ee("\\lArr","\\Leftarrow");ee("\\Larr","\\Leftarrow");ee("\\lrarr","\\leftrightarrow");ee("\\lrArr","\\Leftrightarrow");ee("\\Lrarr","\\Leftrightarrow");ee("\\Mu","\\mathrm{M}");ee("\\natnums","\\mathbb{N}");ee("\\Nu","\\mathrm{N}");ee("\\Omicron","\\mathrm{O}");ee("\\plusmn","\\pm");ee("\\rarr","\\rightarrow");ee("\\rArr","\\Rightarrow");ee("\\Rarr","\\Rightarrow");ee("\\real","\\Re");ee("\\reals","\\mathbb{R}");ee("\\Reals","\\mathbb{R}");ee("\\Rho","\\mathrm{P}");ee("\\sdot","\\cdot");ee("\\sect","\\S");ee("\\spades","\\spadesuit");ee("\\sub","\\subset");ee("\\sube","\\subseteq");ee("\\supe","\\supseteq");ee("\\Tau","\\mathrm{T}");ee("\\thetasym","\\vartheta");ee("\\weierp","\\wp");ee("\\Zeta","\\mathrm{Z}");ee("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ee("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ee("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ee("\\bra","\\mathinner{\\langle{#1}|}");ee("\\ket","\\mathinner{|{#1}\\rangle}");ee("\\braket","\\mathinner{\\langle{#1}\\rangle}");ee("\\Bra","\\left\\langle#1\\right|");ee("\\Ket","\\left|#1\\right\\rangle");var pk=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get("|"),l=t.macros.get("\\|");t.macros.beginGroup();var u=f=>g=>{e&&(g.macros.set("|",o),i.length&&g.macros.set("\\|",l));var b=f;if(!f&&i.length){var S=g.future();S.text==="|"&&(g.popToken(),b=!0)}return{tokens:b?i:r,numArgs:0}};t.macros.set("|",u(!1)),i.length&&t.macros.set("\\|",u(!0));var d=t.consumeArg().tokens,p=t.expandTokens([...a,...d,...n]);return t.macros.endGroup(),{tokens:p.reverse(),numArgs:0}};ee("\\bra@ket",pk(!1));ee("\\bra@set",pk(!0));ee("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ee("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ee("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ee("\\angln","{\\angl n}");ee("\\blue","\\textcolor{##6495ed}{#1}");ee("\\orange","\\textcolor{##ffa500}{#1}");ee("\\pink","\\textcolor{##ff00af}{#1}");ee("\\red","\\textcolor{##df0030}{#1}");ee("\\green","\\textcolor{##28ae7b}{#1}");ee("\\gray","\\textcolor{gray}{#1}");ee("\\purple","\\textcolor{##9d38bd}{#1}");ee("\\blueA","\\textcolor{##ccfaff}{#1}");ee("\\blueB","\\textcolor{##80f6ff}{#1}");ee("\\blueC","\\textcolor{##63d9ea}{#1}");ee("\\blueD","\\textcolor{##11accd}{#1}");ee("\\blueE","\\textcolor{##0c7f99}{#1}");ee("\\tealA","\\textcolor{##94fff5}{#1}");ee("\\tealB","\\textcolor{##26edd5}{#1}");ee("\\tealC","\\textcolor{##01d1c1}{#1}");ee("\\tealD","\\textcolor{##01a995}{#1}");ee("\\tealE","\\textcolor{##208170}{#1}");ee("\\greenA","\\textcolor{##b6ffb0}{#1}");ee("\\greenB","\\textcolor{##8af281}{#1}");ee("\\greenC","\\textcolor{##74cf70}{#1}");ee("\\greenD","\\textcolor{##1fab54}{#1}");ee("\\greenE","\\textcolor{##0d923f}{#1}");ee("\\goldA","\\textcolor{##ffd0a9}{#1}");ee("\\goldB","\\textcolor{##ffbb71}{#1}");ee("\\goldC","\\textcolor{##ff9c39}{#1}");ee("\\goldD","\\textcolor{##e07d10}{#1}");ee("\\goldE","\\textcolor{##a75a05}{#1}");ee("\\redA","\\textcolor{##fca9a9}{#1}");ee("\\redB","\\textcolor{##ff8482}{#1}");ee("\\redC","\\textcolor{##f9685d}{#1}");ee("\\redD","\\textcolor{##e84d39}{#1}");ee("\\redE","\\textcolor{##bc2612}{#1}");ee("\\maroonA","\\textcolor{##ffbde0}{#1}");ee("\\maroonB","\\textcolor{##ff92c6}{#1}");ee("\\maroonC","\\textcolor{##ed5fa6}{#1}");ee("\\maroonD","\\textcolor{##ca337c}{#1}");ee("\\maroonE","\\textcolor{##9e034e}{#1}");ee("\\purpleA","\\textcolor{##ddd7ff}{#1}");ee("\\purpleB","\\textcolor{##c6b9fc}{#1}");ee("\\purpleC","\\textcolor{##aa87ff}{#1}");ee("\\purpleD","\\textcolor{##7854ab}{#1}");ee("\\purpleE","\\textcolor{##543b78}{#1}");ee("\\mintA","\\textcolor{##f5f9e8}{#1}");ee("\\mintB","\\textcolor{##edf2df}{#1}");ee("\\mintC","\\textcolor{##e0e5cc}{#1}");ee("\\grayA","\\textcolor{##f6f7f7}{#1}");ee("\\grayB","\\textcolor{##f0f1f2}{#1}");ee("\\grayC","\\textcolor{##e3e5e6}{#1}");ee("\\grayD","\\textcolor{##d6d8da}{#1}");ee("\\grayE","\\textcolor{##babec2}{#1}");ee("\\grayF","\\textcolor{##888d93}{#1}");ee("\\grayG","\\textcolor{##626569}{#1}");ee("\\grayH","\\textcolor{##3b3e40}{#1}");ee("\\grayI","\\textcolor{##21242c}{#1}");ee("\\kaBlue","\\textcolor{##314453}{#1}");ee("\\kaGreen","\\textcolor{##71B307}{#1}");var mk={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class SF{constructor(t,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new xF(yF,n.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new q6(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,r,i;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:i,end:r}=this.consumeArg(["]"])}else({tokens:i,start:n,end:r}=this.consumeArg());return this.pushToken(new ks("EOF",r.loc)),this.pushTokens(i),new ks("",di.range(n,r))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],r=t&&t.length>0;r||this.consumeSpaces();var i=this.future(),a,o=0,l=0;do{if(a=this.popToken(),n.push(a),a.text==="{")++o;else if(a.text==="}"){if(--o,o===-1)throw new He("Extra }",a)}else if(a.text==="EOF")throw new He("Unexpected end of input in a macro argument, expected '"+(t&&r?t[l]:"}")+"'",a);if(t&&r)if((o===0||o===1&&t[l]==="{")&&a.text===t[l]){if(++l,l===t.length){n.splice(-l,l);break}}else l=0}while(o!==0||r);return i.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:a}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new He("The length of delimiters doesn't match the number of args!");for(var r=n[0],i=0;ithis.settings.maxExpand)throw new He("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),r=n.text,i=n.noexpand?null:this._getExpansion(r);if(i==null||t&&i.unexpandable){if(t&&i==null&&r[0]==="\\"&&!this.isDefined(r))throw new He("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var a=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var l=a.length-1;l>=0;--l){var u=a[l];if(u.text==="#"){if(l===0)throw new He("Incomplete placeholder at end of macro body",u);if(u=a[--l],u.text==="#")a.splice(l+1,1);else if(/^[1-9]$/.test(u.text))a.splice(l,2,...o[+u.text-1]);else throw new He("Not a valid argument number",u)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new ks(t)]):void 0}expandTokens(t){var n=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),n.push(i)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(r=>r.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var r=this.lexer.catcodes[t];if(r!=null&&r!==13)return}var i=typeof n=="function"?n(this):n;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var o=i.replace(/##/g,"");o.includes("#"+(a+1));)++a;for(var l=new q6(i,this.settings),u=[],d=l.lex();d.text!=="EOF";)u.push(d),d=l.lex();u.reverse();var p={tokens:u,numArgs:a};return p}return i}isDefined(t){return this.macros.has(t)||To.hasOwnProperty(t)||En.math.hasOwnProperty(t)||En.text.hasOwnProperty(t)||mk.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:To.hasOwnProperty(t)&&!To[t].primitive}}var W6=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,$0=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Pg={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Y6={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Ep{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new SF(t,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new He("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new ks("}")),this.gullet.pushTokens(t);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(t,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(Ep.endOfExpression.has(i.text)||n&&i.text===n||t&&To[i.text]&&To[i.text].infix)break;var a=this.parseAtom(n);if(a){if(a.type==="internal")continue}else break;r.push(a)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(t){for(var n=-1,r,i=0;i=128)this.settings.strict&&(y9(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),o={type:"textord",mode:"text",loc:di.range(t),text:n};else return null;if(this.consume(),a)for(var p=0;p0?{type:"text",value:E}:void 0),E===!1?g.lastIndex=C+1:(S!==C&&w.push({type:"text",value:d.value.slice(S,C)}),Array.isArray(E)?w.push(...E):E&&w.push(E),S=C+y[0].length,v=!0),!g.global)break;y=g.exec(d.value)}return v?(S?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=K6(e,"(");let a=K6(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function _k(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Cl(n)||cp(n))&&(!t||n!==47)}xk.peek=nP;function YF(){this.buffer()}function XF(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function KF(){this.buffer()}function ZF(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function QF(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ws(this.sliceSerialize(e)).toLowerCase(),n.label=t}function JF(e){this.exit(e)}function eP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ws(this.sliceSerialize(e)).toLowerCase(),n.label=t}function tP(e){this.exit(e)}function nP(){return"["}function xk(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),l(),o(),a+=i.move("]"),a}function rP(){return{enter:{gfmFootnoteCallString:YF,gfmFootnoteCall:XF,gfmFootnoteDefinitionLabelString:KF,gfmFootnoteDefinition:ZF},exit:{gfmFootnoteCallString:QF,gfmFootnoteCall:JF,gfmFootnoteDefinitionLabelString:eP,gfmFootnoteDefinition:tP}}}function iP(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:xk},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,o){const l=a.createTracker(o);let u=l.move("[^");const d=a.enter("footnoteDefinition"),p=a.enter("label");return u+=l.move(a.safe(a.associationId(r),{before:u,after:"]"})),p(),u+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),u+=l.move((t?` -`:" ")+a.indentLines(a.containerFlow(r,l.current()),t?yk:sP))),d(),u}}function sP(e,t,n){return t===0?e:yk(e,t,n)}function yk(e,t,n){return(n?"":" ")+e}const aP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];wk.peek=dP;function oP(){return{canContainEols:["delete"],enter:{strikethrough:cP},exit:{strikethrough:uP}}}function lP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:aP}],handlers:{delete:wk}}}function cP(e){this.enter({type:"delete",children:[]},e)}function uP(e){this.exit(e)}function wk(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function dP(){return"~"}function hP(e){return e.length}function fP(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||hP,a=[],o=[],l=[],u=[];let d=0,p=-1;for(;++pd&&(d=e[p].length);++vu[v])&&(u[v]=y)}k.push(w)}o[p]=k,l[p]=x}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fu[f]&&(u[f]=w),b[f]=w),g[f]=y}o.splice(1,0,g),l.splice(1,0,b),p=-1;const S=[];for(;++p "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),gP);return i(),o}function gP(e,t,n){return">"+(n?"":" ")+e}function bP(e,t){return Q6(e,t.inConstruct,!0)&&!Q6(e,t.notInConstruct,!1)}function Q6(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ro&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function vP(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 _P(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 xP(e,t,n,r){const i=_P(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(vP(e,n)){const f=n.enter("codeIndented"),g=n.indentLines(a,yP);return f(),g}const l=n.createTracker(r),u=i.repeat(Math.max(Sk(a,i)+1,3)),d=n.enter("codeFenced");let p=l.move(u);if(e.lang){const f=n.enter(`codeFencedLang${o}`);p+=l.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);p+=l.move(" "),p+=l.move(n.safe(e.meta,{before:p,after:` -`,encode:["`"],...l.current()})),f()}return p+=l.move(` -`),a&&(p+=l.move(a+` -`)),p+=l.move(u),d(),p}function yP(e,t,n){return(n?"":" ")+e}function K_(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 wP(e,t,n,r){const i=K_(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("[");return d+=u.move(n.safe(n.associationId(e),{before:d,after:"]",...u.current()})),d+=u.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(l=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":` -`,...u.current()}))),l(),e.title&&(l=n.enter(`title${a}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),l()),o(),d}function SP(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 Nd(e){return"&#x"+e.toString(16).toUpperCase()+";"}function $f(e,t,n){const r=qc(e),i=qc(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}kk.peek=kP;function kk(e,t,n,r){const i=SP(n),a=n.enter("emphasis"),o=n.createTracker(r),l=o.move(i);let u=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const d=u.charCodeAt(0),p=$f(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(u=Nd(d)+u.slice(1));const f=u.charCodeAt(u.length-1),g=$f(r.after.charCodeAt(0),f,i);g.inside&&(u=u.slice(0,-1)+Nd(f));const b=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:p.outside},l+u+b}function kP(e,t,n){return n.options.emphasis||"*"}function CP(e,t){let n=!1;return w_(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ob}),!!((!e.depth||e.depth<3)&&N_(e)&&(t.options.setext||n))}function EP(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(CP(e,n)){const p=n.enter("headingSetext"),f=n.enter("phrasing"),g=n.containerPhrasing(e,{...a.current(),before:` -`,after:` -`});return f(),p(),g+` -`+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(` -`))+1))}const o="#".repeat(i),l=n.enter("headingAtx"),u=n.enter("phrasing");a.move(o+" ");let d=n.containerPhrasing(e,{before:"# ",after:` -`,...a.current()});return/^[\t ]/.test(d)&&(d=Nd(d.charCodeAt(0))+d.slice(1)),d=d?o+" "+d:o,n.options.closeAtx&&(d+=" "+o),u(),l(),d}Ck.peek=AP;function Ck(e){return e.value||""}function AP(){return"<"}Ek.peek=TP;function Ek(e,t,n,r){const i=K_(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("![");return d+=u.move(n.safe(e.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(l=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),l(),e.title&&(l=n.enter(`title${a}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),l()),d+=u.move(")"),o(),d}function TP(){return"!"}Ak.peek=NP;function Ak(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");const d=n.safe(e.alt,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),o();const p=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return o(),n.stack=p,a(),i==="full"||!d||d!==f?u+=l.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function NP(){return"!"}Tk.peek=jP;function Tk(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a\u007F]/.test(e.url))}jk.peek=MP;function jk(e,t,n,r){const i=K_(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,u;if(Nk(e,n)){const p=n.stack;n.stack=[],l=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),l(),n.stack=p,f}l=n.enter("link"),u=n.enter("label");let d=o.move("[");return d+=o.move(n.containerPhrasing(e,{before:d,after:"](",...o.current()})),d+=o.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=o.move("<"),d+=o.move(n.safe(e.url,{before:d,after:">",...o.current()})),d+=o.move(">")):(u=n.enter("destinationRaw"),d+=o.move(n.safe(e.url,{before:d,after:e.title?" ":")",...o.current()}))),u(),e.title&&(u=n.enter(`title${a}`),d+=o.move(" "+i),d+=o.move(n.safe(e.title,{before:d,after:i,...o.current()})),d+=o.move(i),u()),d+=o.move(")"),l(),d}function MP(e,t,n){return Nk(e,n)?"<":"["}Mk.peek=RP;function Mk(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");const d=n.containerPhrasing(e,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),o();const p=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return o(),n.stack=p,a(),i==="full"||!d||d!==f?u+=l.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function RP(){return"["}function Z_(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 DP(e){const t=Z_(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 LP(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 Rk(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 OP(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?LP(n):Z_(n);const l=e.ordered?o==="."?")":".":DP(n);let u=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&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&&(u=!0),Rk(n)===o&&p){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(a+" ".repeat(o-a.length)),l.shift(o);const u=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,l.current()),p);return u(),d;function p(f,g,b){return g?(b?"":" ".repeat(o))+f:(b?a:a+" ".repeat(o-a.length))+f}}function BP(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const HP=oh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function $P(e,t,n,r){return(e.children.some(function(o){return HP(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function FP(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Dk.peek=PP;function Dk(e,t,n,r){const i=FP(n),a=n.enter("strong"),o=n.createTracker(r),l=o.move(i+i);let u=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const d=u.charCodeAt(0),p=$f(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(u=Nd(d)+u.slice(1));const f=u.charCodeAt(u.length-1),g=$f(r.after.charCodeAt(0),f,i);g.inside&&(u=u.slice(0,-1)+Nd(f));const b=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:p.outside},l+u+b}function PP(e,t,n){return n.options.strong||"*"}function UP(e,t,n,r){return n.safe(e.value,r)}function qP(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 GP(e,t,n){const r=(Rk(n)+(n.options.ruleSpaces?" ":"")).repeat(qP(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Lk={blockquote:mP,break:J6,code:xP,definition:wP,emphasis:kk,hardBreak:J6,heading:EP,html:Ck,image:Ek,imageReference:Ak,inlineCode:Tk,link:jk,linkReference:Mk,list:OP,listItem:zP,paragraph:BP,root:$P,strong:Dk,text:UP,thematicBreak:GP};function VP(){return{enter:{table:WP,tableData:ew,tableHeader:ew,tableRow:XP},exit:{codeText:KP,table:YP,tableData:Vg,tableHeader:Vg,tableRow:Vg}}}function WP(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 YP(e){this.exit(e),this.data.inTable=void 0}function XP(e){this.enter({type:"tableRow",children:[]},e)}function Vg(e){this.exit(e)}function ew(e){this.enter({type:"tableCell",children:[]},e)}function KP(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ZP));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function ZP(e,t){return t==="|"?t:e}function QP(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=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:g,table:o,tableCell:u,tableRow:l}};function o(b,S,k,x){return d(p(b,k,x),b.align)}function l(b,S,k,x){const v=f(b,k,x),w=d([v]);return w.slice(0,w.indexOf(` -`))}function u(b,S,k,x){const v=k.enter("tableCell"),w=k.enter("phrasing"),y=k.containerPhrasing(b,{...x,before:a,after:a});return w(),v(),y}function d(b,S){return fP(b,{align:S,alignDelimiters:r,padding:n,stringLength:i})}function p(b,S,k){const x=b.children;let v=-1;const w=[],y=S.enter("table");for(;++v0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const gU={tokenize:kU,partial:!0};function bU(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:yU,continuation:{tokenize:wU},exit:SU}},text:{91:{name:"gfmFootnoteCall",tokenize:xU},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:vU,resolveTo:_U}}}}function vU(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){o=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!o||!o._balanced)return n(u);const d=ws(r.sliceSerialize({start:o.end,end:r.now()}));return d.codePointAt(0)!==94||!a.includes(d.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function _U(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)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function xU(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,o;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(f){if(a>999||f===93&&!o||f===null||f===91||hn(f))return n(f);if(f===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return i.includes(ws(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return hn(f)||(o=!0),a++,e.consume(f),f===92?p:d}function p(f){return f===91||f===92||f===93?(e.consume(f),a++,d):d(f)}}function yU(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0,l;return u;function u(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(S)}function p(S){if(o>999||S===93&&!l||S===null||S===91||hn(S))return n(S);if(S===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return a=ws(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return hn(S)||(l=!0),o++,e.consume(S),S===92?f:p}function f(S){return S===91||S===92||S===93?(e.consume(S),o++,p):p(S)}function g(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),i.includes(a)||i.push(a),Mt(e,b,"gfmFootnoteDefinitionWhitespace")):n(S)}function b(S){return t(S)}}function wU(e,t,n){return e.check(uh,t,e.attempt(gU,t,n))}function SU(e){e.exit("gfmFootnoteDefinition")}function kU(e,t,n){const r=this;return Mt(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function CU(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,l){let u=-1;for(;++u1?u(S):(o.consume(S),f++,b);if(f<2&&!n)return u(S);const x=o.exit("strikethroughSequenceTemporary"),v=qc(S);return x._open=!v||v===2&&!!k,x._close=!k||k===2&&!!v,l(S)}}}class EU{constructor(){this.map=[]}add(t,n,r){AU(this,t,n,r)}consume(t){if(this.map.sort(function(a,o){return a[0]-o[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 i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function AU(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const G=r.events[$][1].type;if(G==="lineEnding"||G==="linePrefix")$--;else break}const F=$>-1?r.events[$][1].type:null,U=F==="tableHead"||F==="tableRow"?E:u;return U===E&&r.parser.lazy[r.now().line]?n(I):U(I)}function u(I){return e.enter("tableHead"),e.enter("tableRow"),d(I)}function d(I){return I===124||(o=!0,a+=1),p(I)}function p(I){return I===null?n(I):at(I)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),b):n(I):Lt(I)?Mt(e,p,"whitespace")(I):(a+=1,o&&(o=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),o=!0,p):(e.enter("data"),f(I)))}function f(I){return I===null||I===124||hn(I)?(e.exit("data"),p(I)):(e.consume(I),I===92?g:f)}function g(I){return I===92||I===124?(e.consume(I),f):f(I)}function b(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),o=!1,Lt(I)?Mt(e,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):S(I))}function S(I){return I===45||I===58?x(I):I===124?(o=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),k):N(I)}function k(I){return Lt(I)?Mt(e,x,"whitespace")(I):x(I)}function x(I){return I===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),v):I===45?(a+=1,v(I)):I===null||at(I)?C(I):N(I)}function v(I){return I===45?(e.enter("tableDelimiterFiller"),w(I)):N(I)}function w(I){return I===45?(e.consume(I),w):I===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(I))}function y(I){return Lt(I)?Mt(e,C,"whitespace")(I):C(I)}function C(I){return I===124?S(I):I===null||at(I)?!o||i!==a?N(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):N(I)}function N(I){return n(I)}function E(I){return e.enter("tableRow"),j(I)}function j(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),j):I===null||at(I)?(e.exit("tableRow"),t(I)):Lt(I)?Mt(e,j,"whitespace")(I):(e.enter("data"),T(I))}function T(I){return I===null||I===124||hn(I)?(e.exit("data"),j(I)):(e.consume(I),I===92?D:T)}function D(I){return I===92||I===124?(e.consume(I),T):T(I)}}function MU(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,u=0,d,p,f;const g=new EU;for(;++nn[2]+1){const S=n[2]+1,k=n[3]-n[2]-1;e.add(S,k,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(a.end=Object.assign({},kc(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function nw(e,t,n,r,i){const a=[],o=kc(t.events,n);i&&(i.end=Object.assign({},o),a.push(["exit",i,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function kc(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const RU={name:"tasklistCheck",tokenize:LU};function DU(){return{text:{91:RU}}}function LU(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),a)}function a(u){return hn(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),o):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),o):n(u)}function o(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(u)}function l(u){return at(u)?t(u):Lt(u)?e.check({tokenize:OU},t,n)(u):n(u)}}function OU(e,t,n){return Mt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function IU(e){return YS([oU(),bU(),CU(e),NU(),DU()])}const zU={};function Uk(e){const t=this,n=e||zU,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(IU(n)),a.push(rU()),o.push(iU(n))}function BU(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:o,mathTextData:l}};function e(u){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},u)}function t(){this.buffer()}function n(){const u=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=u}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(u){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];p.type,this.exit(u),p.value=d;const f=p.data.hChildren[0];f.type,f.tagName,f.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function a(u){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},u),this.buffer()}function o(u){const d=this.resume(),p=this.stack[this.stack.length-1];p.type,this.exit(u),p.value=d,p.data.hChildren.push({type:"text",value:d})}function l(u){this.config.enter.data.call(this,u),this.config.exit.data.call(this,u)}}function HU(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` -`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(a,o,l,u){const d=a.value||"",p=l.createTracker(u),f="$".repeat(Math.max(Sk(d,"$")+1,2)),g=l.enter("mathFlow");let b=p.move(f);if(a.meta){const S=l.enter("mathFlowMeta");b+=p.move(l.safe(a.meta,{after:` -`,before:b,encode:["$"],...p.current()})),S()}return b+=p.move(` -`),d&&(b+=p.move(d+` -`)),b+=p.move(f),g(),b}function r(a,o,l){let u=a.value||"",d=1;for(t||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(u);)d++;const p="$".repeat(d);/[^ \r\n]/.test(u)&&(/^[ \r\n]/.test(u)&&/[ \r\n]$/.test(u)||/^\$|\$$/.test(u))&&(u=" "+u+" ");let f=-1;for(;++f]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}fh.displayName="c";fh.aliases=[];function fh(e){e.register(ea),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}Ap.displayName="cpp";Ap.aliases=[];function Ap(e){e.register(fh),(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(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return n.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//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+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//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)}e2.displayName="arduino";e2.aliases=["ino"];function e2(e){e.register(Ap),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}t2.displayName="bash";t2.aliases=["sh","shell"];function t2(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},i={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:i},{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:i},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:i.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:i.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 a=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=i.variable[1].inside,l=0;l>/g,function(V,W){return"(?:"+H[+W]+")"})}function r(O,H,V){return RegExp(n(O,H),"")}function i(O,H){for(var V=0;V>/g,function(){return"(?:"+O+")"});return O.replace(/<>/g,"[^\\s\\S]")}var a={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 o(O){return"\\b(?:"+O.trim().replace(/ /g,"|")+")\\b"}var l=o(a.typeDeclaration),u=RegExp(o(a.type+" "+a.typeDeclaration+" "+a.contextual+" "+a.other)),d=o(a.typeDeclaration+" "+a.contextual+" "+a.other),p=o(a.type+" "+a.typeDeclaration+" "+a.other),f=i(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),g=i(/\((?:[^()]|<>)*\)/.source,2),b=/@?\b[A-Za-z_]\w*\b/.source,S=n(/<<0>>(?:\s*<<1>>)?/.source,[b,f]),k=n(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,S]),x=/\[\s*(?:,\s*)*\]/.source,v=n(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[k,x]),w=n(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[f,g,x]),y=n(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=n(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,k,x]),N={keyword:u,punctuation:/[<>()?,.:[\]]/},E=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,j=/"(?:\\.|[^\\"\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,[j]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[k]),lookbehind:!0,inside:N},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[b,C]),lookbehind:!0,inside:N},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[b]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[l,S]),lookbehind:!0,inside:N},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[k]),lookbehind:!0,inside:N},{pattern:r(/(\bwhere\s+)<<0>>/.source,[b]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[v]),lookbehind:!0,inside:N},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,p,b]),inside:N}],keyword:u,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,[b]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[b]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[g]),lookbehind:!0,alias:"class-name",inside:N},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,k]),inside:N,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:N,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[b,f]),inside:{function:r(/^<<0>>/.source,[b]),generic:{pattern:RegExp(f),alias:"class-name",inside:N}}},"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,[l,S,b,C,u.source,g,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[S,g]),lookbehind:!0,greedy:!0,inside:t.languages.csharp},keyword:u,"class-name":{pattern:RegExp(C),greedy:!0,inside:N},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 D=j+"|"+E,I=n(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[D]),$=i(n(/[^"'/()]|<<0>>|\(<>*\)/.source,[I]),2),F=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,U=n(/<<0>>(?:\s*\(<<1>>*\))?/.source,[k,$]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[F,U]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[F]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[$]),inside:t.languages.csharp},"class-name":{pattern:RegExp(k),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var G=/:[^}\r\n]+/.source,X=i(n(/[^"'/()]|<<0>>|\(<>*\)/.source,[I]),2),Y=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,G]),Z=i(n(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[D]),2),Q=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Z,G]);function z(O,H){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[O]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[H,G]),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,[Y]),lookbehind:!0,greedy:!0,inside:z(Y,X)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[Q]),lookbehind:!0,greedy:!0,inside:z(Q,Z)}],char:{pattern:RegExp(E),greedy:!0}}),t.languages.dotnet=t.languages.cs=t.languages.csharp})(e)}ph.displayName="markup";ph.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function ph(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\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://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 i={};i["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},i.cdata=/^$/i;var a={"included-cdata":{pattern://i,inside:i}};a["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var o={};o[n]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:a},e.languages.insertBefore("markup","cdata",o)}}),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}lu.displayName="css";lu.aliases=[];function lu(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)}r2.displayName="diff";r2.aliases=[];function r2(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 i=n[r],a=[];/^\w+$/.test(r)||a.push(/\w+/.exec(r)[0]),r==="diff"&&a.push("bold"),t.languages.diff[r]={pattern:RegExp("^(?:["+i+`].*(?:\r -?| -|(?![\\s\\S])))+`,"m"),alias:a,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)}i2.displayName="go";i2.aliases=[];function i2(e){e.register(ea),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"]}s2.displayName="ini";s2.aliases=[];function s2(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:/=/}}a2.displayName="java";a2.aliases=[];function a2(e){e.register(ea),(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,i={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":[i,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:i.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:i.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":i,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:i.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:i.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+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}o2.displayName="regex";o2.aliases=[];function o2(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]|.)/,i={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},o="(?:[^\\\\-]|"+r.source+")",l=RegExp(o+"-"+o),u={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:l,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":a,escape:r}},"special-escape":n,"char-set":i,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":u}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{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}l2.displayName="json";l2.aliases=["webmanifest"];function l2(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}c2.displayName="kotlin";c2.aliases=["kt","kts"];function c2(e){e.register(ea),(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)}u2.displayName="less";u2.aliases=[];function u2(e){e.register(lu),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"}})}d2.displayName="lua";d2.aliases=[];function d2(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:/[\[\](){},;]|\.+|:+/}}h2.displayName="makefile";h2.aliases=[];function h2(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:/[:;(){}]/}}f2.displayName="yaml";f2.aliases=["yml"];function f2(e){(function(t){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,i="(?:"+r.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+r.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function l(u,d){d=(d||"").replace(/m/g,"")+"m";var p=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return i}).replace(/<>/g,function(){return u});return RegExp(p,d)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return i})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return i}).replace(/<>/g,function(){return"(?:"+a+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:l(/\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:l(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:l(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:l(o),lookbehind:!0,greedy:!0},number:{pattern:l(/[+-]?(?: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)}p2.displayName="markdown";p2.aliases=["md"];function p2(e){e.register(ph),(function(t){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(l){return l=l.replace(//g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+l+")")}var i=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return i}),o=/\|?[ \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("^"+a+o+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+o+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(i),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(i),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__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\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(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.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(l){["url","bold","italic","strike","code-snippet"].forEach(function(u){l!==u&&(t.languages.markdown[l].inside.content.inside[u]=t.languages.markdown[u])})}),t.hooks.add("after-tokenize",function(l){if(l.language!=="markdown"&&l.language!=="md")return;function u(d){if(!(!d||typeof d=="string"))for(var p=0,f=d.length;p]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}g2.displayName="perl";g2.aliases=[];function g2(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)}Np.displayName="markup-templating";Np.aliases=[];function Np(e){e.register(ph),(function(t){function n(r,i){return"___"+r.toUpperCase()+i+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,i,a,o){if(r.language===i){var l=r.tokenStack=[];r.code=r.code.replace(a,function(u){if(typeof o=="function"&&!o(u))return u;for(var d=l.length,p;r.code.indexOf(p=n(i,d))!==-1;)++d;return l[d]=u,p}),r.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(r,i){if(r.language!==i||!r.tokenStack)return;r.grammar=t.languages[i];var a=0,o=Object.keys(r.tokenStack);function l(u){for(var d=0;d=o.length);d++){var p=u[d];if(typeof p=="string"||p.content&&typeof p.content=="string"){var f=o[a],g=r.tokenStack[f],b=typeof p=="string"?p:p.content,S=n(i,f),k=b.indexOf(S);if(k>-1){++a;var x=b.substring(0,k),v=new t.Token(i,t.tokenize(g,r.grammar),"language-"+i,g),w=b.substring(k+S.length),y=[];x&&y.push.apply(y,l([x])),y.push(v),w&&y.push.apply(y,l([w])),typeof p=="string"?u.splice.apply(u,[d,1].concat(y)):p.content=y}}else p.content&&l(p.content)}return u}l(r.tokens)}}})})(e)}b2.displayName="php";b2.aliases=[];function b2(e){e.register(Np),(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*\()/],i=/\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,a=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,o=/[{}\[\](),:;]/;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:i,operator:a,punctuation:o};var l={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php},u=[{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:l}},{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:l}}];t.languages.insertBefore("php","variable",{string:u,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:n,string:u,"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:i,operator:a,punctuation:o}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(d){if(/<\?/.test(d.code)){var p=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(d,"php",p)}}),t.hooks.add("after-tokenize",function(d){t.languages["markup-templating"].tokenizePlaceholders(d,"php")})})(e)}v2.displayName="python";v2.aliases=["py"];function v2(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}_2.displayName="r";_2.aliases=[];function _2(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:/[(){}\[\],;]/}}x2.displayName="ruby";x2.aliases=["rb"];function x2(e){e.register(ea),(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("|")+")",i=/(?:"(?:\\.|[^"\\\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+i),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+i+/(?=:(?!:))/.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)}y2.displayName="rust";y2.aliases=[];function y2(e){(function(t){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)n=n.replace(//g,function(){return n});n=n.replace(//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)}w2.displayName="sass";w2.aliases=[];function w2(e){e.register(lu),(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)}S2.displayName="scss";S2.aliases=[];function S2(e){e.register(lu),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}k2.displayName="sql";k2.aliases=[];function k2(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:/[;[\]()`,.]/}}C2.displayName="swift";C2.aliases=[];function C2(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})}E2.displayName="typescript";E2.aliases=["ts"];function E2(e){e.register(Tp),(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)}jp.displayName="basic";jp.aliases=[];function jp(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:/[,;:()]/}}A2.displayName="vbnet";A2.aliases=[];function A2(e){e.register(jp),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 KU=["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"],iw={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 Gk(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}function ZU(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function QU(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function sw(e){return QU(e)||Gk(e)}const JU=["","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 eq(e,t){const n={},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,i=[];let a=0,o=-1,l="",u,d;n.position&&("start"in n.position||"indent"in n.position?(d=n.position.indent,u=n.position.start):u=n.position);let p=(u?u.line:0)||1,f=(u?u.column:0)||1,g=S(),b;for(a--;++a<=e.length;)if(b===10&&(f=(d?d[o]:0)||1),b=e.charCodeAt(a),b===38){const v=e.charCodeAt(a+1);if(v===9||v===10||v===12||v===32||v===38||v===60||Number.isNaN(v)||r&&v===r){l+=String.fromCharCode(b),f++;continue}const w=a+1;let y=w,C=w,N;if(v===35){C=++y;const U=e.charCodeAt(C);U===88||U===120?(N="hexadecimal",C=++y):N="decimal"}else N="named";let E="",j="",T="";const D=N==="named"?sw:N==="decimal"?Gk:ZU;for(C--;++C<=e.length;){const U=e.charCodeAt(C);if(!D(U))break;T+=String.fromCharCode(U),N==="named"&&KU.includes(T)&&(E=T,j=Ed(T))}let I=e.charCodeAt(C)===59;if(I){C++;const U=N==="named"?Ed(T):!1;U&&(E=T,j=U)}let $=1+C-w,F="";if(!(!I&&n.nonTerminated===!1))if(!T)N!=="named"&&k(4,$);else if(N==="named"){if(I&&!j)k(5,1);else if(E!==T&&(C=y+E.length,$=1+C-y,I=!1),!I){const U=E?1:3;if(n.attribute){const G=e.charCodeAt(C);G===61?(k(U,$),j=""):sw(G)?j="":k(U,$)}else k(U,$)}F=j}else{I||k(2,$);let U=Number.parseInt(T,N==="hexadecimal"?16:10);if(tq(U))k(7,$),F="�";else if(U in iw)k(6,$),F=iw[U];else{let G="";nq(U)&&k(6,$),U>65535&&(U-=65536,G+=String.fromCharCode(U>>>10|55296),U=56320|U&1023),F=G+String.fromCharCode(U)}}if(F){x(),g=S(),a=C-1,f+=C-w+1,i.push(F);const U=S();U.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,F,{start:g,end:U},e.slice(w-1,C)),g=U}else T=e.slice(w-1,C),l+=T,f+=T.length,a=C-1}else b===10&&(p++,o++,f=0),Number.isNaN(b)?x():(l+=String.fromCharCode(b),f++);return i.join("");function S(){return{line:p,column:f,offset:a+((u?u.offset:0)||0)}}function k(v,w){let y;n.warning&&(y=S(),y.column+=w,y.offset+=w,n.warning.call(n.warningContext||void 0,JU[v],y,v))}function x(){l&&(i.push(l),n.text&&n.text.call(n.textContext||void 0,l,{start:g,end:S()}),l="")}}function tq(e){return e>=55296&&e<=57343||e>1114111}function nq(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 rq=0,P0={},fr={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++rq}),e.__id},clone:function e(t,n){n=n||{};var r,i;switch(fr.util.type(t)){case"Object":if(i=fr.util.objId(t),n[i])return n[i];r={},n[i]=r;for(var a in t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case"Array":return i=fr.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(o,l){r[l]=e(o,n)}),r);default:return t}}},languages:{plain:P0,plaintext:P0,text:P0,txt:P0,extend:function(e,t){var n=fr.util.clone(fr.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||fr.languages;var i=r[e],a={};for(var o in i)if(i.hasOwnProperty(o)){if(o==t)for(var l in n)n.hasOwnProperty(l)&&(a[l]=n[l]);n.hasOwnProperty(o)||(a[o]=i[o])}var u=r[e];return r[e]=a,fr.languages.DFS(fr.languages,function(d,p){p===u&&d!=e&&(this[d]=a)}),a},DFS:function e(t,n,r,i){i=i||{};var a=fr.util.objId;for(var o in t)if(t.hasOwnProperty(o)){n.call(t,o,t[o],r||o);var l=t[o],u=fr.util.type(l);u==="Object"&&!i[a(l)]?(i[a(l)]=!0,e(l,n,null,i)):u==="Array"&&!i[a(l)]&&(i[a(l)]=!0,e(l,n,o,i))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(fr.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=fr.tokenize(r.code,r.grammar),fr.hooks.run("after-tokenize",r),gd.stringify(fr.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 i=new iq;return pf(i,i.head,e),Vk(e,i,t,i.head,0),aq(i)},hooks:{all:{},add:function(e,t){var n=fr.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=fr.hooks.all[e];if(!(!n||!n.length))for(var r=0,i;i=n[r++];)i(t)}},Token:gd};function gd(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||"").length|0}function aw(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function Vk(e,t,n,r,i,a){for(var o in n)if(!(!n.hasOwnProperty(o)||!n[o])){var l=n[o];l=Array.isArray(l)?l:[l];for(var u=0;u=a.reach);v+=x.value.length,x=x.next){var w=x.value;if(t.length>e.length)return;if(!(w instanceof gd)){var y=1,C;if(g){if(C=aw(k,v,e,f),!C||C.index>=e.length)break;var T=C.index,N=C.index+C[0].length,E=v;for(E+=x.value.length;T>=E;)x=x.next,E+=x.value.length;if(E-=x.value.length,v=E,x.value instanceof gd)continue;for(var j=x;j!==t.tail&&(Ea.reach&&(a.reach=F);var U=x.prev;I&&(U=pf(t,U,I),v+=I.length),sq(t,U,y);var G=new gd(o,p?fr.tokenize(D,p):D,b,D);if(x=pf(t,U,G),$&&pf(t,x,$),y>1){var X={cause:o+","+u,reach:F};Vk(e,t,n,x.prev,v,X),a&&X.reach>a.reach&&(a.reach=X.reach)}}}}}}function iq(){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 pf(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function sq(e,t,n){for(var r=t.next,i=0;in)return null;try{return dt.highlight(e,t).children}catch{return null}}function Kk(e,t){var n;return e.type==="text"?e.value??"":e.type!=="element"?null:h.jsx("span",{className:(((n=e.properties)==null?void 0:n.className)??[]).join(" "),children:(e.children??[]).map(Kk)},t)}function pq(e,t,n=3e5){var r;return((r=Xk(e,t,n))==null?void 0:r.map(Kk))??e}function Zk(e,t,n=3e5){const r=Xk(e,t,n);if(!r)return e.split(` -`);const i=[];let a=[];const o=[];let l=0;const u=p=>{let f=p;for(let g=o.length-1;g>=0;g--)f=h.jsx("span",{className:o[g],children:f},l++);a.push(f)},d=p=>{var f;if(p.type==="text"){(p.value??"").split(` -`).forEach((g,b)=>{b>0&&(i.push(a),a=[]),g&&u(g)});return}p.type==="element"&&(o.push((((f=p.properties)==null?void 0:f.className)??[]).join(" ")),(p.children??[]).forEach(d),o.pop())};return r.forEach(d),i.push(a),i}function Qk(e){return Array.isArray(e)?e.length===0:e===""}const ow=/^\d+(?:,\d{3})*(?:\.\d+)?(?:\s*[–—-]\s*\$?\d+(?:,\d{3})*(?:\.\d+)?)?(?:\/[A-Za-z][A-Za-z0-9-]*)?/;function Yc(e,t,n){let r=t;for(;e[r]===n;)r+=1;return r-t}function jd(e,t){let n=0;for(let r=t-1;r>=0&&e[r]==="\\";r-=1)n+=1;return n%2===1}function mv(e){var o;let t=!1,n=0,r=0,i=0;for(;r[ \t]?/.exec(e.slice(r));if(l){r+=l[0].length,i+=1;continue}const u=/^ {0,3}(?:[-+*]|\d+[.)])[ \t]+/.exec(e.slice(r));if(!u)break;r+=u[0].length,n+=u[0].length,t=!0}const a=((o=/^[ \t]*/.exec(e.slice(r)))==null?void 0:o[0].length)??0;return{hasListMarker:t,indentation:a,listIndent:n,offset:r+a,quoteDepth:i}}function mq(e,t){const n=e[t];if(n!=="`"&&n!=="~"||jd(e,t)||Yc(e,t,n)<3)return!1;const r=e.lastIndexOf(` -`,t-1)+1,i=e.indexOf(` -`,t),a=e.slice(r,i===-1?e.length:i),o=mv(a);return o.indentation<=3&&r+o.offset===t}function gq(e,t){const n=e[t],r=Yc(e,t,n),i=e.lastIndexOf(` -`,t-1)+1,a=e.indexOf(` -`,t),o=mv(e.slice(i,a===-1?e.length:a));let l=e.indexOf(` -`,t+r);if(l===-1)return e.length;for(l+=1;l=o.listIndent&&f.indentation<=o.listIndent+3&&b>=r&&/^[ \t\r]*$/.test(e.slice(g+b,d)))return u===-1?e.length:u+1;if(u===-1)return e.length;l=u+1}return e.length}function bq(e,t,n){const r=Yc(e,t,"`");let i=t+r;for(;i")return i+1}return n?e.length:null}function _q(e){const t=[];for(let n=0;n|()[\]-]+$/.test(n)?/^[eE][+-]?\d+$/.test(n)||/[+*/=^_{}\\<>|()]/.test(n)?!0:/^[A-Za-z][A-Za-z0-9]*$/.test(n):!1:!0}function yq(e,{predictMath:t=!1}={}){const n=_q(e),r=new Set,i=new Set;for(let d=0;d`$$${i}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,i)=>`$$${i}$$`);return t.predictMath&&(n=n.replace(/\\\[([\s\S]*)$/,(r,i)=>`$$${i}`).replace(/\\\(([\s\S]*)$/,(r,i)=>`$$${i}`)),yq(n,t)}function Jk(e,t={}){let n="",r=0,i=0;for(;i{var a;(a=navigator.clipboard)==null||a.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return h.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[h.jsx("button",{className:"md-code-copy absolute top-1.5 right-1.5 inline-flex items-center justify-center w-6.5 h-6.5 text-muted bg-background border border-border-variant rounded-sm opacity-0 transition-[opacity,color] duration-120 ease-standard [&:hover]:text-text [&:hover]:border-muted",title:"Copy","aria-label":"Copy code",onClick:i,children:n?h.jsx(Di,{size:13}):h.jsx(n_,{size:13})}),h.jsx("pre",{children:h.jsx("code",{children:pq(e,t,wq)})})]})}function kq(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 cw(e,t,n){let r=t.line,i=t.column;for(let a=0;a]*?)\/?>/gi,r=[];let i=0,a=!1;for(const o of t.matchAll(n)){const l=(o[1]??"").toLowerCase(),u=kq(o[2]??"");if(!u[l==="run"?"id":"path"])continue;a=!0,o.index>i&&r.push({type:"text",value:t.slice(i,o.index),position:Wg(e,i,o.index)});const p=o.index+o[0].length;r.push({children:[],data:{hName:l==="run"?"run-mention":"file-mention",hProperties:u},position:Wg(e,o.index,p),type:l==="run"?"runMention":"fileMention"}),i=p}return a?(ieC(e)}function Eq(){return e=>{const t=n=>{var r;for(const i of["href","src"])n.properties&&Object.hasOwn(n.properties,i)&&(n.properties[i]=h9(String(n.properties[i]||"")));(r=n.children)==null||r.forEach(t)};t(e)}}function dw({path:e,lines:t,exp:n,onOpenFile:r}){const i=e.split("/").pop()||e,a=t&&Number.parseInt(t,10)||void 0,o=a!=null?`${i}:${a}`:i;return h.jsxs("button",{className:"file-chip",title:`Open ${e}`,onClick:()=>r==null?void 0:r(e,a,n),disabled:!r,children:[h.jsx(eS,{size:12}),h.jsx("span",{className:"file-chip-label",children:o})]})}function Aq({id:e,label:t,onOpenRun:n}){return h.jsxs("button",{className:"file-chip run-chip",title:`Open logs for run ${e}`,onClick:()=>n==null?void 0:n(e),disabled:!n,children:[h.jsx(s_,{size:12}),h.jsx("span",{className:"file-chip-label",children:t||"logs"})]})}const tC={singleDollarTextMath:!0},Tq=k_().use(M_).use(Uk).use(qk,tC).use(Cq).use(Df).use(Eq).use(vk);function Nq(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const nC={code:({node:e,className:t,children:n,...r})=>{const i=t??"",a=/language-(\w+)/.exec(i),o=String(n??"").replace(/\n$/,"");if(!(a!=null||o.includes(` -`)))return h.jsx("code",{className:i,...r,children:n});const u=a?fv(a[1]):null;return h.jsx(Sq,{code:o,lang:u})},pre:({children:e})=>h.jsx(h.Fragment,{children:e})},La=R.memo(function({text:t,onOpenFile:n,onOpenRun:r,predict:i=!1}){const a=R.useMemo(()=>({"file-mention":o=>h.jsx(dw,{path:o.path,lines:o.lines,exp:o.exp,onOpenFile:n}),"run-mention":o=>h.jsx(Aq,{id:o.id,label:o.label,onOpenRun:r}),a:({node:o,href:l,children:u,...d})=>l&&Nq(l)&&n?h.jsx(dw,{path:decodeURI(l),onOpenFile:n}):h.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",...d,children:u}),...nC}),[n,r]);return h.jsx("div",{"data-streaming":i||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-[color-mix(in_oklab,_var(--border)_50%,_transparent)] [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-[0.9em] [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-[1.05em] [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-[0.9em] [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-[1.05em] [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-[1.05em] [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-[1.05em] [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-[1.05em] [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:pl-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:pl-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-md [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-left [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-left [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pr-0 [&_blockquote]:pb-0.5 [&_blockquote]:pl-2.5 [&_blockquote]:border-l-[3px] [&_blockquote]:border-l-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text",children:h.jsx(WB,{content:Jk(t,{predictMath:i}),processor:Tq,components:a,predict:i})})}),hw=["prompt-actions flex flex-wrap [&_.btn-primary]:inline-flex","[&_.btn-primary]:items-center [&_.btn-primary]:gap-1.5 [&_.btn-primary]:py-1.5 [&_.btn-primary]:px-[13px]","[&_.btn-primary]:font-[inherit] [&_.btn-primary]:text-sm","[&_.btn-primary]:font-semibold [&_.btn-primary]:rounded-sm","[&_.btn-primary]:cursor-pointer [&_.btn-primary]:transition-[background,border-color] [&_.btn-primary]:duration-80 [&_.btn-primary]:ease-standard","[&_.btn-ghost]:inline-flex [&_.btn-ghost]:items-center [&_.btn-ghost]:gap-1.5","[&_.btn-ghost]:py-1.5 [&_.btn-ghost]:px-[13px] [&_.btn-ghost]:font-[inherit] [&_.btn-ghost]:text-sm","[&_.btn-ghost]:font-semibold [&_.btn-ghost]:rounded-sm","[&_.btn-ghost]:cursor-pointer [&_.btn-ghost]:transition-[background,border-color] [&_.btn-ghost]:duration-80 [&_.btn-ghost]:ease-standard","[&_.btn-ghost]:border-border [&_button:disabled]:opacity-50","[&_button:disabled]:cursor-default plan-strip-actions gap-y-1.5 gap-x-2 justify-end","[&_.btn-primary]:bg-transparent [&_.btn-primary]:border [&_.btn-primary]:border-text","[&_.btn-primary]:text-text [&_.btn-ghost]:bg-transparent","[&_.btn-ghost]:border [&_.btn-ghost]:border-text [&_.btn-ghost]:text-text","[&_.btn-primary:hover:not(:disabled)]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]","[&_.btn-primary:hover:not(:disabled)]:border-text","[&_.btn-primary:hover:not(:disabled)]:text-text [&_.btn-primary:hover:not(:disabled)]:opacity-100","[&_.btn-ghost:hover:not(:disabled)]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]","[&_.btn-ghost:hover:not(:disabled)]:border-text","[&_.btn-ghost:hover:not(:disabled)]:text-text [&_.btn-ghost:hover:not(:disabled)]:opacity-100","[&_.plan-strip-primary]:bg-text [&_.plan-strip-primary]:border-text","[&_.plan-strip-primary]:text-background","[&_.plan-strip-primary:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--text)_85%,_var(--base))]","[&_.plan-strip-primary:hover:not(:disabled)]:border-text","[&_.plan-strip-primary:hover:not(:disabled)]:text-background","[&_.plan-strip-caret]:rounded-tl-none [&_.plan-strip-caret]:rounded-bl-none","[&_.plan-strip-caret]:py-0 [&_.plan-strip-caret]:px-1.5 [&_.plan-strip-caret]:flex","[&_.plan-strip-caret]:items-center","[&_.plan-strip-caret]:border-l [&_.plan-strip-caret]:border-l-[color-mix(in_oklab,_var(--base)_35%,_var(--text))]"].join(" ");function jq({synthesized:e,agentLabel:t,onView:n,onApprove:r,showResumeModes:i,onReject:a,onRevise:o}){const[l,u]=R.useState(!1),d=R.useRef(null),[p,f]=R.useState(!1),[g,b]=R.useState(""),S=R.useRef(null);R.useEffect(()=>{if(!l)return;const x=v=>{d.current&&!d.current.contains(v.target)&&u(!1)};return window.addEventListener("pointerdown",x),()=>window.removeEventListener("pointerdown",x)},[l]),R.useEffect(()=>{var x;p&&((x=S.current)==null||x.focus())},[p]);const k=()=>{o(g.trim()||"no specific feedback — use your judgment"),b(""),f(!1)};return h.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-l-[3px] border-l-accent-blue rounded-md bg-surface shadow-[0_2px_10px_rgb(0_0_0_/_6%)]",children:[h.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[h.jsx(s_,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),h.jsx("span",{className:"plan-strip-title text-md font-semibold whitespace-nowrap",children:e?`${t} is ready to proceed`:`${t} proposed a plan`}),h.jsx("button",{className:"plan-strip-open ml-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-md cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",onClick:n,children:"Open plan"})]}),p?h.jsxs(h.Fragment,{children:[h.jsx("textarea",{ref:S,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-md font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:"What should change? (optional)",rows:2,value:g,onChange:x=>b(x.target.value),onKeyDown:x=>{x.key==="Escape"?(x.preventDefault(),b(""),f(!1)):x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),k())}}),h.jsxs("div",{className:hw,children:[h.jsx("button",{className:"btn-ghost",onClick:()=>{b(""),f(!1)},children:"Back"}),h.jsx("span",{className:"plan-strip-spacer flex-1"}),h.jsxs("button",{className:"btn-primary plan-strip-primary",onClick:k,children:["Revise",h.jsx(Q8,{size:13})]})]})]}):h.jsxs("div",{className:hw,children:[h.jsx("button",{className:"btn-ghost",onClick:a,children:"Reject"}),h.jsx("button",{className:"btn-ghost",onClick:()=>f(!0),children:"Revise…"}),h.jsx("span",{className:"plan-strip-spacer flex-1"}),i?h.jsxs("div",{className:"plan-strip-approve relative flex [&_.btn-primary:first-child]:rounded-tr-none [&_.btn-primary:first-child]:rounded-br-none",ref:d,children:[h.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>r("auto"),children:"Accept and auto mode"}),h.jsx("button",{className:"btn-primary plan-strip-primary plan-strip-caret","aria-label":"More approval options",onClick:()=>u(x=>!x),children:h.jsx(Rl,{size:13})}),l&&h.jsx("div",{className:"plan-strip-menu absolute right-0 bottom-[calc(100%_+_4px)] flex flex-col min-w-47.5 p-1 border border-border rounded-md bg-surface shadow-[0_6px_20px_rgb(0_0_0_/_12%)] z-6 [&_button]:text-left [&_button]:py-[7px] [&_button]:px-[9px] [&_button]:border-0 [&_button]:rounded-sm [&_button]:bg-transparent [&_button]:text-text [&_button]:text-md [&_button]:cursor-pointer [&_button:hover]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]",children:h.jsx("button",{onClick:()=>{u(!1),r("bypassPermissions")},children:"Accept and bypass all"})})]}):h.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>r(),children:"Accept plan"})]})]})}function rC(){const[e,t]=R.useState(null),[n,r]=R.useState(null);return R.useEffect(()=>{let i=!1;const a=rL(o=>{i=!0,t(o)});return YR().then(o=>!i&&t(o)).catch(o=>r(o instanceof Error?o.message:String(o))),a},[]),{status:e,error:n,apply:t}}function Mq(){const{status:e}=rC(),[t,n]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null;return!r||t===r?null:h.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-xs text-text bg-surface border-b border-b-border",role:"status",children:[h.jsx(rh,{size:13,className:"shrink-0 text-subtext"}),h.jsxs("span",{className:"min-w-0",children:["Updated to ",h.jsx("strong",{className:"font-semibold",children:r}),". Restart to use it."]}),h.jsx("button",{type:"button",className:"ml-auto shrink-0 p-1 rounded-sm text-subtext hover:text-text hover:bg-highlight","aria-label":"Dismiss",onClick:()=>n(r),children:h.jsx(qr,{size:13})})]})}const iC="orx:theme";function Rq(){try{const e=localStorage.getItem(iC);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let Md=Rq();const gv=new Set;function Dq(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function T2(){document.documentElement.dataset.theme=Dq(Md)}function Lq(e){Md=e;try{localStorage.setItem(iC,e)}catch{}T2();for(const t of gv)t()}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Md==="system"&&T2()});T2();function Oq(e){return gv.add(e),()=>gv.delete(e)}function Iq(){return[R.useSyncExternalStore(Oq,()=>Md,()=>Md),Lq]}function sC({onSaved:e}){const[t,n]=R.useState(""),[r,i]=R.useState(!1),[a,o]=R.useState(null);async function l(u){if(u.preventDefault(),!(r||!t.trim())){i(!0),o(null);try{e(await SD(t.trim())),n("")}catch(d){o(d instanceof Error?d.message:String(d))}finally{i(!1)}}}return h.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:font-mono [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap",onSubmit:l,children:[h.jsx("input",{type:"password",value:t,onChange:u=>n(u.target.value),placeholder:"ghp_… personal access token",autoComplete:"off"}),h.jsx("button",{type:"submit",className:fi,disabled:r||!t.trim(),children:r?"Checking…":"Save"}),h.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,workflow&description=orx",target:"_blank",rel:"noreferrer",children:"Create a token ↗"}),a&&h.jsx("div",{className:"error",children:a})]})}function zq(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"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return"This machine";default:return e||"—"}}function Bq({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[h.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"}),h.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"}),h.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),h.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"}),h.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"}),h.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-0.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-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),h.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-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.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-0.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-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.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-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Hq({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[h.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"}),h.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)"}),h.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)"}),h.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"}),h.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"}),h.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)"}),h.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)"}),h.jsxs("defs",{children:[h.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#BFF9B4"}),h.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),h.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#80EE64"}),h.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),h.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),h.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),h.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),h.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),h.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),h.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#BFF9B4"}),h.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),h.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#80EE64"}),h.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),h.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),h.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),h.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),h.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),h.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function $q({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:h.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-0.5-.623h-.804l-0.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-0.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-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.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-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.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-0.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-0.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-0.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 Fq({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:h.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function Pq({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[h.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),h.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function Mp({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:h.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-0.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-0.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 aC({kind:e,size:t=16}){switch(e){case"modal_job":return h.jsx(Hq,{size:t});case"hf_job":return h.jsx(Bq,{size:t});case"k8s_job":return h.jsx($q,{size:t});case"ssh_job":return h.jsx(n3,{size:t});case"slurm_job":return h.jsx(zj,{size:t});case"ray_job":return h.jsx(Fq,{size:t});case"openresearch_job":return h.jsx(Pq,{size:t});case"local_job":return h.jsx(RM,{size:t});default:return h.jsx(n3,{size:t})}}function N2({backend:e}){const t=l_(e),n=KD(e);return t?h.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[h.jsx(aC,{kind:t}),h.jsx("span",{className:"backend-name",children:zq(t)}),n&&h.jsx("span",{className:`backend-detail ${tn}`,children:n})]}):h.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function oC({value:e,max:t,label:n,caption:r,fillColor:i}){const a=t>0?Math.min(100,Math.round(e/t*100)):0;return h.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,children:[h.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:h.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${a}%`,background:i}})}),(n!==void 0||r!==void 0)&&h.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[h.jsx("span",{children:n??`${a}%`}),r]})]})}const fw={done:{className:"st-done",live:!1},failed:{className:"st-failed",live:!1},running:{className:"st-running",live:!0},starting:{className:"st-starting",live:!0},cancelling:{className:"st-cancelling",live:!0},cancelled:{className:"st-cancelled",live:!1},editing:{className:"st-editing",live:!0},idle:{className:"st-idle",live:!1}};function Uq(e){return fw[e]??fw.idle}function qq(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ma({status:e,label:t}){const n=Uq(e);return h.jsxs("span",{className:`${p_} ${n.className}${n.live?" live":""}`,children:[h.jsx("span",{className:"dot"}),t??qq(e)]})}const Oa=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Vs=["kv grid grid-cols-[auto_1fr] gap-y-[3px] gap-x-3.5 text-md","[&_.k]:text-subtext [&_.v]:font-mono [&_.v]:text-sm","[&_.v]:break-all"].join(" "),Cn=["settings-note mt-2.5 mx-0 mb-0 text-sm py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),mh=["form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-mono","[&_.repo-hint]:font-normal [&_.repo-hint]:text-xs","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-left","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-[0_2px_8px_rgb(0_0_0_/_5%)]","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-semibold [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-semibold","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pr-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:pl-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))]","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-left [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-md","[&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:font-mono [&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-md [&_.paper-pick_.title]:font-semibold","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-xs [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5 [&_.new-project-actions_.primary]:ml-auto","[&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),ml=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_p]:text-muted [&_p]:text-sm"].join(" "),pw=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-md [&_.kv_.v]:break-normal [&_.kv_.v.mono]:font-mono","[&_.kv_.v.mono]:text-sm [&_.kv_.v_.mono]:font-mono","[&_.kv_.v_.mono]:text-sm [&_.kv_.k.mono]:font-mono","[&_.kv_.k.mono]:text-sm [@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),Yg=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Ju=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function Xg(e){return e.agentReady?{cls:"ok",label:"Signed in"}:e.installed?e.authState==="unknown"?{cls:"warn",label:"Unable to verify"}:e.authState==="unsupported"?{cls:"warn",label:"Update required"}:{cls:"warn",label:"Not signed in"}:{cls:"warn",label:"Not installed"}}function Gq({h:e}){return e.authMethod?h.jsx(h.Fragment,{children:e.authMethod==="oauth"?"OAuth (subscription login)":"API key"}):h.jsx(h.Fragment,{children:"—"})}function Vq(){const[e,t]=R.useState(null),[n,r]=R.useState("claude-code"),[i,a]=R.useState(!1),o=(u,d=!1)=>{a(!0),Tf(u,d).then(t).catch(()=>{}).finally(()=>a(!1))};R.useEffect(()=>o(!1),[]),R.useEffect(()=>u_(()=>o(!0)),[]);const l=e==null?void 0:e.find(u=>u.id===n);return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Harnesses"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",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."}),h.jsx("div",{className:"harness-tabs flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-md [&_button]:font-semibold [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(e??[]).map(u=>h.jsxs("button",{className:u.id===n?"active":"",onClick:()=>r(u.id),children:[u.name,h.jsx("span",{className:`harness-dot w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${Xg(u).cls}`})]},u.id))}),e?l?h.jsxs("div",{className:Oa,children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("span",{className:`${lr} ${Xg(l).cls}`,children:Xg(l).label}),h.jsx("div",{className:"spacer",style:{flex:1}}),h.jsxs("button",{className:Kn,onClick:()=>o(!0,!0),disabled:i,children:[h.jsx(rh,{size:12,className:i?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," Refresh"]})]}),h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Binary"}),h.jsx("span",{className:"v",children:l.binPath??"not found on PATH"}),h.jsx("span",{className:"k",children:"Version"}),h.jsx("span",{className:"v",children:l.version??"—"}),h.jsx("span",{className:"k",children:"Auth"}),h.jsx("span",{className:"v",children:h.jsx(Gq,{h:l})}),l.account&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:l.id==="opencode"?"Providers":"Account"}),h.jsx("span",{className:"v",children:l.account})]}),l.org&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:"Org"}),h.jsx("span",{className:"v",children:l.org})]}),l.plan&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:"Plan"}),h.jsx("span",{className:"v",children:l.plan})]}),h.jsx("span",{className:"k",children:"Agent models"}),h.jsx("span",{className:"v",children:l.models.length>0?`${l.models.length} available — ${l.models.slice(0,4).map(u=>Af(u)).join(", ")}${l.models.length>4?", …":""}`:"none"})]}),!l.agentReady&&l.agentNote&&h.jsx("p",{className:Cn,children:l.agentNote})]}):null:h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Detecting harnesses…"]})]})}function Wq({s:e}){if(!e.configured)return h.jsx("span",{className:lr,children:"Not configured"});const t=e.preflight;return t.kubectlFound?t.reachable?t.canCreateJobs?h.jsx("span",{className:Cs,children:"Connected"}):h.jsx("span",{className:Li,children:"No job-create permission"}):h.jsx("span",{className:Li,children:"Cluster unreachable"}):h.jsx("span",{className:Li,children:"kubectl not found"})}function Yq(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(""),[u,d]=R.useState(!1),[p,f]=R.useState(null),g=k=>{t(k),a(k.context??""),l(k.namespace)};R.useEffect(()=>{QR().then(g).catch(k=>r(k instanceof Error?k.message:String(k)))},[]);const b=e!==null&&i===(e.context??"")&&o.trim()===e.namespace;async function S(k){if(k.preventDefault(),!u){d(!0),f(null);try{g(await JR({context:i,namespace:o.trim()}))}catch(x){f(x instanceof Error?x.message:String(x))}finally{d(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on your own cluster with ",h.jsx("code",{children:"--backend k8s"}),". The run's resources (image, GPUs, topology) come from a manifest committed on the experiment branch (default ",h.jsx("code",{children:".orx/k8s.yaml"}),"); only the cluster context and namespace live here. Auth comes from your kubeconfig."]}),n?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Cluster"}),h.jsx("span",{className:"v",children:h.jsx(Wq,{s:e})})]}),e.preflight.error&&h.jsx("p",{className:Cn,children:e.preflight.error}),h.jsxs("form",{className:mh,onSubmit:S,children:[h.jsxs("div",{className:"row2",children:[h.jsxs("label",{children:["Context",h.jsxs("select",{value:i,onChange:k=>a(k.target.value),children:[h.jsxs("option",{value:"",children:["kubectl default",e.currentContext?` (${e.currentContext})`:""]}),e.contexts.map(k=>h.jsx("option",{value:k,children:k},k))]})]}),h.jsxs("label",{children:["Namespace",h.jsx("input",{className:tn,type:"text",value:o,onChange:k=>l(k.target.value),placeholder:"default",autoComplete:"off",spellCheck:!1})]})]}),p&&h.jsx("div",{className:"error",children:p}),h.jsx("div",{className:"actions",children:h.jsx("button",{type:"submit",className:Wr,disabled:u||b,children:u?"Saving…":"Save"})})]}),h.jsxs("div",{className:Oa,children:[h.jsx("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:h.jsx("h3",{children:"Run manifest"})}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Each run applies the manifest committed on its experiment branch — default"," ",h.jsx("code",{children:".orx/k8s.yaml"}),", or ",h.jsx("code",{children:"--manifest "}),". It declares whatever the run needs (image, GPU requests, an Indexed Job across nodes, extra Services, …); orx injects the run script as ",h.jsx("code",{children:"$ORX_SCRIPT"}),", the"," ",h.jsx("code",{children:"orx-env"})," Secret, run labels, and a default timeout, and requires exactly one Job (or one labelled ",h.jsx("code",{children:'orx-primary: "true"'}),") whose completion is the run's. Logs follow that Job's leader pod. Use"," ",h.jsx("code",{children:"{{ORX_RUN}}"})," in resource names to keep re-runs collision-free."]})]})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Checking kubectl…"]})]})}const Xq={env:"MODAL_TOKEN_ID env var",syncedEnv:"~/.openresearch/env",modalToml:"~/.modal.toml (modal token new)"};function Kq({s:e}){return e.ready?h.jsx("span",{className:Cs,children:"Connected"}):!e.tokenConfigured&&!e.modalImportable?h.jsx("span",{className:lr,children:"Not set up"}):e.modalImportable?e.tokenConfigured?h.jsx("span",{className:lr,children:"Unknown"}):h.jsx("span",{className:Li,children:"No token"}):h.jsx("span",{className:Li,children:e.envProvisioned?"Env broken":"Env not built"})}function Zq(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(!1),[o,l]=R.useState(null);R.useEffect(()=>{eD().then(t).catch(d=>r(d instanceof Error?d.message:String(d)))},[]);async function u(){if(!i){a(!0),l(null);try{t(await tD())}catch(d){l(d instanceof Error?d.message:String(d))}finally{a(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Serverless GPUs on your own Modal account with"," ",h.jsx("code",{children:"--backend modal --flavor "})," (t4, a10g, a100-80gb, h100, …). orx manages a dedicated Python env with the Modal SDK; sandboxes scale to zero between runs."]}),n?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Status"}),h.jsx("span",{className:"v",children:h.jsx(Kq,{s:e})}),h.jsx("span",{className:"k",children:"Environment"}),h.jsx("span",{className:"v",children:e.modalImportable?"Ready":e.envProvisioned?"Provisioned (modal import failing)":"Not built yet"}),h.jsx("span",{className:"k",children:"Token"}),h.jsx("span",{className:"v",children:e.tokenSource?Xq[e.tokenSource]:"Not configured"})]}),!e.tokenConfigured&&h.jsxs("p",{className:Cn,children:["No Modal token found. Run ",h.jsx("code",{children:"modal token new"}),", or add"," ",h.jsx("code",{children:"MODAL_TOKEN_ID"})," and ",h.jsx("code",{children:"MODAL_TOKEN_SECRET"})," in the Environment tab."]}),e.error&&e.envProvisioned&&!e.modalImportable&&h.jsx("p",{className:Cn,children:e.error}),o&&h.jsx("div",{className:"error",children:o}),!e.modalImportable&&h.jsx("div",{className:"actions",children:h.jsx("button",{className:Wr,onClick:()=>void u(),disabled:i,children:i?"Setting up… (~30–60s)":"Set up environment"})})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Checking Modal…"]})]})}function Qq({test:e}){if(e===void 0)return h.jsx("span",{className:"muted text-muted",children:"never tested"});if(e==="testing")return h.jsx("span",{className:qt});const t=e.reachable?e.toolsFound?h.jsx("span",{className:Cs,children:"Ready"}):h.jsx("span",{className:Li,children:"Missing bash/tar"}):h.jsx("span",{className:Li,title:e.error??void 0,children:"Unreachable"});return h.jsxs(h.Fragment,{children:[t,h.jsx("span",{className:"ssh-tested-at block mt-0.5 text-muted text-xs",children:Gs(e.testedAt)})]})}function Jq(){const[e,t]=R.useState(null),[n,r]=R.useState({});R.useEffect(()=>{oD().then(t).catch(()=>t([]))},[]);async function i(a){r(o=>({...o,[a]:"testing"}));try{const o=await lD(a);r(l=>({...l,[a]:o}))}catch(o){r(l=>({...l,[a]:{reachable:!1,toolsFound:!1,error:o instanceof Error?o.message:String(o),testedAt:Date.now()}}))}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run experiments directly on your own boxes with"," ",h.jsx("code",{children:"--backend ssh --host "}),". Hosts come from"," ",h.jsx("code",{children:"~/.ssh/config"}),"; auth uses your keys/agent (orx never reads a key). The host just needs ",h.jsx("code",{children:"git"})," and ",h.jsx("code",{children:"bash"}),"."]}),e===null?h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Reading ~/.ssh/config…"]}):e.length===0?h.jsx("p",{className:"settings-empty text-muted text-md mt-1 mx-0 mb-0",children:"No hosts found in ~/.ssh/config."}):h.jsxs("table",{className:"flavor-table w-full border-collapse text-md [&_th]:pt-[5px] [&_th]:pr-2.5 [&_th]:pb-[5px] [&_th]:pl-0 [&_th]:border-b [&_th]:border-b-border [&_th]:text-left [&_th]:font-medium [&_th]:text-text [&_td]:pt-[5px] [&_td]:pr-2.5 [&_td]:pb-[5px] [&_td]:pl-0 [&_td]:border-b [&_td]:border-b-border-variant ssh-table table-fixed [&_th:nth-child(1)]:w-[20%] [&_th:nth-child(2)]:w-[26%] [&_th:nth-child(4)]:w-27 [&_th:nth-child(5)]:w-13 [&_td]:wrap-anywhere [&_td:last-child]:pr-0 [&_td:last-child]:text-right",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Host"}),h.jsx("th",{children:"Address"}),h.jsx("th",{children:"Identity"}),h.jsx("th",{children:"Status"}),h.jsx("th",{})]})}),h.jsx("tbody",{children:e.map(a=>h.jsxs("tr",{children:[h.jsx("td",{className:tn,children:a.host}),h.jsxs("td",{className:`${tn} muted text-muted`,children:[[a.user,a.hostname??"—"].filter(Boolean).join("@"),a.port?`:${a.port}`:""]}),h.jsx("td",{className:`${tn} muted text-muted`,children:a.identityFile??"—"}),h.jsx("td",{children:h.jsx(Qq,{test:n[a.host]??a.lastTest})}),h.jsx("td",{children:h.jsx("button",{className:Kn,onClick:()=>void i(a.host),disabled:n[a.host]==="testing",children:"Test"})})]},a.host))})]})]})}function eG({test:e}){return e===null?null:e==="testing"?h.jsx("span",{className:qt}):e.reachable?e.slurmFound?e.toolsFound?h.jsx("span",{className:Cs,children:"Ready"}):h.jsx("span",{className:Li,children:"Missing bash/tar"}):h.jsx("span",{className:Li,children:"No Slurm CLI"}):h.jsx("span",{className:Li,title:e.error??void 0,children:"Unreachable"})}function tG(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(""),[u,d]=R.useState(""),[p,f]=R.useState(""),[g,b]=R.useState(!1),[S,k]=R.useState(null),[x,v]=R.useState(null),w=x!==null&&x!=="testing"?x:null,y=j=>{t(j),a(j.host??""),l(j.partition??""),d(j.account??""),f(j.timeLimit??"")};R.useEffect(()=>{cD().then(y).catch(j=>r(j instanceof Error?j.message:String(j)))},[]);const C=e!==null&&i===(e.host??"")&&o.trim()===(e.partition??"")&&u.trim()===(e.account??"")&&p.trim()===(e.timeLimit??"");async function N(j){if(j.preventDefault(),!g){b(!0),k(null);try{y(await uD({host:i,partition:o.trim(),account:u.trim(),timeLimit:p.trim()}))}catch(T){k(T instanceof Error?T.message:String(T))}finally{b(!1)}}}async function E(j){v("testing");try{v(await dD(j))}catch(T){v({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:T instanceof Error?T.message:String(T)})}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on your own cluster with ",h.jsx("code",{children:"--backend slurm [--flavor h100:2]"}),". orx submits via ",h.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?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[(w==null?void 0:w.error)&&h.jsx("p",{className:Cn,children:w.error}),w&&w.partitions.length>0&&h.jsxs("p",{className:Cn,children:["Partitions: ",h.jsx("code",{children:w.partitions.join(", ")})]}),h.jsxs("form",{className:mh,onSubmit:N,children:[h.jsxs("div",{className:"row2",children:[h.jsxs("label",{children:["Login node",h.jsxs("select",{value:i,onChange:j=>{a(j.target.value),v(null)},children:[h.jsx("option",{value:"",children:"not set (pass --host per launch)"}),i&&!e.hosts.some(j=>j.host===i)&&h.jsxs("option",{value:i,children:[i," (not in ~/.ssh/config)"]}),e.hosts.map(j=>h.jsx("option",{value:j.host,children:j.host},j.host))]})]}),h.jsxs("label",{children:["Partition",h.jsx("input",{className:tn,type:"text",list:"slurm-partitions",value:o,onChange:j=>l(j.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1}),h.jsx("datalist",{id:"slurm-partitions",children:w==null?void 0:w.partitions.map(j=>h.jsx("option",{value:j},j))})]})]}),h.jsxs("div",{className:"row2",children:[h.jsxs("label",{children:["Account",h.jsx("input",{className:tn,type:"text",value:u,onChange:j=>d(j.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1})]}),h.jsxs("label",{children:["Time limit",h.jsx("input",{className:tn,type:"text",value:p,onChange:j=>f(j.target.value),placeholder:"cluster default (e.g. 4h, 30m)",autoComplete:"off",spellCheck:!1})]})]}),S&&h.jsx("div",{className:"error",children:S}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"submit",className:Wr,disabled:g||C,children:g?"Saving…":"Save"}),h.jsx("button",{type:"button",className:fi,onClick:()=>void E(i),disabled:!i||x==="testing",title:i?void 0:"Pick a login node first",children:"Test connection"}),h.jsx(eG,{test:x})]})]})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading slurm settings…"]})]})}function nG(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,d]=R.useState(null),[p,f]=R.useState(null),g=p!==null&&p!=="testing"?p:null,b=v=>{t(v),a(v.address??"")};R.useEffect(()=>{hD().then(b).catch(v=>r(v instanceof Error?v.message:String(v)))},[]);const S=e!==null&&i===(e.address??"");async function k(v){if(v.preventDefault(),!o){l(!0),d(null);try{b(await fD({address:i}))}catch(w){d(w instanceof Error?w.message:String(w))}finally{l(!1)}}}async function x(){f("testing");try{f(await pD(i.trim()||void 0))}catch(v){f({reachable:!1,address:i.trim()||"(unknown)",rayVersion:null,error:v instanceof Error?v.message:String(v)})}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on a Ray cluster with ",h.jsx("code",{children:"--backend ray [--flavor gpu:1]"}),". orx submits via the Ray Jobs API (Dashboard URL). Address resolution: this setting, then ",h.jsx("code",{children:"ASTROAI_RAY_JOBS_ADDRESS"})," /"," ",h.jsx("code",{children:"RAY_DASHBOARD_URL"}),", then ",h.jsx("code",{children:"http://127.0.0.1:8265"}),". Optional flavor maps to entrypoint CPUs/GPUs/memory (e.g."," ",h.jsx("code",{children:"cpu:2"}),", ",h.jsx("code",{children:"gpu:1,mem:8GiB"}),")."]}),n?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:Cn,children:["Effective: ",h.jsx("code",{children:e.resolvedAddress})," (",e.source,")"]}),(g==null?void 0:g.error)&&h.jsx("p",{className:Cn,children:g.error}),(g==null?void 0:g.reachable)&&g.rayVersion&&h.jsxs("p",{className:Cn,children:["Ray version: ",h.jsx("code",{children:g.rayVersion})]}),h.jsxs("form",{className:mh,onSubmit:k,children:[h.jsxs("label",{children:["Jobs / Dashboard URL",h.jsx("input",{className:tn,type:"text",value:i,onChange:v=>{a(v.target.value),f(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),u&&h.jsx("div",{className:"error",children:u}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"submit",className:Wr,disabled:o||S,children:o?"Saving…":"Save"}),h.jsx("button",{type:"button",className:fi,onClick:()=>void x(),disabled:p==="testing",children:"Test connection"}),h.jsx(rG,{test:p})]})]})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading Ray settings…"]})]})}function rG({test:e}){return e===null?null:e==="testing"?h.jsx("span",{className:lr,children:"Testing…"}):e.reachable?h.jsx("span",{className:Cs,children:"Reachable"}):h.jsx("span",{className:f_,children:"Unreachable"})}function iG(){const[e,t]=R.useState(null),[n,r]=R.useState(null);return R.useEffect(()=>{gD().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]),h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run experiments as detached, supervised processes on the machine running orx with"," ",h.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?h.jsx("div",{className:"error",children:n}):e?h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Hostname"}),h.jsx("span",{className:`v ${tn}`,children:e.hostname}),h.jsx("span",{className:"k",children:"System"}),h.jsxs("span",{className:"v",children:[e.os,"/",e.arch,e.chip?` — ${e.chip}`:""]}),h.jsx("span",{className:"k",children:"CPU"}),h.jsx("span",{className:"v",children:e.cpuCount>0?`${e.cpuCount} cores`:"—"}),h.jsx("span",{className:"k",children:"RAM"}),h.jsx("span",{className:"v",children:e.memBytes!==null?Ao(e.memBytes):"—"}),h.jsx("span",{className:"k",children:"GPUs"}),h.jsx("span",{className:"v",children:e.gpus.length===0?"none detected (nvidia-smi)":e.gpus.map(i=>`${i.name}${i.memMib!==null?` — ${Ao(i.memMib*1024*1024)}`:""}`).join(", ")})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Detecting hardware…"]})]})}function sG(){const[e,t]=R.useState(null),[n,r]=R.useState(null);return R.useEffect(()=>{bD().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]),h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on an ephemeral OpenResearch box billed to your org with"," ",h.jsx("code",{children:"--backend openresearch --flavor "})," (h100_sxm, cpu5c, …; browse with ",h.jsx("code",{children:"orx compute"}),"). The box is provisioned for the run and deleted when it ends. Needs ",h.jsx("code",{children:"orx login"})," and a registered SSH key."]}),n?h.jsx("div",{className:"error",children:n}):e?e.loggedIn?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Status"}),h.jsx("span",{className:"v",children:h.jsx("span",{className:Cs,children:"Signed in"})}),h.jsx("span",{className:"k",children:"Orgs"}),h.jsx("span",{className:"v",children:e.orgs.length>0?e.orgs.join(", "):"—"}),h.jsx("span",{className:"k",children:"SSH key"}),h.jsx("span",{className:"v",children:e.sshKeyStatus==="matched"?h.jsx("span",{className:Cs,children:"On this computer"}):e.sshKeyStatus==="no_local_match"?h.jsx("span",{className:f_,children:"Not on this computer"}):e.sshKeyStatus==="none_registered"?h.jsx("span",{className:Li,children:"None registered"}):h.jsx("span",{className:lr,children:"Unknown"})})]}),e.sshKeyStatus==="none_registered"&&(e.sshKeyPath?h.jsxs("p",{className:Cn,children:["Add one with ",h.jsxs("code",{children:["orx ssh-key add ",e.sshKeyPath]}),"."]}):h.jsxs("p",{className:Cn,children:["No key on this computer yet — create one with"," ",h.jsx("code",{children:"ssh-keygen -t ed25519"}),", then add it with"," ",h.jsx("code",{children:"orx ssh-key add"}),"."]})),e.sshKeyStatus==="no_local_match"&&(e.sshKeyPath?h.jsxs("p",{className:Cn,children:["Register this computer with ",h.jsxs("code",{children:["orx ssh-key add ",e.sshKeyPath]}),", or load a registered key with ",h.jsx("code",{children:"ssh-add"}),"."]}):h.jsxs("p",{className:Cn,children:["No key on this computer to register — load a registered key with"," ",h.jsx("code",{children:"ssh-add"}),", or create one with"," ",h.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),e.error&&h.jsx("p",{className:Cn,children:e.error})]}):h.jsxs("p",{className:Cn,children:["Not signed in. Run ",h.jsx("code",{children:"orx login"})," in a terminal to connect your OpenResearch account."]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Checking credentials…"]})]})}const mw={local:"This machine",hf:"HF Jobs",modal:"Modal",k8s:"Kubernetes",ssh:"SSH",slurm:"Slurm",ray:"Ray",openresearch:"OpenResearch"},aG={local:"local_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},oG=["hf","modal","slurm","ray","openresearch"],gw=["hf","modal","openresearch"],bw={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"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]};function lG({t:e,isDefault:t}){return e.id==="local"?h.jsx("span",{className:Cs,children:"Ready"}):e.unverified?h.jsx("span",{className:lr,children:"Unknown"}):!e.configured&&t?h.jsx("span",{className:f_,children:"Not configured"}):e.configured?h.jsx("span",{className:Cs,children:"Configured"}):h.jsx("span",{className:lr,children:"Not set up"})}function cG({target:e,flavor:t,projectId:n,onSaved:r}){var g;const[i,a]=R.useState(t??""),[o,l]=R.useState(!1),[u,d]=R.useState(null);R.useEffect(()=>a(t??""),[t]);async function p(b){if(b.preventDefault(),!o){l(!0),d(null);try{r(await gS({backend:e,flavor:i.trim()||null,projectId:n}))}catch(S){d(S instanceof Error?S.message:String(S))}finally{l(!1)}}}const f=i.trim()===(t??"");return h.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-mono [&_.repo-hint]:font-normal [&_.repo-hint]:text-xs [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-left [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-[0_2px_8px_rgb(0_0_0_/_5%)] [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-semibold [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-semibold [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pr-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:pl-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))] [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-left [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-md [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:font-mono [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-md [&_.paper-pick_.title]:font-semibold flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-xs [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.new-project-actions_.primary]:ml-auto [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap settings-form mt-3.5 pt-3.5 border-t border-t-border compute-flavor-form mb-3.5 [&_label]:max-w-80",onSubmit:p,children:[h.jsxs("label",{children:["Default flavor",h.jsx("input",{className:tn,type:"text",list:`flavors-${e}`,value:i,onChange:b=>a(b.target.value),placeholder:gw.includes(e)?`e.g. ${((g=bw[e])==null?void 0:g[1])??""}`:"none (CPU-only)",autoComplete:"off",spellCheck:!1}),h.jsx("datalist",{id:`flavors-${e}`,children:(bw[e]??[]).map(b=>h.jsx("option",{value:b},b))})]}),u&&h.jsx("div",{className:"error",children:u}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"submit",className:Kn,disabled:o||f,children:o?"Saving…":"Save flavor"}),gw.includes(e)&&!t&&h.jsxs("span",{className:"muted text-muted compute-flavor-hint text-sm",children:["This backend requires a flavor — without a default one, each launch must pass"," ",h.jsx("code",{children:"--flavor"}),"."]})]})]})}function uG({target:e,isDefault:t,isFallbackDefault:n,defaultFlavor:r,open:i,onToggle:a,onSettings:o,onError:l,projectId:u}){const[d,p]=R.useState(!1),[f,g]=R.useState(!1);i&&!d&&p(!0);async function b(S){if(!f){g(!0);try{o(await gS({backend:S,projectId:u}))}catch(k){l(k instanceof Error?k.message:String(k))}finally{g(!1)}}}return h.jsxs("div",{className:`compute-row bg-background border border-border rounded-lg [&.disabled]:opacity-52 [&.disabled_.compute-row-head]:cursor-default [&.open_.compute-row-head:hover]:rounded-[var(--radius-lg)_var(--radius-lg)_0_0] [&.open_.compute-chevron]:rotate-180${i?" open":""}${e.enabled?"":" disabled"}`,children:[h.jsxs("div",{className:"compute-row-head flex items-center gap-2.5 py-3 px-3.5 cursor-pointer select-none [&:hover]:bg-surface [&:hover]:rounded-lg [&_.badge]:flex-none",onClick:e.enabled?a:void 0,children:[h.jsx("span",{className:"compute-row-logo inline-flex items-center flex-none",children:h.jsx(aC,{kind:aG[e.id],size:18})}),h.jsx("span",{className:"compute-row-name text-md font-semibold text-text flex-none",children:mw[e.id]}),h.jsx("span",{className:"compute-row-summary flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-muted text-sm",children:e.summary}),h.jsx(lG,{t:e,isDefault:t}),t?h.jsx("span",{className:"badge inline-flex items-center font-sans text-xs font-medium py-px px-[7px] border border-border rounded-sm [&.ok]:text-accent-green [&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle [&.err]:text-accent-red [&.err]:border-accent-red [&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber [&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle compute-default-pill flex-none text-primary border-primary",children:n?"Local fallback":"Default"}):h.jsx("button",{type:"button",className:`${Kn} compute-make-default flex-none`,onClick:S=>{S.stopPropagation(),b(e.id)},disabled:f||!e.enabled,children:"Make default"}),h.jsx("button",{type:"button",className:"compute-chevron-btn flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":i,"aria-label":`${i?"Collapse":"Expand"} ${mw[e.id]}`,disabled:!e.enabled,onClick:S=>{S.stopPropagation(),e.enabled&&a()},children:h.jsx(Rl,{size:16,className:"compute-chevron text-muted transition-transform duration-120 ease-standard"})})]}),d&&e.enabled&&h.jsxs("div",{className:"compute-row-body border-t border-t-border p-3.5 [&_.settings-card]:mb-0 [&_.settings-card]:mt-3.5",hidden:!i,children:[t&&!n&&h.jsxs("p",{className:"settings-note mt-2.5 mx-0 mb-0 text-sm py-2 px-2.5 border border-accent-amber rounded-md bg-accent-amber-subtle text-accent-amber font-medium compute-default-note flex items-center gap-2.5 flex-wrap",children:["The agent launches runs here unless you tell it otherwise, and so does"," ",h.jsx("code",{children:"orx exp run"})," with no ",h.jsx("code",{children:"--backend"})," flag."," ",h.jsx("button",{type:"button",className:Kn,onClick:()=>void b(null),disabled:f,children:"Clear default"})]}),t&&!e.configured&&h.jsx("p",{className:Cn,children:"This target is the default but isn't configured — launches will fail until it's set up below."}),t&&oG.includes(e.id)&&h.jsx(cG,{target:e.id,flavor:r,projectId:u,onSaved:o}),e.id==="local"&&h.jsx(iG,{}),e.id==="hf"&&h.jsx(mG,{}),e.id==="modal"&&h.jsx(Zq,{}),e.id==="k8s"&&h.jsx(Yq,{}),e.id==="ssh"&&h.jsx(Jq,{}),e.id==="slurm"&&h.jsx(tG,{}),e.id==="ray"&&h.jsx(nG,{}),e.id==="openresearch"&&h.jsx(sG,{})]})]})}function dG({project:e,onViewHistory:t}){const[n,r]=R.useState(null),[i,a]=R.useState(null),[o,l]=R.useState(null),[u,d]=R.useState(null),p=R.useRef(0);R.useEffect(()=>{p.current++,r(null),l(null),a(null),d(null)},[e==null?void 0:e.id]),R.useEffect(()=>{const k=++p.current;mD(e==null?void 0:e.id).then(x=>{k===p.current&&(r(x),a(null))}).catch(x=>{if(k!==p.current)return;const v=x instanceof Error?x.message:String(x);r(w=>(w===null?a(v):d(v),w))})},[o,e==null?void 0:e.id]);const f=k=>{p.current++,r(k),d(null)},g=n?n.targets:null,b=(n==null?void 0:n.defaultBackend)==="local"&&n.configuredDefaultBackend!==null&&n.configuredDefaultBackend!==void 0&&n.configuredDefaultBackend!=="local",S=k=>h.jsx(uG,{target:k,isDefault:(n==null?void 0:n.defaultBackend)===k.id,isFallbackDefault:!!(b&&k.id==="local"),defaultFlavor:(n==null?void 0:n.defaultFlavor)??null,open:k.enabled&&o===k.id,onToggle:()=>l(x=>x===k.id?null:k.id),onSettings:f,onError:d,projectId:e==null?void 0:e.id},`${(e==null?void 0:e.id)??"none"}:${k.id}`);return h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:"Compute"}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Where ",h.jsx("code",{children:"orx exp run"})," executes. Pick a default target; the agent uses it when a launch doesn't name a backend (",h.jsx("code",{children:"--backend "})," always wins)."]}),h.jsx(NG,{onViewHistory:t}),h.jsx("h2",{className:"compute-section-title mt-0 mx-0 mb-2.5 text-lg",children:"Targets"}),i?h.jsx("div",{className:"error",children:i}):g?h.jsxs(h.Fragment,{children:[u&&h.jsx("div",{className:"error",children:u}),h.jsxs("div",{className:"compute-list flex flex-col gap-2.5 mb-3.5",children:[g.filter(k=>k.id==="local").map(S),g.filter(k=>k.id!=="local").map(S)]}),b&&h.jsxs("p",{className:Cn,children:["Using this machine because the saved ",n==null?void 0:n.configuredDefaultBackend," default is not currently configured."]}),h.jsxs("p",{className:"compute-footnote flex items-start gap-1.5 mt-0.5 mx-0 mb-0 text-sm text-muted [&_svg]:flex-none [&_svg]:mt-px",children:[h.jsx(jM,{size:14,"aria-hidden":"true"}),h.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."})]})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Checking compute targets…"]})]})}const hG={env:"HF_TOKEN env var",openresearchEnv:"~/.openresearch/env",hfCache:"~/.cache/huggingface/token (hf auth login)"};function fG({settings:e}){return e.configured?e.valid?h.jsx("span",{className:Cs,children:"Connected"}):h.jsx("span",{className:Li,children:"Invalid token"}):h.jsx("span",{className:lr,children:"Not configured"})}function pG({settings:e}){return!e.configured||!e.valid?null:e.jobsWrite===!0?h.jsx("span",{className:Cs,children:"Jobs: write OK"}):e.jobsWrite===!1?h.jsx("span",{className:Li,children:"No job.write permission"}):h.jsx("span",{className:lr,children:"Jobs permission unknown"})}function mG(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,d]=R.useState(null),p=R.useRef(!1);R.useEffect(()=>{VR().then(g=>{p.current||t(g)}).catch(g=>{p.current||r(g instanceof Error?g.message:String(g))})},[]);async function f(g){if(g.preventDefault(),!(!i.trim()||o)){l(!0),d(null);try{const b=await WR(i.trim());p.current=!0,t(b),r(null),a("")}catch(b){d(b instanceof Error?b.message:String(b))}finally{l(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run experiments on your Hugging Face account with"," ",h.jsx("code",{children:"--backend hf --flavor "})," (t4-small, a10g-small, a100-large, …). Billed to HF per minute."]}),n?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Status"}),h.jsx("span",{className:"v",children:h.jsx(fG,{settings:e})}),h.jsx("span",{className:"k",children:"Account"}),h.jsx("span",{className:"v",children:e.username??"—"}),h.jsx("span",{className:"k",children:"Token"}),h.jsx("span",{className:"v",children:e.maskedToken??"—"}),h.jsx("span",{className:"k",children:"Source"}),h.jsx("span",{className:"v",children:e.source?hG[e.source]:"Not configured"}),h.jsx("span",{className:"k",children:"Jobs"}),h.jsxs("span",{className:"v",children:[h.jsx(pG,{settings:e}),(!e.configured||!e.valid)&&"—"]})]}),e.source==="env"&&h.jsx("p",{className:Cn,children:"HF_TOKEN is set in the environment and overrides any token saved here."}),e.valid&&e.jobsWrite===null&&h.jsxs("p",{className:Cn,children:["This token is valid but doesn't report whether it can launch Jobs — OAuth tokens from ",h.jsx("code",{children:"hf auth login"})," never do. Launches may still work; for a definitive check, save a write-scoped token from"," ",h.jsx("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",children:"huggingface.co/settings/tokens"}),"."]})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading status…"]}),h.jsxs("form",{className:mh,onSubmit:f,children:[h.jsxs("label",{children:[e!=null&&e.configured?"Replace token":"New token",h.jsx("input",{type:"password",value:i,onChange:g=>a(g.target.value),placeholder:"hf_…",autoComplete:"off"})]}),u&&h.jsx("div",{className:"error",children:u}),h.jsx("div",{className:"actions",children:h.jsx("button",{type:"submit",className:Wr,disabled:!i.trim()||o,children:o?"Validating…":"Save"})})]})]})}const lC=/^hf_[A-Za-z0-9]{10,}$/;function cC(){return h.jsx("tr",{children:h.jsx("td",{colSpan:3,children:h.jsxs("p",{className:Cn,children:["This value looks like a Hugging Face token — compute runs only read it from"," ",h.jsx("code",{children:"HF_TOKEN"}),". Save it under that key if it's meant for HF Jobs."]})})})}const vw=["HF_TOKEN","WANDB_API_KEY"];function gG({name:e,entry:t,onVars:n,onError:r}){const[i,a]=R.useState(""),[o,l]=R.useState(!1),u=f=>r(`${e}: ${f instanceof Error?f.message:String(f)}`);async function d(){if(!(!i.trim()||o)){l(!0);try{n(await mS(e,i.trim())),a("")}catch(f){u(f)}finally{l(!1)}}}async function p(){if(!o){l(!0);try{n(await rD(e))}catch(f){u(f)}finally{l(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("tr",{children:[h.jsx("td",{className:tn,children:e}),h.jsx("td",{className:`${tn} muted text-muted`,children:t?h.jsxs(h.Fragment,{children:[t.maskedValue,t.inProcessEnv&&h.jsx("span",{className:lr,children:"Overridden by env"})]}):h.jsx("input",{className:tn,type:"password",value:i,onChange:f=>a(f.target.value),onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),d()),f.key==="Escape"&&!o&&a("")},placeholder:"value","aria-label":`Value for ${e}`,autoComplete:"new-password",disabled:o})}),h.jsx("td",{children:t?h.jsx("button",{className:Xn,title:`Delete ${e}`,"aria-label":`Delete ${e}`,onClick:()=>void p(),disabled:o,children:h.jsx(ih,{size:13})}):i.trim()&&h.jsx("button",{className:Kn,onClick:()=>void d(),disabled:o,children:o?"Saving…":"Save"})})]}),!t&&e!=="HF_TOKEN"&&lC.test(i.trim())&&h.jsx(cC,{})]})}function bG({onVars:e,onError:t,onDone:n}){const[r,i]=R.useState(""),[a,o]=R.useState(""),[l,u]=R.useState(!1);async function d(){if(!(!r.trim()||!a.trim()||l)){u(!0);try{e(await mS(r.trim(),a.trim())),n()}catch(f){t(`${r.trim()}: ${f instanceof Error?f.message:String(f)}`)}finally{u(!1)}}}const p=f=>{f.key==="Enter"&&(f.preventDefault(),d()),f.key==="Escape"&&!l&&n()};return h.jsxs(h.Fragment,{children:[h.jsxs("tr",{children:[h.jsx("td",{children:h.jsx("input",{autoFocus:!0,className:tn,type:"text",value:r,onChange:f=>i(f.target.value),onKeyDown:p,placeholder:"MY_API_KEY","aria-label":"New variable key",autoComplete:"off",spellCheck:!1,disabled:l})}),h.jsx("td",{children:h.jsx("input",{className:tn,type:"password",value:a,onChange:f=>o(f.target.value),onKeyDown:p,placeholder:"value","aria-label":"New variable value",autoComplete:"new-password",disabled:l})}),h.jsxs("td",{children:[h.jsx("button",{className:Kn,onClick:()=>void d(),disabled:l||!r.trim()||!a.trim(),children:l?"Saving…":"Save"}),h.jsx("button",{className:Xn,title:"Cancel","aria-label":"Cancel new variable",onClick:n,disabled:l,children:h.jsx(qr,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&lC.test(a.trim())&&h.jsx(cC,{})]})}function vG(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(!1),[o,l]=R.useState(null);R.useEffect(()=>{nD().then(t).catch(f=>r(f instanceof Error?f.message:String(f)))},[]);const u=f=>{t(f),l(null)},d=e===null?[]:e.map(f=>f.key).filter(f=>!vw.includes(f)),p=[...vw,...d];return h.jsxs("div",{className:Oa,children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("h3",{children:"Environment variables"}),h.jsx("div",{className:"spacer",style:{flex:1}}),h.jsxs("button",{className:Kn,onClick:()=>a(!0),disabled:i||e===null,children:[h.jsx(i_,{size:12})," Add variable"]})]}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Stored in ",h.jsx("code",{children:"~/.openresearch/env"})," and passed to runs and the research agent."," ",h.jsx("code",{children:"HF_TOKEN"})," and ",h.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?h.jsx("div",{className:"error",children:n}):e===null?h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading…"]}):h.jsx("table",{className:"env-table w-full border-collapse text-md table-fixed [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ml-2 [&_input]:w-full [&_input]:border-0 [&_input]:bg-transparent [&_input]:p-0 [&_input:focus]:shadow-[0_1px_0_0_var(--text)] [&_td]:h-9 [&_td]:pt-0 [&_td]:pr-2.5 [&_td]:pb-0 [&_td]:pl-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-right [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-left [&_.icon-btn]:ml-2 [&_.icon-btn]:align-middle [&_.icon-btn:hover]:text-accent-red",children:h.jsxs("tbody",{children:[p.map(f=>h.jsx(gG,{name:f,entry:e.find(g=>g.key===f),onVars:u,onError:l},f)),i&&h.jsx(bG,{onVars:u,onError:l,onDone:()=>a(!1)})]})}),o&&h.jsx("div",{className:"error",children:o})]})}const ed=[{value:"system",label:"System",icon:PM},{value:"light",label:"Light",icon:mR},{value:"dark",label:"Dark",icon:qM}];function _G(){const[e,t]=Iq(),n=r=>{var d;const i=r.key==="ArrowRight"||r.key==="ArrowDown"?1:r.key==="ArrowLeft"||r.key==="ArrowUp"?-1:0;if(!i)return;r.preventDefault();const a=[...r.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(p=>p===document.activeElement),u=((o===-1?ed.findIndex(p=>p.value===e):o)+i+ed.length)%ed.length;t(ed[u].value),(d=a[u])==null||d.focus()};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Appearance"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"How the interface looks on this device."}),h.jsx("div",{className:Oa,children:h.jsxs("div",{className:ml,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"Theme"}),h.jsx("p",{children:"System follows your operating system's light or dark setting."})]}),h.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":"Theme",onKeyDown:n,children:ed.map(({value:r,label:i,icon:a})=>h.jsxs("button",{type:"button",role:"radio","aria-checked":e===r,tabIndex:e===r?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${e===r?"on":""}`,onClick:()=>t(r),children:[h.jsx(a,{size:14}),i]},r))})]})})]})}const xG={installer:"Installed with the orx installer","app-bundle":"macOS app",cargo:"Installed with cargo",homebrew:"Installed with Homebrew",nix:"Managed by Nix",unknown:"Unknown install"},yG={cargo:"Re-run your cargo install to update.",homebrew:"Run brew upgrade to update.",nix:"Update it through your Nix configuration."};function wG(){const{status:e,error:t,apply:n}=rC(),[r,i]=R.useState(null),[a,o]=R.useState(null);if(!e)return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Updates"}),t?h.jsx("div",{className:Oa,children:h.jsx("div",{className:"error",children:t})}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading…"]})]});const l=async(u,d)=>{i(u),o(null);try{await d()}catch(p){o(p instanceof Error?p.message:String(p))}finally{i(null)}};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Updates"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"Keeping this copy of orx on the latest release."}),h.jsxs("div",{className:Oa,children:[h.jsxs("div",{className:Vs,children:[h.jsx("div",{className:"k",children:"Version"}),h.jsx("div",{className:"v",children:e.current}),h.jsx("div",{className:"k",children:"Latest"}),h.jsx("div",{className:"v",children:e.latest??"—"}),h.jsx("div",{className:"k",children:"Install"}),h.jsx("div",{className:"v",children:xG[e.channel]})]}),e.restartRequired&&h.jsx("div",{className:ml,children:h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"Restart to finish updating"}),h.jsxs("p",{children:["Version ",e.installedVersion," is installed. This window is still running"," ",e.current,"."]})]})}),e.selfUpdates?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:ml,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"Install updates automatically"}),h.jsxs("p",{children:["New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",e.envDisabled&&" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect."]})]}),h.jsx("button",{type:"button",role:"switch","aria-checked":e.autoUpdate,"aria-label":"Install updates automatically",className:`${m_} ${e.autoUpdate?"on":""}`,disabled:r!==null,onClick:()=>void l("auto",()=>KR(!e.autoUpdate).then(n)),children:h.jsx("span",{})})]}),h.jsxs("div",{className:ml,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:e.updateAvailable?`Update to ${e.latest}`:"Check for updates"}),h.jsx("p",{children:e.updateAvailable?"Install the new release now instead of waiting for the background update.":"orx checks a few times a day on its own."})]}),h.jsx("button",{type:"button",className:Kn,disabled:r!==null,onClick:()=>void l("apply",()=>XR().then(n)),children:r==="apply"?"Working…":e.updateAvailable?"Update now":"Check now"})]})]}):h.jsx("div",{className:ml,children:h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"orx can't update this install"}),h.jsx("p",{children:yG[e.channel]??"Reinstall with the orx installer to get automatic updates."})]})}),e.channel==="app-bundle"&&h.jsx(SG,{busy:r,run:l}),a&&h.jsx("div",{className:"error",children:a})]})]})}function SG({busy:e,run:t}){const[n,r]=R.useState(null),[i,a]=R.useState(!1),o=l=>void t("cli",()=>ZR(l).then(u=>{r(u),a(!1)}).catch(u=>{throw a(!l&&String((u==null?void 0:u.message)??u).includes("--force")),u}));return h.jsxs("div",{className:ml,children:[h.jsxs("div",{children:[h.jsxs("div",{className:"project-default-title text-md font-semibold",children:["Install the ",h.jsx("code",{children:"orx"})," command"]}),n?h.jsxs("p",{children:[n.alreadyCurrent?"Already linked at ":"Linked ",h.jsx("code",{children:n.link}),".",!n.onPath&&` Add ${n.dir} to your PATH to use it.`]}):h.jsxs("p",{children:["Adds ",h.jsx("code",{children:"orx"})," to your terminal, pointing at this app — so the CLI and the app are always the same version."]})]}),h.jsx("button",{type:"button",className:Kn,disabled:e!==null,onClick:()=>o(i),children:e==="cli"?"Working…":i?"Replace anyway":n?"Re-link":"Install"})]})}function kG(){const[e,t]=R.useState(null),[n,r]=R.useState(!1),[i,a]=R.useState(null),o=()=>{a(null),o_().then(t).catch(u=>a(u instanceof Error?u.message:String(u)))};R.useEffect(o,[]);const l=()=>{if(!e||n)return;const u=!e.githubForNewProjects;r(!0),a(null),_S(u,!0).then(t).catch(d=>a(d instanceof Error?d.message:String(d))).finally(()=>r(!1))};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"General"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"Defaults applied when you create a project."}),e?h.jsxs("div",{className:"settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md [&_>_.error]:whitespace-pre-wrap bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5 [&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0",children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("h3",{children:"GitHub publishing"}),h.jsx("span",{className:`${lr} ${e.githubAuthenticated?"ok":""}`,children:e.githubAuthenticated?`Connected via ${e.githubTokenSource}`:"Not connected"})]}),h.jsxs("div",{className:ml,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"Enable GitHub syncing for new projects"}),h.jsx("p",{children:"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots."})]}),h.jsx("button",{type:"button",role:"switch","aria-checked":e.githubForNewProjects,"aria-label":"Enable GitHub syncing for new projects",className:`${m_} ${e.githubForNewProjects?"on":""}`,disabled:n||!e.githubAuthenticated&&!e.githubForNewProjects,onClick:l,children:h.jsx("span",{})})]}),!e.githubAuthenticated&&h.jsxs("div",{className:"project-default-connect [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0 [&_p]:text-muted [&_p]:text-sm mt-3.5 pt-3.5 border-t border-t-border-variant [&_.onb-token-form]:mt-2.5",children:[h.jsx("p",{children:"Connect GitHub to make publishing the default for new projects."}),h.jsx(sC,{onSaved:o})]}),i&&h.jsx("div",{className:"error",children:i})]}):i?h.jsx("div",{className:"error",children:i}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading…"]})]})}function CG({project:e,publicationError:t,onProjectUpdate:n}){const[r,i]=R.useState(null),[a,o]=R.useState(!1),[l,u]=R.useState(null),[d,p]=R.useState(!1),[f,g]=R.useState(!1),[b,S]=R.useState(null),k=R.useRef(0),x=!!(r!=null&&r.github.owner&&r.github.repo),v=()=>{const N=++k.current;i(null),u(null),e&&AD(e.id).then(E=>{N===k.current&&i(E)}).catch(E=>{N===k.current&&u(E instanceof Error?E.message:String(E))})};R.useEffect(v,[e==null?void 0:e.id]);const w=N=>{const E=N instanceof Error?N.message:String(N);return E.toLowerCase().includes("archived")?"GitHub rejected the push because this repository is archived and read-only. The local project is still available. Unarchive the repository on GitHub, then enable syncing here.":E.includes("(fetch first)")||E.includes("non-fast-forward")?"GitHub contains changes that are not in this local project. Pull the latest GitHub changes and resolve any conflicts in Git, then try enabling syncing again.":E.includes("403")||E.toLowerCase().includes("permission denied")?"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.":E},y=()=>{e&&(o(!0),u(null),ND(e.id).then(N=>{i(N.git),n(N.project),o_().then(E=>{!E.githubForNewProjects&&!E.githubDefaultPromptSeen&&p(!0)}).catch(()=>{})}).catch(N=>u(w(N))).finally(()=>o(!1)))},C=N=>{g(!0),S(null),_S(N,!0).then(()=>p(!1)).catch(E=>S(E instanceof Error?E.message:String(E))).finally(()=>g(!1))};return h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:"Repository"}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Git and GitHub settings for ",h.jsx("strong",{children:(e==null?void 0:e.name)??"the current project"}),". Local Git powers experiments; publishing is optional."]}),e?l&&!r?h.jsx("div",{className:"error",children:l}):r?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:pw,children:[h.jsx("h3",{children:"Local repository"}),h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Path"}),h.jsx("span",{className:`v ${tn}`,children:r.path}),h.jsx("span",{className:"k",children:"Git"}),h.jsx("span",{className:"v",children:r.gitVersion??"not found"}),h.jsx("span",{className:"k",children:"State"}),h.jsx("span",{className:"v",children:r.initialized?`${r.currentBranch??"detached"} · ${r.clean?"clean":"has changes"}`:"not initialized"}),h.jsx("span",{className:"k",children:"Baseline"}),h.jsx("span",{className:`v ${tn}`,children:r.baselineBranch}),h.jsx("span",{className:"k",children:"Remotes"}),h.jsx("span",{className:"v",children:r.remotes.length?r.remotes.map(N=>`${N.name}: ${N.url}`).join(" · "):"none"})]}),!r.initialized&&h.jsx("div",{className:Yg,children:h.jsx("button",{className:Wr,onClick:()=>void TD(e.id).then(i).catch(N=>u(String(N))),children:"Initialize Git"})})]}),h.jsxs("div",{className:pw,children:[h.jsx("h3",{children:"GitHub"}),h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Authentication"}),h.jsxs("span",{className:"v",children:[h.jsx("span",{className:`${lr} ${r.github.authenticated?"ok":""}`,children:r.github.authenticated?"Connected":"Not connected"}),r.github.authenticated&&h.jsxs("span",{className:"git-detail-meta text-muted text-sm",children:["via ",r.github.tokenSource]})]}),h.jsx("span",{className:"k",children:"Project"}),h.jsx("span",{className:"v",children:x?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:tn,children:[r.github.owner,"/",r.github.repo]}),!r.github.enabled&&h.jsx("span",{className:"badge inline-flex items-center font-sans font-medium py-px px-[7px] border border-border rounded-sm [&.ok]:text-accent-green [&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle [&.err]:text-accent-red [&.err]:border-accent-red [&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber [&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle git-detail-meta text-muted text-sm",children:"Syncing off"})]}):h.jsx("span",{className:lr,children:"Local only"})}),r.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:"Sync"}),h.jsx("span",{className:"v",children:r.github.syncStatus})]})]}),!r.github.authenticated&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:"GitHub is optional. Connect only when you want a hosted copy for collaboration."}),h.jsx(sC,{onSaved:()=>v()})]}),r.github.authenticated&&!r.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:x?"Use this repository for automatic experiment-branch pushes when your connected account can write to it. Otherwise, OpenResearch creates a separate private repository for collaboration.":"Create a private repository and automatically push experiment branches for collaborator visibility."}),h.jsxs("div",{className:Yg,children:[x&&r.github.url&&h.jsxs("a",{className:fi,href:r.github.url,target:"_blank",rel:"noreferrer",children:["Open on GitHub ",h.jsx(xd,{size:12})]}),h.jsx("button",{className:Wr,disabled:a,onClick:y,children:a?"Enabling…":"Enable GitHub syncing"})]})]}),r.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed."}),h.jsxs("div",{className:Yg,children:[r.github.url&&h.jsxs("a",{className:fi,href:r.github.url,target:"_blank",rel:"noreferrer",children:["Open on GitHub ",h.jsx(xd,{size:12})]}),h.jsx("button",{className:fi,disabled:a,onClick:()=>{o(!0),jD(e.id).then(N=>{i(N.git),n(N.project)}).catch(N=>u(N instanceof Error?N.message:String(N))).finally(()=>o(!1))},children:a?"Updating…":"Disable syncing"})]})]})]}),t&&h.jsx("div",{className:"error",children:w(t)}),l&&h.jsx("div",{className:"error",children:w(l)})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading…"]}):h.jsx("div",{className:Oa,children:h.jsx("p",{className:Cn,children:"Open a project to inspect its repository and GitHub publication state."})}),d&&h.jsx("div",{className:"modal-backdrop fixed inset-0 bg-[rgba(29,_27,_26,_0.4)] flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>C(!1),children:h.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)] p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-muted [&_>_p]:text-md [&_>_p]:leading-normal [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:N=>N.stopPropagation(),children:[h.jsx("h2",{id:"github-default-title",children:"Make GitHub syncing the default?"}),h.jsx("p",{children:"This is useful when collaborators follow project changes on GitHub. New projects will enable syncing automatically, creating a private repository when needed and pushing experiment branches for visibility."}),b&&h.jsx("div",{className:"error",children:b}),h.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[h.jsx("button",{className:fi,disabled:f,onClick:()=>C(!1),children:"Not now"}),h.jsx("button",{className:Wr,disabled:f,onClick:()=>C(!0),children:f?"Saving…":"Make default"})]})]})})]})}const EG={env:"ORX_DATA_DIR environment variable",config:"your saved setting",xdg:"XDG_DATA_HOME",default:"default location"};function AG(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,d]=R.useState(null),[p,f]=R.useState({kind:"idle"}),[g,b]=R.useState(null),S=()=>iD().then(C=>{t(C),a(N=>N||C.current)}).catch(C=>r(C instanceof Error?C.message:String(C)));R.useEffect(()=>{S()},[]),R.useEffect(()=>nL(C=>{C.type==="progress"?f(N=>{const E=N.kind==="moving"?N.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||E}}):C.type==="done"?(f({kind:"done",oldPathLeft:C.oldPathLeft}),d(null),a(""),S()):C.type==="error"&&f({kind:"error",message:C.error})}),[]);const k=(e==null?void 0:e.source)==="env",x=i.trim(),v=e!==null&&x===e.current;async function w(){if(!(o||!x)){l(!0),b(null),d(null);try{d(await sD(x))}catch(C){b(C instanceof Error?C.message:String(C))}finally{l(!1)}}}async function y(C){if(C.preventDefault(),!(p.kind==="moving"||!x||v)&&(b(null),!!window.confirm(`Move all orx data to: -${x} - -The store is copied to the new location and activated there. Active runs or chats will block the move.`))){f({kind:"moving",phase:"preparing",copied:0,total:(u==null?void 0:u.treeBytes)??0});try{await aD(x)}catch(N){f({kind:"idle"}),b(N instanceof Error?N.message:String(N))}}}return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Storage"}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Where orx keeps everything on this machine — the local database, run logs, artifacts, and chat attachments for ",h.jsx("strong",{children:"all"})," projects. Moving it copies the whole store to the new location and activates it there."]}),n?h.jsx("div",{className:Oa,children:h.jsx("div",{className:"error",children:n})}):e?h.jsxs("div",{className:Oa,children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("h3",{children:"Data directory"}),h.jsx("div",{className:"spacer",style:{flex:1}}),h.jsx("span",{className:lr,children:e.isDefault?"Default":"Custom"})]}),h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Current"}),h.jsx("span",{className:`v ${tn}`,children:e.current}),h.jsx("span",{className:"k",children:"Source"}),h.jsx("span",{className:"v",children:EG[e.source]}),!e.isDefault&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:"Default"}),h.jsx("span",{className:`v ${tn}`,children:e.defaultPath})]})]}),k?h.jsxs("p",{className:Cn,children:["The data directory is pinned by the ",h.jsx("code",{children:"ORX_DATA_DIR"})," environment variable, which overrides this setting. Unset it to choose a location here."]}):h.jsxs("form",{className:mh,onSubmit:y,children:[h.jsxs("label",{children:["New location",h.jsx("input",{className:tn,type:"text",value:i,onChange:C=>{a(C.target.value),d(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:p.kind==="moving"})]}),u&&!u.error&&u.ok&&h.jsxs("p",{className:Cn,children:["Ready to move ",Ao(u.treeBytes??0),u.freeBytes!=null&&` — ${Ao(u.freeBytes)} free at target`,u.sameFilesystem?" (same disk, instant)":"","."]}),u&&u.ok===!1&&u.error&&h.jsx("div",{className:"error",children:u.error}),g&&h.jsx("div",{className:"error",children:g}),p.kind==="moving"&&h.jsx(oC,{value:p.copied,max:p.total,label:`${p.phase.charAt(0).toUpperCase()}${p.phase.slice(1)}…`,caption:p.total>0?h.jsxs("span",{className:tn,children:[Ao(p.copied)," / ",Ao(p.total)]}):void 0}),p.kind==="done"&&h.jsxs("p",{className:Cn,children:["Moved. orx is now using the new location.",p.oldPathLeft&&h.jsxs(h.Fragment,{children:[" ","The old copy was left at ",h.jsx("code",{children:p.oldPathLeft})," (different disk) — you can delete it once you've confirmed everything works."]})]}),p.kind==="error"&&h.jsxs("div",{className:"error",children:["Move failed: ",p.message]}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"button",className:fi,onClick:w,disabled:o||!x||v||p.kind==="moving",children:o?"Checking…":"Check"}),h.jsx("button",{type:"submit",className:Wr,disabled:!x||v||p.kind==="moving",children:p.kind==="moving"?"Moving…":"Move data here"})]})]})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading…"]})]})}const bv=e=>e==="running"||e==="starting";function TG(e){return bv(e.status)?Nf(Date.now()-e.createdAt):e.endedAt?Nf(e.endedAt-e.createdAt):"—"}function uC({instances:e,emptyLabel:t}){return e.length===0?h.jsx("p",{className:"instances-empty m-0 py-3.5 px-4 border border-border rounded-lg bg-background text-subtext text-md",children:t}):h.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:h.jsxs("table",{className:"runs-table w-full border-collapse text-md bg-background [&_th]:text-left [&_th]:text-text [&_th]:text-xs [&_th]:font-semibold [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-[color-mix(in_oklab,_var(--text)_6%,_transparent)] [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Backend"}),h.jsx("th",{children:"Project"}),h.jsx("th",{children:"Status"}),h.jsx("th",{children:"Started"}),h.jsx("th",{children:"Runtime"})]})}),h.jsx("tbody",{children:e.map(n=>{var i;const r=typeof((i=n.backend)==null?void 0:i.url)=="string"?n.backend.url:void 0;return h.jsxs("tr",{children:[h.jsx("td",{children:h.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5 [&_.icon-btn]:w-5.5 [&_.icon-btn]:h-5.5",children:[h.jsx(N2,{backend:n.backend}),r&&h.jsx("a",{className:Xn,href:r,target:"_blank",rel:"noreferrer",title:"Open job page","aria-label":"Open job page",onClick:a=>a.stopPropagation(),children:h.jsx(xd,{size:12})})]})}),h.jsx("td",{children:n.projectName??XD(n.projectId)}),h.jsx("td",{children:h.jsx(Ma,{status:ss(n)})}),h.jsx("td",{children:Gs(n.createdAt)}),h.jsx("td",{children:TG(n)})]},n.id)})})]})})}function NG({onViewHistory:e}){const[t,n]=R.useState(null),[r,i]=R.useState(null),[a,o]=R.useState(!1),[,l]=R.useState(0);R.useEffect(()=>{const g=setInterval(()=>l(b=>b+1),3e4);return()=>clearInterval(g)},[]);const u=()=>{o(!0),hS().then(g=>{n(g),i(null)}).catch(g=>{i(g instanceof Error?g.message:String(g)),n(b=>b??[])}).finally(()=>o(!1))};R.useEffect(()=>u(),[]);const d=(g,b)=>b.createdAt-g.createdAt,p=t==null?void 0:t.filter(g=>bv(g.status)).sort(d),f=t==null?void 0:t.filter(g=>!bv(g.status)).sort(d);return h.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-6.5",children:[h.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0 [&_p]:text-muted [&_p]:text-sm [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[h.jsxs("div",{children:[h.jsxs("h2",{children:["Running instances",p&&p.length>0&&h.jsx("span",{className:"count-badge",children:p.length})]}),h.jsx("p",{children:"Compute currently active across all projects."})]}),h.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[h.jsxs("button",{className:Kn,onClick:u,disabled:a,children:[h.jsx(rh,{size:12,className:a?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," Refresh"]}),h.jsx("button",{className:Kn,onClick:e,children:`View history${f!=null&&f.length?` (${f.length})`:""}`})]})]}),r&&h.jsx("div",{className:"error",children:r}),!p||!f?h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading…"]}):h.jsx(uC,{instances:p,emptyLabel:"Nothing running right now."})]})}function jG({onBack:e}){const[t,n]=R.useState(null),[r,i]=R.useState(null),[a,o]=R.useState(!1),[,l]=R.useState(0);R.useEffect(()=>{const d=setInterval(()=>l(p=>p+1),3e4);return()=>clearInterval(d)},[]);const u=()=>{o(!0),hS().then(d=>{n(d.sort((p,f)=>f.createdAt-p.createdAt)),i(null)}).catch(d=>{i(d instanceof Error?d.message:String(d)),n(p=>p??[])}).finally(()=>o(!1))};return R.useEffect(u,[]),h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:e,children:[h.jsx(Cf,{size:14})," Back to Compute"]}),h.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[h.jsx("h1",{children:"Instance history"}),h.jsxs("button",{className:Kn,onClick:u,disabled:a,children:[h.jsx(rh,{size:12,className:a?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," Refresh"]})]}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"Every compute instance spun up across your projects."}),r&&h.jsx("div",{className:"error",children:r}),t?h.jsx(uC,{instances:t,emptyLabel:"No instances yet."}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading…"]})]})}const dC=["projects","harnesses","storage"],MG=[{id:"compute",label:"Compute",icon:h.jsx(sM,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:"Environment",icon:h.jsx(sS,{size:15}),activeTabs:["environment"]},{id:"settings",label:"Settings",icon:h.jsx(uR,{size:15}),activeTabs:["settings",...dC]}];function RG(e){return dC.includes(e)}function DG({tab:e,project:t,githubPublicationError:n,onProjectUpdate:r,onSelectTab:i}){const a=e==="settings"||RG(e);return h.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-md [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[a&&h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:"Settings"}),h.jsxs("div",{className:"settings-stack mt-4.5",children:[h.jsx("section",{className:Ju,children:h.jsx(_G,{})}),h.jsx("section",{className:Ju,children:h.jsx(kG,{})}),h.jsx("section",{className:Ju,children:h.jsx(Vq,{})}),h.jsx("section",{className:Ju,children:h.jsx(AG,{})}),h.jsx("section",{className:Ju,children:h.jsx(wG,{})})]})]}),e==="compute"&&h.jsx(dG,{project:t,onViewHistory:()=>i("instances")}),e==="instances"&&h.jsx(jG,{onBack:()=>i("compute")}),e==="environment"&&h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:"Environment"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"Variables available to runs and the research agent (API keys, tokens)."}),h.jsx(vG,{})]}),e==="git"&&h.jsx(CG,{project:t,publicationError:n,onProjectUpdate:r})]})}function LG({skills:e,activeIndex:t,onPick:n,onHover:r}){return h.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] left-0 min-w-85 max-w-full p-1.5 bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden",children:e.map((i,a)=>h.jsxs("button",{type:"button",className:`skill-item flex flex-col gap-0.5 w-full text-left py-[7px] px-2 rounded-sm [&.active]:bg-surface [&_.skill-name]:text-md [&_.skill-hint]:text-muted [&_.skill-desc]:text-sm [&_.skill-desc]:text-subtext ${a===t?"active":""}`,onMouseDown:o=>{o.preventDefault(),n(i)},onMouseEnter:()=>r(a),children:[h.jsxs("span",{className:"skill-name",children:["/",i.name," ",h.jsx("span",{className:"skill-hint",children:i.argHint})]}),h.jsx("span",{className:"skill-desc",children:i.description})]},i.name))})}function OG({cmd:e}){const[t,n]=R.useState(!1);return h.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[h.jsx("code",{className:tn,children:e}),h.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)}).catch(()=>{})},"aria-label":t?"Copied":`Copy ${e}`,title:t?"Copied":"Copy",children:t?h.jsx(Di,{size:11,strokeWidth:3}):h.jsx(n_,{size:11})})]})}function j2(e){return e?e.split(/`([^`]+)`/).map((t,n)=>n%2===1?h.jsx(OG,{cmd:t},n):t):null}function vv({harness:e,size:t=16}){const n=`block shrink-0${e==="claude-code"?" text-[#d97757]":""}`;return e==="claude-code"?h.jsx("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?h.jsx("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):h.jsx("svg",{className:n,width:t,height:t,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const IG=["model-group flex items-center justify-between gap-2","text-md font-semibold text-text pt-2.5 px-2 pb-1.5"].join(" "),_w=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-xs text-muted"].join(" "),ad={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"};function zG(e){var r,i;const t=e.find(a=>a.agentReady);if(!t)return null;const n=((r=t.models[0])==null?void 0:r.id)??null;return{harness:t.id,model:n,permissionMode:((i=t.options)==null?void 0:i.defaultPermissionMode)??null,reasoningLevel:lp(t,n).defaultId}}function Bo(e){const[t,n]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!t)return;const i=o=>{var l;(l=r.current)!=null&&l.contains(o.target)||n(!1)},a=o=>{var l;o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),n(!1),(l=e==null?void 0:e.current)==null||l.focus())};return document.addEventListener("mousedown",i,!0),document.addEventListener("keydown",a,!0),()=>{document.removeEventListener("mousedown",i,!0),document.removeEventListener("keydown",a,!0)}},[t,e]),{open:t,setOpen:n,ref:r}}function BG({value:e,onSelect:t,permissionChoices:n=[],defaultPermissionId:r,onSelectPermission:i,reasoningChoices:a=[],defaultReasoningId:o,onSelectReasoning:l,onHarnesses:u,lockHarness:d=!1}){var O,H,V,W,re;const[p,f]=R.useState([]),g=R.useRef(null),b=R.useRef(null),{open:S,setOpen:k,ref:x}=Bo(g),[v,w]=R.useState(""),[y,C]=R.useState("root"),N=()=>{k(!1),C("root"),w("")};R.useEffect(()=>{var le;S&&(y==="reasoning"||y==="permissions")&&((le=b.current)==null||le.focus())},[S,y]),R.useEffect(()=>{let le=!0;const pe=(B=!1)=>Tf(B).then(ie=>{le&&(f(ie),u==null||u(ie))}).catch(()=>{});pe();const te=u_(()=>void pe(!0));return()=>{le=!1,te()}},[]);const E=R.useMemo(()=>{const le=v.trim().toLowerCase();return(d&&e?p.filter(te=>te.id===e.harness):p).map(te=>{let B=te.models;return le?B=B.filter(ie=>ie.id.toLowerCase().includes(le)):te.id==="opencode"&&(B=B.slice(0,6)),{harness:te,models:B,hidden:le?0:te.models.length-B.length}})},[p,v,d,e]),j=(le,pe)=>{var B;const te=(e==null?void 0:e.harness)===le.id;t({harness:le.id,model:pe,permissionMode:te?e.permissionMode:((B=le.options)==null?void 0:B.defaultPermissionMode)??null,reasoningLevel:xS(le,pe,te?e.reasoningLevel:null)}),N()},T=(e==null?void 0:e.model)!=null?(O=p.find(le=>le.id===e.harness))==null?void 0:O.models.find(le=>le.id===e.model):void 0,D=e?e.model?T?Af(T):yS(e.model):"Default model":"Model",I=(e==null?void 0:e.reasoningLevel)??o??((H=a[0])==null?void 0:H.id),$=(V=a.find(le=>le.id===I))==null?void 0:V.label,F=(e==null?void 0:e.permissionMode)??r??((W=n[0])==null?void 0:W.id),U=(re=n.find(le=>le.id===F))==null?void 0:re.label,G=(e==null?void 0:e.harness)==="opencode"?"Variant":"Effort",X=le=>{l==null||l(le),N()},Y=le=>{i==null||i(le),N()},Z=(le,pe,te)=>h.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-md text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>C(te),children:[h.jsx("span",{className:"flex-1",children:le}),pe&&h.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:pe}),h.jsx(Xs,{size:14,className:"shrink-0 text-muted"})]}),Q=le=>h.jsxs("button",{ref:b,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-left text-sm font-medium text-text hover:bg-surface",onClick:()=>{C("root"),w("")},children:[h.jsx(Y8,{size:15}),le]}),z=(le,pe,te,B)=>h.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:le.map(ie=>h.jsxs("button",{className:hi,onClick:()=>B(ie.id),children:[h.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[h.jsxs("span",{children:[ie.label,ie.id===te&&h.jsx("span",{className:"font-normal text-muted",children:" · Default"})]}),ie.description&&h.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:ie.description})]}),ie.id===pe&&h.jsx(Di,{size:13})]},ie.id))});return h.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:x,children:[h.jsxs("button",{ref:g,type:"button",className:"composer-pill inline-flex min-w-0 max-w-full items-center gap-[5px] text-md text-text py-[5px] px-2 rounded-sm whitespace-nowrap transition-[background] duration-150 ease-standard [&:hover]:bg-surface",title:`Harness + model for this chat: ${D}${$?` · ${$}`:""}`,"aria-haspopup":"menu","aria-expanded":S,onClick:()=>{S?N():(C("root"),k(!0))},children:[(e==null?void 0:e.harness)&&h.jsx(vv,{harness:e.harness,size:14}),h.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[D,$&&h.jsx("span",{className:"model-picker-reasoning ml-1 text-muted",children:$})]}),h.jsx(Rl,{size:14,className:"shrink-0 text-muted"})]}),S&&h.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-[0_10px_26px_rgba(0,_0,_0,_0.16)] z-50 overflow-hidden w-72 [&.align-right]:left-auto [&.align-right]:right-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[y==="root"&&h.jsxs("div",{className:"model-root-menu p-1",children:[Z("Model",D,"models"),a.length>0&&Z(G,$,"reasoning"),n.length>0&&Z("Mode",U,"permissions")]}),y==="models"&&h.jsxs(h.Fragment,{children:[Q("Model"),h.jsx("input",{autoFocus:!0,type:"text",placeholder:"Search models…",value:v,onChange:le=>w(le.target.value)}),h.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[E.map(({harness:le,models:pe,hidden:te})=>h.jsxs("div",{className:"[&_.model-item]:pl-6",children:[h.jsxs("div",{className:IG,children:[h.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[h.jsx(vv,{harness:le.id,size:14}),le.name]}),!le.agentReady&&h.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[h.jsx(t3,{size:10})," Unavailable"]})]}),le.agentReady?h.jsxs(h.Fragment,{children:[le.models.length===0&&h.jsxs("button",{className:hi,onClick:()=>j(le,null),children:[h.jsxs("span",{children:["Default model",h.jsx("span",{className:"model-id",children:"CLI configuration"})]}),(e==null?void 0:e.harness)===le.id&&(e==null?void 0:e.model)===null&&h.jsx(Di,{size:13})]}),pe.map(B=>h.jsxs("button",{className:hi,title:B.id,onClick:()=>j(le,B.id),children:[h.jsx("span",{children:Af(B)}),(e==null?void 0:e.harness)===le.id&&(e==null?void 0:e.model)===B.id&&h.jsx(Di,{size:13})]},B.id)),te>0&&h.jsxs("div",{className:_w,children:[te," more — search to find"]}),v.trim().length>0&&!le.models.some(B=>B.id===v.trim())&&h.jsx("button",{className:hi,onClick:()=>j(le,v.trim()),children:h.jsxs("span",{children:["Use “",v.trim(),"”",h.jsx("span",{className:"model-id",children:"pass as the model id"})]})})]}):h.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-xs text-muted model-unavailable leading-normal border-b border-b-border-variant",children:le.agentNote?j2(le.agentNote):"Not available"})]},le.id)),p.length===0&&h.jsx("div",{className:_w,children:"Detecting harnesses…"})]}),d&&e&&p.length>1&&h.jsxs("div",{className:"model-locked-note flex items-center gap-1.5 py-[7px] px-3 text-xs text-muted border-t border-t-border-variant [&_svg]:shrink-0",children:[h.jsx(t3,{size:11}),"Sessions keep their harness — new chat to switch"]})]}),y==="reasoning"&&h.jsxs(h.Fragment,{children:[Q(G),z(a,I,o,X)]}),y==="permissions"&&h.jsxs(h.Fragment,{children:[Q("Mode"),z(n,F,r,Y)]})]})]})}function HG(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const _v=6.5,xw=2*Math.PI*_v;function $G({usage:e}){return!e||e.usedTokens<=0?null:h.jsx(FG,{usage:e})}function FG({usage:e}){const{open:t,setOpen:n,ref:r}=Bo(),{usedTokens:i,contextWindow:a}=e,o=a&&a>0?Math.min(100,Math.round(i/a*100)):null,l=o===null?"var(--accent)":HG(o);return h.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[h.jsx("button",{type:"button",className:"composer-bare inline-flex items-center gap-[3px] text-md text-text py-[5px] px-1 rounded-sm transition-[background] duration-150 ease-standard [&:hover]:bg-surface [&.context-ring]:inline-flex [&.context-ring]:items-center [&.context-ring]:mr-2 context-ring",title:"Context window used",onClick:()=>n(u=>!u),children:o===null?N0(i):h.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[h.jsx("circle",{cx:"8",cy:"8",r:_v,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),h.jsx("circle",{cx:"8",cy:"8",r:_v,fill:"none",stroke:l,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${xw*Math.max(o,2)/100} ${xw}`,transform:"rotate(-90 8 8)"})]})}),t&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 align-right context-meter-menu w-70 pt-2.5 px-3 pb-3 [&_.progress]:mt-2 [&_.progress]:mx-0 [&_.progress]:mb-0 [&_.progress-track]:h-[5px] [&_.progress-track]:border-0 [&_.progress-track]:bg-border",children:[h.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[h.jsx("span",{children:"Context window"}),h.jsx("span",{className:"context-meter-value text-text tabular-nums",children:o===null?`${N0(i)} tokens`:`${N0(i)} / ${N0(a)} (${o}%)`})]}),o!==null&&h.jsx(oC,{value:i,max:a,fillColor:l})]})]})}const xv={name:"plan",description:"Toggle Plan mode for this chat",argHint:"",source:"command"},PG=new Set([xv.name]);function yw(e,t){if(t<0||t>e.length)return null;let n=t;for(;n>0&&!/\s/.test(e[n-1]);)n-=1;if(e[n]!=="/")return null;let r=t;for(;r0}}function UG(e,t){return t?e.filter(n=>n.source==="command"&&PG.has(n.name.toLowerCase())):e}function qG(e,t){let n=e.slice(0,t.start),r=e.slice(t.end);return n?r?/\s$/.test(n)&&/^\s/.test(r)&&(r=r.slice(1)):n=n.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:n+r,cursor:n.length}}function GG(e,t){const n=e.filter(r=>r.name.toLowerCase()!==xv.name);return t?[xv,...n]:n}function VG(e,t){if(!t)return null;const n=/(^|\s)\/plan(?=\s|$)/gi;return n.test(e)?{prompt:e.replace(n,"").trim()}:null}function WG(e,t,n){if(e==="command")return t!==void 0?t:n??void 0}const M2="orx:demo-read-sessions";function hC(){try{const e=JSON.parse(sessionStorage.getItem(M2)??"[]");return new Set(Array.isArray(e)?e.filter(t=>typeof t=="string"):[])}catch{return new Set}}function YG(e){try{const t=hC();t.add(e),sessionStorage.setItem(M2,JSON.stringify([...t]))}catch{}}function XG(){try{sessionStorage.removeItem(M2)}catch{}}function KG(e){return e.replace(/([\\`*_[\]<>$~])/g,"\\$1").replace(/(^|\n)(\s*)(#{1,6}|>|[-+]|\d+\.)\s/g,"$1$2\\$3 ").replace(/(^|\n)(\s*)(=+|-{1,2})(?=\s*(?:\n|$))/g,"$1$2\\$3").replace(/(^|\n)(\s*)(-{3,})(?=\s*(?:\n|$))/g,"$1$2\\$3")}function ZG(e){const t=Math.max(0,...Array.from(e.matchAll(/`+/g),i=>i[0].length)),n="`".repeat(t+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${n}${r}${n}`}function QG(e){const t=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),n="`".repeat(Math.max(3,t+1));return` - -${n} -${e.replace(/^\n|\n$/g,"")} -${n} - -`}function yv(e,t){return t?` - -\\[ -${e} -\\] - -`:`\\(${e}\\)`}function JG(e,t){const n=t.trim().split(` -`),r=" ".repeat(e.length+1);return[`${e} ${n[0]??""}`,...n.slice(1).map(i=>i?`${r}${i}`:"")].join(` -`)}function eV(e,t){if(e.length===0)return"";const n=Math.max(...e.map(o=>o.length)),r=o=>`| ${Array.from({length:n},(l,u)=>o[u]??"").join(" | ")} |`,i=t?e[0]:Array.from({length:n},()=>""),a=t?e.slice(1):e;return[r(i),r(Array.from({length:n},()=>"---")),...a.map(r)].join(` -`)}function tV(e,t){const n=Number(e.slice(1));return Number.isInteger(n)&&n>=1&&n<=6?`${"#".repeat(n)} ${t.trim()}`:void 0}function nV(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function rV(e,t){return Math.min(e.length,t.length)/Math.max(e.length,t.length)>=.8&&(e.includes(t)||t.includes(e))}const iV=["tool-line flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap","text-lg"].join(" "),El=256,fC=1024,sV=2e4,Kg=8,U0="chat-annotations";function gl(e){return e instanceof Element?e:e.parentElement}function ww(e){const t=document.createRange();return t.setStart(e.container,e.offset),t.collapse(!0),t}function Zg(e,t){return ww(e).compareBoundaryPoints(Range.START_TO_START,ww(t))<0}function Sw(e,t){const n=document.createRange();return n.setStart(e.container,e.offset),n.setEnd(t.container,t.offset),n.cloneContents()}const aV=new Set(["A","B","CODE","EM","I","STRONG"]);function oV(e,t){var i,a;const n=gl(e.endContainer);if(Array.from(t.childNodes).every(o=>o.nodeType===Node.TEXT_NODE)){let o=gl(e.startContainer);for(;o&&o.matches(".md *")&&o.contains(n);){if(aV.has(o.tagName)){const l=o.cloneNode(!1);l instanceof HTMLElement&&(l.replaceChildren(...Array.from(t.childNodes)),t.replaceChildren(l))}o=o.parentElement}}const r=(i=gl(e.startContainer))==null?void 0:i.closest("pre");if(r!=null&&r.contains(n)){const o=(a=r.querySelector("code"))==null?void 0:a.cloneNode(!1),l=r.cloneNode(!1);l instanceof HTMLElement&&o instanceof HTMLElement&&(o.replaceChildren(...Array.from(t.childNodes)),l.replaceChildren(o),t.replaceChildren(l))}}function lV(e){e.querySelectorAll("button").forEach(t=>{t.replaceWith(document.createTextNode(t.textContent??""))}),e.querySelectorAll("script, style, iframe, object, embed, input, textarea, select").forEach(t=>t.remove()),e.querySelectorAll("*").forEach(t=>{for(const n of Array.from(t.attributes))(n.name.toLowerCase().startsWith("on")||n.name==="contenteditable"||n.name==="tabindex")&&t.removeAttribute(n.name)})}function cV(e,t){const n=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let i={container:e.startContainer,offset:e.startOffset};const a=Array.from(t.querySelectorAll(".katex")).filter(o=>e.intersectsNode(o));for(const o of a){const l=o.closest(".katex-display")??o,u=document.createRange();u.selectNode(l);const d={container:u.startContainer,offset:u.startOffset},p={container:u.endContainer,offset:u.endOffset};if(Zg(i,d)&&n.append(Sw(i,d)),n.append(l.cloneNode(!0)),i=p,!Zg(i,r))break}return a.length===0?n.append(e.cloneContents()):Zg(i,r)&&n.append(Sw(i,r)),oV(e,n),lV(n),n}function uV(e){const t=Array.from(e.querySelectorAll("tr")).map(n=>Array.from(n.querySelectorAll(":scope > th, :scope > td")).map(r=>Rd(r).trim().replaceAll("|","\\|"))).filter(n=>n.length>0);return t.length>0?` - -${eV(t,!!e.querySelector("tr:first-child th"))} - -`:""}function pC(e){const t=e.tagName==="OL",n=e.getAttribute("start"),r=n===null?1:Number(n);let i=Number.isFinite(r)?r:1;const a=[];for(const o of Array.from(e.children).filter(l=>l instanceof HTMLElement&&l.tagName==="LI")){const l=o.getAttribute("value"),u=l===null?i:Number(l),d=Number.isFinite(u)?u:i;i=d+1;const p=Array.from(o.childNodes).map(f=>f instanceof HTMLElement&&f.matches("UL, OL")?` -${pC(f).trim()} -`:Rd(f)).join("").trim();a.push(JG(t?`${d}.`:"-",p))}return` - -${a.join(` -`)} - -`}function Rd(e){var r,i,a,o,l;if(e.nodeType===Node.TEXT_NODE)return KG(e.textContent??"");if(!(e instanceof HTMLElement))return Array.from(e.childNodes).map(Rd).join("");if(e.matches(".katex-display")){const u=(i=(r=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:r.textContent)==null?void 0:i.trim();return u?yv(u,!0):""}if(e.matches(".katex")){const u=(o=(a=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:a.textContent)==null?void 0:o.trim();return u?yv(u,!1):""}if(e.tagName==="BR")return` -`;if(e.tagName==="TABLE")return uV(e);if(e.matches("UL, OL"))return pC(e);if(e.tagName==="CODE"&&((l=e.parentElement)==null?void 0:l.tagName)!=="PRE")return ZG(e.textContent??"");if(e.tagName==="PRE")return QG(e.textContent??"");const t=Array.from(e.childNodes).map(Rd).join("");if(!t)return"";if(e.matches("strong, b"))return`**${t}**`;if(e.matches("em, i"))return`*${t}*`;if(e.tagName==="A"){const u=e.getAttribute("href");return u?`[${t}](${u})`:t}if(e.tagName==="LI")return`${t.trim()} -`;if(e.matches("TH, TD"))return`${t.trim()} | `;if(e.tagName==="TR")return`${t.replace(/ \| $/,"")} -`;if(e.tagName==="BLOCKQUOTE")return` - -${t.trim().split(` -`).map(u=>`> ${u}`).join(` -`)} - -`;const n=tV(e.tagName,t);return n?` - -${n} - -`:e.matches("P, DIV, UL, OL, TABLE")?` - -${t.trim()} - -`:t}function dV(e,t){return Rd(e).replace(/\r\n?/g,` -`).replace(/[ \t]+\n/g,` -`).replace(/\n{3,}/g,` - -`).trim()||t}function kw(e){return e.normalize("NFKC").replace(/[\s\u200B-\u200D\u2060\uFEFF]/g,"").toLowerCase()}function hV(e,t){var i,a,o,l;if(!nV(e))return;const n=kw(e);if(n.length<8)return;let r;for(const u of t.querySelectorAll(".msg-assistant > .md .katex")){const p=[(i=u.querySelector(".katex-mathml"))==null?void 0:i.textContent,(a=u.querySelector(".katex-html"))==null?void 0:a.textContent,u.textContent].filter(S=>!!S).map(kw).find(S=>rV(S,n));if(!p)continue;const f=(l=(o=u.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:o.textContent)==null?void 0:l.trim();if(!f)continue;const g=!!u.closest(".katex-display"),b={markdown:yv(f,g).trim(),delta:Math.abs(p.length-n.length)};(!r||b.deltaT.width>0&&T.height>0),S=b[0]??n.getBoundingClientRect(),k=b.filter(T=>T.topS.top),x=k.length>0?k:[S],v=Math.min(...x.map(T=>T.left)),w=Math.max(...x.map(T=>T.right)),y=Math.min(...x.map(T=>T.top)),C=Math.max(...x.map(T=>T.bottom)),N=34,E=74,j=y>=N+Kg?y-N-Kg:C+Kg;return{text:dV(g,f),range:n.cloneRange(),x:Math.min(window.innerWidth-E,Math.max(E,v+(w-v)/2)),top:j}}function pV(e,t){const[n,r]=R.useState(null),i=R.useRef(!1),a=R.useCallback(()=>{const u=e.current;r(u?fV(u):null)},[e]);R.useEffect(()=>{let u=null;const d=()=>{i.current||a()},p=g=>{const b=e.current,S=g.target;!g.isPrimary||g.button!==0||!b||!(S instanceof Node)||!b.contains(S)||(i.current=!0,r(null))},f=g=>{!g.isPrimary||!i.current||(i.current=!1,u=window.requestAnimationFrame(a))};return document.addEventListener("selectionchange",d),document.addEventListener("pointerdown",p,!0),window.addEventListener("pointerup",f,!0),window.addEventListener("pointercancel",f,!0),()=>{document.removeEventListener("selectionchange",d),document.removeEventListener("pointerdown",p,!0),window.removeEventListener("pointerup",f,!0),window.removeEventListener("pointercancel",f,!0),u!==null&&window.cancelAnimationFrame(u),i.current=!1}},[a]),R.useEffect(()=>{if(!n)return;const u=d=>{const p=d.target;p instanceof Element&&p.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",u,!0),window.addEventListener("resize",a),()=>{document.removeEventListener("mousedown",u,!0),window.removeEventListener("resize",a)}},[n,a]);const o=R.useCallback(()=>{var u;n&&(t({text:n.text,range:n.range}),r(null),(u=window.getSelection())==null||u.removeAllRanges())},[n,t]),l=R.useCallback(()=>r(null),[]);return{action:n,add:o,dismiss:l}}function mV(e){R.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const t=e.flatMap(r=>r.range?[r.range]:[]);if(t.length===0){CSS.highlights.delete(U0);return}const n=new Highlight(...t);return CSS.highlights.set(U0,n),()=>{CSS.highlights.get(U0)===n&&CSS.highlights.delete(U0)}},[e])}function gV({annotation:e}){const t=R.useRef(null),[n,r]=R.useState();return R.useLayoutEffect(()=>{var a;const i=(a=t.current)==null?void 0:a.closest(".chat-thread-inner");r(i?hV(e.text,i):void 0)},[e.id,e.text]),h.jsx("div",{ref:t,children:h.jsx(La,{text:n??e.text})})}function bV({annotations:e,onRemove:t}){return e.map((n,r)=>h.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${t?"grid-cols-[24px_minmax(0,_1fr)_24px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[h.jsxs("span",{className:"text-sm text-muted text-right",children:[r+1,"."]}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"text-sm text-muted mb-1",children:"Selected text:"}),h.jsx(gV,{annotation:n})]}),t&&h.jsx("button",{type:"button",className:"inline-flex items-center justify-center w-6 h-6 rounded-sm text-muted [&:hover]:bg-surface [&:hover]:text-text",title:"Remove annotation","aria-label":`Remove annotation ${r+1}`,onClick:()=>t(n.id),children:h.jsx(qr,{size:13})})]},n.id))}function R2({annotations:e,variant:t,onClear:n,onRemove:r}){const i=R.useRef(null),a=R.useRef(null),o=R.useId(),l=Bo(i),u=t==="sent",d=R.useRef(null),p=()=>{d.current!==null&&window.clearTimeout(d.current),d.current=null,l.setOpen(!0)},f=()=>{d.current=window.setTimeout(()=>{var S;(S=a.current)!=null&&S.contains(document.activeElement)||l.setOpen(!1)},160)},g=()=>{const S=u||!l.open;l.setOpen(S),S&&window.requestAnimationFrame(()=>{var k;return(k=a.current)==null?void 0:k.focus()})},b=S=>{r==null||r(S),window.requestAnimationFrame(()=>{var x,v;(v=((x=a.current)==null?void 0:x.querySelector("button[aria-label^='Remove annotation']"))??a.current??i.current)==null||v.focus()})};return R.useEffect(()=>()=>{d.current!==null&&window.clearTimeout(d.current)},[]),h.jsxs("div",{className:u?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:l.ref,onMouseEnter:u?p:void 0,onMouseLeave:u?f:void 0,children:[h.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${u?"rounded-full":"rounded-sm"}`,children:[h.jsxs("button",{ref:i,type:"button",className:`inline-flex items-center gap-1.5 py-1 text-sm font-medium text-text [&:hover]:bg-surface ${u?"px-2.5":"pl-2 pr-1.5"}`,"aria-expanded":l.open,"aria-haspopup":"dialog","aria-controls":o,onClick:g,children:[h.jsx(nS,{size:u?13:14,className:"text-muted"}),e.length," ",e.length===1?"annotation":"annotations"]}),n&&h.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-l border-border [&:hover]:bg-surface [&:hover]:text-text",title:"Clear annotations","aria-label":"Clear annotations",onClick:n,children:h.jsx(qr,{size:13})})]}),l.open&&h.jsx("div",{id:o,ref:a,tabIndex:-1,className:`annotation-menu absolute bottom-[calc(100%_+_8px)] z-50 w-[min(440px,_calc(100vw_-_48px))] max-h-80 overflow-y-auto overscroll-contain bg-background border border-border rounded-lg shadow-[0_4px_16px_rgba(0,_0,_0,_0.10)] p-2 text-left ${u?"right-0 after:absolute after:top-full after:left-0 after:right-0 after:h-2 after:content-['']":"left-3"}`,role:"dialog","aria-label":"Selected chat text",children:h.jsx(bV,{annotations:e,onRemove:r?b:void 0})})]})}function vV(e){return h.jsx(R2,{...e,variant:"composer"})}const _V=["prompt-collapsed text-muted text-lg font-[375] my-3.5 mx-0 [&_summary]:flex","[&_summary]:items-center [&_summary]:gap-2 [&_summary]:cursor-pointer","[&_summary]:list-none [&_summary]:select-none [&_summary::-webkit-details-marker]:hidden","[&_summary::after]:content-['›'] [&_summary::after]:text-muted","[&_summary::after]:transition-transform [&_summary::after]:duration-80 [&_summary::after]:ease-standard [&[open]_summary::after]:rotate-90"].join(" "),Cw=["prompt-collapsed-body mt-1.5 pl-3 border-l-2 border-l-border","text-md text-subtext"].join(" "),xV=["prompt-collapsed plan-resolved text-subtext my-3.5 mx-0","[&_summary]:flex [&_summary]:items-center [&_summary]:gap-2 [&_summary]:w-fit [&_summary]:max-w-full","[&_summary]:py-[3px] [&_summary]:px-1 [&_summary]:cursor-pointer [&_summary]:rounded-sm","[&_summary]:list-none [&_summary]:select-none [&_summary:hover]:bg-surface","[&_summary::-webkit-details-marker]:hidden","[&_summary_.plan-chevron]:transition-transform [&_summary_.plan-chevron]:duration-120","[&_summary_.plan-chevron]:ease-standard [&[open]_summary_.plan-chevron]:rotate-90"].join(" "),yV=["prompt-head text-xs font-semibold text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),wv=["prompt-actions flex flex-wrap gap-2 [&_.btn-primary]:inline-flex","[&_.btn-primary]:items-center [&_.btn-primary]:gap-1.5 [&_.btn-primary]:py-1.5 [&_.btn-primary]:px-[13px]","[&_.btn-primary]:font-[inherit] [&_.btn-primary]:text-sm","[&_.btn-primary]:font-semibold [&_.btn-primary]:border [&_.btn-primary]:border-transparent","[&_.btn-primary]:rounded-sm [&_.btn-primary]:cursor-pointer","[&_.btn-primary]:transition-[background,border-color] [&_.btn-primary]:duration-80 [&_.btn-primary]:ease-standard [&_.btn-ghost]:inline-flex","[&_.btn-ghost]:items-center [&_.btn-ghost]:gap-1.5 [&_.btn-ghost]:py-1.5 [&_.btn-ghost]:px-[13px]","[&_.btn-ghost]:font-[inherit] [&_.btn-ghost]:text-sm","[&_.btn-ghost]:font-semibold [&_.btn-ghost]:border [&_.btn-ghost]:border-transparent","[&_.btn-ghost]:rounded-sm [&_.btn-ghost]:cursor-pointer","[&_.btn-ghost]:transition-[background,border-color] [&_.btn-ghost]:duration-80 [&_.btn-ghost]:ease-standard","[&_.btn-primary]:bg-primary [&_.btn-primary]:text-background","[&_.btn-primary:hover:not(:disabled)]:opacity-90 [&_.btn-ghost]:bg-transparent","[&_.btn-ghost]:border-border [&_.btn-ghost]:text-subtext","[&_.btn-ghost:hover:not(:disabled)]:border-border-strong","[&_.btn-ghost:hover:not(:disabled)]:text-text","[&_.btn-ghost:hover:not(:disabled)]:bg-surface [&_button:disabled]:opacity-50","[&_button:disabled]:cursor-default"].join(" "),Ic="local-",Ew=[];function wV(e,t){const n=e.findIndex(r=>r.id===t.id);if(n>=0){const r=e.slice();return r[n]=t,r}return t.role!=="user"?[...e,t]:[...e.filter(r=>!r.id.startsWith(Ic)),t]}function SV(e,t){switch(t.type){case"reset":return{messagesBySession:{},busySessions:new Set,queuedBySession:{},activeLeafBySession:{}};case"seed":return t.onlyIfAbsent&&t.sessionId in e.messagesBySession?e:{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:t.messages},queuedBySession:{...e.queuedBySession,[t.sessionId]:t.queued??[]},activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:t.activeLeafId??null}};case"upsertMessage":{const n=e.messagesBySession[t.sessionId]??[],r=n.some(l=>l.id===t.message.id),i=e.activeLeafBySession[t.sessionId]??null,a=t.message.role==="user"&&i!==null&&i.startsWith(Ic),o=t.message.parentId!=null&&t.message.parentId===i;return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:wV(n,t.message)},activeLeafBySession:r&&!a&&!o?e.activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:t.message.id}}}case"localError":{const n=e.messagesBySession[t.sessionId]??[],r={id:`${Ic}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:t.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[t.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:[...n,r]},activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:r.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:t.leafId}};case"optimisticUser":{const n=e.messagesBySession[t.sessionId]??[],r=t.text?[{id:"p0",type:"text",text:t.text}]:[];t.attachments.forEach((a,o)=>r.push({id:`img${o}`,type:"image",text:a.url,name:a.name})),t.annotations.forEach((a,o)=>r.push({id:`annotation${o}`,type:"annotation",text:a.text}));const i={id:`${Ic}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[t.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:[...n,i]},activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:i.id}}}case"busy":{const n=new Set(e.busySessions);return t.busy?n.add(t.sessionId):n.delete(t.sessionId),{...e,busySessions:n}}case"seedBusy":{const n=new Set(t.sessions),r=new Set(t.known);for(const i of e.busySessions)r.has(i)||n.add(i);return{...e,busySessions:n}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[t.sessionId]:t.items}};case"forget":{const n={...e.messagesBySession};delete n[t.sessionId];const r=new Set(e.busySessions);r.delete(t.sessionId);const i={...e.queuedBySession};delete i[t.sessionId];const a={...e.activeLeafBySession};return delete a[t.sessionId],{messagesBySession:n,busySessions:r,queuedBySession:i,activeLeafBySession:a}}}}function kV(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 dl(e){const t=e.replace(/\/+$/,"");return t.slice(t.lastIndexOf("/")+1)||t}function ji(e,...t){for(const n of t){const r=e[n];if(typeof r=="string"&&r)return r}return null}function Qg(e,t,n){const r=e[t];if(!Array.isArray(r))return null;for(const i of r){if(!i||typeof i!="object"||!(n in i))continue;const a=i[n];if(typeof a=="string"&&a)return a}return null}function Jg(e,t){const n=e[t];if(!Array.isArray(n))return[];const r=[];for(let i=0;i=El));i++);return r}function zc(...e){const t=new Set,n=new RegExp(`^${wl}$`,"i");let r=0;for(const i of e)for(const a of i){if(t.size>=El||r++>=fC)return[...t];n.test(a)&&t.add(a.toLowerCase())}return[...t]}function D2(e){return e.replace(/^Exit code \d+\s*/i,"").split(` -`).filter(t=>!/^\s*\[orx-(?:run|experiment):[^\]]+\]\s*$/.test(t)).join(` -`).trim()}function CV(e){const t=e.changes;if(!Array.isArray(t))return null;for(const n of t){if(!n||typeof n!="object"||!("path"in n)||typeof n.path!="string")continue;const r="kind"in n?n.kind:null,i=r&&typeof r=="object"&&"type"in r&&typeof r.type=="string"?r.type:null;return{path:n.path,type:i}}return null}function EV(e){const t=e.trim(),n=t.match(/^\/bin\/(?:ba|z)?sh\s+-lc\s+([\s\S]+)$/);let r=((n==null?void 0:n[1])??t).trim();const i=r[0];return(i==='"'||i==="'")&&r[r.length-1]===i&&(r=r.slice(1,-1)),TV(r).replace(/[\t\r ]+/g," ").trim()}function AV(e){let t=null,n=!1;for(let r=0;r{n&&t.push(n),n=""};for(const o of e){if(i){n+=o,i=!1;continue}if(o==="\\"&&r!=="'"){i=!0;continue}if(r){o===r?r=null:n+=o;continue}if(o==='"'||o==="'"){r=o;continue}/\s/.test(o)?a():n+=o}return a(),t}function gC(e){const t=e==null?void 0:e.replace(/[)'\"]+$/,"");return!t||t==="-"||/^\d+$/.test(t)||/[$`]/.test(t)?null:t}function bC(e){const t=gC(e);if(!t)return null;const n=dl(t);return t.includes("/")||t.startsWith(".")||/\.[A-Za-z0-9][A-Za-z0-9_-]*$/.test(n)||/^(?:Dockerfile|Makefile|README|LICENSE|NOTICE|CHANGELOG)$/i.test(n)?t:null}function vC(e){var i,a;const t=mC(e);let n=0;for(;["do","then","else","if","while","until"].includes(t[n]);)n++;for(;/^[A-Za-z_][A-Za-z0-9_]*=/.test(t[n]??"");)n++;if(t[n]==="command")for(n++;(i=t[n])!=null&&i.startsWith("-");)n++;if(t[n]==="env")for(n++;(a=t[n])!=null&&a.startsWith("-")||/^[A-Za-z_][A-Za-z0-9_]*=/.test(t[n]??"");)n++;const r=t[n];return r?{name:r.split("/").pop()??r,args:t.slice(n+1)}:null}function NV(e){const{name:t,args:n}=e;if(t==="sed"){let i=0,a=!1;for(;i!a.startsWith("-")&&a.includes(":"));if(!t)return null;const n=t.indexOf(":"),r=t.slice(0,n),i=t.slice(n+1);return r&&bC(i)?{ref:r,path:i}:null}function MV(e){const t=e.match(/\b(?:rg|grep)\b(?:\s+-[^\s]+)*\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/);return(t==null?void 0:t[1])??(t==null?void 0:t[2])??(t==null?void 0:t[3])??null}function Aw(e,t){if(/[$`~]/.test(e)||/[$`~]/.test(t))return null;const n=t.startsWith("/")||!t.startsWith("/")&&e.startsWith("/"),r=t.startsWith("/")?[]:e.split("/").filter(Boolean);for(const a of t.split("/"))if(!(!a||a===".")){if(a===".."){r.length>0&&r[r.length-1]!==".."?r.pop():n||r.push(a);continue}r.push(a)}return`${n?"/":""}${r.join("/")}`||(n?"/":null)}function RV(e,t,n,r){if(e.startsWith("/"))return e;let i=r??"";for(let a=0;a!d.startsWith("-"));if(!l)return null;const u=Aw(i,l);if(!u)return null;i=u}return i?Aw(i,e):e}const Ca="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",wl=`(?:${Ca}|[0-9a-f]{8})`;function bd(e){const t=[];let n="",r="",i=null,a=!1;const o=()=>{(n.trim()||r.trim())&&t.push({raw:n.trim(),code:r.trim()}),n="",r=""},l=d=>{let p=1,f=null,g=!1;for(let b=d;b{let p=!1;for(let f=d;fn.test(r.code))}function Ea(e,t){return Dd(e,t).length>0?!0:new RegExp(`(?:^|[\\s($;])orx\\s+${t}\\b`,"i").test(e)}function Sv(e,t){if(!e)return[];const n=new Set,r=e.slice(0,sV),i=t==="runs"?[new RegExp(`/runs/(${Ca})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${Ca})`,"gi"),new RegExp(`^\\s*RUN\\s+(${Ca})\\b`,"gim"),new RegExp(`={3,}\\s*(${Ca})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${Ca})`,"gi"),new RegExp(`^\\s*id:\\s*(${Ca})`,"gim"),new RegExp(`={3,}\\s*(${Ca})\\s*={3,}`,"gi")];for(const o of i)for(const l of r.matchAll(o))if(n.add(l[1]),n.size>=El)return[...n];const a=new RegExp(`^\\s*(${Ca})(?:\\s|$)`,"gim");for(const o of r.matchAll(a))if(n.add(o[1]),n.size>=El)break;return[...n]}function _C(e,t){let n=0;return t.map(r=>{const i=e.indexOf(r.raw,n),a=i===-1?e.indexOf(r.raw):i;return n=Math.max(n,a+r.raw.length),{invocation:r,offset:Math.max(0,a)}})}function xC(e,t,n,r){const i=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let a="";for(const o of e.matchAll(i)){if((o.index??0)>=n)break;a=o[1]??o[2]??o[3]??""}return[...a.matchAll(new RegExp(r,"gi"))].map(o=>o[0])}function yC(e,t,n,r){const i=new RegExp(`\\bfor\\s+${t}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let a="";for(const o of e.matchAll(i)){const l=o.index??0;if(l>=n)break;const u=l+o[0].length;u<=n&&/\bdone\b/.test(e.slice(u,n))||(a=o[1])}return/\$\(|`/.test(a)?[]:[...a.matchAll(new RegExp(r,"gi"))].map(o=>o[0])}function DV(e,t,n=[],r=[]){const i=Dd(e,"logs"),a=new Set;if(i.length===0){if(!Ea(e,"logs"))return[];const l=n.length>0?[]:Sv(t,"runs");for(const u of n.length>0?n:l.length>0?l:r)if(a.add(u),a.size>=El)break;return zc([...a])}let o=!1;for(const{invocation:l,offset:u}of _C(e,i)){const d=/\borx\s+logs\b/i.exec(l.raw);if(!d)continue;const p=mC(l.raw.slice(d.index+d[0].length));let f=null;for(let x=0;x0?[]:Sv(t,"runs"),u=n.length>0?n:l.length>0?l:r;for(const d of u)if(a.add(d),a.size>=El)break}return zc([...a])}function yc(e,t,n=[],r=[]){const i=Dd(e,"exp\\s+(?:status|desc)");if(i.length===0)return[];const a=new Set;let o=!1;for(const{invocation:l,offset:u}of _C(e,i)){let d=!1;for(const f of l.raw.matchAll(new RegExp(`\\borx\\s+exp\\s+(?:status|desc)\\s+["']?(${wl})`,"gi")))a.add(f[1]),d=!0;const p=/\borx\s+exp\s+(?:status|desc)\s+["']?\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?/.exec(l.raw);if(p){const f=p[1],g=xC(e,f,u,wl);if(g.length>0){for(const S of g)a.add(S);d=!0}const b=yC(e,f,u,wl);for(const S of b)a.add(S);b.length>0&&(d=!0)}d||(o=!0)}if(a.size===0||o){const l=n.length>0?[]:Sv(t,"experiments"),u=n.length>0?n:l.length>0?l:r;for(const d of u)if(a.add(d),a.size>=El)break}return zc([...a])}function Ws(e){var x,v,w,y;const t=e.tool??"tool",n=((x=e.state)==null?void 0:x.input)??{},r=n.arguments,i=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},a={...n,...i},o=ji(a,"command","cmd"),l=((v=e.state)==null?void 0:v.output)||((w=e.state)==null?void 0:w.error),u=zc(Jg(a,"targetIds")),d=zc(Jg(a,"runTargetIds")),p=zc(Jg(a,"experimentTargetIds")),f=ji(a,"filePath","file_path","notebookPath","notebook_path","path"),g=ji(a,"description"),b=t.toLowerCase().split(/(?::|\.|__)+/),S=b.at(-1)??t.toLowerCase();if(S==="run"&&b.includes("web")){const C=Qg(a,"search_query","q"),N=Qg(a,"image_query","q"),E=Qg(a,"find","pattern");return C?{kind:"web",label:`Searched the web for “${C}”`}:N?{kind:"web",label:`Searched images for “${N}”`}:E?{kind:"web",label:`Searched a web page for “${E}”`}:Array.isArray(a.open)?{kind:"web",label:"Opened web pages"}:Array.isArray(a.weather)?{kind:"web",label:"Checked the weather"}:Array.isArray(a.finance)?{kind:"web",label:"Checked market data"}:Array.isArray(a.sports)?{kind:"web",label:"Checked sports data"}:Array.isArray(a.time)?{kind:"web",label:"Checked local times"}:{kind:"web",label:"Browsed the web"}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(S)??S){case"bash":{if(!o)return{kind:"command",label:"Ran a command"};const C=EV(o),N=Dd(C,"(?:lit|paper)")[0],E=N?pL(N.raw):null;if(E){const re=E.kind==="lit"?E.query?`Searched for “${E.query}”`:"Searched the literature":E.id?`Read ${E.id}`:"Read a paper";return{kind:E.kind==="lit"?"search":"read",label:re,litCall:E}}const j=bd(C),T=j.map(re=>vC(re.raw)),D=Ea(C,"exp\\s+status"),I=Ea(C,"exp\\s+desc"),$=Dd(C,"exp\\s+desc").some(re=>/(?:^|\s)--(?:set(?:=|\s)|stdin\b)/.test(re.raw)),F=$?"Updated experiment notes":"Read experiment notes",U=$?"Checked experiment status and updated notes":"Reviewed experiment status and notes";if(Ea(C,"logs")){const re=DV(C,l,d,u);return{kind:"project",label:re.length===1?"Reviewed run log":"Reviewed run logs",runIds:re}}if(Ea(C,"exp\\s+run"))return{kind:"project",label:"Started an experiment run"};if(Ea(C,"exp\\s+wait"))return{kind:"project",label:"Waited for an experiment run"};if(Ea(C,"exp\\s+cancel"))return{kind:"project",label:"Cancelled an experiment run"};const G=Ea(C,"project\\s+view");if(G&&D&&I)return{kind:"project",label:U,experimentIds:yc(C,l,p,u)};if(G&&I)return{kind:"project",label:F,experimentIds:yc(C,l,p,u)};if(G&&D)return{kind:"project",label:"Checked experiment status",experimentIds:yc(C,l,p,u)};if(G)return{kind:"project",label:"Read project details"};if(D&&I)return{kind:"project",label:U,experimentIds:yc(C,l,p,u)};if(D)return{kind:"project",label:"Checked experiment status",experimentIds:yc(C,l,p,u)};if(I)return{kind:"project",label:F,experimentIds:yc(C,l,p,u)};if(Ea(C,"runs?"))return{kind:"project",label:"Listed project runs"};const X=T.map(jV).find(re=>re!=null);if(X)return{kind:"read",label:`Read ${dl(X.path)}`,filePath:X.path,fileRef:X.ref,labelPrefix:"Read ",labelTarget:dl(X.path)};const Y=T.findIndex(re=>re!=null&&["sed","cat","head","tail"].includes(re.name)),Z=Y>=0?T[Y]:null,Q=Z?NV(Z):null,z=Q?RV(Q,j,Y,ji(a,"cwd","workdir")):null;if(Q&&z)return{kind:"read",label:`Read ${dl(Q)}`,filePath:z,labelPrefix:"Read ",labelTarget:dl(Q)};if(T.some(re=>(re==null?void 0:re.name)==="find"||(re==null?void 0:re.name)==="ls"||(re==null?void 0:re.name)==="rg"&&re.args.includes("--files")))return{kind:"search",label:"Listed files"};const O=T.findIndex(re=>(re==null?void 0:re.name)==="rg"||(re==null?void 0:re.name)==="grep");if(O>=0){const re=MV(j[O].raw);return{kind:"search",label:re?`Searched code for “${re}”`:"Searched code",searchPattern:re??void 0}}const H=T.find(re=>(re==null?void 0:re.name)==="git"),V=H==null?void 0:H.args[0];if(V==="grep"){const re=H==null?void 0:H.args.slice(1).find(le=>!le.startsWith("-"));return{kind:"search",label:re?`Searched code for “${re}”`:"Searched code",searchPattern:re}}if(Z)return{kind:"read",label:"Read a file"};if(V==="status")return{kind:"command",label:"Checked Git status"};if(V==="diff")return{kind:"command",label:"Reviewed code changes"};if(V==="log")return{kind:"command",label:"Read Git history"};const W=re=>T.some(le=>!le||!["cargo","pnpm","npm","yarn"].includes(le.name)?!1:le.args[0]===re||le.args[0]==="run"&&le.args[1]===re);return W("test")?{kind:"command",label:"Ran tests"}:T.some(re=>(re==null?void 0:re.name)==="tsc")||W("typecheck")?{kind:"command",label:"Checked types"}:W("lint")?{kind:"command",label:"Checked code style"}:W("build")?{kind:"command",label:"Built the project"}:{kind:"command",label:`Ran ${C}`}}case"read":{const C=f?dl(f):null;return C?{kind:"read",label:`Read ${C}`,filePath:f??void 0,labelPrefix:"Read ",labelTarget:C}:{kind:"read",label:"Read a file"}}case"edit":case"write":case"notebookedit":{const C=CV(a),N=f??(C==null?void 0:C.path)??null,E=N?dl(N):null,j=(C==null?void 0:C.type)==="add"?"Created":(C==null?void 0:C.type)==="delete"?"Deleted":"Edited";return E?{kind:"edit",label:`${j} ${E}`,filePath:N??void 0,labelPrefix:`${j} `,labelTarget:E}:{kind:"edit",label:"Edited a file"}}case"grep":{const C=ji(a,"pattern");return{kind:"search",label:C?`Searched code for “${C}”`:"Searched code",searchPattern:C??void 0}}case"glob":{const C=ji(a,"pattern");return{kind:"search",label:C?`Listed files matching ${C}`:"Listed files"}}case"websearch":{const C=ji(a,"query"),N=ji(a,"url"),E=ji(a,"pattern");return C?{kind:"web",label:`Searched the web for “${C}”`}:E&&N?{kind:"web",label:`Searched “${E}” on a page`}:N?{kind:"web",label:`Opened ${N}`}:{kind:"web",label:g??"Browsed the web"}}case"webfetch":{const C=ji(a,"url");return{kind:"web",label:C?`Read ${C}`:g??"Read a web page"}}case"task":return{kind:"agent",label:g??"Ran a subagent"};case"subagent":return{kind:"agent",label:LV(a)};case"error":return{kind:"command",label:"Tool failed"};case"interrupted":return{kind:"command",label:"Tool was interrupted"};default:{const C=g??f??o??((y=e.state)==null?void 0:y.title)??"";return{kind:"command",label:C?`${t}: ${C}`:t}}}}function LV(e){const t=a=>a.length>60?`${a.slice(0,60)}…`:a,n=typeof e.prompt=="string"&&e.prompt?` — “${t(e.prompt)}”`:"",r=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",i=r&&r.charAt(0).toUpperCase()+r.slice(1);switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return i||`Spawned agent${n}`;case"sendInput":return r?`Sent input to ${r}`:`Sent input to agent${n}`;case"resumeAgent":return r?`Resumed ${r}`:"Resumed agent";case"wait":return`Waiting on ${r||"agent"}`;case"closeAgent":return`Closed ${r||"agent"}`}switch(typeof e.kind=="string"?e.kind:""){case"started":return i||"Sub-agent started";case"interacted":return r?`${i} reported back`:"Agent reported back";case"interrupted":return r?`${i} interrupted`:"Sub-agent interrupted"}return i||"Sub-agent"}function Ff({activity:e,className:t=""}){if(e.litCall)return h.jsx(h_,{source:e.litCall.source,size:16,className:`tool-kind-icon shrink-0 ${t}`});const n={size:16,strokeWidth:1.75,className:`tool-kind-icon shrink-0 ${t}`};switch(e.kind){case"read":case"project":return h.jsx(V8,{...n});case"search":return h.jsx(sR,{...n});case"edit":return h.jsx(sp,{...n});case"web":return h.jsx(EM,{...n});case"agent":return h.jsx(aS,{...n});case"command":return h.jsx(sS,{...n})}}function Tw({items:e,onOpen:t,targetType:n}){const[r,i]=R.useState(!1),a=R.useRef(null),o=R.useRef(!1);return R.useEffect(()=>{var l,u;!r||!o.current||(o.current=!1,(u=(l=a.current)==null?void 0:l.querySelector("button"))==null||u.focus())},[r]),h.jsxs("span",{className:"tool-target-overflow inline",children:[r&&h.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((l,u)=>h.jsxs("span",{children:[u>0&&", ",t?h.jsx("button",{className:"tool-target",onClick:d=>{d.preventDefault(),d.stopPropagation(),t(l.id)},children:l.label}):h.jsx("span",{children:l.label})]},l.id))}),r&&", ",h.jsx("button",{className:"tool-target-more","aria-expanded":r,"aria-label":r?`Hide additional ${n}`:`Show ${e.length} more ${n}`,onClick:l=>{l.preventDefault(),l.stopPropagation(),o.current=!r&&l.detail===0,i(u=>!u)},children:r?"show less":`+ ${e.length} more`})]})}function kv({activity:e,onOpenFile:t,onOpenRun:n,runExperimentName:r,onOpenExperiment:i,experimentName:a}){var o,l,u;if(e.searchPattern){const d=e.label.indexOf(e.searchPattern),p=d>=0?e.label.slice(0,d):"Searched code for “",f=d>=0?e.label.slice(d+e.searchPattern.length):"”";return h.jsxs(h.Fragment,{children:[p,e.searchPattern.split(/([|/_-])/).map((g,b)=>h.jsxs("span",{children:[g,/^[|/_-]$/.test(g)&&h.jsx("wbr",{})]},`${b}-${g}`)),f]})}if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return h.jsxs("a",{className:"tool-target",href:hL(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,h.jsx(Rj,{className:"inline ml-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&t){const d=e.filePath;return h.jsxs(h.Fragment,{children:[e.labelPrefix,h.jsx("button",{className:"tool-target",onClick:p=>{p.preventDefault(),p.stopPropagation(),t(d,void 0,void 0,e.fileRef)},children:e.labelTarget})]})}if((l=e.runIds)!=null&&l.length){const d=r?e.runIds.filter(b=>!!r(b)):e.runIds;if(d.length===0)return e.label;const p=d.length>1,f=d.slice(0,3),g=d.slice(f.length).map(b=>({id:b,label:(r==null?void 0:r(b))||"Experiment"}));return h.jsxs(h.Fragment,{children:[p?"Reviewed run logs for ":"Reviewed run log ",f.map((b,S)=>h.jsxs("span",{children:[S>0&&", ",n?h.jsx("button",{className:"tool-target",title:`Open logs for run ${b}`,onClick:k=>{k.preventDefault(),k.stopPropagation(),n(b)},children:(r==null?void 0:r(b))||"Experiment"}):h.jsx("span",{children:(r==null?void 0:r(b))||"Experiment"})]},b)),g.length>0&&h.jsxs(h.Fragment,{children:[", ",h.jsx(Tw,{items:g,onOpen:n,targetType:"run logs"})]})]})}if((u=e.experimentIds)!=null&&u.length){const d=a?e.experimentIds.filter(g=>!!a(g)):e.experimentIds;if(d.length===0)return e.label;const p=d.slice(0,3),f=d.slice(p.length).map(g=>({id:g,label:(a==null?void 0:a(g))||"Experiment"}));return h.jsxs(h.Fragment,{children:[e.label," for ",p.map((g,b)=>h.jsxs("span",{children:[b>0&&", ",i?h.jsx("button",{className:"tool-target",title:`Open experiment ${(a==null?void 0:a(g))||""}`.trim(),onClick:S=>{S.preventDefault(),S.stopPropagation(),i(g)},children:(a==null?void 0:a(g))||"Experiment"}):h.jsx("span",{children:(a==null?void 0:a(g))||"Experiment"})]},g)),f.length>0&&h.jsxs(h.Fragment,{children:[", ",h.jsx(Tw,{items:f,onOpen:i,targetType:"experiments"})]})]})}return e.label}function OV(e){const t=f=>e.filter(g=>g.kind===f).length,n=[],r=t("read"),i=t("search"),a=t("edit"),o=t("project"),l=t("web"),u=t("command"),d=t("agent");r&&n.push(r===1?"Read a file":"Read files"),i&&n.push("searched code"),a&&n.push(a===1?"edited a file":"edited files"),o&&n.push("reviewed project data"),l&&n.push("browsed the web"),u&&n.push(u===1?"ran a command":"ran commands"),d&&n.push(d===1?"worked with a subagent":"worked with subagents");const p=n.join(", ");return p?`${p[0].toUpperCase()}${p.slice(1)}`:"Used tools"}function L2(e){const t=[[/^Reviewed run logs?/,e.label.startsWith("Reviewed run logs")?"Reading run logs":"Reading run log"],[/^Reviewed /,"Reviewing "],[/^Read /,"Reading "],[/^Searched /,"Searching "],[/^Listed /,"Listing "],[/^Edited /,"Editing "],[/^Updated /,"Updating "],[/^Created /,"Creating "],[/^Deleted /,"Deleting "],[/^Ran /,"Running "],[/^Started /,"Starting "],[/^Waited /,"Waiting "],[/^Checked /,"Checking "],[/^Built /,"Building "],[/^Cancelled /,"Cancelling "]];let n=e.label;for(const[r,i]of t)if(r.test(n)){n=n.replace(r,i);break}return{...e,label:n}}function wC(e,t){const n=Ws({tool:e,state:{status:"running",input:t}}),r=[[/^Reviewed /,"Review "],[/^Searched /,"Search "],[/^Listed /,"List "],[/^Edited /,"Edit "],[/^Updated /,"Update "],[/^Created /,"Create "],[/^Deleted /,"Delete "],[/^Ran /,"Run "],[/^Started /,"Start "],[/^Waited /,"Wait "],[/^Checked /,"Check "],[/^Built /,"Build "],[/^Cancelled /,"Cancel "]];for(const[i,a]of r)if(i.test(n.label))return n.label.replace(i,a);return n.label}function IV(e,t,n){var i,a;const r=o=>{const l=o.slice(0,3),u=o.length-l.length;return`${l.join(", ")}${u>0?`, + ${u} more`:""}`};if((i=e.runIds)!=null&&i.length){const o=e.runIds.map(l=>(t==null?void 0:t(l))||"").filter(Boolean);return o.length===0?e.label:`${e.label}${o.length>1?" for ":" "}${r(o)}`}if((a=e.experimentIds)!=null&&a.length){const o=e.experimentIds.map(l=>(n==null?void 0:n(l))||"").filter(Boolean);return o.length===0?e.label:`${e.label} for ${r(o)}`}return e.label}function zV(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const BV=250;function HV(e,t){const[n,r]=R.useState(e),i=R.useRef(Date.now()),a=R.useRef(e);return R.useEffect(()=>{if(a.current=e,(e==null?void 0:e.label)===(n==null?void 0:n.label)||t&&e!=null&&n!=null)return;if(e==null||n==null){i.current=Date.now(),r(e);return}const o=BV-(Date.now()-i.current);if(o<=0){i.current=Date.now(),r(e);return}const l=window.setTimeout(()=>{i.current=Date.now(),r(a.current)},o);return()=>window.clearTimeout(l)},[e,n,t]),e!=null&&e.label===(n==null?void 0:n.label)?e:n}const $V=160;function SC(e){const[t,n]=R.useState(!1);return R.useEffect(()=>{if(!e){n(!1);return}const r=window.setTimeout(()=>n(!0),$V);return()=>window.clearTimeout(r)},[e]),e&&t}function FV(e){const t=["read","search","edit","project","web","command","agent"];for(const n of t){const r=e.find(i=>i.kind===n);if(r)return r}return e[0]??{kind:"command",label:"Used tools"}}function Nw(e){var n,r;if(((n=e.state)==null?void 0:n.status)!=="completed")return null;const t=Ws(e);return JSON.stringify([t.kind,t.label,t.filePath??null,t.fileRef??null,((r=t.litCall)==null?void 0:r.kind)==="paper"?t.litCall.id??null:null,t.runIds??null,t.experimentIds??null])}function PV(e){const t=[];for(const n of e){const r=Nw(n),i=t[t.length-1];r&&i&&Nw(i.part)===r?i.count++:t.push({part:n,count:1})}return t}function jw({part:e,repeatCount:t=1,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o}){const l=e.state,u=Ws(e),d=(l==null?void 0:l.status)==="error",p=D2((l==null?void 0:l.error)||(l==null?void 0:l.output)||""),f=d&&!!p,[g,b]=R.useState(!1),S=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`,k=h.jsxs(h.Fragment,{children:[d&&h.jsx("span",{className:"sr-only",children:"Failed: "}),d?h.jsx(K8,{size:16,strokeWidth:1.75,className:"tool-kind-icon shrink-0 text-accent-red self-start mt-[5px]","aria-hidden":"true"}):h.jsx(Ff,{activity:u,className:"text-muted self-start mt-[5px]"}),h.jsxs("span",{className:`tool-line flex-1 min-w-0 whitespace-normal break-words text-lg ${d?"text-accent-red":"text-subtext"}`,children:[h.jsx(kv,{activity:u,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o}),t>1&&h.jsxs("span",{className:"tool-repeat-count ml-1 text-muted font-normal",title:`${t} consecutive identical calls`,children:["×",t]})]})]});return f?h.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[k,h.jsx("button",{type:"button",className:"tool-row-detail-toggle shrink-0 inline-flex items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":g,"aria-controls":S,"aria-label":`${g?"Hide":"Show"} error details for ${u.label}`,onClick:()=>b(x=>!x),children:h.jsx(Xs,{size:12,className:`text-accent-red transition-transform duration-120 ease-standard ${g?"rotate-90":""}`})})]}),g&&h.jsx("div",{className:"tool-detail mt-1 mr-0 mb-1 ml-6",id:S,children:h.jsx("div",{className:"tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",children:p.slice(0,2e4)})})]}):h.jsx("div",{className:"tool-row flex items-center gap-2 min-w-0 py-[3px] px-1",children:k})}function UV({parts:e,pendingTail:t,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var C,N,E;const[l,u]=R.useState(!1),d=PV(e),p=d.map(({part:j})=>Ws(j)),f=t?e.at(-1):void 0,g=((C=f==null?void 0:f.state)==null?void 0:C.status)!=="error"?(f&&L2(Ws(f)))??null:null,b=!!f&&((N=f.state)==null?void 0:N.status)==="running"&&(zV((E=f.state)==null?void 0:E.input)||(g==null?void 0:g.label)==="Running a command"),S=HV(g,b),k=SC(S!=null),x=OV(p),v=S??FV(p),w=S?IV(S,i,o):x;if(e.length===1)return S?h.jsx("div",{className:"tool-group my-3.5 mx-0",children:h.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-lg text-subtext",children:[h.jsx(Ff,{activity:S,className:`${k?"tool-running-shimmer-icon":"text-muted"} self-start mt-[5px]`}),h.jsx("span",{className:`${k?"tool-running-shimmer":""} tool-active-label min-w-0 whitespace-normal break-words`,title:w,children:h.jsx(kv,{activity:S,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):h.jsx("div",{className:"tool-group my-3.5 mx-0",children:h.jsx(jw,{part:e[0],onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o})});const y=l;return h.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[h.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-lg text-subtext text-left",children:[h.jsx(Ff,{activity:v,className:`${k?"tool-running-shimmer-icon":"text-muted"} mt-[5px]`}),S?h.jsx("span",{className:`tool-group-label tool-active-label min-w-0 whitespace-normal break-words ${k?"tool-running-shimmer":""}`,title:w,children:h.jsx(kv,{activity:S,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):h.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-left",onClick:()=>u(j=>!j),"aria-expanded":y,children:w}),h.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex items-center justify-center self-center shrink-0 p-px cursor-pointer rounded-sm",onClick:()=>u(j=>!j),"aria-expanded":y,"aria-label":y?"Collapse tool activity":"Expand tool activity",children:h.jsx(Xs,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${y?"open":""}`})})]}),h.jsx("div",{className:`tool-group-disclosure ${y?"open":""}`,"aria-hidden":!y,inert:!y,children:h.jsx("div",{className:"tool-group-disclosure-inner",children:h.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 mr-0 mb-1 ml-6",children:d.map(({part:j,count:T})=>h.jsx(jw,{part:j,repeatCount:T,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o},j.id))})})})]})}function qV({part:e,onRespond:t,onOpenFile:n,onOpenPlan:r}){var p;const i=e.prompt,[a,o]=R.useState([]),l=!t,u=f=>t==null?void 0:t({promptId:e.id,...f});if(i.resolved){if(i.kind==="permission")return null;if(i.kind==="plan"){const b=i.approved===!0?{label:"Plan approved",icon:Di,iconClass:"text-accent-green"}:i.approved===!1&&i.note?{label:"Plan revision requested",icon:sp,iconClass:"text-accent-amber"}:i.approved===!1?{label:"Plan rejected",icon:qr,iconClass:"text-accent-red"}:{label:"Plan resolved",icon:th,iconClass:"text-muted"},S=b.icon;return h.jsxs("details",{className:xV,children:[h.jsxs("summary",{children:[h.jsx("span",{className:"plan-resolved-label text-lg font-[375] wrap-anywhere",children:i.synthesized?"Plan":"Proposed plan"}),h.jsx(S,{size:17,strokeWidth:1.8,className:`shrink-0 ${b.iconClass}`}),h.jsx("span",{className:"plan-resolved-label prompt-outcome text-lg font-[375] wrap-anywhere",children:b.label}),h.jsx(Xs,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),h.jsxs("div",{className:`${Cw} ml-6`,children:[h.jsx(La,{text:i.plan??"",onOpenFile:n}),i.note&&h.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:i.note})]})]})}const f=(i.answers??[]).join(", ")||i.note||"",g=(i.annotations??[]).map((b,S)=>({id:`${e.id}-annotation-${S}`,text:b.text}));return h.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[g.length>0&&h.jsx(R2,{annotations:g,variant:"sent"}),h.jsxs("details",{className:_V,children:[h.jsxs("summary",{children:[h.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:i.header||i.question||"Question"}),h.jsx("span",{className:`prompt-outcome font-[375] text-subtext wrap-anywhere [&.approved]:text-accent-green [&.chosen]:text-accent-green [&.approved::before]:content-['✓_'] [&.chosen::before]:content-['✓_'] [&.revised]:text-accent-amber [&.rejected]:text-accent-amber ${f?"chosen":""}`,children:f||"Resolved"})]}),h.jsxs("div",{className:Cw,children:[i.header&&i.question&&h.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:i.question}),(i.options??[]).length>0&&h.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 pl-4.5 [&_.sel]:text-text [&_.sel]:font-semibold",children:(i.options??[]).map(b=>{var S;return h.jsx("li",{className:(S=i.answers)!=null&&S.includes(b.label)?"sel":"",children:b.label},b.label)})}),i.note&&i.note!==f&&h.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:i.note})]})]})]})}if(i.kind==="plan"){const f=!!r;return h.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-l-[3px] border-l-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-l-accent-blue [&.permission]:border-l-accent-amber [&.question]:border-l-accent-purple [&.readonly]:opacity-60 plan ${l?"readonly":""}`,children:[h.jsx("div",{className:"prompt-head text-lg font-semibold text-text",children:i.synthesized?"Plan mode — ready to proceed?":"Proposed plan"}),h.jsx("div",{className:`prompt-plan text-base leading-[1.6] text-text max-h-85 overflow-y-auto [&.clamped]:max-h-[9.5em] [&.clamped]:overflow-hidden [&.clamped]:relative [&.clamped::after]:content-[''] [&.clamped::after]:absolute [&.clamped::after]:inset-x-0 [&.clamped::after]:bottom-0 [&.clamped::after]:top-auto [&.clamped::after]:h-8.5 [&.clamped::after]:bg-[linear-gradient(to_bottom,_transparent,_var(--surface))] [&.clamped::after]:pointer-events-none ${f?"clamped":""}`,children:h.jsx(La,{text:i.plan??"",onOpenFile:n})}),f&&h.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",onClick:()=>r(i.plan??"",e.id),children:"View full plan"}),!l&&!f&&h.jsxs("div",{className:wv,children:[h.jsx("button",{className:"btn-primary",onClick:()=>u({approve:!0,resumeMode:"auto"}),children:"Accept and auto mode"}),h.jsx("button",{className:"btn-ghost",onClick:()=>u({approve:!0,resumeMode:"bypassPermissions"}),children:"Accept and bypass all"}),h.jsx("button",{className:"btn-ghost",onClick:()=>u({approve:!1}),children:"Reject"})]})]})}if(i.kind==="permission"){const f=i.toolInput??{},g=ji(f,"command","cmd","filePath","file_path","path")||"",b=typeof((p=i.toolInput)==null?void 0:p.reason)=="string"&&i.toolInput.reason||"",S=ji(f,"description")||"",k=b||S||wC(i.tool,f),x=`permission-heading-${e.id}`;return h.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-[0_1px_2px_rgb(0_0_0_/_4%)] [&.readonly]:opacity-60 ${l?"readonly":""}`,role:"group","aria-labelledby":x,children:[h.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[h.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:h.jsx(yR,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),h.jsx("span",{id:x,className:"text-base font-semibold text-text",children:"Approval required"})]}),h.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[h.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:k}),g&&h.jsx("code",{className:"prompt-command block max-h-36 overflow-auto whitespace-pre-wrap wrap-anywhere rounded-md border border-border-variant bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-text",children:g}),!l&&h.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[h.jsx("button",{className:"rounded-sm border border-transparent bg-transparent px-3 py-1.5 text-sm font-semibold text-subtext transition-[background,color] duration-80 ease-standard hover:bg-surface hover:text-text",onClick:()=>u({approve:!1}),children:"Deny"}),h.jsx("button",{className:"rounded-sm border border-text bg-text px-3 py-1.5 text-sm font-semibold text-background transition-opacity duration-80 ease-standard hover:opacity-85",onClick:()=>u({approve:!0}),children:"Allow"})]})]})]})}const d=f=>o(g=>i.multiSelect?g.includes(f)?g.filter(b=>b!==f):[...g,f]:[f]);return h.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-l-[3px] border-l-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-l-accent-blue [&.permission]:border-l-accent-amber [&.question]:border-l-accent-purple [&.readonly]:opacity-60 question ${l?"readonly":""}`,children:[i.header&&h.jsx("div",{className:yV,children:i.header}),i.question&&h.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:i.question}),h.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(i.options??[]).map(f=>{const g=a.includes(f.label);return h.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-left border border-border rounded-sm bg-background text-text cursor-pointer transition-[border-color,background] duration-80 ease-standard [&:hover:not(:disabled)]:border-border-strong [&:hover:not(:disabled)]:bg-surface [&.sel]:border-primary [&.sel]:bg-primary-subtle [&:disabled]:cursor-default ${g?"sel":""}`,disabled:l,onClick:()=>l?void 0:i.multiSelect?d(f.label):u({answers:[f.label]}),children:[h.jsx("span",{className:"prompt-option-label block text-md font-semibold",children:f.label}),f.description&&h.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:f.description})]},f.label)})}),i.multiSelect&&!l&&h.jsx("div",{className:wv,children:h.jsx("button",{className:"btn-primary",disabled:a.length===0,onClick:()=>u({answers:a}),children:"Submit"})})]})}function Pf(e,t){if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(t!==void 0)return e.id===t}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function GV(e,t){return e.role==="user"?!0:e.parts.some(n=>Pf(n,t))}function VV(e){const t=e.text??"",n=t.startsWith("data:")?t:qD(t),r=t.startsWith("data:")?"":t.includes("__")?t.slice(t.indexOf("__")+2):t,i=e.name||r||"attachment",a=t.startsWith("data:application/pdf")||/\.pdf$/i.test(i)||/\.pdf$/i.test(t);return{src:n,isPdf:a,name:i}}const eb=[ah,"w-6 h-6 rounded-sm [&:disabled]:opacity-40 [&:disabled]:cursor-default","[&:disabled:hover]:bg-transparent [&:disabled:hover]:text-subtext"].join(" ");function Mw({count:e,index:t,prevId:n,nextId:r,onSelect:i,pagerDisabled:a,actionLabel:o,icon:l,onAction:u,disabled:d}){const p=e>1;return h.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${p?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[p&&h.jsxs(h.Fragment,{children:[h.jsx("button",{className:eb,title:"Previous version","aria-label":"Previous version",disabled:a||!n,onClick:()=>n&&i(n),children:h.jsx(Y8,{size:14})}),h.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[t+1,"/",e]}),h.jsx("button",{className:eb,title:"Next version","aria-label":"Next version",disabled:a||!r,onClick:()=>r&&i(r),children:h.jsx(Xs,{size:14})})]}),h.jsx("button",{className:eb,title:o,"aria-label":o,disabled:d,onClick:u,children:l})]})}const WV=R.memo(function({message:t,activePermissionId:n,pendingTailToolId:r,onOpenFile:i,onOpenRun:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:d,onOpenPlan:p,onOpenSubagent:f,skills:g,predictTextTail:b=!1,forkCount:S,forkIndex:k=0,forkPrevId:x,forkNextId:v,forkDisabled:w,branchDisabled:y,onFork:C,onSelectFork:N}){const[E,j]=R.useState(null);if(t.role==="user"){const T=t.parts.filter(X=>X.type==="text").map(X=>X.text??"").join(` -`),D=T.match(/^\/(\S+)([\s\S]*)$/),I=D?g==null?void 0:g.find(X=>X.name===D[1]):void 0,$=t.parts.filter(X=>X.type==="image"&&X.text).map(VV),F=$.filter(X=>!X.isPdf),U=$.filter(X=>X.isPdf),G=t.parts.filter(X=>X.type==="annotation"&&X.text).map(X=>({id:X.id,text:X.text??""}));if(E!==null){const X=()=>{const Y=E.trim();!Y||w||(j(null),C(t.id,Y))};return h.jsx("div",{className:"msg-user-group self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:h.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[h.jsx("textarea",{className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":"Edit message",value:E,autoFocus:!0,onChange:Y=>j(Y.target.value),onKeyDown:Y=>{Y.key==="Escape"?(Y.preventDefault(),j(null)):Y.key==="Enter"&&!Y.shiftKey&&!Y.nativeEvent.isComposing&&(Y.preventDefault(),X())}}),h.jsxs("div",{className:`${wv} justify-end`,children:[h.jsx("button",{className:"btn-ghost",onClick:()=>j(null),children:"Cancel"}),h.jsx("button",{className:"btn-primary",onClick:X,disabled:w||!E.trim(),children:"Send"})]})]})})}return h.jsxs("div",{className:"msg-user-group group/turn self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[G.length>0&&h.jsx(R2,{annotations:G,variant:"sent"}),h.jsxs("div",{className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:mr-0.5 [&_.skill-chip]:align-baseline",children:[I?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"skill-chip inline-flex items-center py-px px-[7px] font-mono text-md font-medium text-primary bg-primary-subtle border border-border-variant rounded-sm",children:["/",I.name]}),D[2]]}):T,F.length>0&&h.jsx("div",{className:"msg-images flex flex-wrap gap-1.5 mt-2 [&_img]:max-w-55 [&_img]:max-h-40 [&_img]:border [&_img]:border-border-variant [&_img]:rounded-xs [&_img]:block",children:F.map((X,Y)=>h.jsx("a",{href:X.src,target:"_blank",rel:"noreferrer",children:h.jsx("img",{src:X.src,alt:"attachment"})},Y))}),U.length>0&&h.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:U.map((X,Y)=>h.jsxs("a",{className:"msg-file inline-flex items-center gap-1.5 max-w-60 py-1.5 px-2.5 border border-border-variant rounded-sm text-text no-underline [&:hover]:border-text [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap",href:X.src,target:"_blank",rel:"noreferrer",children:[h.jsx(th,{size:15}),h.jsx("span",{children:X.name})]},Y))})]}),S!==void 0&&h.jsx(Mw,{count:S,index:k,prevId:x,nextId:v,onSelect:N,pagerDisabled:y,actionLabel:"Edit and re-send",icon:h.jsx(sp,{size:13}),onAction:()=>j(T),disabled:w})]})}return h.jsxs("div",{className:"msg-assistant group/turn text-lg leading-[1.62] text-text min-w-0",children:[kC(t.parts,{activePermissionId:n,pendingTailToolId:r,onOpenFile:i,onOpenRun:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:d,onOpenPlan:p,onOpenSubagent:f,predictTextTail:b}),S!==void 0&&h.jsx(Mw,{count:S,index:k,prevId:x,nextId:v,onSelect:N,pagerDisabled:y,actionLabel:"Try another response",icon:h.jsx(tR,{size:13}),onAction:()=>C(t.id),disabled:w})]})});function kC(e,t){var v,w;const{activePermissionId:n,pendingTailToolId:r,onOpenFile:i,onOpenRun:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:d,onOpenPlan:p,onOpenSubagent:f,predictTextTail:g=!1}=t,b=e.filter(y=>y.type!=="steer"&&Pf(y,n)).at(-1),S=[];let k=[];const x=()=>{k.length!==0&&(S.push(h.jsx(UV,{parts:k,pendingTail:k.some(y=>y.id===r),onOpenFile:i,onOpenRun:a,runExperimentName:o,onOpenExperiment:l,experimentName:u},`tg-${k[0].id}`)),k=[])};for(const y of e)if(Pf(y,n)){if(y.type==="tool"&&(XV(y.tool)||(((v=y.children)==null?void 0:v.length)??0)>0)){x(),S.push(h.jsx(ZV,{part:y,pendingTail:g&&((w=y.state)==null?void 0:w.status)==="running"||y.id===r,onOpenSubagent:f},y.id));continue}if(y.type==="tool"){k.push(y);continue}x(),y.type==="text"?S.push(h.jsx(La,{text:y.text,onOpenFile:i,onOpenRun:a,predict:g&&y.id===(b==null?void 0:b.id)},y.id)):y.type==="steer"?S.push(h.jsx("div",{role:"note","aria-label":"You, mid-task",className:"msg-steer my-2 ml-auto w-fit max-w-[88%] bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere",children:y.text},y.id)):y.type==="prompt"&&y.prompt&&S.push(h.jsx(qV,{part:y,onRespond:d,onOpenFile:i,onOpenPlan:p},y.id))}return x(),S}function YV(e){return Ws(e).label}function XV(e){const t=(e??"").toLowerCase();return t==="subagent"||t==="task"||t==="agent"}function CC(e){var n,r;const t=((n=e.state)==null?void 0:n.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return t.startsWith("Async agent launched")?"":t}function O2(e,t){for(const n of e){if(n.id===t)return n;const r=n.children&&O2(n.children,t);if(r)return r}return null}function KV({spawn:e,onOpenFile:t,onOpenRun:n,runExperimentName:r,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}){var S,k,x,v;const l=e.children??[],u=((S=e.state)==null?void 0:S.status)==="running",d=((k=e.state)==null?void 0:k.status)==="error",p=d?D2(((x=e.state)==null?void 0:x.error)||((v=e.state)==null?void 0:v.output)||""):"",f=kC(l,{onOpenFile:t,onOpenRun:n,runExperimentName:r,onOpenExperiment:i,experimentName:a,onOpenSubagent:o,predictTextTail:u,pendingTailToolId:u?EC(l):null}),b=l.some(w=>w.type==="text"&&!!w.text)?"":CC(e);return h.jsxs("div",{className:"msg-assistant text-lg leading-[1.62] text-text min-w-0",children:[d&&h.jsx("span",{className:"sr-only",children:"Failed: "}),p&&h.jsx("div",{className:"tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",children:p.slice(0,2e4)}),f.length===0&&!b&&!p?h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:u?"Working…":"No activity"}):h.jsxs(h.Fragment,{children:[f,b&&h.jsx(La,{text:b,onOpenFile:t,onOpenRun:n})]})]})}function ZV({part:e,pendingTail:t,onOpenSubagent:n}){var d,p,f,g;const r=((d=e.state)==null?void 0:d.status)==="error",i=D2(((p=e.state)==null?void 0:p.error)||((f=e.state)==null?void 0:f.output)||""),a=t&&!r?L2(Ws(e)):Ws(e),o=SC(!!(t&&!r)),l=(((g=e.children)==null?void 0:g.length)??0)===0&&!r&&!CC(e),u=h.jsxs(h.Fragment,{children:[r&&h.jsx("span",{className:"sr-only",children:"Failed: "}),r?h.jsx(K8,{size:16,strokeWidth:1.75,className:"subagent-icon shrink-0 text-accent-red","aria-hidden":"true"}):h.jsx(Ff,{activity:a,className:`subagent-icon shrink-0 ${o?"tool-running-shimmer-icon":"text-muted"}`}),h.jsx("span",{className:`${iV} ${o?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:a.label})]});return l?h.jsx("div",{className:"subagent-row flex items-center gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-lg text-left rounded-sm [&_.tool-line]:text-lg",children:u}):h.jsxs("button",{className:"subagent-row flex items-center gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-lg text-left rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default [&_.tool-line]:text-lg",title:r&&i?i:"Open sub-agent transcript",onClick:()=>n==null?void 0:n(e.id,a.label),disabled:!n,children:[u,h.jsx(Xs,{size:12,className:"subagent-row-chevron shrink-0 text-muted"})]})}function QV(e){const t=new Map;let n;for(let i=e.length-1;i>=0;i--)if(e[i].role==="assistant"){n=e[i];break}if(!n)return{messageId:"",states:t};const r=(i,a)=>{var o,l;for(const u of i){const d=`${a}/${u.id}`;u.type==="tool"&&((o=u.state)!=null&&o.status)&&t.set(d,{status:u.state.status,part:u}),(l=u.children)!=null&&l.length&&r(u.children,d)}};return r(n.parts,n.id),{messageId:n.id,states:t}}function I2(e){const t=(n,r)=>{var i;for(const a of n){const o=a.prompt;if(a.type==="prompt"&&(o==null?void 0:o.kind)==="permission"&&!o.resolved){const l=o.toolInput??{},d=ji(l,"reason","description")||wC(o.tool,l);return{id:a.id,path:`${r}/${a.id}`,label:d}}if((i=a.children)!=null&&i.length){const l=t(a.children,`${r}/${a.id}`);if(l)return l}}return null};for(const n of e){if(n.role!=="assistant")continue;const r=t(n.parts,n.id);if(r)return r}return null}function JV(e){const[t,n]=R.useState({text:"",sequence:0}),r=R.useRef(null);return R.useEffect(()=>{var b,S;const i=((b=e[0])==null?void 0:b.id)??"",{messageId:a,states:o}=QV(e),l=I2(e);if(!r.current||r.current.transcript!==i){r.current={transcript:i,messageId:a,states:o,permissionPath:(l==null?void 0:l.path)??null},n(k=>({text:l?`Approval required: ${l.label}`:"",sequence:k.sequence+1}));return}const u=r.current.messageId===a?r.current.states:new Map,d=r.current.permissionPath,p=[...o].filter(([k,x])=>{var v;return((v=u.get(k))==null?void 0:v.status)!==x.status});if(r.current={transcript:i,messageId:a,states:o,permissionPath:(l==null?void 0:l.path)??null},l&&l.path!==d){n(k=>({text:`Approval required: ${l.label}`,sequence:k.sequence+1}));return}const f=p.filter(([,k])=>k.status==="error");if(f.length>0){const k=f.slice(0,2).map(([,x])=>Ws(x.part).label).join(", ");n(x=>({text:`${f.length===1?"Tool activity failed":`${f.length} tool activities failed`}: ${k}`,sequence:x.sequence+1}));return}const g=p.filter(([,k])=>k.status==="running");if(g.length>0){const k=(S=g.at(-1))==null?void 0:S[1].part;n(x=>({text:k?L2(Ws(k)).label:"Running a tool",sequence:x.sequence+1}));return}p.some(([,k])=>k.status==="completed")&&n(k=>({text:"Tool activity completed",sequence:k.sequence+1}))},[e]),t}function EC(e){var t;for(let n=e.length-1;n>=0;n--){const r=e[n];if(!(r.type==="steer"||!Pf(r)))return r.type!=="tool"||((t=r.state)==null?void 0:t.status)==="error"?null:r.id}return null}function AC(e){const t=e.at(-1);if((t==null?void 0:t.role)!=="assistant")return null;const n=EC(t.parts);return n?{messageId:t.id,toolId:n}:null}const eW=R.memo(function({messages:t,allMessages:n,canFork:r,onFork:i,onSelectFork:a,busy:o,onOpenFile:l,onOpenRun:u,runExperimentName:d,onOpenExperiment:p,experimentName:f,onRespond:g,onOpenPlan:b,onOpenSubagent:S,skills:k}){var E;const x=((E=I2(t))==null?void 0:E.id)??null,v=R.useMemo(()=>t.filter(j=>GV(j,x)),[t,x]),w=R.useMemo(()=>{const j=v.filter(D=>!D.id.startsWith(Ic)),T=j.filter((D,I)=>D.role==="user"||!j[I+1]||j[I+1].role==="user");return JD(n,t,T,D=>D.startsWith(Ic))},[t,v,n]),y=v.at(-1),C=JV(t),N=o?AC(t):null;return h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:h.jsx("span",{children:C.text},C.sequence)}),v.map(j=>{var T,D,I,$;return h.jsx(WV,{message:j,forkCount:(T=w.get(j.id))==null?void 0:T.count,forkIndex:(D=w.get(j.id))==null?void 0:D.index,forkPrevId:(I=w.get(j.id))==null?void 0:I.prevId,forkNextId:($=w.get(j.id))==null?void 0:$.nextId,forkDisabled:!r,branchDisabled:o,onFork:i,onSelectFork:a,activePermissionId:x,pendingTailToolId:(N==null?void 0:N.messageId)===j.id?N.toolId:null,onOpenFile:l,onOpenRun:u,runExperimentName:d,onOpenExperiment:p,experimentName:f,onRespond:g,onOpenPlan:b,onOpenSubagent:S,skills:k,predictTextTail:o&&j===y&&j.role==="assistant"},j.id)})]})}),Rw=(e,t)=>e==="all"?!0:e==="archived"?t:!t,TC=[{id:"active",label:"Active",railLabel:"Recents"},{id:"archived",label:"Archived",railLabel:"Archived"},{id:"all",label:"All",railLabel:"All sessions"}];function tW({value:e,onChange:t}){const{open:n,setOpen:r,ref:i}=Bo();return h.jsxs("div",{className:"rail-filter relative inline-flex",ref:i,children:[h.jsx("button",{className:`${ah} rail-filter-btn w-6 h-6 rounded-sm ${e!=="active"?"active":""}`,title:"Filter sessions","aria-label":"Filter sessions",onClick:()=>r(a=>!a),children:h.jsx(hR,{size:13})}),n&&h.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:TC.map(a=>h.jsxs("button",{className:hi,onClick:()=>{t(a.id),r(!1)},children:[h.jsx("span",{children:a.label}),e===a.id&&h.jsx(Di,{size:13})]},a.id))})]})}const nW=14,rW=500,iW=1200;function NC({title:e,animate:t}){return t?h.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((n,r)=>n===" "?h.jsx("span",{"aria-hidden":!0,children:n},r):h.jsx("span",{"aria-hidden":!0,className:"title-reveal-char inline-block animate-[title-char-in_240ms_ease-out_both] [@media((prefers-reduced-motion:_reduce))]:animate-none",style:{animationDelay:`${Math.min(r*nW,rW)}ms`},children:n},r))}):h.jsx(h.Fragment,{children:e})}function sW({session:e,active:t,unread:n,busy:r,waiting:i,revealTitle:a,onOpen:o,onRename:l,onSetArchived:u,onDelete:d}){var N;const{open:p,setOpen:f,ref:g}=Bo(),b=((N=e.title)==null?void 0:N.trim())||"Untitled",[S,k]=R.useState(!1),[x,v]=R.useState(""),w=R.useRef(null);function y(){var E;v(((E=e.title)==null?void 0:E.trim())||""),k(!0)}function C(){var j;const E=x.trim();k(!1),E&&E!==(((j=e.title)==null?void 0:j.trim())||"")&&l(E)}return R.useEffect(()=>{var E,j;S&&((E=w.current)==null||E.focus(),(j=w.current)==null||j.select())},[S]),h.jsxs("div",{ref:g,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-left py-[7px] px-2.5 rounded-md text-md text-text cursor-pointer select-none [&:hover]:bg-surface [&.active]:bg-surface [&.active]:font-medium [&_.session-dot]:w-3.5 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:text-ellipsis [&_.session-title]:whitespace-nowrap [&.unread_.session-title]:font-semibold [&_.session-time]:text-2xs [&_.session-time]:text-muted [&_.session-time]:shrink-0 [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-within_.session-menu-btn]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-time]:hidden [&:focus-within_.session-time]:hidden [&.menu-open_.session-time]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-time]:hidden ${t?"active":""} ${n?"unread":""} ${p?"menu-open":""} ${S?"editing":""}`,title:`${ad[e.harness]}${e.model?` · ${e.model}`:""}`,onClick:()=>{S||(p?f(!1):o())},onKeyDown:E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),p?f(!1):o())},children:[h.jsx("span",{className:"session-dot",children:r?h.jsx("span",{className:`busy-dot ${i?"waiting":""}`}):n&&h.jsx("span",{className:"unread-dot"})}),S?h.jsx("input",{ref:w,className:"session-title-input","aria-label":"Session title",value:x,onChange:E=>v(E.target.value),onClick:E=>E.stopPropagation(),onBlur:C,onKeyDown:E=>{E.stopPropagation(),E.key==="Enter"?(E.preventDefault(),C()):E.key==="Escape"&&(E.preventDefault(),k(!1))}}):h.jsx("span",{className:"session-title",children:h.jsx(NC,{title:b,animate:a!==void 0},a??"static")}),h.jsx("span",{className:"session-time",children:kV(e.updatedAt)}),h.jsx("button",{className:"session-menu-btn",title:"Session options","aria-label":"Session options",onClick:E=>{E.stopPropagation(),f(j=>!j)},children:h.jsx(J8,{size:14})}),p&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[h.jsx("button",{className:hi,onClick:E=>{E.stopPropagation(),f(!1),y()},children:h.jsx("span",{children:"Rename"})}),h.jsx("button",{className:hi,onClick:E=>{E.stopPropagation(),f(!1),u(!e.archived)},children:h.jsx("span",{children:e.archived?"Unarchive":"Archive"})}),h.jsx("button",{className:`${hi} danger`,onClick:E=>{E.stopPropagation(),f(!1),d()},children:h.jsx("span",{children:"Delete"})})]})]})}function aW({projectId:e,projectName:t,paperId:n,railHeader:r,railOpen:i,onShowRail:a,mainView:o,onSelectMainView:l,experimentsActive:u,filesActive:d,artifactsActive:p,onOpenExperiments:f,onOpenArtifacts:g,onOpenFile:b,onOpenRun:S,runExperimentName:k,onOpenExperiment:x,experimentName:v,onOpenPlan:w,onOpenSubagent:y,onOpenWorktree:C,onOpenDemoWelcome:N,onActiveSessionChange:E,preferredAgent:j,onPreferredAgentChange:T,children:D}){var Ve,qe,vt;const[I,$]=R.useState([]),[F,U]=R.useState(null),[G,X]=R.useState(new Set),[Y,Z]=R.useState("active"),[Q,z]=R.useState(""),[O,H]=R.useState([]),V=R.useRef(0),W=R.useRef({projectId:e,activeId:F});W.current={projectId:e,activeId:F};const[re,le]=R.useState([]),[pe,te]=R.useState(null),[B,ie]=R.useState(null),oe=R.useRef(Promise.resolve()),be=R.useRef(0),ge=R.useRef(0),[Ce,Le]=R.useState(null),Ue=R.useRef(null),We=R.useRef(!1),Fe=R.useRef(null),[mt,De]=R.useReducer(SV,{messagesBySession:{},busySessions:new Set,queuedBySession:{},activeLeafBySession:{}}),[ot,Bt]=R.useState([]),[on,Ze]=R.useState(j);R.useEffect(()=>Ze(j),[j]);const[ct,st]=R.useState({}),[xe,Me]=R.useState(new Map),Ge=R.useRef(new Map),Qe=R.useRef(new Set),Oe=R.useRef(new Set),tt=R.useRef(0),it=R.useRef([]),jt=R.useRef(null),_t=R.useRef(null),Tt=R.useRef(!0),ut=R.useRef(null),xn=Bo(),dr=R.useCallback(ne=>{var fe;V.current+=1,H(Se=>[...Se,{id:`annotation-${V.current}`,...ne}]),(fe=ut.current)==null||fe.focus()},[]),Or=pV(_t,dr);mV(O),R.useEffect(()=>{H([]),Or.dismiss()},[F,e,Or.dismiss]);const[os,ls]=R.useState([]),[gi,pr]=R.useState(0),[Ts,Jn]=R.useState(!1),[Xr,Kr]=R.useState(0),[yn,mn]=R.useState(null),bi=R.useRef(null),[Ns,Ui]=R.useState(0);R.useLayoutEffect(()=>{Ui(yn&&bi.current?bi.current.offsetWidth+8:0),Sr()},[yn]);function Sr(){var ne;bi.current&&(bi.current.style.transform=`translateY(${-(((ne=ut.current)==null?void 0:ne.scrollTop)??0)}px)`)}const mr=R.useRef(!1);R.useEffect(()=>{MD(e).then(ls).catch(()=>{})},[e,o]);function Pt(ne){var fe;if(ne.source==="command"&&ne.name==="plan"&&pn){js(Q,pn);return}if(pn!=null&&pn.inline){const Se=Q.slice(0,pn.start),Te=Q.slice(pn.end),ze=`/${ne.name}`,nt=Te?"":" ",Zt=Se.length+ze.length+nt.length;z(`${Se}${ze}${nt}${Te}`),Jn(!0),window.requestAnimationFrame(()=>{var Nr,$n;(Nr=ut.current)==null||Nr.focus(),($n=ut.current)==null||$n.setSelectionRange(Zt,Zt),Kr(Zt)});return}mn(ne),z(""),(fe=ut.current)==null||fe.focus()}function er(){var ne;mn(null),(ne=ut.current)==null||ne.focus()}function Zr(ne){te(null);let Te=re.reduce((ze,nt)=>ze+nt.size,0);for(const ze of ne){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(ze.type))continue;if(ze.size>31457280){te(`${ze.name} is too large — each attachment must be under 30 MB.`);continue}if(Te+ze.size>41943040){te("Attachments exceed the 40 MB total limit — remove one and try again.");continue}Te+=ze.size;const nt=new FileReader;nt.onload=()=>{const Zt=nt.result;le(Nr=>[...Nr,{dataUrl:Zt,mediaType:ze.type,name:ze.name,size:ze.size}])},nt.readAsDataURL(ze)}}function Qr(ne){const fe=Array.from(ne.clipboardData.items).filter(Se=>Se.kind==="file"&&(Se.type.startsWith("image/")||Se.type==="application/pdf")).map(Se=>Se.getAsFile()).filter(Se=>Se!==null);fe.length>0&&(ne.preventDefault(),Zr(fe))}const ft=I.find(ne=>ne.id===F),In=on??zG(ot),tr=ft?{harness:ft.harness,model:ct.model??ft.model,permissionMode:ct.permissionMode??ft.permissionMode,reasoningLevel:ct.reasoningLevel??ft.reasoningLevel}:In?{...In,...ct}:null,Je=tr?ot.find(ne=>ne.id===tr.harness):void 0,Nt=Je==null?void 0:Je.options,na=GG(os,Nt==null?void 0:Nt.planActivation),pn=yn?null:yw(Q,Xr),kr=(pn==null?void 0:pn.query)??null,Cr=kr!==null&&!Ts?UG(na,(pn==null?void 0:pn.inline)??!1).filter(ne=>ne.name.startsWith(kr)):[],Jr=Cr.length>0,Er=Math.min(gi,Math.max(0,Cr.length-1));R.useEffect(()=>pr(0),[kr]);const Ut=tr&&{...tr,reasoningLevel:xS(Je,tr.model,tr.reasoningLevel)},Ir=lp(Je,Ut==null?void 0:Ut.model),Qt=ne=>{if(!Ut)return;const fe={...Ut,...ne};Ze(fe),T(fe).catch(()=>{}),ft?st(Se=>({...Se,...ne})):ne.harness&&ne.harness!==Ut.harness&&st({})},gr=R.useCallback(ne=>{const fe=oe.current.catch(()=>{}).then(ne);return oe.current=fe.then(()=>{},()=>{}),fe},[]),qi=ne=>{if(ne==="plan"&&(Je==null?void 0:Je.id)==="claude-code"?st(Te=>({...Te,permissionMode:ne})):(st(Te=>{const ze={...Te};return delete ze.permissionMode,ze}),Qt({permissionMode:ne})),!ft)return;const fe=ft.id,Se=++be.current;ie(null),gr(()=>PD(fe,ne)).then(Te=>{$(ze=>ze.map(nt=>nt.id===Te.id?Te:nt)),be.current===Se&&st(ze=>{const nt={...ze};return delete nt.permissionMode,nt})}).catch(()=>{be.current===Se&&(st(Te=>{const ze={...Te};return delete ze.permissionMode,ze}),ie("Could not update permissions. Try again."))})},Hn=ne=>Qt({reasoningLevel:ne}),zr=(Ut==null?void 0:Ut.harness)==="claude-code"?Ut.permissionMode==="plan":(Nt==null?void 0:Nt.planActivation)==="command"?Ce??(ft==null?void 0:ft.planMode)??!1:!1;R.useEffect(()=>{Ce===null||(ft==null?void 0:ft.planMode)!==Ce||(Ue.current=null,Le(null))},[ft==null?void 0:ft.planMode,Ce]);async function ra(ne){if(Ue.current=ne,Le(ne),!ft)return;const fe=ft.id,Se=++ge.current;ie(null);try{const Te=await gr(()=>FD(fe,ne));$(ze=>ze.map(nt=>nt.id===Te.id?Te:nt)),ge.current===Se&&(Ue.current=null,Le(null),ie(null))}catch(Te){throw ge.current===Se&&(Ue.current=null,Le(null)),Te}}async function Gi(){if((Ut==null?void 0:Ut.harness)==="claude-code"){qi("auto");return}if(ft)try{await ra(!1)}catch{ie("Could not exit Plan mode. Try again.")}}async function ia(){const ne=!zr;try{if((Ut==null?void 0:Ut.harness)==="claude-code")qi(ne?"plan":"auto");else if((Nt==null?void 0:Nt.planActivation)==="command")await ra(ne);else throw new Error("The selected harness is unavailable")}catch{ie("Could not toggle Plan mode. Try again.")}}function js(ne,fe){const Se=qG(ne,fe);z(Se.text),mn(null),Jn(!0),ia(),window.requestAnimationFrame(()=>{var Te,ze;(Te=ut.current)==null||Te.focus(),(ze=ut.current)==null||ze.setSelectionRange(Se.cursor,Se.cursor),Kr(Se.cursor)})}it.current=I;const ei=R.useCallback(async()=>{const ne=it.current.map(fe=>fe.id);try{const fe=(await lf(e)).filter(Te=>!Oe.current.has(Te.id)),Se=new Set(fe.map(Te=>Te.id));for(const Te of ne)Se.has(Te)||Hr(Te);return $(Te=>{const ze=new Map(Te.map(nt=>[nt.id,nt.contextUsage]));return fe.map(nt=>({...nt,contextUsage:nt.contextUsage??ze.get(nt.id)}))}),Ge.current=new Map(fe.map(Te=>[Te.id,Te.title])),De({type:"seedBusy",sessions:fe.filter(Te=>Te.busy).map(Te=>Te.id),known:fe.map(Te=>Te.id)}),fe}catch{return null}},[e]);R.useEffect(()=>{$([]),it.current=[],U(null);const ne=hC();X(e===og?new Set([oS,lS].filter(fe=>!ne.has(fe))):new Set),z(""),mn(null),le([]),De({type:"reset"}),Qe.current=new Set,Me(new Map),Ge.current=new Map,ei().then(fe=>{fe&&U(Se=>{var Te,ze;return Se??(e===og?(Te=fe.find(nt=>nt.id===cd))==null?void 0:Te.id:void 0)??((ze=fe.find(nt=>!nt.archived))==null?void 0:ze.id)??null})})},[e,ei]),R.useEffect(()=>{!F||Qe.current.has(F)||(Qe.current.add(F),ud(F).then(({messages:ne,queued:fe,activeLeafId:Se})=>De({type:"seed",sessionId:F,messages:ne,queued:fe,activeLeafId:Se})).catch(()=>{De({type:"seed",sessionId:F,messages:[],onlyIfAbsent:!0}),Qe.current.delete(F)}))},[F]),R.useEffect(()=>wd(ne=>{switch(ne.type){case"session":{if(ne.session.projectId!==e||Oe.current.has(ne.session.id))return;const fe=Ge.current.has(ne.session.id),Se=Ge.current.get(ne.session.id)!==ne.session.title;Ge.current.set(ne.session.id,ne.session.title),fe&&Se&&ne.session.titleSource==="generated"&&(Me(Te=>{const ze=new Map(Te);return ze.set(ne.session.id,(Te.get(ne.session.id)??0)+1),ze}),window.setTimeout(()=>{Me(Te=>{if(!Te.has(ne.session.id))return Te;const ze=new Map(Te);return ze.delete(ne.session.id),ze})},iW)),$(Te=>{const ze=Te.findIndex(Zt=>Zt.id===ne.session.id);if(ze<0)return[ne.session,...Te];const nt=Te.slice();return nt[ze]={...ne.session,contextUsage:ne.session.contextUsage??Te[ze].contextUsage},nt});break}case"sessionDeleted":Hr(ne.sessionId);break;case"message":tt.current++,De({type:"upsertMessage",sessionId:ne.sessionId,message:ne.message});break;case"busy":De({type:"busy",sessionId:ne.sessionId,busy:ne.busy});break;case"queued":De({type:"setQueued",sessionId:ne.sessionId,items:ne.items});break;case"branch":De({type:"activeLeaf",sessionId:ne.sessionId,leafId:ne.activeLeafId});break;case"usage":$(fe=>fe.map(Se=>Se.id===ne.sessionId?{...Se,contextUsage:ne.usage}:Se));break}}),[e]),R.useEffect(()=>wd(ne=>{if(ne.type!=="reconnected"||(ei(),!F||!Qe.current.has(F)))return;const fe=Se=>{const Te=tt.current;ud(F).then(({messages:ze,queued:nt,activeLeafId:Zt})=>{De({type:"seed",sessionId:F,messages:ze,queued:nt,activeLeafId:Zt}),Se&&tt.current!==Te&&fe(!1)}).catch(()=>{})};fe(!0)}),[F,ei]);const vi=F?mt.messagesBySession[F]??Ew:Ew,nr=F?mt.activeLeafBySession[F]??null:null,rr=R.useRef(nr);rr.current=nr;const Rn=R.useMemo(()=>ZD(vi,nr),[vi,nr]),ln=F?mt.busySessions.has(F):!1,sa=!ln&&!!(Je!=null&&Je.agentReady),cs=ln&&AC(Rn)!=null,ti=F?mt.queuedBySession[F]??[]:[];R.useEffect(()=>{const ne=ti.reduce((fe,Se)=>Se.planMode??fe,void 0);ne!==void 0?(We.current=!0,Ue.current=ne,Le(ne)):We.current&&(We.current=!1,Ue.current=null,Le(null))},[ti]);const Ga=!!F&&!(F in mt.messagesBySession),ir=R.useMemo(()=>{const ne=new Set;for(const fe of mt.busySessions)(mt.messagesBySession[fe]??[]).some(Se=>Se.parts.some(Te=>Te.type==="prompt"&&Te.prompt&&!Te.prompt.resolved&&Te.prompt.nativeId))&&ne.add(fe);return ne},[mt.busySessions,mt.messagesBySession]),aa=F?ir.has(F):!1,cn=ft,Ms=cn?xe.get(cn.id):void 0,gn=R.useMemo(()=>{var ne;for(let fe=Rn.length-1;fe>=0;fe--)for(const Se of Rn[fe].parts)if(Se.type==="prompt"&&((ne=Se.prompt)==null?void 0:ne.kind)==="plan"&&!Se.prompt.resolved)return{promptId:Se.id,plan:Se.prompt.plan??"",synthesized:!!Se.prompt.synthesized};return null},[Rn]),Ar=R.useMemo(()=>{const ne=cn==null?void 0:cn.harness;if(!F||ne!=="claude-code"&&ne!=="codex")return null;for(let fe=Rn.length-1;fe>=0;fe--)for(const Se of Rn[fe].parts)if(!(Se.type!=="prompt"||!Se.prompt||Se.prompt.resolved)&&Se.prompt.kind==="question")return Se.prompt.nativeId&&!mt.busySessions.has(F)?null:Se.id;return null},[Rn,cn==null?void 0:cn.harness,F,mt.busySessions]),[Br,Vi]=R.useState(null),Bl=Br&&Br.sessionId===F?Br:null;R.useEffect(()=>{if(!Br)return;const ne=mt.busySessions.has(Br.sessionId),fe=Br.sessionId===F&&gn&&gn.promptId!==Br.promptId;(!ne||fe)&&Vi(null)},[Br,gn,mt.busySessions,F]);const Hl=R.useMemo(()=>I2(Rn),[Rn]),oa=ln&&!!(Je!=null&&Je.supportsSteering)&&!!(Je!=null&&Je.agentReady)&&!gn&&!Ar&&!Hl&&re.length===0&&O.length===0,Rs=R.useMemo(()=>w&&F?(ne,fe)=>w(ne,F,fe):void 0,[w,F]),$o=R.useMemo(()=>y&&F?(ne,fe)=>y(F,ne,fe):void 0,[y,F]),$l=R.useMemo(()=>b&&((ne,fe,Se,Te)=>b(ne,F??void 0,fe,Se,Te)),[b,F]);R.useEffect(()=>{be.current+=1,ge.current+=1;const ne=(F?mt.queuedBySession[F]??[]:[]).reduce((fe,Se)=>Se.planMode??fe,void 0);We.current=ne!==void 0,Ue.current=ne??null,Le(ne??null),st({}),ie(null)},[F]),R.useEffect(()=>{E==null||E(F)},[F,E]);const br=o==="chat"&&(Rn.length>0||ln);R.useLayoutEffect(()=>{Tt.current=!0;const ne=jt.current;ne&&(ne.scrollTop=ne.scrollHeight)},[F,br]),R.useLayoutEffect(()=>{const ne=jt.current;ne&&Tt.current&&(ne.scrollTop=ne.scrollHeight)},[Rn,ln]),R.useEffect(()=>{const ne=jt.current,fe=_t.current;if(!ne||!fe)return;const Se=new ResizeObserver(()=>{Tt.current&&(ne.scrollTop=ne.scrollHeight)});return Se.observe(fe),Se.observe(ne),()=>Se.disconnect()},[br]);async function nn({queue:ne=!1}={}){const fe=Q.trim(),Se=yn?`/${yn.name}${fe?` ${fe}`:""}`:fe,Te=Ar?null:VG(Se,Nt==null?void 0:Nt.planActivation),ze=!!Te,nt=!zr,Zt=WG(Nt==null?void 0:Nt.planActivation,ze?nt:void 0,Ue.current),Nr=ze&&(Je==null?void 0:Je.id)==="claude-code"?nt?"plan":"auto":void 0,$n=Te?Te.prompt:Se,ri=re,xi=O,Po=xi.map(wn=>({text:wn.text})),im=e;let Sh=F;const kh=()=>{const wn=W.current;return wn.projectId===im&&wn.activeId===Sh},Fl=()=>{kh()&&(z(wn=>wn||Se),le(wn=>wn.length?wn:ri),H(wn=>wn.length?wn:xi))};if(ze&&!$n&&ri.length===0&&xi.length===0){z(""),mn(null),Jn(!1);try{if((Je==null?void 0:Je.id)==="claude-code")qi(nt?"plan":"auto");else if((Nt==null?void 0:Nt.planActivation)==="command")await ra(nt);else throw new Error("The selected harness is unavailable")}catch{ie("Could not toggle Plan mode. Try again."),Fl()}return}const $r=Ut?{...Ut,...Nr?{permissionMode:Nr}:{}}:null;Nr&&qi(Nr);let Pl=null;const Ch=Ue.current;ze&&(Nt==null?void 0:Nt.planActivation)==="command"&&(Pl=++ge.current,Ue.current=nt,Le(nt));const Uo=()=>{Pl===null||ge.current!==Pl||(Ue.current=Ch,Le(Ch))};if(!$n&&ri.length===0&&xi.length===0)return;if(($n||xi.length>0)&&Ar&&ri.length===0){z(""),mn(null),H([]),St({promptId:Ar,answers:[],note:$n||void 0,annotations:Po}).then(wn=>{wn||Fl()});return}if(ln){if(!F||!(Je!=null&&Je.agentReady)){Uo();return}const wn=F;z(""),mn(null),le([]),H([]),te(null);const fs=$r?{model:$r.model,permissionMode:$r.permissionMode,planMode:(Nt==null?void 0:Nt.planActivation)==="command"?Zt??(ft==null?void 0:ft.planMode):Zt,reasoningLevel:$r.reasoningLevel}:{};st({});const Ya=ri.map(sr=>({mediaType:sr.mediaType,dataBase64:sr.dataUrl.slice(sr.dataUrl.indexOf(",")+1),name:sr.name}));try{await gr(()=>a3(wn,$n,fs,Ya.length?Ya:void 0,Po,oa&&!ne&&!ze?"steer":void 0))}catch{Uo(),Fl()}return}if(!(Je!=null&&Je.agentReady)){Uo();return}if(!$r){Uo();return}z(""),mn(null),le([]),H([]),te(null);let hs=F;try{if(!hs){const Fn=await zD(e,$r.harness,{model:$r.model,permissionMode:$r.permissionMode,planMode:Zt,reasoningLevel:$r.reasoningLevel});Qe.current.add(Fn.id),$(Ul=>[Fn,...Ul]),U(Fn.id),hs=Fn.id,Sh=Fn.id,W.current={projectId:e,activeId:Fn.id}}De({type:"optimisticUser",sessionId:hs,text:$n||"Asked about selected text",attachments:ri.map(Fn=>({url:Fn.dataUrl,mediaType:Fn.mediaType,name:Fn.name})),annotations:xi}),De({type:"busy",sessionId:hs,busy:!0}),Tt.current=!0,Y==="archived"&&Z("active");const wn=$r?{model:$r.model,permissionMode:$r.permissionMode,planMode:Zt,reasoningLevel:$r.reasoningLevel}:{};st({});const fs=ri.map(Fn=>({mediaType:Fn.mediaType,dataBase64:Fn.dataUrl.slice(Fn.dataUrl.indexOf(",")+1),name:Fn.name})),Ya=hs;if(!Ya)throw new Error("chat session was not created");await gr(()=>a3(Ya,$n,wn,fs.length?fs:void 0,Po))}catch(wn){if(Fl(),Uo(),!hs)return;const fs=wn instanceof Error?wn.message:String(wn);if(!/session is busy/i.test(fs)&&await lf(e).then(sr=>{var Fn;return!!((Fn=sr.find(Ul=>Ul.id===hs))!=null&&Fn.busy)}).catch(()=>!1)){kh()&&(z(sr=>sr===$n?"":sr),le(sr=>sr===ri?[]:sr),H(sr=>sr===xi?[]:sr));return}De({type:"busy",sessionId:hs,busy:!1}),De({type:"localError",sessionId:hs,text:`Message not sent: ${fs}`})}}function us(){F&&WD(F)}const Fo=R.useCallback((ne,fe)=>{if(!F||ln||!(Je!=null&&Je.agentReady))return;const Se=F;De({type:"busy",sessionId:Se,busy:!0}),Tt.current=!0,gr(()=>GD(Se,ne,fe)).catch(Te=>{De({type:"busy",sessionId:Se,busy:!1});const ze=Te instanceof Error?Te.message:String(Te);De({type:"localError",sessionId:Se,text:`Could not re-sample: ${ze}`})})},[F,ln,Je==null?void 0:Je.agentReady,gr]),Ds=R.useCallback(ne=>{if(!F||ln)return;const fe=F,Se=rr.current;De({type:"activeLeaf",sessionId:fe,leafId:ne}),gr(()=>VD(fe,ne)).catch(Te=>{De({type:"activeLeaf",sessionId:fe,leafId:Se});const ze=Te instanceof Error?Te.message:String(Te);De({type:"localError",sessionId:fe,text:`Could not switch fork: ${ze}`})})},[F,ln,gr]);function ni(ne){if(!F)return;const fe=F;De({type:"setQueued",sessionId:fe,items:ti.filter(Se=>Se.id!==ne)}),UD(fe,ne).catch(()=>{})}R.useEffect(()=>{if(!ln||o!=="chat")return;function ne(fe){var Se;fe.key!=="Escape"||fe.defaultPrevented||(fe.preventDefault(),us(),(Se=ut.current)==null||Se.focus())}return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[ln,F,o]);function Hr(ne){Oe.current.add(ne),$(fe=>fe.filter(Se=>Se.id!==ne)),U(fe=>fe===ne?null:fe),X(fe=>{if(!fe.has(ne))return fe;const Se=new Set(fe);return Se.delete(ne),Se}),Qe.current.delete(ne),Ge.current.delete(ne),De({type:"forget",sessionId:ne})}function Va(ne,fe){const Se=ne.archived;$(Te=>Te.map(ze=>ze.id===ne.id?{...ze,archived:fe}:ze)),Rw(Y,fe)||U(Te=>Te===ne.id?null:Te),HD(ne.id,fe).catch(()=>{$(Te=>Te.map(ze=>ze.id===ne.id?{...ze,archived:Se}:ze))})}function Tr(ne,fe){const Se=ne.title;$(Te=>Te.map(ze=>ze.id===ne.id?{...ze,title:fe}:ze)),$D(ne.id,fe).catch(()=>{$(Te=>Te.map(ze=>ze.id===ne.id?{...ze,title:Se}:ze))})}async function Ls(ne){var Se;const fe=((Se=ne.title)==null?void 0:Se.trim())||"Untitled";if(window.confirm(`Delete "${fe}"? - -Its transcript is permanently removed.`)){try{await BD(ne.id)}catch(Te){window.alert(`Failed to delete "${fe}": ${Te instanceof Error?Te.message:String(Te)}`);return}Hr(ne.id)}}const St=R.useCallback(ne=>{if(!F)return Promise.resolve(!1);const fe=F;return De({type:"busy",sessionId:fe,busy:!0}),gr(()=>YD(fe,ne)).then(()=>!0).catch(()=>!1).finally(()=>{ud(fe).then(({messages:Se,queued:Te,activeLeafId:ze})=>De({type:"seed",sessionId:fe,messages:Se,queued:Te,activeLeafId:ze})).catch(()=>{}),lf(e).then(Se=>{var Te;return De({type:"busy",sessionId:fe,busy:!!((Te=Se.find(ze=>ze.id===fe))!=null&&Te.busy)})}).catch(()=>{})})},[F,e,gr]),_i=I.filter(ne=>Rw(Y,ne.archived)),Wi=/Mac|iPhone|iPad/.test(navigator.platform),Yi=Wi?"⌘ ⇧ Enter":"Ctrl + Shift + Enter",Wa=Wi?"⌘ Enter":"Ctrl + Enter",ds=R.useCallback(()=>{Z("active"),U(null),l("chat")},[l]);R.useEffect(()=>{const ne=fe=>{fe.repeat||fe.key!=="Enter"||!fe.metaKey&&!fe.ctrlKey||fe.altKey||!fe.shiftKey||(fe.preventDefault(),ds())};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[ds]);const se=h.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-2.5 mr-3.5 mb-2.5 ml-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:py-1 [&_.rail-body]:px-2 floating-panel border border-border rounded-lg shadow-[0_6px_24px_color-mix(in_oklab,_var(--text)_5%,_transparent),_0_1px_4px_color-mix(in_oklab,_var(--text)_4%,_transparent)] overflow-visible",children:[r,h.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${d?"active":""}`,onClick:C,children:[h.jsx(yd,{size:15}),"Files"]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${p?"active":""}`,"data-onboarding":"nav-artifacts",onClick:g,children:[h.jsx(r_,{size:15}),"Artifacts"]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${u?"active":""}`,onClick:f,children:[h.jsx(Eb,{size:15}),"Experiments"]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${o==="skills"?"active":""}`,onClick:()=>l("skills"),children:[h.jsx(Lj,{size:15}),"Skills"]}),MG.map(ne=>h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${o!=="chat"&&o!=="skills"&&ne.activeTabs.includes(o)?"active":""}`,"data-onboarding":ne.id==="compute"?"nav-compute":void 0,onClick:()=>l(ne.id),children:[ne.icon,ne.label]},ne.id))]}),h.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pr-2.5 pb-1.5 pl-4.5",children:[h.jsx("div",{className:"rail-section-label p-0 text-md font-medium text-subtext",children:((Ve=TC.find(ne=>ne.id===Y))==null?void 0:Ve.railLabel)??"Recents"}),h.jsxs("div",{className:"rail-section-actions flex items-center gap-0.5",children:[h.jsxs("button",{className:"rail-section-new inline-flex items-center gap-1 py-[3px] px-1.5 rounded-sm text-subtext text-xs font-medium [&:hover]:text-text [&:hover]:bg-surface tip-up [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":Yi,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:ds,children:[h.jsx(i_,{size:13}),"Task"]}),h.jsx(tW,{value:Y,onChange:Z})]})]}),h.jsxs("div",{className:"rail-body",children:[_i.map(ne=>h.jsx(sW,{session:ne,active:ne.id===F&&o==="chat",unread:G.has(ne.id),busy:mt.busySessions.has(ne.id),waiting:ir.has(ne.id),revealTitle:xe.get(ne.id),onOpen:()=>{U(ne.id),e===og&&YG(ne.id),X(fe=>{if(!fe.has(ne.id))return fe;const Se=new Set(fe);return Se.delete(ne.id),Se}),l("chat")},onRename:fe=>Tr(ne,fe),onSetArchived:fe=>Va(ne,fe),onDelete:()=>void Ls(ne)},ne.id)),_i.length===0&&h.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-md text-muted",children:Y==="archived"?"No archived sessions":I.length>0?"No active sessions":"No sessions yet"})]})]}),we=`chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&.rail-hidden]:max-w-none [&.rail-hidden]:py-0 [&.rail-hidden]:px-0.5 [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:left-0 [&::after]:right-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none${i?"":" rail-hidden"}`,Ee=!i&&h.jsx("button",{className:Xn,title:"Show sidebar","aria-label":"Show sidebar",onClick:a,children:h.jsx(rS,{size:15})});return o!=="chat"?h.jsxs(h.Fragment,{children:[i&&se,h.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!i&&h.jsx("div",{className:we,children:Ee}),h.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:D})]})]}):h.jsxs(h.Fragment,{children:[i&&se,h.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[h.jsxs("div",{className:we,children:[Ee,h.jsx("div",{className:Sd,title:cn?((qe=cn.title)==null?void 0:qe.trim())||"Untitled":"New session",children:cn?h.jsx(NC,{title:((vt=cn.title)==null?void 0:vt.trim())||"Untitled",animate:Ms!==void 0},Ms??"static"):"New session"}),N&&h.jsx("button",{className:Xn,"data-tip":"About this demo","aria-label":"About this demo",onClick:N,children:h.jsx(Yj,{size:15})})]}),Ga?h.jsxs("div",{className:"chat-loading flex-1 flex items-center justify-center gap-3 text-subtext text-xl p-5 [&_.spinner]:w-5.5 [&_.spinner]:h-5.5 [&_.spinner]:border-[3px]","aria-live":"polite","aria-busy":"true",children:[h.jsx("span",{className:qt}),h.jsx("span",{children:"Loading conversation…"})]}):br?h.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:jt,onScroll:ne=>{const fe=ne.currentTarget;Tt.current=fe.scrollHeight-fe.scrollTop-fe.clientHeight<60,Or.dismiss()},children:h.jsxs("div",{className:"chat-thread-inner max-w-readable my-0 mx-auto pt-4 px-4 pb-8 flex flex-col gap-4",ref:_t,children:[h.jsx(eW,{messages:Rn,allMessages:vi,canFork:sa,onFork:Fo,onSelectFork:Ds,busy:ln,onOpenFile:$l,onOpenRun:S,runExperimentName:k,onOpenExperiment:x,experimentName:v,onRespond:St,onOpenPlan:Rs,onOpenSubagent:$o,skills:na}),ln&&(aa?h.jsx("div",{className:"working flex items-center gap-2 text-subtext text-md pt-0.5 px-0 pb-2 [&.awaiting]:italic awaiting",children:"Waiting for your input…"}):h.jsxs("div",{className:"working flex items-center gap-2 text-subtext text-md pt-0.5 px-0 pb-2 [&.awaiting]:italic",children:[h.jsx("span",{className:qt})," ",cs?"Working…":"Thinking…"]}))]})}):h.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center @container text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[h.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:h.jsx(c_,{})}),h.jsx("h2",{children:"What should we research?"}),h.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-semibold",children:[h.jsx(yd,{size:19}),h.jsx("span",{children:t})]}),h.jsxs("div",{className:"chat-empty-starters grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2.5 w-[min(100%,_620px)] mt-19 [@container((min-width:_500px))]:grid-cols-[repeat(4,_minmax(0,_1fr))] [@container((min-width:_500px))]:w-[min(100%,_720px)]",children:[h.jsxs("button",{type:"button",className:"chat-empty-starter min-h-28 flex flex-col items-start justify-between gap-5 p-4 border border-border rounded-lg text-text bg-background shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_5%,_transparent)] text-left text-md font-medium leading-[1.35] transition-[border-color,background,translate] duration-120 ease-standard [&:hover]:border-muted [&:hover]:bg-surface [&:hover]:-translate-y-px [&.blue_svg]:text-accent-blue [&.purple_svg]:text-accent-purple [&.green_svg]:text-accent-green [&.orange_svg]:text-accent-orange blue",onClick:()=>{var ne;mn(null),z("Explore this codebase and explain its architecture, key components, and open research questions."),(ne=ut.current)==null||ne.focus()},children:[h.jsx(V8,{size:16}),h.jsx("span",{children:"Explore this codebase"})]}),h.jsxs("button",{type:"button",className:"chat-empty-starter min-h-28 flex flex-col items-start justify-between gap-5 p-4 border border-border rounded-lg text-text bg-background shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_5%,_transparent)] text-left text-md font-medium leading-[1.35] transition-[border-color,background,translate] duration-120 ease-standard [&:hover]:border-muted [&:hover]:bg-surface [&:hover]:-translate-y-px [&.blue_svg]:text-accent-blue [&.purple_svg]:text-accent-purple [&.green_svg]:text-accent-green [&.orange_svg]:text-accent-orange purple",onClick:()=>{var fe;const ne=os.find(Se=>Se.name==="reproduce-paper");n&&ne?(mn(ne),z("")):(mn(null),z(n?"/reproduce-paper ":"Find and summarize the research most relevant to this project.")),(fe=ut.current)==null||fe.focus()},children:[h.jsx(nh,{size:16}),h.jsx("span",{children:n?"Reproduce the linked paper":"Review relevant literature"})]}),h.jsxs("button",{type:"button",className:"chat-empty-starter min-h-28 flex flex-col items-start justify-between gap-5 p-4 border border-border rounded-lg text-text bg-background shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_5%,_transparent)] text-left text-md font-medium leading-[1.35] transition-[border-color,background,translate] duration-120 ease-standard [&:hover]:border-muted [&:hover]:bg-surface [&:hover]:-translate-y-px [&.blue_svg]:text-accent-blue [&.purple_svg]:text-accent-purple [&.green_svg]:text-accent-green [&.orange_svg]:text-accent-orange green",onClick:()=>{var ne;mn(null),z("Set up and run an experiment for this project, including a baseline and meaningful variants."),(ne=ut.current)==null||ne.focus()},children:[h.jsx(Eb,{size:16}),h.jsx("span",{children:"Run an experiment"})]}),h.jsxs("button",{type:"button",className:"chat-empty-starter min-h-28 flex flex-col items-start justify-between gap-5 p-4 border border-border rounded-lg text-text bg-background shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_5%,_transparent)] text-left text-md font-medium leading-[1.35] transition-[border-color,background,translate] duration-120 ease-standard [&:hover]:border-muted [&:hover]:bg-surface [&:hover]:-translate-y-px [&.blue_svg]:text-accent-blue [&.purple_svg]:text-accent-purple [&.green_svg]:text-accent-green [&.orange_svg]:text-accent-orange orange",onClick:()=>{var ne;mn(null),z("Analyze the latest experiment results and recommend the most useful next iteration."),(ne=ut.current)==null||ne.focus()},children:[h.jsx(W8,{size:16}),h.jsx("span",{children:"Analyze results"})]})]})]}),Or.action&&h.jsxs("button",{type:"button",className:"chat-selection-action fixed z-50 inline-flex items-center gap-1.5 py-1.5 px-3 border border-border rounded-md bg-background text-text text-sm font-medium shadow-[0_2px_8px_rgba(0,_0,_0,_0.10)] whitespace-nowrap [&:hover]:bg-surface",style:{left:Or.action.x,top:Or.action.top,transform:"translateX(-50%)"},onMouseDown:ne=>ne.preventDefault(),onClick:Or.add,children:[h.jsx(nS,{size:14}),"Ask about this"]}),h.jsxs("div",{className:"composer pt-0 px-3 pb-3 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&::before]:content-[''] [&::before]:absolute [&::before]:bottom-full [&::before]:left-0 [&::before]:right-0 [&::before]:h-6 [&::before]:bg-[linear-gradient(to_top,_var(--base),_transparent)] [&::before]:pointer-events-none [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[gn&&!(Bl&&gn.promptId===Bl.promptId)&&h.jsx(jq,{synthesized:gn.synthesized,agentLabel:cn?ad[cn.harness]:"The agent",showResumeModes:(cn==null?void 0:cn.harness)==="claude-code",onView:()=>Rs==null?void 0:Rs(gn.plan,gn.promptId),onApprove:ne=>St({promptId:gn.promptId,approve:!0,...ne?{resumeMode:ne}:{}}),onReject:()=>St({promptId:gn.promptId,approve:!1}),onRevise:ne=>{F&&Vi({sessionId:F,promptId:gn.promptId}),St({promptId:gn.promptId,approve:!1,note:ne})}}),ti.length>0&&h.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:ti.map(ne=>h.jsxs("div",{className:"queued-chip flex items-center gap-2 py-1.5 px-2.5 text-sm text-subtext bg-surface border border-border rounded-sm",title:ne.text,children:[h.jsx(eM,{size:13,className:"shrink-0 text-muted"}),h.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:ne.text}),h.jsx("span",{className:"shrink-0 text-xs text-muted uppercase tracking-wide",children:"Queued"}),h.jsx("button",{title:"Cancel queued message","aria-label":"Cancel queued message",onClick:()=>ni(ne.id),className:"shrink-0 inline-flex items-center justify-center w-4 h-4 p-0 border-0 rounded-full text-muted cursor-pointer [&:hover]:bg-text [&:hover]:text-background",children:h.jsx(qr,{size:11})})]},ne.id))}),h.jsxs("div",{className:"composer-box relative flex flex-col border border-border rounded-md bg-background","data-onboarding":"composer",children:[Je&&!Je.agentReady&&h.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-xs leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[h.jsxs("strong",{children:[Je.name," is unavailable."]})," ",Je.agentNote?j2(Je.agentNote):"Re-check its setup."]}),Jr&&h.jsx(LG,{skills:Cr,activeIndex:Er,onPick:Pt,onHover:pr}),O.length>0&&h.jsx(vV,{annotations:O,onClear:()=>{H([]),window.requestAnimationFrame(()=>{var ne;return(ne=ut.current)==null?void 0:ne.focus()})},onRemove:ne=>{const fe=O.filter(Se=>Se.id!==ne);H(fe),fe.length===0&&window.requestAnimationFrame(()=>{var Se;return(Se=ut.current)==null?void 0:Se.focus()})}}),re.length>0&&h.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:re.map((ne,fe)=>{const Se=()=>le(Te=>Te.filter((ze,nt)=>nt!==fe));return ne.mediaType==="application/pdf"?h.jsxs("div",{className:"attachment-file [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background relative inline-flex items-center gap-2 max-w-55 py-2 px-2.5 border border-border rounded-sm text-text bg-surface [&_svg]:shrink-0 [&_svg]:text-muted",title:ne.name,children:[h.jsx(th,{size:22}),h.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:ne.name??"document.pdf"}),h.jsx("button",{title:"Remove file","aria-label":"Remove file",onClick:Se,children:h.jsx(qr,{size:11})})]},fe):h.jsxs("div",{className:"attachment-thumb relative [&_img]:w-13 [&_img]:h-13 [&_img]:object-cover [&_img]:border [&_img]:border-border [&_img]:rounded-sm [&_img]:block [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background",children:[h.jsx("img",{src:ne.dataUrl,alt:"pasted"}),h.jsx("button",{title:"Remove image","aria-label":"Remove image",onClick:Se,children:h.jsx(qr,{size:11})})]},fe)})}),pe&&h.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:pe}),B&&h.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:B}),h.jsxs("div",{className:"composer-input relative flex overflow-hidden [&_textarea]:flex-1",children:[yn&&h.jsxs("span",{ref:bi,className:"skill-chip inline-flex items-center py-px px-[7px] font-mono text-md font-medium text-primary bg-primary-subtle border border-border-variant rounded-sm composer-chip absolute top-[9px] left-3 z-1 pointer-events-none",children:["/",yn.name]}),h.jsx("textarea",{ref:ut,value:Q,style:yn?{textIndent:Ns}:void 0,onScroll:Sr,placeholder:Ar?"Type a custom answer…":yn?["reproduce-paper","paper-to-marimo"].includes(yn.name)&&n?`[optional — defaults to ${n} on your default compute]`:yn.argHint:oa&&Je?`Steer ${ad[Je.id]}… (${Wa} to queue)`:Ut?Je!=null&&Je.agentReady?`Message ${ad[Ut.harness]}… ( / for commands)`:`${ad[Ut.harness]} is unavailable — open the model picker`:"Ask the research agent… ( / for commands)",rows:2,onPaste:Qr,onDragOver:ne=>{ne.dataTransfer.types.includes("Files")&&ne.preventDefault()},onDrop:ne=>{ne.dataTransfer.files.length!==0&&(ne.preventDefault(),Zr(Array.from(ne.dataTransfer.files)))},onChange:ne=>{const fe=ne.target.value,Se=ne.target.selectionStart;Kr(Se);const Te=Se>0&&/\s/.test(fe[Se-1])?yw(fe,Se-1):null;if((Te==null?void 0:Te.query)==="plan"){js(fe,Te);return}if(!yn&&!Ar&&!mr.current){const ze=fe.match(/^\/(\S+)\s([\s\S]*)$/),nt=ze&&na.find(Zt=>Zt.name===ze[1].toLowerCase());if(nt){mn(nt),z(ze[2]),Jn(!1);return}}z(fe),Jn(!1)},onSelect:ne=>Kr(ne.currentTarget.selectionStart),onCompositionStart:()=>{mr.current=!0},onCompositionEnd:()=>{mr.current=!1},onKeyDown:ne=>{if(Jr){if(ne.key==="ArrowDown"||ne.key==="ArrowUp"){ne.preventDefault();const fe=ne.key==="ArrowDown"?1:-1;pr((Er+fe+Cr.length)%Cr.length);return}if(ne.key==="Enter"||ne.key==="Tab"){ne.preventDefault(),Pt(Cr[Er]);return}if(ne.key==="Escape"){ne.preventDefault(),Jn(!0);return}}if(yn&&ne.key==="Backspace"&&ne.currentTarget.selectionStart===0&&ne.currentTarget.selectionEnd===0){ne.preventDefault(),er();return}ne.key==="Enter"&&!ne.shiftKey&&!ne.nativeEvent.isComposing&&(ne.preventDefault(),nn({queue:ne.metaKey||ne.ctrlKey}))}})]}),h.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[h.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:xn.ref,children:[h.jsx("button",{type:"button",className:"composer-bare inline-flex items-center justify-center rounded-sm p-1.5 text-text transition-[background] duration-150 ease-standard hover:bg-surface",title:"Data sources","aria-label":"Data sources","aria-haspopup":"dialog","aria-expanded":xn.open,onClick:()=>xn.setOpen(ne=>!ne),children:h.jsx(vR,{size:16})}),xn.open&&h.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] left-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-[0_10px_26px_rgba(0,_0,_0,_0.16)]",children:[h.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:"Data sources"}),h.jsx(bL,{})]})]}),h.jsx("input",{ref:Fe,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:ne=>{Zr(Array.from(ne.target.files??[])),ne.target.value=""}}),h.jsx("button",{type:"button",className:"composer-attach inline-flex shrink-0 items-center justify-center w-7.5 h-7.5 rounded-sm text-text cursor-pointer transition-[background] duration-150 ease-standard [&:hover]:bg-surface",title:"Attach a PDF or image","aria-label":"Attach a PDF or image",onClick:()=>{var ne;return(ne=Fe.current)==null?void 0:ne.click()},children:h.jsx(KM,{size:16})}),zr&&h.jsxs("button",{type:"button",className:"plan-indicator group inline-flex h-7.5 shrink-0 items-center gap-1.5 rounded-sm bg-surface px-2 text-sm text-muted transition-colors hover:text-text focus-visible:text-text",title:"Exit Plan mode","aria-label":"Exit Plan mode",onClick:()=>void Gi(),children:[h.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[h.jsx(LM,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),h.jsx(qr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),h.jsx("span",{children:"Plan"})]}),h.jsx("div",{className:"min-w-0 flex-1"}),h.jsx(BG,{value:Ut,onSelect:Qt,permissionChoices:Je!=null&&Je.agentReady?(Nt==null?void 0:Nt.permissionModes)??[]:[],defaultPermissionId:(Nt==null?void 0:Nt.defaultPermissionMode)??null,onSelectPermission:qi,reasoningChoices:Je!=null&&Je.agentReady?Ir.choices:[],defaultReasoningId:Ir.defaultId,onSelectReasoning:Hn,onHarnesses:Bt,lockHarness:!!ft}),h.jsx($G,{usage:ft==null?void 0:ft.contextUsage}),ln&&!Ar?h.jsx("button",{className:"send-btn inline-flex shrink-0 items-center justify-center w-8 h-8 rounded-md bg-primary text-background transition-[background,opacity] duration-100 ease-standard [&:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))] [&:disabled]:opacity-40 [&:disabled]:cursor-default [&.stop]:bg-surface [&.stop]:text-text [&.stop:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--surface)_88%,_var(--text))] stop",title:"Stop","aria-label":"Stop",onClick:us,children:h.jsx(qr,{size:16})}):h.jsx("button",{className:"send-btn inline-flex shrink-0 items-center justify-center w-8 h-8 rounded-md bg-primary text-background transition-[background,opacity] duration-100 ease-standard [&:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))] [&:disabled]:opacity-40 [&:disabled]:cursor-default [&.stop]:bg-surface [&.stop]:text-text [&.stop:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--surface)_88%,_var(--text))]",title:"Send","aria-label":"Send",onClick:()=>void nn(),disabled:!(Je!=null&&Je.agentReady)||!yn&&!Q.trim()&&re.length===0&&O.length===0,children:h.jsx(Q8,{size:16})})]})]})]})]})]})}const Dw=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function oW({sessionId:e,spawnPartId:t,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:l}){const[u,d]=R.useState(null),p=R.useRef(null),f=R.useRef(null),g=R.useRef(!0);if(R.useLayoutEffect(()=>{g.current=!0;const S=p.current;S&&(S.scrollTop=S.scrollHeight)},[e,t]),R.useLayoutEffect(()=>{const S=p.current;S&&g.current&&(S.scrollTop=S.scrollHeight)},[u]),R.useEffect(()=>{const S=p.current,k=f.current;if(!S||!k)return;const x=new ResizeObserver(()=>{g.current&&(S.scrollTop=S.scrollHeight)});return x.observe(k),x.observe(S),()=>x.disconnect()},[u===null]),R.useEffect(()=>{let S=!0;const k=new Set;let x=0;const v=()=>{const y=++x;ud(e).then(({messages:C})=>{!S||y!==x||d(N=>{if(!N)return C;const E=C.map(T=>k.has(T.id)?N.find(D=>D.id===T.id)??T:T),j=new Set(C.map(T=>T.id));return[...E,...N.filter(T=>!j.has(T.id))]})}).catch(()=>S&&d(C=>C??[]))};v();const w=wd(y=>{if(y.type==="reconnected"){k.clear(),v();return}y.type!=="message"||y.sessionId!==e||(k.add(y.message.id),d(C=>{const N=C?C.slice():[],E=N.findIndex(j=>j.id===y.message.id);return E===-1?N.push(y.message):N[E]=y.message,N}))});return()=>{S=!1,w()}},[e]),u===null)return h.jsx("div",{className:Aa,children:h.jsx("div",{className:Dw,children:h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:"Loading…"})})});let b=null;for(const S of u)if(b=O2(S.parts,t),b)break;return h.jsx("div",{className:Aa,children:h.jsx("div",{className:Dw,ref:p,onScroll:S=>{const k=S.currentTarget;g.current=k.scrollHeight-k.scrollTop-k.clientHeight<60},children:h.jsx("div",{ref:f,children:b?h.jsx(KV,{spawn:b,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:l}):h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:"This sub-agent is no longer available."})})})})}function Lw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.push.apply(n,r)}return n}function Xt(e){for(var t=1;t=0||(p[u]=o[u]);return p})(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $t(e,t){return MC(e)||(function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var a,o,l,u,d=[],p=!0,f=!1;try{if(l=(i=i.call(n)).next,r===0){if(Object(i)!==i)return;p=!1}else for(;!(p=(a=l.call(i)).done)&&(d.push(a.value),d.length!==r);p=!0);}catch(g){f=!0,o=g}finally{try{if(!p&&i.return!=null&&(u=i.return(),Object(u)!==u))return}finally{if(f)throw o}}return d}})(e,t)||Rp(e,t)||DC()}function jC(e){return MC(e)||RC(e)||Rp(e)||DC()}function Ii(e){return(function(t){if(Array.isArray(t))return Ev(t)})(e)||RC(e)||Rp(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 MC(e){if(Array.isArray(e))return e}function RC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Rp(e,t){if(e){if(typeof e=="string")return Ev(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)?Ev(e,t):void 0}}function Ev(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:i}}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 a,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return o=u.done,u},e:function(u){l=!0,a=u},f:function(){try{o||n.return==null||n.return()}finally{if(l)throw a}}}}var q0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gh(e,t){return e(t={exports:{}},t.exports),t.exports}var Ri=gh((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=[],i=0;i-1?v.slice(0,y):C;switch(C){case"diff":k--;break e;case"deleted":case"new":var N=v.slice(y+1);N.indexOf("file mode")===0&&(o[C==="new"?"newMode":"oldMode"]=N.slice(10));break;case"similarity":o.similarity=parseInt(v.split(" ")[2],10);break;case"index":var E=v.slice(y+1).split(" "),j=E[0].split("..");o.oldRevision=j[0],o.newRevision=j[1],E[1]&&(o.oldMode=o.newMode=E[1]);break;case"copy":case"rename":var T=v.slice(y+1);T.indexOf("from")===0?o.oldPath=T.slice(5):o.newPath=T.slice(3),w=C;break;case"---":var D=v.slice(y+1),I=b[++k].slice(4);D==="/dev/null"?(I=I.slice(2),w="add"):I==="/dev/null"?(D=D.slice(2),w="delete"):(w="modify",D=D.slice(2),I=I.slice(2)),D&&(o.oldPath=D),I&&(o.newPath=I),g=5;break e}}o.type=w||"modify"}else if(x.indexOf("Binary")===0)o.isBinary=!0,o.type=x.indexOf("/dev/null and")>=0?"add":x.indexOf("and /dev/null")>=0?"delete":"modify",g=2,o=null;else if(g===5)if(x.indexOf("@@")===0){var $=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(x);l={content:x,oldStart:$[1]-0,newStart:$[4]-0,oldLines:$[3]-0||1,newLines:$[6]-0||1,changes:[]},o.hunks.push(l),u=l.oldStart,d=l.newStart}else{var F=x.slice(0,1),U={content:x.slice(1)};switch(F){case"+":U.type="insert",U.isInsert=!0,U.lineNumber=d,d++;break;case"-":U.type="delete",U.isDelete=!0,U.lineNumber=u,u++;break;case" ":U.type="normal",U.isNormal=!0,U.oldLineNumber=u,U.newLineNumber=d,u++,d++;break;case"\\":var G=l.changes[l.changes.length-1];G.isDelete||(o.newEndingNewLine=!1),G.isInsert||(o.oldEndingNewLine=!1)}U.type&&l.changes.push(U)}k++}return f}};e.exports=i})()}));function Ho(e){return e.type==="insert"}function zi(e){return e.type==="delete"}function Ia(e){return e.type==="normal"}function dW(e,t){var n=t.nearbySequences==="zip"?(function(r){var i=r.reduce((function(a,o,l){var u=$t(a,3),d=u[0],p=u[1],f=u[2];return p?Ho(o)&&f>=0?(d.splice(f+1,0,o),[d,o,f+2]):(d.push(o),[d,o,zi(o)&&zi(p)?f:l]):(d.push(o),[d,o,zi(o)?l:-1])}),[[],null,-1]);return $t(i,1)[0]})(e.changes):e.changes;return Xt(Xt({},e),{},{isPlain:!1,changes:n})}function Av(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=(function(r){if(r.startsWith("diff --git"))return r;var i=r.indexOf(` -`),a=r.indexOf(` -`,i+1),o=r.slice(0,i),l=r.slice(i+1,a),u=o.split(" ").slice(1,-3).join(" "),d=l.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(u," b/").concat(d),"index 1111111..2222222 100644","--- a/".concat(u),"+++ b/".concat(d),r.slice(a+1)].join(` -`)})(e.trimStart());return uW.parse(n).map((function(r){return(function(i,a){var o=i.hunks.map((function(l){return dW(l,a)}));return Xt(Xt({},i),{},{hunks:o})})(r,t)}))}function hW(e){return e[0]}function fW(e){return e[e.length-1]}function Tv(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function Ld(e){return e==="old"?function(t){return Ho(t)?-1:Ia(t)?t.oldLineNumber:t.lineNumber}:function(t){return zi(t)?-1:Ia(t)?t.newLineNumber:t.lineNumber}}function OC(e,t){return function(n,r){var i=n[e],a=i+n[t];return r>=i&&r=a&&i-1},yW=function(e,t){var n=this.__data__,r=Dp(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Cc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tl))return!1;var d=a.get(e),p=a.get(t);if(d&&p)return d==t&&p==e;var f=-1,g=!0,b=2&n?new iY:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},_n={};_n["[object Float32Array]"]=_n["[object Float64Array]"]=_n["[object Int8Array]"]=_n["[object Int16Array]"]=_n["[object Int32Array]"]=_n["[object Uint8Array]"]=_n["[object Uint8ClampedArray]"]=_n["[object Uint16Array]"]=_n["[object Uint32Array]"]=!0,_n["[object Arguments]"]=_n["[object Array]"]=_n["[object ArrayBuffer]"]=_n["[object Boolean]"]=_n["[object DataView]"]=_n["[object Date]"]=_n["[object Error]"]=_n["[object Function]"]=_n["[object Map]"]=_n["[object Number]"]=_n["[object Object]"]=_n["[object RegExp]"]=_n["[object Set]"]=_n["[object String]"]=_n["[object WeakMap]"]=!1;var xY=function(e){return Xc(e)&&H2(e.length)&&!!_n[cu(e)]},yY=function(e){return function(t){return e(t)}},Pw=gh((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,i=r&&r.exports===n&&BC.process,a=(function(){try{var o=r&&r.require&&r.require("util").types;return o||i&&i.binding&&i.binding("util")}catch{}})();e.exports=a})),Uw=Pw&&Pw.isTypedArray,$2=Uw?yY(Uw):xY,wY=Object.prototype.hasOwnProperty,SY=function(e,t){var n=Hi(e),r=!n&&zp(e),i=!n&&!r&&Uf(e),a=!n&&!r&&!i&&$2(e),o=n||r||i||a,l=o?mY(e.length,String):[],u=l.length;for(var d in e)!wY.call(e,d)||o&&(d=="length"||i&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||qC(d,u))||l.push(d);return l},kY=Object.prototype,GC=function(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||kY)},CY=(function(e,t){return function(n){return e(t(n))}})(Object.keys,Object),EY=Object.prototype.hasOwnProperty,VC=function(e){if(!GC(e))return CY(e);var t=[];for(var n in Object(e))EY.call(e,n)&&n!="constructor"&&t.push(n);return t},Bp=function(e){return e!=null&&H2(e.length)&&!$C(e)},F2=function(e){return Bp(e)?SY(e):VC(e)},qw=function(e){return uY(e,F2,pY)},AY=Object.prototype.hasOwnProperty,TY=function(e,t,n,r,i,a){var o=1&n,l=qw(e),u=l.length;if(u!=qw(t).length&&!o)return!1;for(var d=u;d--;){var p=l[d];if(!(o?p in t:AY.call(t,p)))return!1}var f=a.get(e),g=a.get(t);if(f&&g)return f==t&&g==e;var b=!0;a.set(e,t),a.set(t,e);for(var S=o;++d1)return!1;if(e.length===1){var t=$t(e,1)[0];return t.type==="text"&&!t.value}return!0}function gX(e){var t=e.changeKey,n=e.text,r=e.tokens,i=e.renderToken,a=Lo(e,pX),o=i?function(l,u){return i(l,Xw,u)}:Xw;return h.jsx("td",Xt(Xt({},a),{},{"data-change-key":t,children:r?mX(r)?" ":r.map(o):n||" "}))}var eE=R.memo(gX);function tE(e,t){return function(){var n=t==="old"?Up(e):qp(e);return n===-1?void 0:n}}function nE(e,t){return function(n){return e&&n?h.jsx("a",{href:t?"#"+t:void 0,children:n}):n}}function qf(e,t){return t?function(n){e(),t(n)}:e}function Kw(e,t,n,r){return R.useMemo((function(){var i=JC(e,(function(a){return function(o){return a&&a(t,o)}}));return i.onMouseEnter=qf(n,i.onMouseEnter),i.onMouseLeave=qf(r,i.onMouseLeave),i}),[e,n,r,t])}function Zw(e,t,n,r,i,a,o,l,u){var d={change:t,side:r,inHoverState:l,renderDefault:tE(t,r),wrapInAnchor:nE(i,a)};return h.jsx("td",Xt(Xt({className:e},o),{},{"data-change-key":n,children:u(d)}))}function bX(e){var t,n,r,i=e.change,a=e.selected,o=e.tokens,l=e.className,u=e.generateLineClassName,d=e.gutterClassName,p=e.codeClassName,f=e.gutterEvents,g=e.codeEvents,b=e.hideGutter,S=e.gutterAnchor,k=e.generateAnchorID,x=e.renderToken,v=e.renderGutter,w=i.type,y=i.content,C=No(i),N=(t=$t(R.useState(!1),2),n=t[0],r=t[1],[n,R.useCallback((function(){return r(!0)}),[]),R.useCallback((function(){return r(!1)}),[])]),E=$t(N,3),j=E[0],T=E[1],D=E[2],I=R.useMemo((function(){return{change:i}}),[i]),$=Kw(f,I,T,D),F=Kw(g,I,T,D),U=k(i),G=u({changes:[i],defaultGenerate:function(){return l}}),X=Ri("diff-gutter","diff-gutter-".concat(w),d,{"diff-gutter-selected":a}),Y=Ri("diff-code","diff-code-".concat(w),p,{"diff-code-selected":a});return h.jsxs("tr",{id:U,className:Ri("diff-line",G),children:[!b&&Zw(X,i,C,"old",S,U,$,j,v),!b&&Zw(X,i,C,"new",S,U,$,j,v),h.jsx(eE,Xt({className:Y,changeKey:C,text:y,tokens:o,renderToken:x},F))]})}var vX=R.memo(bX);function _X(e){var t=e.hideGutter,n=e.element;return h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:t?1:3,className:"diff-widget-content",children:n})})}var xX=["hideGutter","selectedChanges","tokens","lineClassName"],yX=["hunk","widgets","className"];function wX(e){var t=e.hunk,n=e.widgets,r=e.className,i=Lo(e,yX),a=(function(o,l){return o.reduce((function(u,d){var p=No(d);u.push(["change",p,d]);var f=l[p];return f&&u.push(["widget",p,f]),u}),[])})(t.changes,n);return h.jsx("tbody",{className:Ri("diff-hunk",r),children:a.map((function(o){return(function(l,u){var d=$t(l,3),p=d[0],f=d[1],g=d[2],b=u.hideGutter,S=u.selectedChanges,k=u.tokens,x=u.lineClassName,v=Lo(u,xX);if(p==="change"){var w=zi(g)?"old":"new",y=zi(g)?Up(g):qp(g),C=k?k[w][y-1]:null;return h.jsx(vX,Xt({className:x,change:g,hideGutter:b,selected:S.includes(f),tokens:C},v),"change".concat(f))}return p==="widget"?h.jsx(_X,{hideGutter:b,element:g},"widget".concat(f)):null})(o,i)}))})}var rE=0;function V0(e,t,n,r){var i=R.useCallback((function(){return t(e)}),[e,t]),a=R.useCallback((function(){return t("")}),[t]);return R.useMemo((function(){var o=JC(r,(function(l){return function(u){return l&&l({side:e,change:n},u)}}));return o.onMouseEnter=qf(i,o.onMouseEnter),o.onMouseLeave=qf(a,o.onMouseLeave),o}),[n,r,i,e,a])}function rb(e){var t=e.change,n=e.side,r=e.selected,i=e.tokens,a=e.gutterClassName,o=e.codeClassName,l=e.gutterEvents,u=e.codeEvents,d=e.anchorID,p=e.gutterAnchor,f=e.gutterAnchorTarget,g=e.hideGutter,b=e.hover,S=e.renderToken,k=e.renderGutter;if(!t){var x=Ri("diff-gutter","diff-gutter-omit",a),v=Ri("diff-code","diff-code-omit",o);return[!g&&h.jsx("td",{className:x},"gutter"),h.jsx("td",{className:v},"code")]}var w=t.type,y=t.content,C=No(t),N=n===rE?"old":"new",E=Xt({id:d||void 0,className:Ri("diff-gutter","diff-gutter-".concat(w),Cv({"diff-gutter-selected":r},"diff-line-hover-"+N,b),a),children:k({change:t,side:N,inHoverState:b,renderDefault:tE(t,N),wrapInAnchor:nE(p,f)})},l),j=Ri("diff-code","diff-code-".concat(w),Cv({"diff-code-selected":r},"diff-line-hover-"+N,b),o);return[!g&&h.jsx("td",Xt(Xt({},E),{},{"data-change-key":C}),"gutter"),h.jsx(eE,Xt({className:j,changeKey:C,text:y,tokens:i,renderToken:S},u),"code")]}function SX(e){var t=e.className,n=e.oldChange,r=e.newChange,i=e.oldSelected,a=e.newSelected,o=e.oldTokens,l=e.newTokens,u=e.monotonous,d=e.gutterClassName,p=e.codeClassName,f=e.gutterEvents,g=e.codeEvents,b=e.hideGutter,S=e.generateAnchorID,k=e.generateLineClassName,x=e.gutterAnchor,v=e.renderToken,w=e.renderGutter,y=$t(R.useState(""),2),C=y[0],N=y[1],E=V0("old",N,n,f),j=V0("new",N,r,f),T=V0("old",N,n,g),D=V0("new",N,r,g),I=n&&S(n),$=r&&S(r),F=k({changes:[n,r],defaultGenerate:function(){return t}}),U={monotonous:u,hideGutter:b,gutterClassName:d,codeClassName:p,gutterEvents:f,codeEvents:g,renderToken:v,renderGutter:w},G=Xt(Xt({},U),{},{change:n,side:rE,selected:i,tokens:o,gutterEvents:E,codeEvents:T,anchorID:I,gutterAnchor:x,gutterAnchorTarget:I,hover:C==="old"}),X=Xt(Xt({},U),{},{change:r,side:1,selected:a,tokens:l,gutterEvents:j,codeEvents:D,anchorID:n===r?null:$,gutterAnchor:x,gutterAnchorTarget:n===r?I:$,hover:C==="new"});if(u)return h.jsx("tr",{className:Ri("diff-line",F),children:rb(n?G:X)});var Y=(function(Z,Q){return Z&&!Q?"diff-line-old-only":!Z&&Q?"diff-line-new-only":Z===Q?"diff-line-normal":"diff-line-compare"})(n,r);return h.jsxs("tr",{className:Ri("diff-line",Y,F),children:[rb(G),rb(X)]})}var kX=R.memo(SX);function CX(e){var t=e.hideGutter,n=e.oldElement,r=e.newElement;return e.monotonous?h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n||r})}):n===r?h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:t?2:4,className:"diff-widget-content",children:n})}):h.jsxs("tr",{className:"diff-widget",children:[h.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n}),h.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:r})]})}var EX=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],AX=["hunk","widgets","className"];function W0(e,t){return(e?No(e):"00")+(t?No(t):"00")}function TX(e){var t=e.hunk,n=e.widgets,r=e.className,i=Lo(e,AX),a=(function(o,l){for(var u=function(v){if(!v)return null;var w=No(v);return l[w]||null},d=[],p=0;p=(a==null?void 0:a.value.length))return[e];var l=function(f,g){var b=a.value.slice(f,g);return[].concat(Ii(i),[Xt(Xt({},a),{},{value:b})])};if(t>0){var u=l(0,t);o.push(jc(u))}var d=l(Math.max(t,0),n);if(o.push(r?(function(f,g){return[g].concat(Ii(jc(f)))})(d,r):jc(d)),n1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,i=Lo(e,YX);n.push(i);var a,o=z2(r);try{for(o.s();!(a=o.n()).done;)oE(a.value,t,n)}catch(l){o.e(l)}finally{o.f()}n.pop()}else t.push(jc([].concat(Ii(n.slice(1)),[e])));return t}function XX(e){return e.reduce((function(t,n){var r=t[t.length-1],i=(function(u){var d=V2(u);return d.value.includes(` -`)?d.value.split(` -`).map((function(p){return GX(u,Xt(Xt({},d),{},{value:p}))})):[u]})(n),a=jC(i),o=a[0],l=a.slice(1);return[].concat(Ii(t.slice(0,-1)),[[].concat(Ii(r),[o])],Ii(l.map((function(u){return[u]}))))}),[[]])}function t7(e){return XX(oE(e))}var KX=function(e,t,n){var r=(n=typeof n=="function"?n:void 0)?n(e,t):void 0;return r===void 0?Hp(e,t,void 0,n):!!r},ZX=function(e,t){return Hp(e,t)},QX=function(e){var t=e==null?0:e.length;return t?e[t-1]:void 0};function JX(e,t){if(!e.children)throw new Error("parent node missing children property");var n,r,i=QX(e.children);return i&&(r=t,(n=i).type===r.type&&(n.type==="text"||n.children&&r.children&&KX(n,r,(function(a,o,l){return l==="chlidren"||ZX(a,o)}))))?e.children[e.children.length-1]=(function(a,o){return"value"in a&&"value"in o?Xt(Xt({},a),{},{value:"".concat(a.value).concat(o.value)}):a})(i,t):e.children.push(t),e.children[e.children.length-1]}function n7(e){var t,n={type:"root",children:[]},r=z2(e);try{var i=function(){var a=t.value;a.reduce((function(o,l,u){return JX(o,u===a.length-1?Xt({},l):Xt(Xt({},l),{},{children:[]}))}),n)};for(r.s();!(t=r.n()).done;)i()}catch(a){r.e(a)}finally{r.f()}return n}var eK=Object.prototype.hasOwnProperty,tK=sE((function(e,t,n){eK.call(e,n)?e[n].push(t):q2(e,n,[t])})),nK=Object.prototype.hasOwnProperty,rK=function(e){if(e==null)return!0;if(Bp(e)&&(Hi(e)||typeof e=="string"||typeof e.splice=="function"||Uf(e)||$2(e)||zp(e)))return!e.length;var t=Dv(e);if(t=="[object Map]"||t=="[object Set]")return!e.size;if(GC(e))return!VC(e).length;for(var n in e)if(nK.call(e,n))return!1;return!0},iK=function(e,t){var n=t.start,r=t.length,i=n+r,a=e.reduce((function(o,l){var u=$t(o,2),d=u[0],p=u[1],f=p+V2(l).value.length;if(p>i||fr.length?n:r,u=n.length>r.length?r:n,d=l.indexOf(u);if(d!=-1)return o=[new t.Diff(1,l.substring(0,d)),new t.Diff(0,u),new t.Diff(1,l.substring(d+u.length))],n.length>r.length&&(o[0][0]=o[2][0]=-1),o;if(u.length==1)return[new t.Diff(-1,n),new t.Diff(1,r)];var p=this.diff_halfMatch_(n,r);if(p){var f=p[0],g=p[1],b=p[2],S=p[3],k=p[4],x=this.diff_main(f,b,i,a),v=this.diff_main(g,S,i,a);return x.concat([new t.Diff(0,k)],v)}return i&&n.length>100&&r.length>100?this.diff_lineMode_(n,r,a):this.diff_bisect_(n,r,a)},t.prototype.diff_lineMode_=function(n,r,i){var a=this.diff_linesToChars_(n,r);n=a.chars1,r=a.chars2;var o=a.lineArray,l=this.diff_main(n,r,!1,i);this.diff_charsToLines_(l,o),this.diff_cleanupSemantic(l),l.push(new t.Diff(0,""));for(var u=0,d=0,p=0,f="",g="";u=1&&p>=1){l.splice(u-d-p,d+p),u=u-d-p;for(var b=this.diff_main(f,g,!1,i),S=b.length-1;S>=0;S--)l.splice(u,0,b[S]);u+=b.length}p=0,d=0,f="",g=""}u++}return l.pop(),l},t.prototype.diff_bisect_=function(n,r,i){for(var a=n.length,o=r.length,l=Math.ceil((a+o)/2),u=l,d=2*l,p=new Array(d),f=new Array(d),g=0;gi);y++){for(var C=-y+k;C<=y-x;C+=2){for(var N=u+C,E=($=C==-y||C!=y&&p[N-1]a)x+=2;else if(E>o)k+=2;else if(S&&(D=u+b-C)>=0&&D=(T=a-f[D]))return this.diff_bisectSplit_(n,r,$,E,i)}for(var j=-y+v;j<=y-w;j+=2){for(var T,D=u+j,I=(T=j==-y||j!=y&&f[D-1]a)w+=2;else if(I>o)v+=2;else if(!S&&(N=u+b-j)>=0&&N=(T=a-T))return this.diff_bisectSplit_(n,r,$,E,i)}}}return[new t.Diff(-1,n),new t.Diff(1,r)]},t.prototype.diff_bisectSplit_=function(n,r,i,a,o){var l=n.substring(0,i),u=r.substring(0,a),d=n.substring(i),p=r.substring(a),f=this.diff_main(l,u,!1,o),g=this.diff_main(d,p,!1,o);return f.concat(g)},t.prototype.diff_linesToChars_=function(n,r){var i=[],a={};function o(d){for(var p="",f=0,g=-1,b=i.length;ga?n=n.substring(i-a):ir.length?n:r,a=n.length>r.length?r:n;if(i.length<4||2*a.length=k.length?[w,y,C,N,T]:null}var u,d,p,f,g,b=l(i,a,Math.ceil(i.length/4)),S=l(i,a,Math.ceil(i.length/2));return b||S?(u=S?b&&b[4].length>S[4].length?b:S:b,n.length>r.length?(d=u[0],p=u[1],f=u[2],g=u[3]):(f=u[0],g=u[1],d=u[2],p=u[3]),[d,p,f,g,u[4]]):null},t.prototype.diff_cleanupSemantic=function(n){for(var r=!1,i=[],a=0,o=null,l=0,u=0,d=0,p=0,f=0;l0?i[a-1]:-1,u=0,d=0,p=0,f=0,o=null,r=!0)),l++;for(r&&this.diff_cleanupMerge(n),this.diff_cleanupSemanticLossless(n),l=1;l=k?(S>=g.length/2||S>=b.length/2)&&(n.splice(l,0,new t.Diff(0,b.substring(0,S))),n[l-1][1]=g.substring(0,g.length-S),n[l+1][1]=b.substring(S),l++):(k>=g.length/2||k>=b.length/2)&&(n.splice(l,0,new t.Diff(0,g.substring(0,k))),n[l-1][0]=1,n[l-1][1]=b.substring(0,b.length-k),n[l+1][0]=-1,n[l+1][1]=g.substring(k),l++),l++}l++}},t.prototype.diff_cleanupSemanticLossless=function(n){function r(k,x){if(!k||!x)return 6;var v=k.charAt(k.length-1),w=x.charAt(0),y=v.match(t.nonAlphaNumericRegex_),C=w.match(t.nonAlphaNumericRegex_),N=y&&v.match(t.whitespaceRegex_),E=C&&w.match(t.whitespaceRegex_),j=N&&v.match(t.linebreakRegex_),T=E&&w.match(t.linebreakRegex_),D=j&&k.match(t.blanklineEndRegex_),I=T&&x.match(t.blanklineStartRegex_);return D||I?5:j||T?4:y&&!N&&E?3:N||E?2:y||C?1:0}for(var i=1;i=b&&(b=S,p=a,f=o,g=l)}n[i-1][1]!=p&&(p?n[i-1][1]=p:(n.splice(i-1,1),i--),n[i][1]=f,g?n[i+1][1]=g:(n.splice(i+1,1),i--))}i++}},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,i=[],a=0,o=null,l=0,u=!1,d=!1,p=!1,f=!1;l0?i[a-1]:-1,p=f=!1),r=!0)),l++;r&&this.diff_cleanupMerge(n)},t.prototype.diff_cleanupMerge=function(n){n.push(new t.Diff(0,""));for(var r,i=0,a=0,o=0,l="",u="";i1?(a!==0&&o!==0&&((r=this.diff_commonPrefix(u,l))!==0&&(i-a-o>0&&n[i-a-o-1][0]==0?n[i-a-o-1][1]+=u.substring(0,r):(n.splice(0,0,new t.Diff(0,u.substring(0,r))),i++),u=u.substring(r),l=l.substring(r)),(r=this.diff_commonSuffix(u,l))!==0&&(n[i][1]=u.substring(u.length-r)+n[i][1],u=u.substring(0,u.length-r),l=l.substring(0,l.length-r))),i-=a+o,n.splice(i,a+o),l.length&&(n.splice(i,0,new t.Diff(-1,l)),i++),u.length&&(n.splice(i,0,new t.Diff(1,u)),i++),i++):i!==0&&n[i-1][0]==0?(n[i-1][1]+=n[i][1],n.splice(i,1)):i++,o=0,a=0,l="",u=""}n[n.length-1][1]===""&&n.pop();var d=!1;for(i=1;ir));i++)l=a,u=o;return n.length!=i&&n[i][0]===-1?u:u+(r-l)},t.prototype.diff_prettyHtml=function(n){for(var r=[],i=/&/g,a=//g,l=/\n/g,u=0;u");switch(d){case 1:r[u]=''+p+"";break;case-1:r[u]=''+p+"";break;case 0:r[u]=""+p+""}}return r.join("")},t.prototype.diff_text1=function(n){for(var r=[],i=0;ithis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var a=this.match_alphabet_(r),o=this;function l(E,j){var T=E/r.length,D=Math.abs(i-j);return o.Match_Distance?T+D/o.Match_Distance:D?1:T}var u=this.Match_Threshold,d=n.indexOf(r,i);d!=-1&&(u=Math.min(l(0,d),u),(d=n.lastIndexOf(r,i+r.length))!=-1&&(u=Math.min(l(0,d),u)));var p,f,g=1<=x;y--){var C=a[n.charAt(y-1)];if(w[y]=k===0?(w[y+1]<<1|1)&C:(w[y+1]<<1|1)&C|(b[y+1]|b[y])<<1|1|b[y+1],w[y]&g){var N=l(k,y-1);if(N<=u){if(u=N,!((d=y-1)>i))break;x=Math.max(1,2*i-d)}}}if(l(k+1,i)>u)break;b=w}return d},t.prototype.match_alphabet_=function(n){for(var r={},i=0;i2&&(this.diff_cleanupSemantic(o),this.diff_cleanupEfficiency(o));else if(n&&typeof n=="object"&&r===void 0&&i===void 0)o=n,a=this.diff_text1(o);else if(typeof n=="string"&&r&&typeof r=="object"&&i===void 0)a=n,o=r;else{if(typeof n!="string"||typeof r!="string"||!i||typeof i!="object")throw new Error("Unknown call format to patch_make.");a=n,o=i}if(o.length===0)return[];for(var l=[],u=new t.patch_obj,d=0,p=0,f=0,g=a,b=a,S=0;S=2*this.Patch_Margin&&d&&(this.patch_addContext_(u,g),l.push(u),u=new t.patch_obj,d=0,g=b,p=f)}k!==1&&(p+=x.length),k!==-1&&(f+=x.length)}return d&&(this.patch_addContext_(u,g),l.push(u)),l},t.prototype.patch_deepCopy=function(n){for(var r=[],i=0;ithis.Match_MaxBits?(u=this.match_main(r,f.substring(0,this.Match_MaxBits),p))!=-1&&((g=this.match_main(r,f.substring(f.length-this.Match_MaxBits),p+f.length-this.Match_MaxBits))==-1||u>=g)&&(u=-1):u=this.match_main(r,f,p),u==-1)o[l]=!1,a-=n[l].length2-n[l].length1;else if(o[l]=!0,a=u-p,f==(d=g==-1?r.substring(u,u+f.length):r.substring(u,g+this.Match_MaxBits)))r=r.substring(0,u)+this.diff_text2(n[l].diffs)+r.substring(u+f.length);else{var b=this.diff_main(f,d,!1);if(f.length>this.Match_MaxBits&&this.diff_levenshtein(b)/f.length>this.Patch_DeleteThreshold)o[l]=!1;else{this.diff_cleanupSemanticLossless(b);for(var S,k=0,x=0;xl[0][1].length){var u=r-l[0][1].length;l[0][1]=i.substring(l[0][1].length)+l[0][1],o.start1-=u,o.start2-=u,o.length1+=u,o.length2+=u}return(l=(o=n[n.length-1]).diffs).length==0||l[l.length-1][0]!=0?(l.push(new t.Diff(0,i)),o.length1+=r,o.length2+=r):r>l[l.length-1][1].length&&(u=r-l[l.length-1][1].length,l[l.length-1][1]+=i.substring(0,u),o.length1+=u,o.length2+=u),i},t.prototype.patch_splitMax=function(n){for(var r=this.Match_MaxBits,i=0;i2*r?(d.length1+=g.length,o+=g.length,p=!1,d.diffs.push(new t.Diff(f,g)),a.diffs.shift()):(g=g.substring(0,r-d.length1-this.Patch_Margin),d.length1+=g.length,o+=g.length,f===0?(d.length2+=g.length,l+=g.length):p=!1,d.diffs.push(new t.Diff(f,g)),g==a.diffs[0][1]?a.diffs.shift():a.diffs[0][1]=a.diffs[0][1].substring(g.length))}u=(u=this.diff_text2(d.diffs)).substring(u.length-this.Patch_Margin);var b=this.diff_text1(a.diffs).substring(0,this.Patch_Margin);b!==""&&(d.length1+=b.length,d.length2+=b.length,d.diffs.length!==0&&d.diffs[d.diffs.length-1][0]===0?d.diffs[d.diffs.length-1][1]+=b:d.diffs.push(new t.Diff(0,b))),p||n.splice(++i,0,d)}}},t.prototype.patch_toText=function(n){for(var r=[],i=0;i1&&arguments[1]!==void 0?arguments[1]:{}).type,n=(t===void 0?"block":t)==="block"?uK:dK,r=G2(e.map((function(l){return l.changes})),lE).map(n).reduce((function(l,u){var d=$t(l,2),p=d[0],f=d[1],g=$t(u,2),b=g[0],S=g[1];return[p.concat(b),f.concat(S)]}),[[],[]]),i=$t(r,2),a=i[0],o=i[1];return sK(i7(a),i7(o))}var fK=["enhancers"],l7=function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.enhancers,i=r===void 0?[]:r,a=$t(qX(e,Lo(n,fK)),2),o=a[0],l=a[1],u=[t7(o),t7(l)],d=(t=[u[0],u[1]],i.reduce((function(k,x){return x(k)}),t)),p=$t(d,2),f=p[0],g=p[1],b=[f.map(n7),g.map(n7)],S=b[1];return{old:b[0].map((function(k){var x;return(x=k.children)!==null&&x!==void 0?x:[]})),new:S.map((function(k){var x;return(x=k.children)!==null&&x!==void 0?x:[]}))}};const Ov=["openresearch-diff flex flex-col gap-4","[&_.openresearch-diff-file]:[--openresearch-diff-selection-background-color:color-mix(_in_oklab,_var(--surface)_76%,_var(--primary)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-gutter-selection-background-color:color-mix(_in_oklab,_var(--surface)_68%,_var(--primary)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-gutter-background-color:color-mix(_in_oklab,_var(--base)_84%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-gutter-background-color:color-mix(_in_oklab,_var(--base)_86%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-code-background-color:color-mix(_in_oklab,_var(--base)_91%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-code-background-color:color-mix(_in_oklab,_var(--base)_92%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-edit-background-color:color-mix(_in_oklab,_var(--base)_72%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-edit-background-color:color-mix(_in_oklab,_var(--base)_78%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-divider-color:var(--border)]","[&_.openresearch-diff-file]:[--openresearch-diff-omit-gutter-line-color:color-mix(in_oklab,_var(--base)_86%,_var(--text))]","[&_.openresearch-diff-file]:[--openresearch-diff-unified-gutter-text-color:color-mix(in_oklab,_var(--text)_45%,_var(--base))]","[&_.openresearch-diff-file]:[--diff-background-color:var(--base)]","[&_.openresearch-diff-file]:[--diff-text-color:var(--text)]","[&_.openresearch-diff-file]:[--diff-font-family:var(--mono)]","[&_.openresearch-diff-file]:[--diff-selection-text-color:var(--primary)]","[&_.openresearch-diff-file]:[--diff-selection-background-color:var(--openresearch-diff-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-background-color:var(--openresearch-diff-gutter-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-code-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-code-selected-background-color:var(--diff-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-insert-text-color:var(--accent-green)]","[&_.openresearch-diff-file]:[--diff-gutter-insert-background-color:var(--openresearch-diff-insert-gutter-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-text-color:var(--accent-red)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-background-color:var(--openresearch-diff-delete-gutter-background-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-background-color:var(--openresearch-diff-insert-code-background-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-background-color:var(--openresearch-diff-delete-code-background-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-background-color:var(--openresearch-diff-insert-edit-background-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-background-color:var(--openresearch-diff-delete-edit-background-color)]","[&_.openresearch-diff-file]:[--diff-omit-gutter-line-color:var(--openresearch-diff-omit-gutter-line-color)]","[&_.openresearch-diff-file]:w-full [&_.openresearch-diff-file]:text-sm","[&_.openresearch-diff-file]:leading-[1.55] [&_.openresearch-diff-file.diff-unified]:table-auto","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:first-child]:collapse","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:first-child]:w-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[1%]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:first-child]:hidden","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:sticky","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:left-0","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:z-1","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[1%]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pr-2.5 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pb-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pl-3.5","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:whitespace-nowrap","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-right","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-[var(--openresearch-diff-unified-gutter-text-color)]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-r [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-r-[var(--openresearch-diff-divider-color)]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line]:leading-[1.55]","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-[var(--openresearch-diff-insert-code-background-color)]","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-[var(--openresearch-diff-delete-code-background-color)]","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:px-4","[&_.openresearch-diff-file_.diff-code]:whitespace-pre","[&_.openresearch-diff-file_.diff-code]:break-normal","[&_.openresearch-diff-file_.diff-code]:wrap-normal","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-[var(--openresearch-diff-divider-color)]"].join(" "),pK=2e3,mK={highlight(e,t){return dt.highlight(e,t).children}};function gK(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function W2(e){let t=0,n=0;for(const r of e.hunks)for(const i of r.changes)i.type==="insert"?t++:i.type==="delete"&&n++;return{additions:t,deletions:n}}function bK(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function Iv(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 vK(e){const t=[hK(e.hunks,{type:"line"})],n=J_(bK(e));return n&&dt.registered(n)?l7(e.hunks,{enhancers:t,highlight:!0,language:n,refractor:mK}):l7(e.hunks,{enhancers:t,highlight:!1})}function _K(e,t){if(!e.trim())return{files:[],failed:!1};try{return{files:Av(e,{nearbySequences:"zip"}),failed:!1}}catch{if(t){const n=Array.from(e.matchAll(/^diff --git /gm),i=>i.index),r=n[n.length-1];if(n.length>1&&r!==void 0)try{return{files:Av(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const xK=({change:e,side:t})=>t==="old"?null:gK(e);function c7(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/1024).toFixed(1)} KB`}function uE({bytesRead:e,byteLimit:t}){return h.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-md [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-md [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[h.jsx("h4",{children:"Diff preview truncated"}),h.jsxs("p",{children:["Showing the first ",c7(t)," (",c7(e)," read). View the complete diff locally with git."]})]})}function dE({file:e,defaultExpanded:t}){const[n,r]=R.useState(t),{additions:i,deletions:a}=R.useMemo(()=>W2(e),[e]),o=n&&i+a<=pK,l=R.useMemo(()=>{if(o)try{return vK(e)}catch{return}},[e,o]);return h.jsxs("section",{className:`diff-file-card overflow-hidden border border-border rounded-md bg-background [&.expanded_.diff-file-header]:border-b [&.expanded_.diff-file-header]:border-b-border ${n?"expanded":""}`,children:[h.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-left py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-2xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-semibold [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-2xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":n,onClick:()=>r(u=>!u),children:[h.jsx("span",{className:"chev",children:n?h.jsx(Rl,{size:14}):h.jsx(Xs,{size:14})}),h.jsx("span",{className:"path",children:h.jsx("code",{children:Iv(e)})}),h.jsxs("span",{className:"stats",children:[h.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",i]}),h.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",a]})]})]}),n&&(e.hunks.length===0?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:"No textual diff for this file."}):h.jsx("div",{className:"diff-file-body overflow-x-auto bg-background",children:h.jsx(LX,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:xK,tokens:l,viewType:"unified"})}))]})}function yK({files:e,className:t}){return h.jsx("div",{className:t?`${Ov} ${t}`:Ov,children:e.map((n,r)=>h.jsx(dE,{file:n,defaultExpanded:r===0},`${n.oldPath}→${n.newPath}#${r}`))})}function wK(e){switch(e.type){case"add":return"A";case"delete":return"D";case"rename":return"R";case"copy":return"C";case"modify":return"M"}}function hE({diff:e,partial:t=!1}){var g;const n=R.useMemo(()=>_K(e,t),[e,t]),r=n.files,i=R.useMemo(()=>r.map((b,S)=>({file:b,key:`${b.oldPath}→${b.newPath}#${S}`,changes:W2(b)})),[r]),[a,o]=R.useState(null),[l,u]=R.useState(!1),d=l&&!t,p=i.some(b=>b.key===a)?a:((g=i[0])==null?void 0:g.key)??null,f=i.find(b=>b.key===p)??null;return n.failed?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:t?"No complete file preview was available before the cutoff.":"Unable to parse this diff."}):i.length===0?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:"No changes."}):h.jsxs("div",{className:"diff-explorer @container",children:[h.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-xs [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[h.jsx("strong",{children:t?`${i.length} ${i.length===1?"file":"files"} shown (partial)`:i.length===1?"1 changed file":`${i.length} changed files`}),!t&&h.jsx("button",{type:"button",onClick:()=>u(b=>!b),children:d?"Back to preview":"View full diff"})]}),d?h.jsx(yK,{files:r}):h.jsxs("div",{className:"diff-explorer-layout grid grid-cols-[minmax(180px,_260px)_minmax(0,_1fr)] items-start gap-3.5 [@container((max-width:_960px))]:grid-cols-1",children:[h.jsx("div",{className:"diff-explorer-files sticky top-0 max-h-[min(70vh,_720px)] overflow-auto border border-border rounded-md bg-background [&_button]:grid [&_button]:grid-cols-[18px_minmax(0,_1fr)_auto_auto] [&_button]:items-center [&_button]:gap-[7px] [&_button]:w-full [&_button]:py-2 [&_button]:px-[9px] [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-left [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-[inset_2px_0_0_var(--text)] [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":"Changed files",children:i.map(b=>h.jsxs("button",{type:"button",className:b.key===p?"active":"","aria-pressed":b.key===p,onClick:()=>o(b.key),children:[h.jsx("span",{className:`diff-file-status font-mono text-xs font-semibold text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${b.file.type}`,children:wK(b.file)}),h.jsx("code",{title:Iv(b.file),children:Iv(b.file)}),h.jsxs("span",{className:"diff-explorer-stat font-mono text-2xs diff-stat-add text-accent-green",children:["+",b.changes.additions]}),h.jsxs("span",{className:"diff-explorer-stat font-mono text-2xs diff-stat-del text-accent-red",children:["−",b.changes.deletions]})]},b.key))}),h.jsx("div",{className:`${Ov} diff-explorer-preview min-w-0`,children:f&&h.jsx(dE,{file:f.file,defaultExpanded:!0},f.key)})]})]})}function SK({experiment:e,refreshKey:t,onLoadingChange:n}){const[r,i]=R.useState(null),[a,o]=R.useState(null);return R.useEffect(()=>{let l=!1;return n(!0),o(null),i(null),$R(e.id).then(u=>{l||i(u)}).catch(u=>{l||o(u.message)}).finally(()=>{l||n(!1)}),()=>{l=!0}},[e.id,t,n]),h.jsx("div",{className:`${Dc} branch-changes [&_>_.changes-note]:my-3.5 [&_>_.changes-note]:mx-4 [&_>_.openresearch-diff]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.truncated-notice]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0`,children:a?h.jsxs("div",{className:vs,children:["Failed to load changes: ",a]}):r?r.diff.trim()?h.jsxs(h.Fragment,{children:[r.truncated&&h.jsx(uE,{bytesRead:r.bytesRead,byteLimit:r.byteLimit}),h.jsx(hE,{diff:r.diff,partial:r.truncated})]}):h.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?"No committed changes from the parent branch.":"This is the baseline branch, so there is no parent comparison."}):h.jsx("div",{className:vs,children:"Loading changes…"})})}function fE({view:e,onViewChange:t,showViewToggle:n=!0,branchLabel:r,branchTitle:i,githubHref:a,githubTitle:o,refreshing:l,onRefresh:u}){return h.jsxs("div",{className:"code-tab-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant shrink-0 [&_>_.seg]:p-0.5 [&_>_.seg]:rounded-sm [&_>_.seg_button]:py-0.5 [&_>_.seg_button]:px-2 [&_>_.seg_button]:text-sm [&_>_.seg_button]:font-medium",children:[n&&h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-md [&_button]:font-semibold [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":"Code browser view",children:[h.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>t("files"),children:"Files"}),h.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>t("changes"),children:"Changes"})]}),r&&h.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-[color-mix(in_oklab,_var(--text)_8%,_transparent)] text-subtext text-xs [&_>_svg]:shrink-0",title:i,children:[h.jsx(nh,{size:12}),h.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap font-mono",children:r})]}),a&&h.jsx("a",{className:Xn,href:a,target:"_blank",rel:"noopener noreferrer",title:o,"aria-label":o,children:h.jsx(Mp,{size:13})}),h.jsx("span",{style:{flex:1}}),h.jsx("button",{className:Xn,title:"Refresh","aria-label":"Refresh",onClick:u,children:l?h.jsx("span",{className:qt}):h.jsx(iS,{size:13})})]})}const kK=/\.(md|mdx|markdown)$/i,CK=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,EK=/\.(csv|tsv|xlsx?|ods)$/i,AK=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,TK=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,NK=/\.pdf$/i,jK=/\.(docx?|log|rtf|txt)$/i;function MK(e){return CK.test(e)}function Y2(e){return kK.test(e)}function pE({name:e}){const t=Y2(e)?"markdown":MK(e)?"image":EK.test(e)?"spreadsheet":AK.test(e)?"code":TK.test(e)?"archive":NK.test(e)?"pdf":jK.test(e)?"document":"file";let n;return t==="markdown"?n=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),h.jsx("path",{d:"M2.6 10.5v-5h1.2l1.6 2 1.6-2h1.2v5H6.8V7.6L5.4 9.3 4 7.6v2.9H2.6Zm8.5-5v2.4h1.3L10.5 10 8.6 7.9h1.3V5.5h1.2Z",fill:"currentColor"})]}):t==="image"?n=h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),h.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),h.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):t==="spreadsheet"?n=h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),h.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):t==="code"?n=h.jsx("path",{d:"M6.2 3 1.8 8l4.4 5 1.3-1.2L4.2 8l3.3-3.8L6.2 3Zm3.6 0-1.3 1.2L11.8 8l-3.3 3.8 1.3 1.2 4.4-5-4.4-5Z",fill:"currentColor"}):t==="archive"?n=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),h.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):n=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),h.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),h.jsx("svg",{className:`file-tree-icon w-[15px] h-[15px] shrink-0 text-muted overflow-visible [&.markdown]:text-accent-blue [&.image]:text-accent-purple [&.spreadsheet]:text-accent-green [&.code]:text-accent-orange [&.archive]:text-accent-amber [&.pdf]:text-accent-red [&.document]:text-subtext ${t}`,viewBox:"0 0 16 16","aria-hidden":"true",children:n})}const mE=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-left cursor-pointer font-[inherit]","text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),u7=["file-tree-chevron text-muted shrink-0 [button&]:inline-flex","[button&]:items-center [button&]:justify-center [button&]:w-[13px]","[button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent","[button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90"].join(" ");function d7(){return{dirs:new Map,files:[]}}function gE(e){const t=d7();for(const n of e){const r=n.split("/");let i=t;for(let a=0;aa(n),title:n,children:[u?h.jsx(Rl,{size:13,className:u7}):h.jsx(Xs,{size:13,className:u7}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),u&&h.jsx(X2,{node:t,parentPath:n,depth:r+1,toggled:i,onToggle:a,onOpenFile:o})]})}function X2({node:e,parentPath:t,depth:n,toggled:r,onToggle:i,onOpenFile:a}){const o=[...e.dirs.keys()].sort((u,d)=>u.localeCompare(d)),l=[...e.files].sort((u,d)=>u.localeCompare(d));return h.jsxs(h.Fragment,{children:[o.map(u=>{const d=t?`${t}/${u}`:u;return h.jsx(RK,{name:u,node:e.dirs.get(u),path:d,depth:n,toggled:r,onToggle:i,onOpenFile:a},`d:${d}`)}),l.map(u=>{const d=t?`${t}/${u}`:u;return h.jsxs("button",{type:"button",className:mE,style:{paddingLeft:8+n*14},onClick:()=>a(d),title:d,children:[h.jsx(pE,{name:u}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:u})]},`f:${d}`)})]})}function DK({projectId:e,project:t,experiment:n,view:r,toggled:i,onViewChange:a,onToggledChange:o,onOpenFile:l}){const u=n.branchName,d=`${e}:${u}`,[p,f]=R.useState(null),[g,b]=R.useState(null),[S,k]=R.useState(!1),[x,v]=R.useState(!1),[w,y]=R.useState(0),[C,N]=R.useState(void 0),E=R.useRef(0),j=R.useRef(null),T=R.useCallback(()=>{j.current=d;const F=++E.current;k(!0),Tb(e,{ref:u}).then(U=>{F===E.current&&(f(U),b(null))}).catch(U=>{F===E.current&&b(U.message)}).finally(()=>{F===E.current&&k(!1)})},[e,u,d]);R.useEffect(()=>(E.current++,j.current=null,f(null),b(null),k(!1),()=>{E.current++}),[d]),R.useEffect(()=>{r==="files"&&j.current!==d&&T()},[r,d,T]),R.useEffect(()=>{N(void 0);const F=n.chatSessionId;if(!F)return;let U=!1;return pS(F).then(G=>{!U&&G.exists&&G.branch===u&&N(F)}).catch(()=>{}),()=>{U=!0}},[n.chatSessionId,u]);const D=R.useMemo(()=>p?gE(p.entries):null,[p]),I=r==="files"?S:x,$=R.useCallback(F=>{const U=new Set(i);U.has(F)?U.delete(F):U.add(F),o(U)},[i,o]);return h.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[h.jsx(fE,{view:r,onViewChange:a,branchLabel:u,branchTitle:`Committed branch ${u}`,githubHref:t.githubEnabled?op(t.githubOwner,t.githubRepo,u):void 0,githubTitle:`Open ${u} on GitHub`,refreshing:I,onRefresh:()=>r==="files"?T():y(F=>F+1)}),r==="changes"?h.jsx(SK,{experiment:n,refreshKey:w,onLoadingChange:v},n.id):h.jsxs(h.Fragment,{children:[(p==null?void 0:p.truncated)&&h.jsx("div",{className:vs,children:"listing truncated"}),g&&D&&h.jsxs("div",{className:vs,children:["Refresh failed: ",g]}),h.jsx("div",{className:Dc,children:D?D.dirs.size===0&&D.files.length===0?h.jsx("div",{className:vs,children:"No files."}):h.jsx("div",{className:"file-tree py-1.5 px-0 text-md",children:h.jsx(X2,{node:D,parentPath:"",depth:0,toggled:i,onToggle:$,onOpenFile:F=>C?l(F,C):l(F,void 0,u)})}):h.jsx("div",{className:vs,children:g?`Failed to load: ${g}`:"Loading…"})})]})]})}const LK=5e3;function OK({sessionId:e,project:t,view:n,toggled:r,onViewChange:i,onToggledChange:a,onOpenFile:o}){var D;const l=t.id,[u,d]=R.useState(null),[p,f]=R.useState(null),[g,b]=R.useState(null),[S,k]=R.useState(!0),x=R.useRef(0),v=R.useCallback(()=>{const I=++x.current;k(!0),(async()=>{if(!e)return[null,await Tb(l,{ref:t.baselineBranch})];const F=await pS(e),U=F.exists?{sessionId:e}:{ref:t.baselineBranch};return[F,await Tb(l,U)]})().then(([F,U])=>{I===x.current&&(d(F),f(U),b(null))}).catch(F=>{I===x.current&&b(F.message)}).finally(()=>{I===x.current&&k(!1)})},[e,l,t.baselineBranch]);R.useEffect(()=>(d(null),f(null),b(null),v(),()=>{x.current++}),[v]),R.useEffect(()=>{if(!e)return;let I=!1,$=!1,F=!1,U=null;const G=()=>{U||(U=setInterval(v,LK))},X=()=>{U&&(clearInterval(U),U=null)},Y=wd(Z=>{Z.type!=="busy"||Z.sessionId!==e||($=!0,Z.busy&&!I?(I=!0,G()):!Z.busy&&I&&(I=!1,X(),v()))});return lf(l).then(Z=>{var Q;F||$||I||(Q=Z.find(z=>z.id===e))!=null&&Q.busy&&(I=!0,G())}).catch(()=>{}),()=>{F=!0,Y(),X()}},[e,l,v]);const w=R.useMemo(()=>p?gE(p.entries):null,[p]),y=R.useCallback(I=>{const $=new Set(r);$.has(I)?$.delete(I):$.add(I),a($)},[r,a]),C=e&&(u!=null&&u.exists)?u:null,N=(C==null?void 0:C.branch)??(C!=null&&C.baselineBranch?`detached @ ${C.baselineBranch}`:"detached"),E=((D=C==null?void 0:C.files)==null?void 0:D.length)??0,j=C?`Current worktree · ${N}${E>0?"*":""}`:`Default branch · ${t.baselineBranch}`,T=C?C.branch:t.baselineBranch;return h.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[h.jsx(fE,{view:C?n:"files",onViewChange:i,showViewToggle:!!C,branchLabel:j,branchTitle:j,githubHref:t.githubEnabled&&T?op(t.githubOwner,t.githubRepo,T):void 0,githubTitle:T?`Open ${T} on GitHub`:void 0,refreshing:S,onRefresh:v}),g&&(u||p)&&h.jsxs("div",{className:vs,children:["Refresh failed: ",g]}),!p||e&&!u?h.jsx("div",{className:Dc,children:h.jsx("div",{className:vs,children:g?`Failed to load: ${g}`:"Loading…"})}):C&&n==="changes"?h.jsx("div",{className:`${Dc} wt-changes pt-0 px-4 pb-6 [&_>_:first-child]:mt-3.5`,children:E===0||!C.diff?h.jsx("div",{className:"changes-note text-sm text-muted",children:"No changes yet."}):h.jsxs(h.Fragment,{children:[C.diff.truncated&&h.jsx(uE,{bytesRead:C.diff.bytesRead,byteLimit:C.diff.byteLimit}),h.jsx(hE,{diff:C.diff.diff,partial:C.diff.truncated})]})}):h.jsxs("div",{className:Dc,children:[p.truncated&&h.jsx("div",{className:vs,children:"Listing truncated."}),w?w.dirs.size===0&&w.files.length===0?h.jsx("div",{className:vs,children:"No files."}):h.jsx("div",{className:"file-tree py-1.5 px-0 text-md",children:h.jsx(X2,{node:w,parentPath:"",depth:0,toggled:r,onToggle:y,onOpenFile:I=>C?o(I,e):o(I,void 0,t.baselineBranch)})}):h.jsx("div",{className:vs,children:"Loading…"})]})]})}const Gf="font-mono text-sm leading-[1.55] [tab-size:4]",bE="whitespace-pre-wrap break-words",vE="file-view-gutter text-right text-muted select-none";function _E(e){const t=String(e).length+2;return{ruleCh:t,codeCh:t+2}}function xE({text:e,path:t,highlightLine:n,scrollRequest:r,onScrollRequestHandled:i}){const a=R.useMemo(()=>{if(!e)return[];const p=e.replace(/\r\n?/g,` -`),f=Zk(p,J_(t));return p.endsWith(` -`)?f.slice(0,-1):f},[e,t]),o=n&&a.length>0?Math.min(Math.max(Math.trunc(n),1),a.length):void 0,l=R.useRef(null);R.useEffect(()=>{var p;r!==void 0&&(o?((p=l.current)==null||p.scrollIntoView({block:"center"}),i==null||i()):a.length===0&&(i==null||i()))},[a.length,i,r,o]);const{ruleCh:u}=_E(a.length),d=R.useMemo(()=>a.map((p,f)=>h.jsxs("div",{ref:f+1===o?l:void 0,className:`file-view-line flex items-stretch ${f+1===o?"file-view-line-highlight bg-[color-mix(in_srgb,_var(--primary)_16%,_transparent)] shadow-[inset_2px_0_0_var(--primary)]":""}`,children:[h.jsx("span",{"data-line":f+1,className:`${vE} before:content-[attr(data-line)] shrink-0 pr-[1ch]`,style:{width:`${u}ch`},"aria-hidden":"true"}),h.jsx("code",{className:`file-view-code flex-1 min-w-0 pl-[2ch] pr-4 ${Gf} ${bE}`,children:Qk(p)?h.jsx("br",{}):p})]},f)),[a,u,o]);return h.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${Gf}`,children:[a.length>0&&h.jsx("div",{className:"absolute left-0 top-0 bottom-0 border-r border-r-border-variant pointer-events-none",style:{width:`${u}ch`},"aria-hidden":"true"}),d]})}function yE(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function h7({url:e,name:t}){return h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["This browser can’t preview this media format."," ",h.jsxs("a",{href:e,download:t,children:["Download ",t]})]})}function wE({kind:e,url:t,name:n}){const[r,i]=R.useState(!1);if(R.useEffect(()=>i(!1),[e,t]),r)return h.jsx(h7,{url:t,name:n});let a;return e==="image"?a=h.jsx("div",{className:"fpreview-image flex min-h-0 flex-1 items-start justify-center overflow-auto p-6 [&_img]:max-w-full [&_img]:h-auto [&_img]:border [&_img]:border-border [&_img]:rounded-sm",children:h.jsx("img",{src:t,alt:n,onError:()=>i(!0)})}):e==="audio"?a=h.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:h.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:t,"aria-label":n,onError:()=>i(!0)})}):e==="video"?a=h.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:h.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:t,"aria-label":n,onError:()=>i(!0)})}):a=h.jsx("object",{className:"fpreview-pdf block min-h-0 flex-1 w-full border-0","aria-label":n,data:t,type:"application/pdf",onError:()=>i(!0),children:h.jsx(h7,{url:t,name:n})}),h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a,h.jsx("div",{className:"shrink-0 border-t border-border-variant py-1.5 px-3 text-right text-xs",children:h.jsxs("a",{href:t,download:n,children:["Download ",n]})})]})}const f7=`${Xn} tip-up [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]`;function IK(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function zK(e,t,n){const r=n.indexOf("#"),i=r===-1?n:n.slice(0,r),a=r===-1?"":n.slice(r),o=i.indexOf("?"),l=o===-1?i:i.slice(0,o),u=o===-1?"":i.slice(o+1),d=l.startsWith("/")?[]:t.split("/").filter(b=>b.length>0);for(const b of l.split("/"))if(!(!b||b==="."))if(b===".."){if(d.length===0)return null;d.pop()}else d.push(b);const p=d.join("/");if(!p)return null;const f=new URLSearchParams(u);f.delete("path");const g=f.toString();return`${sh(e,p)}${g?`&${g}`:""}${a}`}function BK(e){if(!e.startsWith("---"))return e;const t=e.indexOf(` ----`,3);return t===-1?e:e.slice(t+4).replace(/^\r?\n/,"")}const SE="orx:files-tree-width",kE="orx:artifacts-collapsed:",CE=180,EE=560,HK=8,$K=280;function FK(){try{const e=Number(localStorage.getItem(SE));if(Number.isFinite(e)&&e>=CE&&e<=EE)return e}catch{}return $K}function PK(e){try{const t=localStorage.getItem(`${kE}${e}`);if(!t)return new Set;const n=JSON.parse(t);return Array.isArray(n)?new Set(n.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function zv(e,t){for(const n of e){if(n.path===t)return n;if(n.isDir&&t.startsWith(n.path+"/")){const r=zv(n.children??[],t);if(r)return r}}return null}function AE({projectId:e,folder:t,markdown:n}){const r=i=>IK(i)?i:zK(e,t,i);return h.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-[color-mix(in_oklab,_var(--border)_50%,_transparent)] [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-[0.9em] [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-[1.05em] [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-[0.9em] [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:pl-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:pl-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-md [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-left [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-left [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pr-0 [&_blockquote]:pb-0.5 [&_blockquote]:pl-2.5 [&_blockquote]:border-l-[3px] [&_blockquote]:border-l-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text artifact-md text-lg [&_h1]:text-[2em] [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-[1.5em] [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-[1.2em] [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-[1em] [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:h.jsx(eH,{remarkPlugins:[Uk,[qk,tC]],rehypePlugins:[vk],components:{a:({href:i,children:a,...o})=>{const l=!i||i.startsWith("#"),u=l?i:r(i);return u?h.jsx("a",{...o,href:u,...l?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):h.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=r(i);return o?h.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[h.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&h.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...nC},children:Jk(BK(n))})})}function UK(e){return e.presentation==="text"&&Y2(e.name)?"markdown":yE(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function TE(e){return e.toLowerCase()===Ef.toLowerCase()}function qK(e,t,n){const[r,i]=R.useState(null),[a,o]=R.useState(!1),[l,u]=R.useState(!1),[d,p]=R.useState(null),f=R.useRef(0),g=R.useRef(!1),b=n==="markdown"||n==="text"&&t.size<=bS;return R.useEffect(()=>{if(o(!1),u(!1),p(null),!b)return;let k=!1;const x=++f.current;return vS(e,t.path).then(w=>{if(!w)throw new Error("Artifact not found");return w}).then(w=>{k||x!==f.current||(w.binary?o(!0):(g.current=!0,i(w.content)),u(w.truncated))}).catch(w=>{!k&&x===f.current&&!g.current&&p(w instanceof Error?w.message:String(w))}),()=>{k=!0}},[e,t.path,t.modifiedAt,n,b]),{text:r,replaceText:k=>{f.current+=1,g.current=!0,i(k)},binary:a,truncated:l,error:d,wantsText:b}}function GK({projectId:e,entry:t,onDelete:n,onChanged:r}){const i=UK(t),{text:a,replaceText:o,binary:l,truncated:u,error:d,wantsText:p}=qK(e,t,i),[f,g]=R.useState(!1),[b,S]=R.useState(!1),[k,x]=R.useState(""),[v,w]=R.useState(!1),[y,C]=R.useState(null),N=i==="markdown",E=TE(t.path),j=t.path.split("/").slice(0,-1).join("/"),T=`${sh(e,t.path)}&v=${t.modifiedAt}`,D=async()=>{w(!0),C(null);try{await xD(e,k),o(k),S(!1),g(!1),r()}catch($){C($ instanceof Error?$.message:String($))}finally{w(!1)}};let I;return b?I=h.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2 p-4",children:[h.jsx("textarea",{className:"min-h-0 flex-1 resize-none font-mono text-sm leading-relaxed","aria-label":"Edit project brief",value:k,onChange:$=>x($.target.value)}),y&&h.jsxs("div",{className:"text-sm text-accent-red",children:["Could not save: ",y]})]}):i==="image"||i==="audio"||i==="video"||i==="pdf"?I=h.jsx(wE,{kind:i,url:T,name:t.name}):i==="download"||!p||l?I=h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[i==="download"||l?"Binary or unsupported file — no inline preview.":"File too large to preview inline."," ",h.jsx("a",{href:T,...i==="download"||l?{download:t.name}:{target:"_blank",rel:"noopener noreferrer"},children:i==="download"||l?"Download":"Open raw"})]}):d?I=h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["Failed to load: ",d]}):a===null?I=h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading…"]}):N&&!f?I=h.jsx(AE,{projectId:e,folder:j,markdown:a}):I=h.jsx(xE,{text:a,path:t.path}),h.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0",children:[h.jsxs("div",{className:"fpreview-head h-10 flex items-center gap-2 py-0 px-3.5 border-b border-b-border-variant text-subtext shrink-0",children:[h.jsx(th,{size:13,style:{flexShrink:0}}),h.jsx("code",{className:"fpreview-path font-mono text-sm text-text flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",title:t.path,children:t.path}),h.jsxs("span",{className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:["Modified"," ",new Date(t.modifiedAt).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})]}),(i==="text"||i==="download")&&h.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:Ao(t.size)}),E&&!b&&a!==null&&!u&&h.jsxs("button",{className:Kn,"data-tip":"Edit project brief","data-tip-align":"end","aria-label":"Edit project brief",onClick:()=>{x(a),C(null),S(!0)},children:[h.jsx(sp,{size:13})," Edit"]}),E&&b&&h.jsxs(h.Fragment,{children:[h.jsxs("button",{className:Kn,"data-tip":"Cancel editing","data-tip-align":"end","aria-label":"Cancel editing",disabled:v,onClick:()=>{S(!1),C(null)},children:[h.jsx(qr,{size:13})," Cancel"]}),h.jsxs("button",{className:mL,"data-tip":v?"Saving…":"Save project brief","data-tip-align":"end","aria-label":v?"Saving project brief":"Save project brief",disabled:v,onClick:()=>void D(),children:[h.jsx(Di,{size:13})," ",v?"Saving…":"Save"]})]}),N&&!b&&h.jsx("button",{className:`${Xn} ${f?"active":""}`,"data-tip":f?"Rendered view":"View source","data-tip-align":"end","aria-label":f?"Rendered view":"View source",onClick:()=>g($=>!$),children:h.jsx(Z8,{size:13})}),h.jsx("a",{className:Xn,href:T,target:"_blank",rel:"noopener noreferrer","data-tip":"Open raw in new tab","data-tip-align":"end","aria-label":"Open raw in new tab",children:h.jsx(xd,{size:13})}),!E&&h.jsx("button",{className:Xn,"data-tip":"Delete artifact","data-tip-align":"end","aria-label":"Delete artifact",onClick:()=>{window.confirm(`Delete "${t.path}" from the artifacts directory?`)&&n(t.path)},children:h.jsx(ih,{size:13})})]}),h.jsxs("div",{className:`fpreview-body flex-1 min-h-0 overflow-auto [&.doc]:pt-4.5 [&.doc]:px-7 [&.doc]:pb-12 [&.doc_.artifact-md]:max-w-readable [&.doc_.artifact-md]:my-0 [&.doc_.artifact-md]:mx-auto ${N&&!f&&!b?"doc":""}`,children:[I,u&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:"File truncated — showing the first 512 KB."})]})]})}function NE({entries:e,depth:t,collapsed:n,selected:r,onToggle:i,onSelect:a,onOpenFile:o,onDelete:l}){return h.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(u=>{var p;const d={paddingLeft:8+Math.min(t,HK)*14};if(u.isDir){const f=!n.has(u.path);return h.jsxs("div",{className:"min-w-0 max-w-full",children:[h.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-left cursor-pointer font-[inherit] text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:d,onClick:()=>i(u.path),children:[h.jsx("button",{className:"file-tree-chevron text-muted shrink-0 [button&]:inline-flex [button&]:items-center [button&]:justify-center [button&]:w-[13px] [button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent [button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90","aria-label":f?`Collapse ${u.name}`:`Expand ${u.name}`,onClick:g=>{g.stopPropagation(),i(u.path)},children:h.jsx(Xs,{size:13,className:f?"open":""})}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:u.name}),h.jsx("button",{className:`${ah} ft-row-delete w-4.5 h-4.5 opacity-35 [&:focus-visible]:opacity-100`,"data-tip":"Delete folder","data-tip-align":"end","aria-label":`Delete folder ${u.name}`,onClick:g=>{g.stopPropagation(),window.confirm(`Delete "${u.path}" from the artifacts directory?`)&&l(u.path)},children:h.jsx(ih,{size:12})})]}),f&&(((p=u.children)==null?void 0:p.length)??0)>0&&h.jsx(NE,{entries:u.children??[],depth:t+1,collapsed:n,selected:r,onToggle:i,onSelect:a,onOpenFile:o,onDelete:l})]},u.path)}return h.jsxs("button",{type:"button",className:`file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-left cursor-pointer font-[inherit] text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===u.path?"selected":""}`,style:d,title:`${u.path} — double-click or Command/Ctrl+Enter to open in a tab`,"aria-keyshortcuts":"Meta+Enter Control+Enter","aria-pressed":r===u.path,onClick:()=>a(u.path),onDoubleClick:()=>o(u.path),onKeyDown:f=>{f.key!=="Enter"||!f.metaKey&&!f.ctrlKey||(f.preventDefault(),f.stopPropagation(),a(u.path),o(u.path))},children:[h.jsx(pE,{name:u.name}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:u.name})]},u.path)})})}function p7({dir:e,onOpenStorage:t}){const[n,r]=R.useState(!1);return h.jsxs("div",{className:"ftree-footer shrink-0 flex items-center gap-0.5 py-[5px] px-2 border-t border-t-border-variant [&_code]:flex-1 [&_code]:min-w-0 [&_code]:[direction:rtl] [&_code]:text-left [&_code]:font-mono [&_code]:text-xs [&_code]:text-muted [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_.icon-btn]:w-5.5 [&_.icon-btn]:h-5.5",title:e,children:[h.jsx("code",{children:e}),h.jsx("button",{className:f7,"data-tip":n?"Copied!":"Copy path","aria-label":"Copy artifacts directory path",onClick:()=>{var i;(i=navigator.clipboard)==null||i.writeText(e),r(!0),setTimeout(()=>r(!1),1200)},children:n?h.jsx(Di,{size:12}):h.jsx(n_,{size:12})}),h.jsx("button",{className:f7,"data-tip":"Storage settings","data-tip-align":"end","aria-label":"Storage settings",onClick:t,children:h.jsx(lR,{size:12})})]})}function VK({project:e,artifacts:t,onChanged:n,onOpenFile:r,onOpenStorage:i}){var w;const[a,o]=R.useState(null),[l,u]=R.useState(()=>PK(e.id)),[d,p]=R.useState(FK),f=R.useRef(null),g=((w=t==null?void 0:t.entries.find(y=>!y.isDir&&TE(y.path)))==null?void 0:w.path)??null;R.useEffect(()=>{!a&&g&&o(g)},[a,g]),R.useEffect(()=>{try{localStorage.setItem(`${kE}${e.id}`,JSON.stringify([...l]))}catch{}},[e.id,l]);const b=y=>{var T;y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId);const C=((T=f.current)==null?void 0:T.getBoundingClientRect().left)??0,N=document.body.style.userSelect;document.body.style.userSelect="none";const E=D=>{const I=Math.round(D.clientX-C),$=Math.min(Math.max(I,CE),EE);p($);try{localStorage.setItem(SE,String($))}catch{}},j=()=>{window.removeEventListener("pointermove",E),window.removeEventListener("pointerup",j),window.removeEventListener("pointercancel",j),document.body.style.userSelect=N};window.addEventListener("pointermove",E),window.addEventListener("pointerup",j),window.addEventListener("pointercancel",j)};R.useEffect(()=>{if(!a||!t)return;const y=zv(t.entries,a);(!y||y.isDir)&&o(null)},[a,t]);const S=y=>u(C=>{const N=new Set(C);return N.has(y)?N.delete(y):N.add(y),N}),k=y=>{(a===y||a!=null&&a.startsWith(y+"/"))&&o(null),vD(e.id,y).catch(()=>{}).finally(n)};if(!t)return h.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:h.jsxs("div",{className:ur,style:{padding:20},children:[h.jsx("span",{className:qt})," Loading artifacts…"]})});const x=y=>h.jsx(NE,{entries:y,depth:0,collapsed:l,selected:a,onToggle:S,onSelect:o,onOpenFile:r,onDelete:k}),v=a?zv(t.entries,a):null;return t.entries.length===0?h.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:h.jsxs("div",{className:"files-empty-state flex-1 flex flex-col items-center justify-center gap-1.5 p-6 text-center text-muted [&_h3]:mt-1.5 [&_h3]:mx-0 [&_h3]:mb-0 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text [&_p]:m-0 [&_p]:max-w-105 [&_p]:text-md [&_p]:leading-[1.55] [&_p]:text-subtext [&_.ftree-footer]:mt-2.5 [&_.ftree-footer]:max-w-full [&_.ftree-footer]:border [&_.ftree-footer]:border-border [&_.ftree-footer]:rounded-md [&_.ftree-footer]:py-1.5 [&_.ftree-footer]:px-2.5 [&_.ftree-footer]:bg-background [&_.ftree-footer_code]:max-w-95",children:[h.jsx(r_,{size:28,strokeWidth:1.5}),h.jsx("h3",{children:"No artifacts yet"}),h.jsx("p",{children:"This is the project's durable output space for reports, figures, images, CSVs, PDFs, and other research artifacts. Ask the agent for a write-up or add your own files:"}),h.jsx(p7,{dir:t.dir,onOpenStorage:i})]})}):h.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background",children:[h.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-l border-l-border-variant border-r border-r-border-variant bg-background",ref:f,style:{width:d},children:[h.jsx("div",{className:"ftree-resizer absolute -right-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] [&:active]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)]",onPointerDown:b}),h.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-md",children:[x(t.entries),t.truncated&&h.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-xs text-muted",children:"Listing truncated — the folder has more artifacts."})]}),h.jsx(p7,{dir:t.dir,onOpenStorage:i})]}),v?h.jsx(GK,{projectId:e.id,entry:v,onDelete:k,onChanged:n},v.path):h.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-md text-muted",children:[h.jsx(VM,{size:22,strokeWidth:1.5}),h.jsx("span",{children:"Click an artifact to view it"})]})]})}const WK=20*1024*1024,Bv="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text",jE="mt-0 mx-0 mb-3 text-muted text-md leading-normal",ME="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",RE="font-mono text-sm font-medium text-text",DE="mt-0.5 mb-0 text-xs leading-relaxed text-muted";function YK(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const i=r.result;if(typeof i!="string"){n(new Error("could not read file"));return}const a=i.indexOf(",");t(a>=0?i.slice(a+1):i)},r.onerror=()=>n(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function XK(e){const t=e.toLowerCase();return t.endsWith(".md")||t.endsWith(".markdown")||t.endsWith(".zip")}function KK({skill:e,projectId:t,onDeleted:n,onError:r}){const[i,a]=R.useState(!1);return h.jsxs("div",{className:ME,children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("code",{className:RE,children:["/",e.name]}),h.jsx("p",{className:DE,children:e.description})]}),h.jsxs("div",{className:"shrink-0 text-right whitespace-nowrap pt-0.5",children:[h.jsx("div",{className:"text-2xs text-subtext",children:Ao(e.bytes)}),e.updatedAt>0&&h.jsx("div",{className:"text-2xs text-muted",children:Gs(e.updatedAt)})]}),h.jsx("button",{className:Xn,"data-tip":"Delete skill","data-tip-align":"end","aria-label":`Delete skill ${e.name}`,disabled:i,onClick:()=>{window.confirm(`Delete the "${e.name}" skill?`)&&(a(!0),LD({scope:e.scope,name:e.name,projectId:e.scope==="project"?t:void 0}).then(n).catch(o=>{a(!1),r(o instanceof Error?o.message:String(o))}))},children:h.jsx(ih,{size:13})})]})}function m7({title:e,hint:t,skills:n,projectId:r,onChanged:i,onError:a}){return h.jsxs("section",{className:Bv,children:[h.jsx("h3",{children:e}),h.jsx("p",{className:jE,children:t}),n.length===0?h.jsx("div",{className:"text-muted text-sm",children:"No skills yet."}):h.jsx("div",{className:"flex flex-col",children:n.map(o=>h.jsx(KK,{skill:o,projectId:r,onDeleted:i,onError:a},o.name))})]})}function ZK({skill:e,scopeLabel:t,alreadyImported:n,onImport:r}){const[i,a]=R.useState(!1);return h.jsxs("div",{className:ME,children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("code",{className:RE,children:["/",e.name]}),h.jsx("span",{className:lr,children:e.harnessName})]}),h.jsx("p",{className:DE,children:e.description})]}),h.jsxs("button",{className:Kn,disabled:i,title:`Import into ${t}`,onClick:async()=>{a(!0);try{await r(e)}finally{a(!1)}},children:[i?h.jsx("span",{className:qt}):h.jsx(oM,{size:13}),n?"Re-import":"Import"]})]})}function QK({project:e}){const[t,n]=R.useState(null),[r,i]=R.useState([]),[a,o]=R.useState("global"),[l,u]=R.useState(!1),[d,p]=R.useState(null),[f,g]=R.useState(!1),b=R.useRef(null),S=R.useCallback(()=>{RD(e==null?void 0:e.id).then(n).catch(()=>n([]))},[e==null?void 0:e.id]);R.useEffect(()=>{S()},[S]),R.useEffect(()=>{OD().then(i).catch(()=>i([]))},[]),R.useEffect(()=>{!e&&a==="project"&&o("global")},[e,a]);const k=R.useRef(!1),x=R.useCallback(async T=>{if(!k.current){if(p(null),!XK(T.name)){p("Upload a SKILL.md file or a .zip of a skill folder.");return}if(T.size>WK){p("File too large (max 20 MB).");return}k.current=!0,u(!0);try{const D=await YK(T);await DD({scope:a,projectId:a==="project"?e==null?void 0:e.id:void 0,filename:T.name,contentBase64:D}),S()}catch(D){p(D instanceof Error?D.message:String(D))}finally{k.current=!1,u(!1)}}},[a,e==null?void 0:e.id,S]),v=T=>{var I;T.preventDefault(),g(!1);const D=(I=T.dataTransfer.files)==null?void 0:I[0];D&&x(D)},w=R.useCallback(async T=>{p(null);try{await ID({harness:T.harnessId,name:T.name,scope:a,projectId:a==="project"?e==null?void 0:e.id:void 0}),S()}catch(D){p(D instanceof Error?D.message:String(D))}},[a,e==null?void 0:e.id,S]),y=(t??[]).filter(T=>T.scope==="global"),C=(t??[]).filter(T=>T.scope==="project"),N=a==="global"?"Global":(e==null?void 0:e.name)??"this project",E=new Set((t??[]).filter(T=>T.scope===a).map(T=>T.name)),j=T=>`flex-1 flex flex-col gap-0.5 py-2.5 px-3 border rounded-md text-left text-sm font-medium cursor-pointer transition-[border-color,background] duration-120 disabled:opacity-50 disabled:cursor-not-allowed ${T?"border-primary bg-surface":"border-border bg-background text-text [&:hover:not(:disabled)]:border-border-variant"}`;return h.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl",children:[h.jsx("h1",{children:"Skills"}),h.jsxs("p",{className:"mt-0 mx-0 mb-5 text-muted text-md leading-normal [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text",children:["Upload ",h.jsx("code",{children:"SKILL.md"})," skills your agent discovers automatically in every session and you can invoke with ",h.jsx("code",{children:"/name"})," in chat. Add a single ",h.jsx("code",{children:"SKILL.md"})," or a"," ",h.jsx("code",{children:".zip"})," of a skill folder (with supporting scripts and resources)."]}),h.jsxs("section",{className:Bv,children:[h.jsx("h3",{children:"Add a skill"}),h.jsxs("div",{className:"flex gap-2 mb-3.5",role:"group","aria-label":"Skill scope",children:[h.jsxs("button",{type:"button","aria-pressed":a==="global",className:j(a==="global"),onClick:()=>o("global"),children:["Global",h.jsx("span",{className:"text-2xs font-normal text-muted",children:"Every project"})]}),h.jsxs("button",{type:"button","aria-pressed":a==="project",className:j(a==="project"),disabled:!e,title:e?void 0:"Open a project to add a project skill",onClick:()=>o("project"),children:["This project",h.jsx("span",{className:"text-2xs font-normal text-muted",children:e?e.name:"No project open"})]})]}),h.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm transition-[border-color,background] duration-120 [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text ${l?"cursor-default":"cursor-pointer"} ${f?"border-primary bg-surface text-text":"border-border-variant bg-surface text-muted [&:hover]:border-primary [&:hover]:text-text"}`,onDragOver:T=>{T.preventDefault(),g(!0)},onDragLeave:()=>g(!1),onDrop:v,onClick:()=>{var T;return(T=b.current)==null?void 0:T.click()},role:"button",tabIndex:0,onKeyDown:T=>{var D;(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),(D=b.current)==null||D.click())},children:[h.jsx("input",{ref:b,type:"file",accept:".md,.markdown,.zip",hidden:!0,onChange:T=>{var I;const D=(I=T.target.files)==null?void 0:I[0];D&&x(D),T.target.value=""}}),l?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:qt}),h.jsx("span",{children:"Uploading…"})]}):h.jsxs(h.Fragment,{children:[h.jsx(SR,{size:20,strokeWidth:1.5}),h.jsxs("span",{children:["Drop a ",h.jsx("code",{children:"SKILL.md"})," or ",h.jsx("code",{children:".zip"})," here, or click to choose"]}),h.jsxs("span",{className:"inline-flex items-center gap-1.5 text-2xs text-subtext",children:[h.jsx(fM,{size:12})," Adding to"," ",h.jsx("strong",{className:"text-text font-semibold",children:a==="global"?"Global":e==null?void 0:e.name})]})]})]}),d&&h.jsx("div",{className:"mt-2.5 text-accent-red text-sm whitespace-pre-wrap",children:d})]}),r.length>0&&h.jsxs("section",{className:Bv,children:[h.jsx("h3",{children:"Import from your agent"}),h.jsxs("p",{className:`${jE} [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text [&_strong]:text-text [&_strong]:font-semibold`,children:["Skills already installed in your coding agents. Import a copy into"," ",h.jsx("strong",{children:N})," so it's managed here and invocable with ",h.jsx("code",{children:"/name"}),"."]}),h.jsx("div",{className:"flex flex-col",children:r.map(T=>h.jsx(ZK,{skill:T,scopeLabel:N,alreadyImported:E.has(T.name),onImport:w},`${T.harnessId}:${T.name}`))})]}),t===null?h.jsxs("div",{className:"flex items-center gap-2 text-subtext text-md p-3",children:[h.jsx("span",{className:qt})," Loading skills…"]}):h.jsxs(h.Fragment,{children:[h.jsx(m7,{title:"Global skills",hint:"Available to the agent in every project.",skills:y,onChanged:S,onError:p}),e&&h.jsx(m7,{title:`${e.name} skills`,hint:"Available only in this project's sessions. Shadows a global skill of the same name.",skills:C,projectId:e.id,onChanged:S,onError:p})]})]})}function wo({active:e,label:t,icon:n,shimmer:r=!1,onSelect:i,onClose:a}){return h.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pr-0.5 [&_.tab-label]:grid [&_.tab-label]:grid-cols-[minmax(0,_1fr)] [&_.tab-label]:min-w-0 [&_.tab-label]:overflow-hidden [&_.tab-label_>_span]:[grid-area:1_/_1] [&_.tab-label_>_span]:overflow-hidden [&_.tab-label_>_span]:text-ellipsis [&_.tab-label_>_span]:whitespace-nowrap [&_.tab-label::after]:[grid-area:1_/_1] [&_.tab-label::after]:overflow-hidden [&_.tab-label::after]:text-ellipsis [&_.tab-label::after]:whitespace-nowrap [&_.tab-label::after]:content-[attr(data-label)] [&_.tab-label::after]:invisible [&_.tab-label::after]:font-medium [&_.tab-close]:inline-flex [&_.tab-close]:items-center [&_.tab-close]:justify-center [&_.tab-close]:w-3.5 [&_.tab-close]:h-3.5 [&_.tab-close]:rounded-xs [&_.tab-close]:text-muted [&_.tab-close]:shrink-0 [&_.tab-close:hover]:bg-[color-mix(in_oklab,_var(--text)_15%,_transparent)] [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap min-w-24 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-left-px [&:not(.active)_+_.tab:not(.active)::before]:w-px [&:not(.active)_+_.tab:not(.active)::before]:bg-border [&.active]:border-border [&.active]:bg-background [&.active]:text-text [&.active]:font-medium [&.active::after]:content-[''] [&.active::after]:absolute [&.active::after]:right-0 [&.active::after]:-bottom-px [&.active::after]:left-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""}`,onClick:i,title:t,children:[n,h.jsx("span",{className:"tab-label","data-label":t,children:h.jsx("span",{className:r?"tool-running-shimmer":"",children:t})}),h.jsx("span",{role:"button",className:"tab-close",title:"Close tab",onClick:o=>{o.stopPropagation(),a()},children:h.jsx(qr,{size:12})})]})}const g7=["files-pill inline-flex items-center gap-2 min-w-0 border border-border","rounded-md py-[7px] px-[11px] bg-background text-text","no-underline [&_code]:font-mono [&_code]:text-sm","[&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap","[&_>_svg]:shrink-0 [&_>_svg]:text-muted [a&:hover]:border-muted"].join(" ");function JK({owner:e,repo:t,branch:n}){return!e||!t?h.jsx("span",{className:g7,children:h.jsx("code",{children:n})}):h.jsxs("a",{className:g7,href:op(e,t,n),target:"_blank",rel:"noopener noreferrer",title:`Open ${n} on GitHub`,children:[h.jsx("code",{children:n}),h.jsx(Mp,{size:12})]})}const b7=["experiment-overview-action inline-flex items-center justify-center gap-[7px]","min-h-9 py-[7px] px-3 border border-border-variant rounded-sm","bg-background text-text text-sm font-semibold","transition-[background,border-color] duration-120 ease-standard","[&:hover]:border-[color-mix(in_oklab,_var(--text)_34%,_var(--border))]","[&:hover]:bg-surface"].join(" "),ib=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-md","[&_h2]:font-semibold"].join(" "),v7=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function _7(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function x7(e,t){return Nf((e.endedAt??t)-e.createdAt)}function eZ({experiment:e,parentExperiment:t,project:n,runs:r,onOpenLogs:i,onOpenCode:a}){const o=r[0]??null,l=r.some(p=>p.status==="running"||p.status==="starting"),[u,d]=R.useState(()=>Date.now());return R.useEffect(()=>{if(!l)return;d(Date.now());const p=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(p)},[l]),h.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-[22px] [&_h1]:leading-tight",children:h.jsxs("div",{className:"experiment-overview-inner w-full max-w-230 my-0 mx-auto pt-6.5 px-7 pb-10 [@media((max-width:_720px))]:pt-5 [@media((max-width:_720px))]:px-4.5 [@media((max-width:_720px))]:pb-8",children:[h.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[h.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[h.jsx("h1",{children:e.title||e.slug}),h.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted font-mono text-sm",children:e.slug})]}),h.jsx(Ma,{status:o?ss(o):"idle"})]}),h.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[o&&h.jsxs("button",{className:b7,onClick:()=>i(o.id),children:[h.jsx(Uc,{size:15}),"Logs"]}),h.jsxs("button",{className:b7,onClick:a,children:[h.jsx(ip,{size:15}),"Code"]})]}),e.description&&h.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-md [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[h.jsx("h2",{children:"Description"}),h.jsx(La,{text:e.description})]}),h.jsxs("section",{className:ib,children:[h.jsx("h2",{children:o?"Latest run":"Runs"}),o&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap gap-y-2.5 gap-x-4.5 text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs",children:[h.jsx(Ma,{status:ss(o)}),h.jsx(N2,{backend:o.backend}),h.jsxs("span",{title:"Started",children:[h.jsx(Hj,{size:13}),_7(o.createdAt)]}),h.jsxs("span",{title:"Duration",children:[h.jsx(Qj,{size:13}),x7(o,u)]}),o.commitSha&&h.jsxs("span",{title:"Commit",children:[h.jsx(kM,{size:14}),h.jsx("code",{children:o.commitSha.slice(0,7)})]}),o.exitCode!==null&&o.exitCode!==void 0&&o.exitCode!==0&&h.jsxs("span",{children:["exit ",o.exitCode]})]}),o.command&&h.jsxs("code",{className:v7,children:["$ ",o.command]}),o.resultMarkdown&&h.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${o.status==="failed"?"failed":""}`,children:h.jsx(La,{text:o.resultMarkdown})})]})]}),h.jsxs("section",{className:ib,children:[h.jsx("h2",{children:"Git"}),h.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs experiment-overview-git-meta gap-y-[9px] gap-x-3.5 [&_.files-pill]:py-[5px] [&_.files-pill]:px-2 [&_.files-pill]:rounded-sm [&_.files-pill_code]:text-xs",children:[h.jsx(JK,{owner:n.githubEnabled?n.githubOwner:"",repo:n.githubEnabled?n.githubRepo:"",branch:e.branchName}),t&&h.jsxs("span",{children:["from ",h.jsx("code",{children:t.slug})]}),h.jsxs("span",{title:_7(e.createdAt),children:["created ",Gs(e.createdAt)]})]}),e.runCommand!==(o==null?void 0:o.command)&&h.jsxs("code",{className:v7,children:["$ ",e.runCommand]})]}),r.length>0&&h.jsxs("section",{className:ib,children:[h.jsx("h2",{children:"Run history"}),h.jsx("div",{className:"experiment-run-history border-t border-t-border-variant [&_button]:w-full [&_button]:grid [&_button]:grid-cols-[minmax(72px,_0.7fr)_minmax(100px,_1fr)_minmax(70px,_0.7fr)_60px_16px] [&_button]:items-center [&_button]:gap-3.5 [&_button]:py-[11px] [&_button]:px-0.5 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-left [&_button]:text-sm [&_button:hover]:bg-surface [@media((max-width:_720px))]:[&_button]:grid-cols-[65px_1fr_60px_16px] [@media((max-width:_720px))]:[&_button_>_:nth-child(3)]:hidden",children:r.map((p,f)=>h.jsxs("button",{onClick:()=>i(p.id),children:[h.jsxs("span",{className:"experiment-run-number font-mono text-xs font-semibold",children:["Run ",r.length-f]}),h.jsx(Ma,{status:ss(p)}),h.jsx("span",{children:Gs(p.createdAt)}),h.jsx("span",{children:x7(p,u)}),h.jsx(Uc,{size:13})]},p.id))})]})]})})}var sb={exports:{}},y7;function tZ(){return y7||(y7=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(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const a=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(a._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,a=i._renderService.dimensions;if(a.css.cell.width===0||a.css.cell.height===0)return;const o=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(l.getPropertyValue("height")),d=Math.max(0,parseInt(l.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),f=u-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),g=d-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-o;return{cols:Math.max(2,Math.floor(g/a.css.cell.width)),rows:Math.max(1,Math.floor(f/a.css.cell.height))}}}})(),n})()))})(sb)),sb.exports}var nZ=tZ(),ab={exports:{}},w7;function rZ(){return w7||(w7=1,(function(e,t){(function(n,r){e.exports=r()})(globalThis,(()=>(()=>{var n={4567:function(o,l,u){var d=this&&this.__decorate||function(w,y,C,N){var E,j=arguments.length,T=j<3?y:N===null?N=Object.getOwnPropertyDescriptor(y,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,C,N);else for(var D=w.length-1;D>=0;D--)(E=w[D])&&(T=(j<3?E(T):j>3?E(y,C,T):E(y,C))||T);return j>3&&T&&Object.defineProperty(y,C,T),T},p=this&&this.__param||function(w,y){return function(C,N){y(C,N,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const f=u(9042),g=u(9924),b=u(844),S=u(4725),k=u(2585),x=u(3656);let v=l.AccessibilityManager=class extends b.Disposable{constructor(w,y,C,N){super(),this._terminal=w,this._coreBrowserService=C,this._renderService=N,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 E=0;Ethis._handleBoundaryFocus(E,0),this._bottomBoundaryFocusListener=E=>this._handleBoundaryFocus(E,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 g.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((E=>this._handleResize(E.rows)))),this.register(this._terminal.onRender((E=>this._refreshRows(E.start,E.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((E=>this._handleChar(E)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` -`)))),this.register(this._terminal.onA11yTab((E=>this._handleTab(E)))),this.register(this._terminal.onKey((E=>this._handleKey(E.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,x.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(w){for(let y=0;y0?this._charsToConsume.shift()!==w&&(this._charsToAnnounce+=w):this._charsToAnnounce+=w,w===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(w){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(w)||this._charsToConsume.push(w)}_refreshRows(w,y){this._liveRegionDebouncer.refresh(w,y,this._terminal.rows)}_renderRows(w,y){const C=this._terminal.buffer,N=C.lines.length.toString();for(let E=w;E<=y;E++){const j=C.lines.get(C.ydisp+E),T=[],D=(j==null?void 0:j.translateToString(!0,void 0,void 0,T))||"",I=(C.ydisp+E+1).toString(),$=this._rowElements[E];$&&(D.length===0?($.innerText=" ",this._rowColumns.set($,[0,1])):($.textContent=D,this._rowColumns.set($,T)),$.setAttribute("aria-posinset",I),$.setAttribute("aria-setsize",N))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(w,y){const C=w.target,N=this._rowElements[y===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||w.relatedTarget!==N)return;let E,j;if(y===0?(E=C,j=this._rowElements.pop(),this._rowContainer.removeChild(j)):(E=this._rowElements.shift(),j=C,this._rowContainer.removeChild(E)),E.removeEventListener("focus",this._topBoundaryFocusListener),j.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(),w.preventDefault(),w.stopImmediatePropagation()}_handleSelectionChange(){var D;if(this._rowElements.length===0)return;const w=document.getSelection();if(!w)return;if(w.isCollapsed)return void(this._rowContainer.contains(w.anchorNode)&&this._terminal.clearSelection());if(!w.anchorNode||!w.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:w.anchorNode,offset:w.anchorOffset},C={node:w.focusNode,offset:w.focusOffset};if((y.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===C.node&&y.offset>C.offset)&&([y,C]=[C,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 N=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(N)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:N,offset:((D=N.textContent)==null?void 0:D.length)??0}),!this._rowContainer.contains(C.node))return;const E=({node:I,offset:$})=>{const F=I instanceof Text?I.parentNode:I;let U=parseInt(F==null?void 0:F.getAttribute("aria-posinset"),10)-1;if(isNaN(U))return console.warn("row is invalid. Race condition?"),null;const G=this._rowColumns.get(F);if(!G)return console.warn("columns is null. Race condition?"),null;let X=$=this._terminal.cols&&(++U,X=0),{row:U,column:X}},j=E(y),T=E(C);if(j&&T){if(j.row>T.row||j.row===T.row&&j.column>=T.column)throw new Error("invalid range");this._terminal.select(j.column,j.row,(T.row-j.row)*this._terminal.cols-j.column+T.column)}}_handleResize(w){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;yw;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const w=this._coreBrowserService.mainDocument.createElement("div");return w.setAttribute("role","listitem"),w.tabIndex=-1,this._refreshRowDimensions(w),w}_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 w=0;w{function u(g){return g.replace(/\r?\n/g,"\r")}function d(g,b){return b?"\x1B[200~"+g+"\x1B[201~":g}function p(g,b,S,k){g=d(g=u(g),S.decPrivateModes.bracketedPasteMode&&k.rawOptions.ignoreBracketedPasteMode!==!0),S.triggerDataEvent(g,!0),b.value=""}function f(g,b,S){const k=S.getBoundingClientRect(),x=g.clientX-k.left-10,v=g.clientY-k.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${x}px`,b.style.top=`${v}px`,b.style.zIndex="1000",b.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=u,l.bracketTextForPaste=d,l.copyHandler=function(g,b){g.clipboardData&&g.clipboardData.setData("text/plain",b.selectionText),g.preventDefault()},l.handlePasteEvent=function(g,b,S,k){g.stopPropagation(),g.clipboardData&&p(g.clipboardData.getData("text/plain"),b,S,k)},l.paste=p,l.moveTextAreaUnderMouseCursor=f,l.rightClickHandler=function(g,b,S,k,x){f(g,b,S),x&&k.rightClickSelect(g),b.value=k.selectionText,b.select()}},7239:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const d=u(1505);l.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(p,f,g){this._css.set(p,f,g)}getCss(p,f){return this._css.get(p,f)}setColor(p,f,g){this._color.set(p,f,g)}getColor(p,f){return this._color.get(p,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(u,d,p,f){u.addEventListener(d,p,f);let g=!1;return{dispose:()=>{g||(g=!0,u.removeEventListener(d,p,f))}}}},3551:function(o,l,u){var d=this&&this.__decorate||function(v,w,y,C){var N,E=arguments.length,j=E<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(v,w,y,C);else for(var T=v.length-1;T>=0;T--)(N=v[T])&&(j=(E<3?N(j):E>3?N(w,y,j):N(w,y))||j);return E>3&&j&&Object.defineProperty(w,y,j),j},p=this&&this.__param||function(v,w){return function(y,C){w(y,C,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const f=u(3656),g=u(8460),b=u(844),S=u(2585),k=u(4725);let x=l.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(v,w,y,C,N){super(),this._element=v,this._mouseService=w,this._renderService=y,this._bufferService=C,this._linkProviderService=N,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{var E;this._lastMouseEvent=void 0,(E=this._activeProviderReplies)==null||E.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(v){this._lastMouseEvent=v;const w=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!w)return;this._isMouseOut=!1;const y=v.composedPath();for(let C=0;C{E==null||E.forEach((j=>{j.link.dispose&&j.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=v.y);let y=!1;for(const[E,j]of this._linkProviderService.linkProviders.entries())w?(N=this._activeProviderReplies)!=null&&N.get(E)&&(y=this._checkLinkProviderResult(E,v,y)):j.provideLinks(v.y,(T=>{var I,$;if(this._isMouseOut)return;const D=T==null?void 0:T.map((F=>({link:F})));(I=this._activeProviderReplies)==null||I.set(E,D),y=this._checkLinkProviderResult(E,v,y),(($=this._activeProviderReplies)==null?void 0:$.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(v.y,this._activeProviderReplies)}))}_removeIntersectingLinks(v,w){const y=new Set;for(let C=0;Cv?this._bufferService.cols:j.link.range.end.x;for(let I=T;I<=D;I++){if(y.has(I)){N.splice(E--,1);break}y.add(I)}}}}_checkLinkProviderResult(v,w,y){var E;if(!this._activeProviderReplies)return y;const C=this._activeProviderReplies.get(v);let N=!1;for(let j=0;jthis._linkAtPosition(T.link,w)));j&&(y=!0,this._handleNewLink(j))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let j=0;jthis._linkAtPosition(D.link,w)));if(T){y=!0,this._handleNewLink(T);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const w=this._positionFromMouseEvent(v,this._element,this._mouseService);w&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,w)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,w){this._currentLink&&this._lastMouseEvent&&(!v||!w||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=w)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(v){if(!this._lastMouseEvent)return;const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._linkAtPosition(v.link,w)&&(this._currentLink=v,this._currentLink.state={decorations:{underline:v.link.decorations===void 0||v.link.decorations.underline,pointerCursor:v.link.decorations===void 0||v.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,v.link,this._lastMouseEvent),v.link.decorations={},Object.defineProperties(v.link.decorations,{pointerCursor:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.pointerCursor},set:y=>{var C;(C=this._currentLink)!=null&&C.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,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.underline},set:y=>{var C,N,E;(C=this._currentLink)!=null&&C.state&&((E=(N=this._currentLink)==null?void 0:N.state)==null?void 0:E.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(v.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const C=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,N=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=N&&(this._clearCurrentLink(C,N),this._lastMouseEvent)){const E=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);E&&this._askForLink(E,!1)}}))))}_linkHover(v,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!0),this._currentLink.state.decorations.pointerCursor&&v.classList.add("xterm-cursor-pointer")),w.hover&&w.hover(y,w.text)}_fireUnderlineEvent(v,w){const y=v.range,C=this._bufferService.buffer.ydisp,N=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-C-1,y.end.x,y.end.y-C-1,void 0);(w?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(N)}_linkLeave(v,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!1),this._currentLink.state.decorations.pointerCursor&&v.classList.remove("xterm-cursor-pointer")),w.leave&&w.leave(y,w.text)}_linkAtPosition(v,w){const y=v.range.start.y*this._bufferService.cols+v.range.start.x,C=v.range.end.y*this._bufferService.cols+v.range.end.x,N=w.y*this._bufferService.cols+w.x;return y<=N&&N<=C}_positionFromMouseEvent(v,w,y){const C=y.getCoords(v,w,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,w,y,C,N){return{x1:v,y1:w,x2:y,y2:C,cols:this._bufferService.cols,fg:N}}};l.Linkifier=x=d([p(1,k.IMouseService),p(2,k.IRenderService),p(3,S.IBufferService),p(4,k.ILinkProviderService)],x)},9042:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(o,l,u){var d=this&&this.__decorate||function(k,x,v,w){var y,C=arguments.length,N=C<3?x:w===null?w=Object.getOwnPropertyDescriptor(x,v):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(k,x,v,w);else for(var E=k.length-1;E>=0;E--)(y=k[E])&&(N=(C<3?y(N):C>3?y(x,v,N):y(x,v))||N);return C>3&&N&&Object.defineProperty(x,v,N),N},p=this&&this.__param||function(k,x){return function(v,w){x(v,w,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const f=u(511),g=u(2585);let b=l.OscLinkProvider=class{constructor(k,x,v){this._bufferService=k,this._optionsService=x,this._oscLinkService=v}provideLinks(k,x){var D;const v=this._bufferService.buffer.lines.get(k-1);if(!v)return void x(void 0);const w=[],y=this._optionsService.rawOptions.linkHandler,C=new f.CellData,N=v.getTrimmedLength();let E=-1,j=-1,T=!1;for(let I=0;Iy?y.activate(G,X,F):S(0,X),hover:(G,X)=>{var Y;return(Y=y==null?void 0:y.hover)==null?void 0:Y.call(y,G,X,F)},leave:(G,X)=>{var Y;return(Y=y==null?void 0:y.leave)==null?void 0:Y.call(y,G,X,F)}})}T=!1,C.hasExtendedAttrs()&&C.extended.urlId?(j=I,E=C.extended.urlId):(j=-1,E=-1)}}x(w)}};function S(k,x){if(confirm(`Do you want to navigate to ${x}? - -WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=x}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=b=d([p(0,g.IBufferService),p(1,g.IOptionsService),p(2,g.IOscLinkService)],b)},6193:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,d,p){this._rowCount=p,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,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 u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const d=u(3614),p=u(3656),f=u(3551),g=u(9042),b=u(3730),S=u(1680),k=u(3107),x=u(5744),v=u(2950),w=u(1296),y=u(428),C=u(4269),N=u(5114),E=u(8934),j=u(3230),T=u(9312),D=u(4725),I=u(6731),$=u(8055),F=u(8969),U=u(8460),G=u(844),X=u(6114),Y=u(8437),Z=u(2584),Q=u(7399),z=u(5941),O=u(9074),H=u(2585),V=u(5435),W=u(4567),re=u(779);class le extends F.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(te={}){super(te),this.browser=X,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new G.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(O.DecorationService),this._instantiationService.setService(H.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(re.LinkProviderService),this._instantiationService.setService(D.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((B,ie)=>this.refresh(B,ie)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((B=>this._reportWindowsOptions(B)))),this.register(this._inputHandler.onColor((B=>this._handleColorEvent(B)))),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((B=>this._afterResize(B.cols,B.rows)))),this.register((0,G.toDisposable)((()=>{var B,ie;this._customKeyEventHandler=void 0,(ie=(B=this.element)==null?void 0:B.parentNode)==null||ie.removeChild(this.element)})))}_handleColorEvent(te){if(this._themeService)for(const B of te){let ie,oe="";switch(B.index){case 256:ie="foreground",oe="10";break;case 257:ie="background",oe="11";break;case 258:ie="cursor",oe="12";break;default:ie="ansi",oe="4;"+B.index}switch(B.type){case 0:const be=$.color.toColorRGB(ie==="ansi"?this._themeService.colors.ansi[B.index]:this._themeService.colors[ie]);this.coreService.triggerDataEvent(`${Z.C0.ESC}]${oe};${(0,z.toRgbString)(be)}${Z.C1_ESCAPED.ST}`);break;case 1:if(ie==="ansi")this._themeService.modifyColors((ge=>ge.ansi[B.index]=$.channels.toColor(...B.color)));else{const ge=ie;this._themeService.modifyColors((Ce=>Ce[ge]=$.channels.toColor(...B.color)))}break;case 2:this._themeService.restoreColor(B.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(te){te?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(te){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Z.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var te;return(te=this.textarea)==null?void 0:te.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Z.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 te=this.buffer.ybase+this.buffer.y,B=this.buffer.lines.get(te);if(!B)return;const ie=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,be=B.getWidth(ie),ge=this._renderService.dimensions.css.cell.width*be,Ce=this.buffer.y*this._renderService.dimensions.css.cell.height,Le=ie*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Le+"px",this.textarea.style.top=Ce+"px",this.textarea.style.width=ge+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(B=>{this.hasSelection()&&(0,d.copyHandler)(B,this._selectionService)})));const te=B=>(0,d.handlePasteEvent)(B,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",te)),this.register((0,p.addDisposableDomListener)(this.element,"paste",te)),X.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(B=>{B.button===2&&(0,d.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(B=>{(0,d.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),X.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(B=>{B.button===1&&(0,d.moveTextAreaUnderMouseCursor)(B,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(te=>this._keyUp(te)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(te=>this._keyDown(te)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(te=>this._keyPress(te)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(te=>this._compositionHelper.compositionupdate(te)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(te=>this._inputEvent(te)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(te){var ie;if(!te)throw new Error("Terminal requires a parent element.");if(te.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ie=this.element)==null?void 0:ie.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=te.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"),te.appendChild(this.element);const B=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),B.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",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),B.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),X.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(N.CoreBrowserService,this.textarea,te.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(D.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),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(D.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(I.ThemeService),this._instantiationService.setService(D.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(D.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(j.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(D.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(v.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(E.MouseService),this._instantiationService.setService(D.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(B);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(S.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.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(D.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(k.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),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(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(x.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(x.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(w.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const te=this,B=this.element;function ie(ge){const Ce=te._mouseService.getMouseReportCoords(ge,te.screenElement);if(!Ce)return!1;let Le,Ue;switch(ge.overrideType||ge.type){case"mousemove":Ue=32,ge.buttons===void 0?(Le=3,ge.button!==void 0&&(Le=ge.button<3?ge.button:3)):Le=1&ge.buttons?0:4&ge.buttons?1:2&ge.buttons?2:3;break;case"mouseup":Ue=0,Le=ge.button<3?ge.button:3;break;case"mousedown":Ue=1,Le=ge.button<3?ge.button:3;break;case"wheel":if(te._customWheelEventHandler&&te._customWheelEventHandler(ge)===!1||te.viewport.getLinesScrolled(ge)===0)return!1;Ue=ge.deltaY<0?0:1,Le=4;break;default:return!1}return!(Ue===void 0||Le===void 0||Le>4)&&te.coreMouseService.triggerMouseEvent({col:Ce.col,row:Ce.row,x:Ce.x,y:Ce.y,button:Le,action:Ue,ctrl:ge.ctrlKey,alt:ge.altKey,shift:ge.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},be={mouseup:ge=>(ie(ge),ge.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(ge)),wheel:ge=>(ie(ge),this.cancel(ge,!0)),mousedrag:ge=>{ge.buttons&&ie(ge)},mousemove:ge=>{ge.buttons||ie(ge)}};this.register(this.coreMouseService.onProtocolChange((ge=>{ge?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ge)),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&ge?oe.mousemove||(B.addEventListener("mousemove",be.mousemove),oe.mousemove=be.mousemove):(B.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&ge?oe.wheel||(B.addEventListener("wheel",be.wheel,{passive:!1}),oe.wheel=be.wheel):(B.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&ge?oe.mouseup||(oe.mouseup=be.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&ge?oe.mousedrag||(oe.mousedrag=be.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(B,"mousedown",(ge=>{if(ge.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ge))return ie(ge),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(ge)}))),this.register((0,p.addDisposableDomListener)(B,"wheel",(ge=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ge)===!1)return!1;if(!this.buffer.hasScrollback){const Ce=this.viewport.getLinesScrolled(ge);if(Ce===0)return;const Le=Z.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ge.deltaY<0?"A":"B");let Ue="";for(let We=0;We{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ge),this.cancel(ge)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(B,"touchmove",(ge=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ge)?void 0:this.cancel(ge)}),{passive:!1}))}refresh(te,B){var ie;(ie=this._renderService)==null||ie.refreshRows(te,B)}updateCursorStyle(te){var B;(B=this._selectionService)!=null&&B.shouldColumnSelect(te)?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(te,B,ie=0){var oe;ie===1?(super.scrollLines(te,B,ie),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(te)}paste(te){(0,d.paste)(te,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(te){this._customKeyEventHandler=te}attachCustomWheelEventHandler(te){this._customWheelEventHandler=te}registerLinkProvider(te){return this._linkProviderService.registerLinkProvider(te)}registerCharacterJoiner(te){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const B=this._characterJoinerService.register(te);return this.refresh(0,this.rows-1),B}deregisterCharacterJoiner(te){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(te)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(te){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+te)}registerDecoration(te){return this._decorationService.registerDecoration(te)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(te,B,ie){this._selectionService.setSelection(te,B,ie)}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 te;(te=this._selectionService)==null||te.clearSelection()}selectAll(){var te;(te=this._selectionService)==null||te.selectAll()}selectLines(te,B){var ie;(ie=this._selectionService)==null||ie.selectLines(te,B)}_keyDown(te){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1)return!1;const B=this.browser.isMac&&this.options.macOptionIsMeta&&te.altKey;if(!B&&!this._compositionHelper.keydown(te))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;B||te.key!=="Dead"&&te.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ie=(0,Q.evaluateKeyboardEvent)(te,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(te),ie.type===3||ie.type===2){const oe=this.rows-1;return this.scrollLines(ie.type===2?-oe:oe),this.cancel(te,!0)}return ie.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,te)||(ie.cancel&&this.cancel(te,!0),!ie.key||!!(te.key&&!te.ctrlKey&&!te.altKey&&!te.metaKey&&te.key.length===1&&te.key.charCodeAt(0)>=65&&te.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ie.key!==Z.C0.ETX&&ie.key!==Z.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ie.key,domEvent:te}),this._showCursor(),this.coreService.triggerDataEvent(ie.key,!0),!this.optionsService.rawOptions.screenReaderMode||te.altKey||te.ctrlKey?this.cancel(te,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(te,B){const ie=te.isMac&&!this.options.macOptionIsMeta&&B.altKey&&!B.ctrlKey&&!B.metaKey||te.isWindows&&B.altKey&&B.ctrlKey&&!B.metaKey||te.isWindows&&B.getModifierState("AltGraph");return B.type==="keypress"?ie:ie&&(!B.keyCode||B.keyCode>47)}_keyUp(te){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1||((function(B){return B.keyCode===16||B.keyCode===17||B.keyCode===18})(te)||this.focus(),this.updateCursorStyle(te),this._keyPressHandled=!1)}_keyPress(te){let B;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1)return!1;if(this.cancel(te),te.charCode)B=te.charCode;else if(te.which===null||te.which===void 0)B=te.keyCode;else{if(te.which===0||te.charCode===0)return!1;B=te.which}return!(!B||(te.altKey||te.ctrlKey||te.metaKey)&&!this._isThirdLevelShift(this.browser,te)||(B=String.fromCharCode(B),this._onKey.fire({key:B,domEvent:te}),this._showCursor(),this.coreService.triggerDataEvent(B,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(te){if(te.data&&te.inputType==="insertText"&&(!te.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const B=te.data;return this.coreService.triggerDataEvent(B,!0),this.cancel(te),!0}return!1}resize(te,B){te!==this.cols||B!==this.rows?super.resize(te,B):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(te,B){var ie,oe;(ie=this._charSizeService)==null||ie.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var te;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 B=1;B{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,p){this._rowCount=p,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=f-this._lastRefreshMs,b=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(o,l,u){var d=this&&this.__decorate||function(v,w,y,C){var N,E=arguments.length,j=E<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(v,w,y,C);else for(var T=v.length-1;T>=0;T--)(N=v[T])&&(j=(E<3?N(j):E>3?N(w,y,j):N(w,y))||j);return E>3&&j&&Object.defineProperty(w,y,j),j},p=this&&this.__param||function(v,w){return function(y,C){w(y,C,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const f=u(3656),g=u(4725),b=u(8460),S=u(844),k=u(2585);let x=l.Viewport=class extends S.Disposable{constructor(v,w,y,C,N,E,j,T){super(),this._viewportElement=v,this._scrollArea=w,this._bufferService=y,this._optionsService=C,this._charSizeService=N,this._renderService=E,this._coreBrowserService=j,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 b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((D=>this._renderDimensions=D))),this._handleThemeChange(T.colors),this.register(T.onChangeColors((D=>this._handleThemeChange(D)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(v){this._viewportElement.style.backgroundColor=v.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(v){if(v)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 w=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==w&&(this._lastRecordedBufferHeight=w,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const v=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==v&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=v),this._refreshAnimationFrame=null}syncScrollArea(v=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(v);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(v)}_handleScroll(v){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 w=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:w,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const v=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(v*(this._smoothScrollState.target-this._smoothScrollState.origin)),v<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(v,w){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(w<0&&this._viewportElement.scrollTop!==0||w>0&&y0&&(y=F),C=""}}return{bufferElements:N,cursorElement:y}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let w=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(w/=this._currentRowHeight+0,this._wheelPartialScroll+=w,w=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(w*=this._bufferService.rows),w}_applyScrollModifier(v,w){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&w.altKey||y==="ctrl"&&w.ctrlKey||y==="shift"&&w.shiftKey?v*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:v*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(v){this._lastTouchY=v.touches[0].pageY}handleTouchMove(v){const w=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,w!==0&&(this._viewportElement.scrollTop+=w,this._bubbleScroll(v,w))}};l.Viewport=x=d([p(2,k.IBufferService),p(3,k.IOptionsService),p(4,g.ICharSizeService),p(5,g.IRenderService),p(6,g.ICoreBrowserService),p(7,g.IThemeService)],x)},3107:function(o,l,u){var d=this&&this.__decorate||function(k,x,v,w){var y,C=arguments.length,N=C<3?x:w===null?w=Object.getOwnPropertyDescriptor(x,v):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(k,x,v,w);else for(var E=k.length-1;E>=0;E--)(y=k[E])&&(N=(C<3?y(N):C>3?y(x,v,N):y(x,v))||N);return C>3&&N&&Object.defineProperty(x,v,N),N},p=this&&this.__param||function(k,x){return function(v,w){x(v,w,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const f=u(4725),g=u(844),b=u(2585);let S=l.BufferDecorationRenderer=class extends g.Disposable{constructor(k,x,v,w,y){super(),this._screenElement=k,this._bufferService=x,this._coreBrowserService=v,this._decorationService=w,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((C=>this._removeDecoration(C)))),this.register((0,g.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 k of this._decorationService.decorations)this._renderDecoration(k);this._dimensionsChanged=!1}_renderDecoration(k){this._refreshStyle(k),this._dimensionsChanged&&this._refreshXPosition(k)}_createElement(k){var w;const x=this._coreBrowserService.mainDocument.createElement("div");x.classList.add("xterm-decoration"),x.classList.toggle("xterm-decoration-top-layer",((w=k==null?void 0:k.options)==null?void 0:w.layer)==="top"),x.style.width=`${Math.round((k.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,x.style.height=(k.options.height||1)*this._renderService.dimensions.css.cell.height+"px",x.style.top=(k.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",x.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const v=k.options.x??0;return v&&v>this._bufferService.cols&&(x.style.display="none"),this._refreshXPosition(k,x),x}_refreshStyle(k){const x=k.marker.line-this._bufferService.buffers.active.ydisp;if(x<0||x>=this._bufferService.rows)k.element&&(k.element.style.display="none",k.onRenderEmitter.fire(k.element));else{let v=this._decorationElements.get(k);v||(v=this._createElement(k),k.element=v,this._decorationElements.set(k,v),this._container.appendChild(v),k.onDispose((()=>{this._decorationElements.delete(k),v.remove()}))),v.style.top=x*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",k.onRenderEmitter.fire(v)}}_refreshXPosition(k,x=k.element){if(!x)return;const v=k.options.x??0;(k.options.anchor||"left")==="right"?x.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":x.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(k){var x;(x=this._decorationElements.get(k))==null||x.remove(),this._decorationElements.delete(k),k.dispose()}};l.BufferDecorationRenderer=S=d([p(1,b.IBufferService),p(2,f.ICoreBrowserService),p(3,b.IDecorationService),p(4,f.IRenderService)],S)},5871:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.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(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,p){return d>=u.startBufferLine-this._linePadding[p||"full"]&&d<=u.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(o,l,u){var d=this&&this.__decorate||function(y,C,N,E){var j,T=arguments.length,D=T<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,N):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,C,N,E);else for(var I=y.length-1;I>=0;I--)(j=y[I])&&(D=(T<3?j(D):T>3?j(C,N,D):j(C,N))||D);return T>3&&D&&Object.defineProperty(C,N,D),D},p=this&&this.__param||function(y,C){return function(N,E){C(N,E,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const f=u(5871),g=u(4725),b=u(844),S=u(2585),k={full:0,left:0,center:0,right:0},x={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let w=l.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,C,N,E,j,T,D){var $;super(),this._viewportElement=y,this._screenElement=C,this._bufferService=N,this._decorationService=E,this._renderService=j,this._optionsService=T,this._coreBrowserService=D,this._colorZoneStore=new f.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(),($=this._viewportElement.parentElement)==null||$.insertBefore(this._canvas,this._viewportElement);const I=this._canvas.getContext("2d");if(!I)throw new Error("Ctx cannot be null");this._ctx=I,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{var F;(F=this._canvas)==null||F.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),C=Math.ceil(this._canvas.width/3);x.full=this._canvas.width,x.left=y,x.center=C,x.right=y,this._refreshDrawHeightConstants(),v.full=0,v.left=0,v.center=x.left,v.right=x.left+x.center}_refreshDrawHeightConstants(){k.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,C=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);k.left=C,k.center=C,k.right=C}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*k.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*k.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*k.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*k.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 C of this._decorationService.decorations)this._colorZoneStore.addDecoration(C);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const C of y)C.position!=="full"&&this._renderColorZone(C);for(const C of y)C.position==="full"&&this._renderColorZone(C);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(v[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-k[y.position||"full"]/2),x[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+k[y.position||"full"]))}_queueRefresh(y,C){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=C||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=w=d([p(2,S.IBufferService),p(3,S.IDecorationService),p(4,g.IRenderService),p(5,S.IOptionsService),p(6,g.ICoreBrowserService)],w)},2950:function(o,l,u){var d=this&&this.__decorate||function(k,x,v,w){var y,C=arguments.length,N=C<3?x:w===null?w=Object.getOwnPropertyDescriptor(x,v):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(k,x,v,w);else for(var E=k.length-1;E>=0;E--)(y=k[E])&&(N=(C<3?y(N):C>3?y(x,v,N):y(x,v))||N);return C>3&&N&&Object.defineProperty(x,v,N),N},p=this&&this.__param||function(k,x){return function(v,w){x(v,w,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const f=u(4725),g=u(2585),b=u(2584);let S=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(k,x,v,w,y,C){this._textarea=k,this._compositionView=x,this._bufferService=v,this._optionsService=w,this._coreService=y,this._renderService=C,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(k){this._compositionView.textContent=k.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(k){if(this._isComposing||this._isSendingComposition){if(k.keyCode===229||k.keyCode===16||k.keyCode===17||k.keyCode===18)return!1;this._finalizeComposition(!1)}return k.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(k){if(this._compositionView.classList.remove("active"),this._isComposing=!1,k){const x={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,x.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(x.start,x.end):this._textarea.value.substring(x.start),v.length>0&&this._coreService.triggerDataEvent(v,!0)}}),0)}else{this._isSendingComposition=!1;const x=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(x,!0)}}_handleAnyTextareaChanges(){const k=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const x=this._textarea.value,v=x.replace(k,"");this._dataAlreadySent=v,x.length>k.length?this._coreService.triggerDataEvent(v,!0):x.lengththis.updateCompositionElements(!0)),0)}}};l.CompositionHelper=S=d([p(2,g.IBufferService),p(3,g.IOptionsService),p(4,g.ICoreService),p(5,f.IRenderService)],S)},9806:(o,l)=>{function u(d,p,f){const g=f.getBoundingClientRect(),b=d.getComputedStyle(f),S=parseInt(b.getPropertyValue("padding-left")),k=parseInt(b.getPropertyValue("padding-top"));return[p.clientX-g.left-S,p.clientY-g.top-k]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=u,l.getCoords=function(d,p,f,g,b,S,k,x,v){if(!S)return;const w=u(d,p,f);return w?(w[0]=Math.ceil((w[0]+(v?k/2:0))/k),w[1]=Math.ceil(w[1]/x),w[0]=Math.min(Math.max(w[0],1),g+(v?1:0)),w[1]=Math.min(Math.max(w[1],1),b),w):void 0}},9504:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const d=u(2584);function p(x,v,w,y){const C=x-f(x,w),N=v-f(v,w),E=Math.abs(C-N)-(function(j,T,D){let I=0;const $=j-f(j,D),F=T-f(T,D);for(let U=0;U=0&&xv?"A":"B"}function b(x,v,w,y,C,N){let E=x,j=v,T="";for(;E!==w||j!==y;)E+=C?1:-1,C&&E>N.cols-1?(T+=N.buffer.translateBufferLineToString(j,!1,x,E),E=0,x=0,j++):!C&&E<0&&(T+=N.buffer.translateBufferLineToString(j,!1,0,x+1),E=N.cols-1,x=E,j--);return T+N.buffer.translateBufferLineToString(j,!1,x,E)}function S(x,v){const w=v?"O":"[";return d.C0.ESC+w+x}function k(x,v){x=Math.floor(x);let w="";for(let y=0;y0?$-f($,F):D;const X=$,Y=(function(Z,Q,z,O,H,V){let W;return W=p(z,O,H,V).length>0?O-f(O,H):Q,Z=z&&Wx?"D":"C",k(Math.abs(C-x),S(E,y));E=N>v?"D":"C";const j=Math.abs(N-v);return k((function(T,D){return D.cols-T})(N>v?x:C,w)+(j-1)*w.cols+1+((N>v?C:x)-1),S(E,y))}},1296:function(o,l,u){var d=this&&this.__decorate||function(U,G,X,Y){var Z,Q=arguments.length,z=Q<3?G:Y===null?Y=Object.getOwnPropertyDescriptor(G,X):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(U,G,X,Y);else for(var O=U.length-1;O>=0;O--)(Z=U[O])&&(z=(Q<3?Z(z):Q>3?Z(G,X,z):Z(G,X))||z);return Q>3&&z&&Object.defineProperty(G,X,z),z},p=this&&this.__param||function(U,G){return function(X,Y){G(X,Y,U)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const f=u(3787),g=u(2550),b=u(2223),S=u(6171),k=u(6052),x=u(4725),v=u(8055),w=u(8460),y=u(844),C=u(2585),N="xterm-dom-renderer-owner-",E="xterm-rows",j="xterm-fg-",T="xterm-bg-",D="xterm-focus",I="xterm-selection";let $=1,F=l.DomRenderer=class extends y.Disposable{constructor(U,G,X,Y,Z,Q,z,O,H,V,W,re,le){super(),this._terminal=U,this._document=G,this._element=X,this._screenElement=Y,this._viewportElement=Z,this._helperContainer=Q,this._linkifier2=z,this._charSizeService=H,this._optionsService=V,this._bufferService=W,this._coreBrowserService=re,this._themeService=le,this._terminalClass=$++,this._rowElements=[],this._selectionRenderModel=(0,k.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new w.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(E),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(I),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,S.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((pe=>this._injectCss(pe)))),this._injectCss(this._themeService.colors),this._rowFactory=O.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(N+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((pe=>this._handleLinkHover(pe)))),this.register(this._linkifier2.onHideLinkUnderline((pe=>this._handleLinkLeave(pe)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(N+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new g.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 X of this._rowElements)X.style.width=`${this.dimensions.css.canvas.width}px`,X.style.height=`${this.dimensions.css.cell.height}px`,X.style.lineHeight=`${this.dimensions.css.cell.height}px`,X.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const G=`${this._terminalSelector} .${E} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=G,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 G=`${this._terminalSelector} .${E} { color: ${U.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;G+=`${this._terminalSelector} .${E} .xterm-dim { color: ${v.color.multiplyOpacity(U.foreground,.5).css};}`,G+=`${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 X=`blink_underline_${this._terminalClass}`,Y=`blink_bar_${this._terminalClass}`,Z=`blink_block_${this._terminalClass}`;G+=`@keyframes ${X} { 50% { border-bottom-style: hidden; }}`,G+=`@keyframes ${Y} { 50% { box-shadow: none; }}`,G+=`@keyframes ${Z} { 0% { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css}; } 50% { background-color: inherit; color: ${U.cursor.css}; }}`,G+=`${this._terminalSelector} .${E}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${E}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${E}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Z} 1s step-end infinite;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css};}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${U.cursor.css} !important; color: ${U.cursorAccent.css} !important;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${U.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${U.cursor.css} inset;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${U.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,G+=`${this._terminalSelector} .${I} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${I} div { position: absolute; background-color: ${U.selectionBackgroundOpaque.css};}${this._terminalSelector} .${I} div { position: absolute; background-color: ${U.selectionInactiveBackgroundOpaque.css};}`;for(const[Q,z]of U.ansi.entries())G+=`${this._terminalSelector} .${j}${Q} { color: ${z.css}; }${this._terminalSelector} .${j}${Q}.xterm-dim { color: ${v.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${T}${Q} { background-color: ${z.css}; }`;G+=`${this._terminalSelector} .${j}${b.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque(U.background).css}; }${this._terminalSelector} .${j}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque(U.background),.5).css}; }${this._terminalSelector} .${T}${b.INVERTED_DEFAULT_COLOR} { background-color: ${U.foreground.css}; }`,this._themeStyleElement.textContent=G}_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,G){for(let X=this._rowElements.length;X<=G;X++){const Y=this._document.createElement("div");this._rowContainer.appendChild(Y),this._rowElements.push(Y)}for(;this._rowElements.length>G;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(U,G){this._refreshRowElements(U,G),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(D),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(D),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(U,G,X){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(U,G,X),this.renderRows(0,this._bufferService.rows-1),!U||!G)return;this._selectionRenderModel.update(this._terminal,U,G,X);const Y=this._selectionRenderModel.viewportStartRow,Z=this._selectionRenderModel.viewportEndRow,Q=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(Q>=this._bufferService.rows||z<0)return;const O=this._document.createDocumentFragment();if(X){const H=U[0]>G[0];O.appendChild(this._createSelectionElement(Q,H?G[0]:U[0],H?U[0]:G[0],z-Q+1))}else{const H=Y===Q?U[0]:0,V=Q===Z?G[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(Q,H,V));const W=z-Q-1;if(O.appendChild(this._createSelectionElement(Q+1,0,this._bufferService.cols,W)),Q!==z){const re=Z===z?G[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(z,0,re))}}this._selectionContainer.appendChild(O)}_createSelectionElement(U,G,X,Y=1){const Z=this._document.createElement("div"),Q=G*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(X-G);return Q+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-Q),Z.style.height=Y*this.dimensions.css.cell.height+"px",Z.style.top=U*this.dimensions.css.cell.height+"px",Z.style.left=`${Q}px`,Z.style.width=`${z}px`,Z}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,G){const X=this._bufferService.buffer,Y=X.ybase+X.y,Z=Math.min(X.x,this._bufferService.cols-1),Q=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let H=U;H<=G;H++){const V=H+X.ydisp,W=this._rowElements[H],re=X.lines.get(V);if(!W||!re)break;W.replaceChildren(...this._rowFactory.createRow(re,V,V===Y,z,O,Z,Q,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${N}${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,G,X,Y,Z,Q){X<0&&(U=0),Y<0&&(G=0);const z=this._bufferService.rows-1;X=Math.max(Math.min(X,z),0),Y=Math.max(Math.min(Y,z),0),Z=Math.min(Z,this._bufferService.cols);const O=this._bufferService.buffer,H=O.ybase+O.y,V=Math.min(O.x,Z-1),W=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,le=this._optionsService.rawOptions.cursorInactiveStyle;for(let pe=X;pe<=Y;++pe){const te=pe+O.ydisp,B=this._rowElements[pe],ie=O.lines.get(te);if(!B||!ie)break;B.replaceChildren(...this._rowFactory.createRow(ie,te,te===H,re,le,V,W,this.dimensions.css.cell.width,this._widthCache,Q?pe===X?U:0:-1,Q?(pe===Y?G:Z)-1:-1))}}};l.DomRenderer=F=d([p(7,C.IInstantiationService),p(8,x.ICharSizeService),p(9,C.IOptionsService),p(10,C.IBufferService),p(11,x.ICoreBrowserService),p(12,x.IThemeService)],F)},3787:function(o,l,u){var d=this&&this.__decorate||function(E,j,T,D){var I,$=arguments.length,F=$<3?j:D===null?D=Object.getOwnPropertyDescriptor(j,T):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(E,j,T,D);else for(var U=E.length-1;U>=0;U--)(I=E[U])&&(F=($<3?I(F):$>3?I(j,T,F):I(j,T))||F);return $>3&&F&&Object.defineProperty(j,T,F),F},p=this&&this.__param||function(E,j){return function(T,D){j(T,D,E)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const f=u(2223),g=u(643),b=u(511),S=u(2585),k=u(8055),x=u(4725),v=u(4269),w=u(6171),y=u(3734);let C=l.DomRendererRowFactory=class{constructor(E,j,T,D,I,$,F){this._document=E,this._characterJoinerService=j,this._optionsService=T,this._coreBrowserService=D,this._coreService=I,this._decorationService=$,this._themeService=F,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(E,j,T){this._selectionStart=E,this._selectionEnd=j,this._columnSelectMode=T}createRow(E,j,T,D,I,$,F,U,G,X,Y){const Z=[],Q=this._characterJoinerService.getJoinedCharacters(j),z=this._themeService.colors;let O,H=E.getNoBgTrimmedLength();T&&H<$+1&&(H=$+1);let V=0,W="",re=0,le=0,pe=0,te=!1,B=0,ie=!1,oe=0;const be=[],ge=X!==-1&&Y!==-1;for(let Ce=0;Ce0&&Ce===Q[0][0]){Ue=!0;const it=Q.shift();Fe=new v.JoinedCellData(this._workCell,E.translateToString(!0,it[0],it[1]),it[1]-it[0]),We=it[1]-1,Le=Fe.getWidth()}const mt=this._isCellInSelection(Ce,j),De=T&&Ce===$,ot=ge&&Ce>=X&&Ce<=Y;let Bt=!1;this._decorationService.forEachDecorationAtCell(Ce,j,void 0,(it=>{Bt=!0}));let on=Fe.getChars()||g.WHITESPACE_CELL_CHAR;if(on===" "&&(Fe.isUnderline()||Fe.isOverline())&&(on=" "),oe=Le*U-G.get(on,Fe.isBold(),Fe.isItalic()),O){if(V&&(mt&&ie||!mt&&!ie&&Fe.bg===re)&&(mt&&ie&&z.selectionForeground||Fe.fg===le)&&Fe.extended.ext===pe&&ot===te&&oe===B&&!De&&!Ue&&!Bt){Fe.isInvisible()?W+=g.WHITESPACE_CELL_CHAR:W+=on,V++;continue}V&&(O.textContent=W),O=this._document.createElement("span"),V=0,W=""}else O=this._document.createElement("span");if(re=Fe.bg,le=Fe.fg,pe=Fe.extended.ext,te=ot,B=oe,ie=mt,Ue&&$>=Ce&&$<=We&&($=Ce),!this._coreService.isCursorHidden&&De&&this._coreService.isCursorInitialized){if(be.push("xterm-cursor"),this._coreBrowserService.isFocused)F&&be.push("xterm-cursor-blink"),be.push(D==="bar"?"xterm-cursor-bar":D==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(I)switch(I){case"outline":be.push("xterm-cursor-outline");break;case"block":be.push("xterm-cursor-block");break;case"bar":be.push("xterm-cursor-bar");break;case"underline":be.push("xterm-cursor-underline")}}if(Fe.isBold()&&be.push("xterm-bold"),Fe.isItalic()&&be.push("xterm-italic"),Fe.isDim()&&be.push("xterm-dim"),W=Fe.isInvisible()?g.WHITESPACE_CELL_CHAR:Fe.getChars()||g.WHITESPACE_CELL_CHAR,Fe.isUnderline()&&(be.push(`xterm-underline-${Fe.extended.underlineStyle}`),W===" "&&(W=" "),!Fe.isUnderlineColorDefault()))if(Fe.isUnderlineColorRGB())O.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Fe.getUnderlineColor()).join(",")})`;else{let it=Fe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Fe.isBold()&&it<8&&(it+=8),O.style.textDecorationColor=z.ansi[it].css}Fe.isOverline()&&(be.push("xterm-overline"),W===" "&&(W=" ")),Fe.isStrikethrough()&&be.push("xterm-strikethrough"),ot&&(O.style.textDecoration="underline");let Ze=Fe.getFgColor(),ct=Fe.getFgColorMode(),st=Fe.getBgColor(),xe=Fe.getBgColorMode();const Me=!!Fe.isInverse();if(Me){const it=Ze;Ze=st,st=it;const jt=ct;ct=xe,xe=jt}let Ge,Qe,Oe,tt=!1;switch(this._decorationService.forEachDecorationAtCell(Ce,j,void 0,(it=>{it.options.layer!=="top"&&tt||(it.backgroundColorRGB&&(xe=50331648,st=it.backgroundColorRGB.rgba>>8&16777215,Ge=it.backgroundColorRGB),it.foregroundColorRGB&&(ct=50331648,Ze=it.foregroundColorRGB.rgba>>8&16777215,Qe=it.foregroundColorRGB),tt=it.options.layer==="top")})),!tt&&mt&&(Ge=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,st=Ge.rgba>>8&16777215,xe=50331648,tt=!0,z.selectionForeground&&(ct=50331648,Ze=z.selectionForeground.rgba>>8&16777215,Qe=z.selectionForeground)),tt&&be.push("xterm-decoration-top"),xe){case 16777216:case 33554432:Oe=z.ansi[st],be.push(`xterm-bg-${st}`);break;case 50331648:Oe=k.channels.toColor(st>>16,st>>8&255,255&st),this._addStyle(O,`background-color:#${N((st>>>0).toString(16),"0",6)}`);break;default:Me?(Oe=z.foreground,be.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):Oe=z.background}switch(Ge||Fe.isDim()&&(Ge=k.color.multiplyOpacity(Oe,.5)),ct){case 16777216:case 33554432:Fe.isBold()&&Ze<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ze+=8),this._applyMinimumContrast(O,Oe,z.ansi[Ze],Fe,Ge,void 0)||be.push(`xterm-fg-${Ze}`);break;case 50331648:const it=k.channels.toColor(Ze>>16&255,Ze>>8&255,255&Ze);this._applyMinimumContrast(O,Oe,it,Fe,Ge,Qe)||this._addStyle(O,`color:#${N(Ze.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(O,Oe,z.foreground,Fe,Ge,Qe)||Me&&be.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}be.length&&(O.className=be.join(" "),be.length=0),De||Ue||Bt?O.textContent=W:V++,oe!==this.defaultSpacing&&(O.style.letterSpacing=`${oe}px`),Z.push(O),Ce=We}return O&&V&&(O.textContent=W),Z}_applyMinimumContrast(E,j,T,D,I,$){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,w.treatGlyphAsBackgroundColor)(D.getCode()))return!1;const F=this._getContrastCache(D);let U;if(I||$||(U=F.getColor(j.rgba,T.rgba)),U===void 0){const G=this._optionsService.rawOptions.minimumContrastRatio/(D.isDim()?2:1);U=k.color.ensureContrastRatio(I||j,$||T,G),F.setColor((I||j).rgba,($||T).rgba,U??null)}return!!U&&(this._addStyle(E,`color:${U.css}`),!0)}_getContrastCache(E){return E.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(E,j){E.setAttribute("style",`${E.getAttribute("style")||""}${j};`)}_isCellInSelection(E,j){const T=this._selectionStart,D=this._selectionEnd;return!(!T||!D)&&(this._columnSelectMode?T[0]<=D[0]?E>=T[0]&&j>=T[1]&&E=T[1]&&E>=D[0]&&j<=D[1]:j>T[1]&&j=T[0]&&E=T[0])}};function N(E,j,T){for(;E.length{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(u,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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=u.createElement("span");p.classList.add("xterm-char-measure-element");const f=u.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const g=u.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const b=u.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[p,f,g,b],this._container.appendChild(p),this._container.appendChild(f),this._container.appendChild(g),this._container.appendChild(b),d.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(u,d,p,f){u===this._font&&d===this._fontSize&&p===this._weight&&f===this._weightBold||(this._font=u,this._fontSize=d,this._weight=p,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(u,d,p){let f=0;if(!d&&!p&&u.length===1&&(f=u.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const S=this._measure(u,0);return S>0&&(this._flat[f]=S),S}let g=u;d&&(g+="B"),p&&(g+="I");let b=this._holey.get(g);if(b===void 0){let S=0;d&&(S|=1),p&&(S|=2),b=this._measure(u,S),b>0&&this._holey.set(g,b)}return b}_measure(u,d){const p=this._measureElements[d];return p.textContent=u.repeat(32),p.offsetWidth/32}}},2223:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(o,l)=>{function u(p){return 57508<=p&&p<=57558}function d(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(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},l.isPowerlineGlyph=u,l.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},l.isEmoji=d,l.allowRescaling=function(p,f,g,b){return f===1&&g>Math.ceil(1.5*b)&&p!==void 0&&p>255&&!d(p)&&!u(p)&&!(function(S){return 57344<=S&&S<=63743})(p)},l.treatGlyphAsBackgroundColor=function(p){return u(p)||(function(f){return 9472<=f&&f<=9631})(p)},l.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}}}},l.computeNextVariantOffset=function(p,f,g=0){return(p-(2*Math.round(f)-g))%(2*Math.round(f))}},6052:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createSelectionRenderModel=void 0;class u{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,f,g,b=!1){if(this.selectionStart=f,this.selectionEnd=g,!f||!g||f[0]===g[0]&&f[1]===g[1])return void this.clear();const S=p.buffers.active.ydisp,k=f[1]-S,x=g[1]-S,v=Math.max(k,0),w=Math.min(x,p.rows-1);v>=p.rows||w<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=k,this.viewportEndRow=x,this.viewportCappedStartRow=v,this.viewportCappedEndRow=w,this.startCol=f[0],this.endCol=g[0])}isCellSelected(p,f,g){return!!this.hasSelection&&(g-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&g>=this.viewportCappedStartRow&&f=this.viewportCappedStartRow&&f>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g=this.startCol&&f=this.startCol)}}l.createSelectionRenderModel=function(){return new u}},456:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(u){this._bufferService=u,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 u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(o,l,u){var d=this&&this.__decorate||function(w,y,C,N){var E,j=arguments.length,T=j<3?y:N===null?N=Object.getOwnPropertyDescriptor(y,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,C,N);else for(var D=w.length-1;D>=0;D--)(E=w[D])&&(T=(j<3?E(T):j>3?E(y,C,T):E(y,C))||T);return j>3&&T&&Object.defineProperty(y,C,T),T},p=this&&this.__param||function(w,y){return function(C,N){y(C,N,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const f=u(2585),g=u(8460),b=u(844);let S=l.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(w,y,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new v(this._optionsService))}catch{this._measureStrategy=this.register(new x(w,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const w=this._measureStrategy.measure();w.width===this.width&&w.height===this.height||(this.width=w.width,this.height=w.height,this._onCharSizeChange.fire())}};l.CharSizeService=S=d([p(2,f.IOptionsService)],S);class k extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,C){y!==void 0&&y>0&&C!==void 0&&C>0&&(this._result.width=y,this._result.height=C)}}class x extends k{constructor(y,C,N){super(),this._document=y,this._parentElement=C,this._optionsService=N,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 v extends k{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const C=this._ctx.measureText("W");if(!("width"in C&&"fontBoundingBoxAscent"in C&&"fontBoundingBoxDescent"in C))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(o,l,u){var d=this&&this.__decorate||function(v,w,y,C){var N,E=arguments.length,j=E<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(v,w,y,C);else for(var T=v.length-1;T>=0;T--)(N=v[T])&&(j=(E<3?N(j):E>3?N(w,y,j):N(w,y))||j);return E>3&&j&&Object.defineProperty(w,y,j),j},p=this&&this.__param||function(v,w){return function(y,C){w(y,C,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const f=u(3734),g=u(643),b=u(511),S=u(2585);class k extends f.AttributeData{constructor(w,y,C){super(),this.content=0,this.combinedData="",this.fg=w.fg,this.bg=w.bg,this.combinedData=y,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(w){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=k;let x=l.CharacterJoinerService=class LE{constructor(w){this._bufferService=w,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(w){const y={id:this._nextCharacterJoinerId++,handler:w};return this._characterJoiners.push(y),y.id}deregister(w){for(let y=0;y1){const F=this._getJoinedRanges(N,T,j,y,E);for(let U=0;U1){const $=this._getJoinedRanges(N,T,j,y,E);for(let F=0;F<$.length;F++)C.push($[F])}return C}_getJoinedRanges(w,y,C,N,E){const j=w.substring(y,C);let T=[];try{T=this._characterJoiners[0].handler(j)}catch(D){console.error(D)}for(let D=1;D{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const d=u(844),p=u(8460),f=u(3656);class g extends d.Disposable{constructor(k,x,v){super(),this._textarea=k,this._window=x,this.mainDocument=v,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(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((w=>this._screenDprMonitor.setWindow(w)))),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(k){this._window!==k&&(this._window=k,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}}l.CoreBrowserService=g;class b extends d.Disposable{constructor(k){super(),this._parentWindow=k,this._windowResizeListener=this.register(new d.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,d.toDisposable)((()=>this.clearListener())))}setWindow(k){this._parentWindow=k,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var k;this._outerListener&&((k=this._resolutionMediaMatchList)==null||k.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:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const d=u(844);class p extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const b=this.linkProviders.indexOf(g);b!==-1&&this.linkProviders.splice(b,1)}}}}l.LinkProviderService=p},8934:function(o,l,u){var d=this&&this.__decorate||function(S,k,x,v){var w,y=arguments.length,C=y<3?k:v===null?v=Object.getOwnPropertyDescriptor(k,x):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(S,k,x,v);else for(var N=S.length-1;N>=0;N--)(w=S[N])&&(C=(y<3?w(C):y>3?w(k,x,C):w(k,x))||C);return y>3&&C&&Object.defineProperty(k,x,C),C},p=this&&this.__param||function(S,k){return function(x,v){k(x,v,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const f=u(4725),g=u(9806);let b=l.MouseService=class{constructor(S,k){this._renderService=S,this._charSizeService=k}getCoords(S,k,x,v,w){return(0,g.getCoords)(window,S,k,x,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,w)}getMouseReportCoords(S,k){const x=(0,g.getCoordsRelativeToElement)(window,S,k);if(this._charSizeService.hasValidSize)return x[0]=Math.min(Math.max(x[0],0),this._renderService.dimensions.css.canvas.width-1),x[1]=Math.min(Math.max(x[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(x[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(x[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(x[0]),y:Math.floor(x[1])}}};l.MouseService=b=d([p(0,f.IRenderService),p(1,f.ICharSizeService)],b)},3230:function(o,l,u){var d=this&&this.__decorate||function(w,y,C,N){var E,j=arguments.length,T=j<3?y:N===null?N=Object.getOwnPropertyDescriptor(y,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,C,N);else for(var D=w.length-1;D>=0;D--)(E=w[D])&&(T=(j<3?E(T):j>3?E(y,C,T):E(y,C))||T);return j>3&&T&&Object.defineProperty(y,C,T),T},p=this&&this.__param||function(w,y){return function(C,N){y(C,N,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const f=u(6193),g=u(4725),b=u(8460),S=u(844),k=u(7226),x=u(2585);let v=l.RenderService=class extends S.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(w,y,C,N,E,j,T,D){super(),this._rowCount=w,this._charSizeService=N,this._renderer=this.register(new S.MutableDisposable),this._pausedResizeTask=new k.DebouncedIdleTask,this._observerDisposable=this.register(new S.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 b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((I,$)=>this._renderRows(I,$)),T),this.register(this._renderDebouncer),this.register(T.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(j.onResize((()=>this._fullRefresh()))),this.register(j.buffers.onBufferActivate((()=>{var I;return(I=this._renderer.value)==null?void 0:I.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(E.onDecorationRegistered((()=>this._fullRefresh()))),this.register(E.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(j.cols,j.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(j.buffer.y,j.buffer.y,!0)))),this.register(D.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(T.window,y),this.register(T.onWindowChange((I=>this._registerIntersectionObserver(I,y))))}_registerIntersectionObserver(w,y){if("IntersectionObserver"in w){const C=new w.IntersectionObserver((N=>this._handleIntersectionChange(N[N.length-1])),{threshold:0});C.observe(y),this._observerDisposable.value=(0,S.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(w){this._isPaused=w.isIntersecting===void 0?w.intersectionRatio===0:!w.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(w,y,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(w,y,this._rowCount))}_renderRows(w,y){this._renderer.value&&(w=Math.min(w,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(w,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:w,end:y}),this._onRender.fire({start:w,end:y}),this._isNextRenderRedrawOnly=!0)}resize(w,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(w){this._renderer.value=w,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(w){return this._renderDebouncer.addRefreshCallback(w)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var w,y;this._renderer.value&&((y=(w=this._renderer.value).clearTextureAtlas)==null||y.call(w),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(w,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(w,y)})):this._renderer.value.handleResize(w,y),this._fullRefresh())}handleCharSizeChanged(){var w;(w=this._renderer.value)==null||w.handleCharSizeChanged()}handleBlur(){var w;(w=this._renderer.value)==null||w.handleBlur()}handleFocus(){var w;(w=this._renderer.value)==null||w.handleFocus()}handleSelectionChanged(w,y,C){var N;this._selectionState.start=w,this._selectionState.end=y,this._selectionState.columnSelectMode=C,(N=this._renderer.value)==null||N.handleSelectionChanged(w,y,C)}handleCursorMove(){var w;(w=this._renderer.value)==null||w.handleCursorMove()}clear(){var w;(w=this._renderer.value)==null||w.clear()}};l.RenderService=v=d([p(2,x.IOptionsService),p(3,g.ICharSizeService),p(4,x.IDecorationService),p(5,x.IBufferService),p(6,g.ICoreBrowserService),p(7,g.IThemeService)],v)},9312:function(o,l,u){var d=this&&this.__decorate||function(T,D,I,$){var F,U=arguments.length,G=U<3?D:$===null?$=Object.getOwnPropertyDescriptor(D,I):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(T,D,I,$);else for(var X=T.length-1;X>=0;X--)(F=T[X])&&(G=(U<3?F(G):U>3?F(D,I,G):F(D,I))||G);return U>3&&G&&Object.defineProperty(D,I,G),G},p=this&&this.__param||function(T,D){return function(I,$){D(I,$,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const f=u(9806),g=u(9504),b=u(456),S=u(4725),k=u(8460),x=u(844),v=u(6114),w=u(4841),y=u(511),C=u(2585),N=" ",E=new RegExp(N,"g");let j=l.SelectionService=class extends x.Disposable{constructor(T,D,I,$,F,U,G,X,Y){super(),this._element=T,this._screenElement=D,this._linkifier=I,this._bufferService=$,this._coreService=F,this._mouseService=U,this._optionsService=G,this._renderService=X,this._coreBrowserService=Y,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 k.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new k.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new k.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new k.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Z=>this._handleMouseMove(Z),this._mouseUpListener=Z=>this._handleMouseUp(Z),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Z=>this._handleTrim(Z))),this.register(this._bufferService.buffers.onBufferActivate((Z=>this._handleBufferActivate(Z)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,x.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,D=this._model.finalSelectionEnd;return!(!T||!D||T[0]===D[0]&&T[1]===D[1])}get selectionText(){const T=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;if(!T||!D)return"";const I=this._bufferService.buffer,$=[];if(this._activeSelectionMode===3){if(T[0]===D[0])return"";const F=T[0]F.replace(E," "))).join(v.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()))),v.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 D=this._getMouseBufferCoords(T),I=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!!(I&&$&&D)&&this._areCoordsInSelection(D,I,$)}isCellInSelection(T,D){const I=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!(!I||!$)&&this._areCoordsInSelection([T,D],I,$)}_areCoordsInSelection(T,D,I){return T[1]>D[1]&&T[1]=D[0]&&T[0]=D[0]}_selectWordAtCursor(T,D){var F,U;const I=(U=(F=this._linkifier.currentLink)==null?void 0:F.link)==null?void 0:U.range;if(I)return this._model.selectionStart=[I.start.x-1,I.start.y-1],this._model.selectionStartLength=(0,w.getRangeLength)(I,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const $=this._getMouseBufferCoords(T);return!!$&&(this._selectWordAt($,D),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,D){this._model.clearSelection(),T=Math.max(T,0),D=Math.min(D,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,D],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const D=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(D)return D[0]--,D[1]--,D[1]+=this._bufferService.buffer.ydisp,D}_getMouseEventScrollAmount(T){let D=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const I=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=I?0:(D>I&&(D-=I),D=Math.min(Math.max(D,-50),50),D/=50,D/Math.abs(D)+Math.round(14*D))}shouldForceSelection(T){return v.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 D=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);D&&D.length!==this._model.selectionStart[0]&&D.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const D=this._getMouseBufferCoords(T);D&&(this._activeSelectionMode=2,this._selectLineAt(D[1]))}shouldColumnSelect(T){return T.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.stopImmediatePropagation(),!this._model.selectionStart)return;const D=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]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const I=this._bufferService.buffer;if(this._model.selectionEnd[1]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 D=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&D<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const I=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(I&&I[0]!==void 0&&I[1]!==void 0){const $=(0,g.moveToCellSequence)(I[0]-1,I[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent($,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,D=this._model.finalSelectionEnd,I=!(!T||!D||T[0]===D[0]&&T[1]===D[1]);I?T&&D&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&D[0]===this._oldSelectionEnd[0]&&D[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,D,I)):this._oldHasSelection&&this._fireOnSelectionChange(T,D,I)}_fireOnSelectionChange(T,D,I){this._oldSelectionStart=T,this._oldSelectionEnd=D,this._oldHasSelection=I,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((D=>this._handleTrim(D)))}_convertViewportColToCharacterIndex(T,D){let I=D;for(let $=0;D>=$;$++){const F=T.loadCell($,this._workCell).getChars().length;this._workCell.getWidth()===0?I--:F>1&&D!==$&&(I+=F-1)}return I}setSelection(T,D,I){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,D],this._model.selectionStartLength=I,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,D,I=!0,$=!0){if(T[0]>=this._bufferService.cols)return;const F=this._bufferService.buffer,U=F.lines.get(T[1]);if(!U)return;const G=F.translateBufferLineToString(T[1],!1);let X=this._convertViewportColToCharacterIndex(U,T[0]),Y=X;const Z=T[0]-X;let Q=0,z=0,O=0,H=0;if(G.charAt(X)===" "){for(;X>0&&G.charAt(X-1)===" ";)X--;for(;Y1&&(H+=pe-1,Y+=pe-1);re>0&&X>0&&!this._isCharWordSeparator(U.loadCell(re-1,this._workCell));){U.loadCell(re-1,this._workCell);const te=this._workCell.getChars().length;this._workCell.getWidth()===0?(Q++,re--):te>1&&(O+=te-1,X-=te-1),X--,re--}for(;le1&&(H+=te-1,Y+=te-1),Y++,le++}}Y++;let V=X+Z-Q+O,W=Math.min(this._bufferService.cols,Y-X+Q+z-O-H);if(D||G.slice(X,Y).trim()!==""){if(I&&V===0&&U.getCodePoint(0)!==32){const re=F.lines.get(T[1]-1);if(re&&U.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const le=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(le){const pe=this._bufferService.cols-le.start;V-=pe,W+=pe}}}if($&&V+W===this._bufferService.cols&&U.getCodePoint(this._bufferService.cols-1)!==32){const re=F.lines.get(T[1]+1);if(re!=null&&re.isWrapped&&re.getCodePoint(0)!==32){const le=this._getWordAt([0,T[1]+1],!1,!1,!0);le&&(W+=le.length)}}return{start:V,length:W}}}_selectWordAt(T,D){const I=this._getWordAt(T,D);if(I){for(;I.start<0;)I.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[I.start,T[1]],this._model.selectionStartLength=I.length}}_selectToWordAt(T){const D=this._getWordAt(T,!0);if(D){let I=T[1];for(;D.start<0;)D.start+=this._bufferService.cols,I--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,I++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,I]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const D=this._bufferService.buffer.getWrappedRangeForLine(T),I={start:{x:0,y:D.first},end:{x:this._bufferService.cols-1,y:D.last}};this._model.selectionStart=[0,D.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,w.getRangeLength)(I,this._bufferService.cols)}};l.SelectionService=j=d([p(3,C.IBufferService),p(4,C.ICoreService),p(5,S.IMouseService),p(6,C.IOptionsService),p(7,S.IRenderService),p(8,S.ICoreBrowserService)],j)},4725:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const d=u(8343);l.ICharSizeService=(0,d.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),l.IMouseService=(0,d.createDecorator)("MouseService"),l.IRenderService=(0,d.createDecorator)("RenderService"),l.ISelectionService=(0,d.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,d.createDecorator)("ThemeService"),l.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(o,l,u){var d=this&&this.__decorate||function(j,T,D,I){var $,F=arguments.length,U=F<3?T:I===null?I=Object.getOwnPropertyDescriptor(T,D):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(j,T,D,I);else for(var G=j.length-1;G>=0;G--)($=j[G])&&(U=(F<3?$(U):F>3?$(T,D,U):$(T,D))||U);return F>3&&U&&Object.defineProperty(T,D,U),U},p=this&&this.__param||function(j,T){return function(D,I){T(D,I,j)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const f=u(7239),g=u(8055),b=u(8460),S=u(844),k=u(2585),x=g.css.toColor("#ffffff"),v=g.css.toColor("#000000"),w=g.css.toColor("#ffffff"),y=g.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const j=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],T=[0,95,135,175,215,255];for(let D=0;D<216;D++){const I=T[D/36%6|0],$=T[D/6%6|0],F=T[D%6];j.push({css:g.channels.toCss(I,$,F),rgba:g.channels.toRgba(I,$,F)})}for(let D=0;D<24;D++){const I=8+10*D;j.push({css:g.channels.toCss(I,I,I),rgba:g.channels.toRgba(I,I,I)})}return j})());let N=l.ThemeService=class extends S.Disposable{get colors(){return this._colors}constructor(j){super(),this._optionsService=j,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:x,background:v,cursor:w,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:g.color.blend(v,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:g.color.blend(v,C),ansi:l.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(j={}){const T=this._colors;if(T.foreground=E(j.foreground,x),T.background=E(j.background,v),T.cursor=E(j.cursor,w),T.cursorAccent=E(j.cursorAccent,y),T.selectionBackgroundTransparent=E(j.selectionBackground,C),T.selectionBackgroundOpaque=g.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=E(j.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=g.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=j.selectionForeground?E(j.selectionForeground,g.NULL_COLOR):void 0,T.selectionForeground===g.NULL_COLOR&&(T.selectionForeground=void 0),g.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=g.color.opacity(T.selectionBackgroundTransparent,.3)),g.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=g.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=l.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=E(j.black,l.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=E(j.red,l.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=E(j.green,l.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=E(j.yellow,l.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=E(j.blue,l.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=E(j.magenta,l.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=E(j.cyan,l.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=E(j.white,l.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=E(j.brightBlack,l.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=E(j.brightRed,l.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=E(j.brightGreen,l.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=E(j.brightYellow,l.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=E(j.brightBlue,l.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=E(j.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=E(j.brightCyan,l.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=E(j.brightWhite,l.DEFAULT_ANSI_COLORS[15]),j.extendedAnsi){const D=Math.min(T.ansi.length-16,j.extendedAnsi.length);for(let I=0;I{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const d=u(8460),p=u(844);class f extends p.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.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(b){if(this._maxLength===b)return;const S=new Array(b);for(let k=0;kthis._length)for(let S=this._length;S=b;x--)this._array[this._getCyclicIndex(x+k.length)]=this._array[this._getCyclicIndex(x)];for(let x=0;xthis._maxLength){const x=this._length+k.length-this._maxLength;this._startIndex+=x,this._length=this._maxLength,this.onTrimEmitter.fire(x)}else this._length+=k.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,S,k){if(!(S<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+k<0)throw new Error("Cannot shift elements in list beyond index 0");if(k>0){for(let v=S-1;v>=0;v--)this.set(b+v+k,this.get(b+v));const x=b+S+k-this._length;if(x>0)for(this._length+=x;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let x=0;x{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function u(d,p=5){if(typeof d!="object")return d;const f=Array.isArray(d)?[]:{};for(const g in d)f[g]=p<=1?d[g]:d[g]&&u(d[g],p-1);return f}},8055:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let u=0,d=0,p=0,f=0;var g,b,S,k,x;function v(y){const C=y.toString(16);return C.length<2?"0"+C:C}function w(y,C){return y>>0},y.toColor=function(C,N,E,j){return{css:y.toCss(C,N,E,j),rgba:y.toRgba(C,N,E,j)}}})(g||(l.channels=g={})),(function(y){function C(N,E){return f=Math.round(255*E),[u,d,p]=x.toChannels(N.rgba),{css:g.toCss(u,d,p,f),rgba:g.toRgba(u,d,p,f)}}y.blend=function(N,E){if(f=(255&E.rgba)/255,f===1)return{css:E.css,rgba:E.rgba};const j=E.rgba>>24&255,T=E.rgba>>16&255,D=E.rgba>>8&255,I=N.rgba>>24&255,$=N.rgba>>16&255,F=N.rgba>>8&255;return u=I+Math.round((j-I)*f),d=$+Math.round((T-$)*f),p=F+Math.round((D-F)*f),{css:g.toCss(u,d,p),rgba:g.toRgba(u,d,p)}},y.isOpaque=function(N){return(255&N.rgba)==255},y.ensureContrastRatio=function(N,E,j){const T=x.ensureContrastRatio(N.rgba,E.rgba,j);if(T)return g.toColor(T>>24&255,T>>16&255,T>>8&255)},y.opaque=function(N){const E=(255|N.rgba)>>>0;return[u,d,p]=x.toChannels(E),{css:g.toCss(u,d,p),rgba:E}},y.opacity=C,y.multiplyOpacity=function(N,E){return f=255&N.rgba,C(N,f*E/255)},y.toColorRGB=function(N){return[N.rgba>>24&255,N.rgba>>16&255,N.rgba>>8&255]}})(b||(l.color=b={})),(function(y){let C,N;try{const E=document.createElement("canvas");E.width=1,E.height=1;const j=E.getContext("2d",{willReadFrequently:!0});j&&(C=j,C.globalCompositeOperation="copy",N=C.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(E){if(E.match(/#[\da-f]{3,8}/i))switch(E.length){case 4:return u=parseInt(E.slice(1,2).repeat(2),16),d=parseInt(E.slice(2,3).repeat(2),16),p=parseInt(E.slice(3,4).repeat(2),16),g.toColor(u,d,p);case 5:return u=parseInt(E.slice(1,2).repeat(2),16),d=parseInt(E.slice(2,3).repeat(2),16),p=parseInt(E.slice(3,4).repeat(2),16),f=parseInt(E.slice(4,5).repeat(2),16),g.toColor(u,d,p,f);case 7:return{css:E,rgba:(parseInt(E.slice(1),16)<<8|255)>>>0};case 9:return{css:E,rgba:parseInt(E.slice(1),16)>>>0}}const j=E.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(j)return u=parseInt(j[1]),d=parseInt(j[2]),p=parseInt(j[3]),f=Math.round(255*(j[5]===void 0?1:parseFloat(j[5]))),g.toColor(u,d,p,f);if(!C||!N)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=N,C.fillStyle=E,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[u,d,p,f]=C.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(u,d,p,f),css:E}}})(S||(l.css=S={})),(function(y){function C(N,E,j){const T=N/255,D=E/255,I=j/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.0722*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))}y.relativeLuminance=function(N){return C(N>>16&255,N>>8&255,255&N)},y.relativeLuminance2=C})(k||(l.rgb=k={})),(function(y){function C(E,j,T){const D=E>>24&255,I=E>>16&255,$=E>>8&255;let F=j>>24&255,U=j>>16&255,G=j>>8&255,X=w(k.relativeLuminance2(F,U,G),k.relativeLuminance2(D,I,$));for(;X0||U>0||G>0);)F-=Math.max(0,Math.ceil(.1*F)),U-=Math.max(0,Math.ceil(.1*U)),G-=Math.max(0,Math.ceil(.1*G)),X=w(k.relativeLuminance2(F,U,G),k.relativeLuminance2(D,I,$));return(F<<24|U<<16|G<<8|255)>>>0}function N(E,j,T){const D=E>>24&255,I=E>>16&255,$=E>>8&255;let F=j>>24&255,U=j>>16&255,G=j>>8&255,X=w(k.relativeLuminance2(F,U,G),k.relativeLuminance2(D,I,$));for(;X>>0}y.blend=function(E,j){if(f=(255&j)/255,f===1)return j;const T=j>>24&255,D=j>>16&255,I=j>>8&255,$=E>>24&255,F=E>>16&255,U=E>>8&255;return u=$+Math.round((T-$)*f),d=F+Math.round((D-F)*f),p=U+Math.round((I-U)*f),g.toRgba(u,d,p)},y.ensureContrastRatio=function(E,j,T){const D=k.relativeLuminance(E>>8),I=k.relativeLuminance(j>>8);if(w(D,I)>8));if(Gw(D,k.relativeLuminance(X>>8))?U:X}return U}const $=N(E,j,T),F=w(D,k.relativeLuminance($>>8));if(Fw(D,k.relativeLuminance(U>>8))?$:U}return $}},y.reduceLuminance=C,y.increaseLuminance=N,y.toChannels=function(E){return[E>>24&255,E>>16&255,E>>8&255,255&E]}})(x||(l.rgba=x={})),l.toPaddedHex=v,l.contrastRatio=w},8969:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const d=u(844),p=u(2585),f=u(4348),g=u(7866),b=u(744),S=u(7302),k=u(6975),x=u(8460),v=u(1753),w=u(1480),y=u(7994),C=u(9282),N=u(5435),E=u(5981),j=u(2660);let T=!1;class D extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new x.EventEmitter),this._onScroll.event(($=>{var F;(F=this._onScrollApi)==null||F.fire($.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($){for(const F in $)this.optionsService.options[F]=$[F]}constructor($){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new x.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new x.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new x.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new x.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new x.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new x.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new S.OptionsService($)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(k.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(w.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(j.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new N.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,x.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,x.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,x.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,x.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((F=>{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((F=>{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 E.WriteBuffer(((F,U)=>this._inputHandler.parse(F,U)))),this.register((0,x.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write($,F){this._writeBuffer.write($,F)}writeSync($,F){this._logService.logLevel<=p.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync($,F)}input($,F=!0){this.coreService.triggerDataEvent($,F)}resize($,F){isNaN($)||isNaN(F)||($=Math.max($,b.MINIMUM_COLS),F=Math.max(F,b.MINIMUM_ROWS),this._bufferService.resize($,F))}scroll($,F=!1){this._bufferService.scroll($,F)}scrollLines($,F,U){this._bufferService.scrollLines($,F,U)}scrollPages($){this.scrollLines($*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine($){const F=$-this._bufferService.buffer.ydisp;F!==0&&this.scrollLines(F)}registerEscHandler($,F){return this._inputHandler.registerEscHandler($,F)}registerDcsHandler($,F){return this._inputHandler.registerDcsHandler($,F)}registerCsiHandler($,F){return this._inputHandler.registerCsiHandler($,F)}registerOscHandler($,F){return this._inputHandler.registerOscHandler($,F)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let $=!1;const F=this.optionsService.rawOptions.windowsPty;F&&F.buildNumber!==void 0&&F.buildNumber!==void 0?$=F.backend==="conpty"&&F.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&($=!0),$?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const $=[];$.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),$.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const F of $)F.dispose()}))}}}l.CoreTerminal=D},8460:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;dd.fire(p)))},l.runAndSubscribe=function(u,d){return d(void 0),u((p=>d(p)))}},5435:function(o,l,u){var d=this&&this.__decorate||function(Q,z,O,H){var V,W=arguments.length,re=W<3?z:H===null?H=Object.getOwnPropertyDescriptor(z,O):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(Q,z,O,H);else for(var le=Q.length-1;le>=0;le--)(V=Q[le])&&(re=(W<3?V(re):W>3?V(z,O,re):V(z,O))||re);return W>3&&re&&Object.defineProperty(z,O,re),re},p=this&&this.__param||function(Q,z){return function(O,H){z(O,H,Q)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const f=u(2584),g=u(7116),b=u(2015),S=u(844),k=u(482),x=u(8437),v=u(8460),w=u(643),y=u(511),C=u(3734),N=u(2585),E=u(1480),j=u(6242),T=u(6351),D=u(5941),I={"(":0,")":1,"*":2,"+":3,"-":1,".":2},$=131072;function F(Q,z){if(Q>24)return z.setWinLines||!1;switch(Q){case 1:return!!z.restoreWin;case 2:return!!z.minimizeWin;case 3:return!!z.setWinPosition;case 4:return!!z.setWinSizePixels;case 5:return!!z.raiseWin;case 6:return!!z.lowerWin;case 7:return!!z.refreshWin;case 8:return!!z.setWinSizeChars;case 9:return!!z.maximizeWin;case 10:return!!z.fullscreenWin;case 11:return!!z.getWinState;case 13:return!!z.getWinPosition;case 14:return!!z.getWinSizePixels;case 15:return!!z.getScreenSizePixels;case 16:return!!z.getCellSizePixels;case 18:return!!z.getWinSizeChars;case 19:return!!z.getScreenSizeChars;case 20:return!!z.getIconTitle;case 21:return!!z.getWinTitle;case 22:return!!z.pushTitle;case 23:return!!z.popTitle;case 24:return!!z.setWinLines}return!1}var U;(function(Q){Q[Q.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Q[Q.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(U||(l.WindowsOptionsReportType=U={}));let G=0;class X extends S.Disposable{getAttrData(){return this._curAttrData}constructor(z,O,H,V,W,re,le,pe,te=new b.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=O,this._coreService=H,this._logService=V,this._optionsService=W,this._oscLinkService=re,this._coreMouseService=le,this._unicodeService=pe,this._parser=te,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new k.StringToUtf32,this._utf8Decoder=new k.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=x.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=x.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new v.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new v.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new v.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new v.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new v.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new v.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new v.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new v.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new v.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new v.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 Y(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._parser.setCsiHandlerFallback(((B,ie)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(B),params:ie.toArray()})})),this._parser.setEscHandlerFallback((B=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(B)})})),this._parser.setExecuteHandlerFallback((B=>{this._logService.debug("Unknown EXECUTE code: ",{code:B})})),this._parser.setOscHandlerFallback(((B,ie,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:B,action:ie,data:oe})})),this._parser.setDcsHandlerFallback(((B,ie,oe)=>{ie==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(B),action:ie,payload:oe})})),this._parser.setPrintHandler(((B,ie,oe)=>this.print(B,ie,oe))),this._parser.registerCsiHandler({final:"@"},(B=>this.insertChars(B))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(B=>this.scrollLeft(B))),this._parser.registerCsiHandler({final:"A"},(B=>this.cursorUp(B))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(B=>this.scrollRight(B))),this._parser.registerCsiHandler({final:"B"},(B=>this.cursorDown(B))),this._parser.registerCsiHandler({final:"C"},(B=>this.cursorForward(B))),this._parser.registerCsiHandler({final:"D"},(B=>this.cursorBackward(B))),this._parser.registerCsiHandler({final:"E"},(B=>this.cursorNextLine(B))),this._parser.registerCsiHandler({final:"F"},(B=>this.cursorPrecedingLine(B))),this._parser.registerCsiHandler({final:"G"},(B=>this.cursorCharAbsolute(B))),this._parser.registerCsiHandler({final:"H"},(B=>this.cursorPosition(B))),this._parser.registerCsiHandler({final:"I"},(B=>this.cursorForwardTab(B))),this._parser.registerCsiHandler({final:"J"},(B=>this.eraseInDisplay(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(B=>this.eraseInDisplay(B,!0))),this._parser.registerCsiHandler({final:"K"},(B=>this.eraseInLine(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(B=>this.eraseInLine(B,!0))),this._parser.registerCsiHandler({final:"L"},(B=>this.insertLines(B))),this._parser.registerCsiHandler({final:"M"},(B=>this.deleteLines(B))),this._parser.registerCsiHandler({final:"P"},(B=>this.deleteChars(B))),this._parser.registerCsiHandler({final:"S"},(B=>this.scrollUp(B))),this._parser.registerCsiHandler({final:"T"},(B=>this.scrollDown(B))),this._parser.registerCsiHandler({final:"X"},(B=>this.eraseChars(B))),this._parser.registerCsiHandler({final:"Z"},(B=>this.cursorBackwardTab(B))),this._parser.registerCsiHandler({final:"`"},(B=>this.charPosAbsolute(B))),this._parser.registerCsiHandler({final:"a"},(B=>this.hPositionRelative(B))),this._parser.registerCsiHandler({final:"b"},(B=>this.repeatPrecedingCharacter(B))),this._parser.registerCsiHandler({final:"c"},(B=>this.sendDeviceAttributesPrimary(B))),this._parser.registerCsiHandler({prefix:">",final:"c"},(B=>this.sendDeviceAttributesSecondary(B))),this._parser.registerCsiHandler({final:"d"},(B=>this.linePosAbsolute(B))),this._parser.registerCsiHandler({final:"e"},(B=>this.vPositionRelative(B))),this._parser.registerCsiHandler({final:"f"},(B=>this.hVPosition(B))),this._parser.registerCsiHandler({final:"g"},(B=>this.tabClear(B))),this._parser.registerCsiHandler({final:"h"},(B=>this.setMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(B=>this.setModePrivate(B))),this._parser.registerCsiHandler({final:"l"},(B=>this.resetMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(B=>this.resetModePrivate(B))),this._parser.registerCsiHandler({final:"m"},(B=>this.charAttributes(B))),this._parser.registerCsiHandler({final:"n"},(B=>this.deviceStatus(B))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(B=>this.deviceStatusPrivate(B))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(B=>this.softReset(B))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(B=>this.setCursorStyle(B))),this._parser.registerCsiHandler({final:"r"},(B=>this.setScrollRegion(B))),this._parser.registerCsiHandler({final:"s"},(B=>this.saveCursor(B))),this._parser.registerCsiHandler({final:"t"},(B=>this.windowOptions(B))),this._parser.registerCsiHandler({final:"u"},(B=>this.restoreCursor(B))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(B=>this.insertColumns(B))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(B=>this.deleteColumns(B))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(B=>this.selectProtected(B))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(B=>this.requestMode(B,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(B=>this.requestMode(B,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new j.OscHandler((B=>(this.setTitle(B),this.setIconName(B),!0)))),this._parser.registerOscHandler(1,new j.OscHandler((B=>this.setIconName(B)))),this._parser.registerOscHandler(2,new j.OscHandler((B=>this.setTitle(B)))),this._parser.registerOscHandler(4,new j.OscHandler((B=>this.setOrReportIndexedColor(B)))),this._parser.registerOscHandler(8,new j.OscHandler((B=>this.setHyperlink(B)))),this._parser.registerOscHandler(10,new j.OscHandler((B=>this.setOrReportFgColor(B)))),this._parser.registerOscHandler(11,new j.OscHandler((B=>this.setOrReportBgColor(B)))),this._parser.registerOscHandler(12,new j.OscHandler((B=>this.setOrReportCursorColor(B)))),this._parser.registerOscHandler(104,new j.OscHandler((B=>this.restoreIndexedColor(B)))),this._parser.registerOscHandler(110,new j.OscHandler((B=>this.restoreFgColor(B)))),this._parser.registerOscHandler(111,new j.OscHandler((B=>this.restoreBgColor(B)))),this._parser.registerOscHandler(112,new j.OscHandler((B=>this.restoreCursorColor(B)))),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 B in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:B},(()=>this.selectCharset("("+B))),this._parser.registerEscHandler({intermediates:")",final:B},(()=>this.selectCharset(")"+B))),this._parser.registerEscHandler({intermediates:"*",final:B},(()=>this.selectCharset("*"+B))),this._parser.registerEscHandler({intermediates:"+",final:B},(()=>this.selectCharset("+"+B))),this._parser.registerEscHandler({intermediates:"-",final:B},(()=>this.selectCharset("-"+B))),this._parser.registerEscHandler({intermediates:".",final:B},(()=>this.selectCharset("."+B))),this._parser.registerEscHandler({intermediates:"/",final:B},(()=>this.selectCharset("/"+B)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((B=>(this._logService.error("Parsing error: ",B),B))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler(((B,ie)=>this.requestStatusString(B,ie))))}_preserveStack(z,O,H,V){this._parseStack.paused=!0,this._parseStack.cursorStartX=z,this._parseStack.cursorStartY=O,this._parseStack.decodedLength=H,this._parseStack.position=V}_logSlowResolvingAsync(z){this._logService.logLevel<=N.LogLevelEnum.WARN&&Promise.race([z,new Promise(((O,H)=>setTimeout((()=>H("#SLOW_TIMEOUT")),5e3)))]).catch((O=>{if(O!=="#SLOW_TIMEOUT")throw O;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(z,O){let H,V=this._activeBuffer.x,W=this._activeBuffer.y,re=0;const le=this._parseStack.paused;if(le){if(H=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,O))return this._logSlowResolvingAsync(H),H;V=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,z.length>$&&(re=this._parseStack.position+$)}if(this._logService.logLevel<=N.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof z=="string"?` "${z}"`:` "${Array.prototype.map.call(z,(B=>String.fromCharCode(B))).join("")}"`),typeof z=="string"?z.split("").map((B=>B.charCodeAt(0))):z),this._parseBuffer.length$)for(let B=re;B0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ie);let be=this._parser.precedingJoinState;for(let ge=O;gepe){if(te){const We=oe;let Fe=this._activeBuffer.x-Ue;for(this._activeBuffer.x=Ue,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),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ue>0&&oe instanceof x.BufferLine&&oe.copyCellsFrom(We,Fe,0,Ue,!1);Fe=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}else if(B&&(oe.insertCells(this._activeBuffer.x,W-Ue,this._activeBuffer.getNullCell(ie)),oe.getWidth(pe-1)===2&&oe.setCellFromCodepoint(pe-1,w.NULL_CELL_CODE,w.NULL_CELL_WIDTH,ie)),oe.setCellFromCodepoint(this._activeBuffer.x++,V,W,ie),W>0)for(;--W;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}this._parser.precedingJoinState=be,this._activeBuffer.x0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,ie),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(z,O){return z.final!=="t"||z.prefix||z.intermediates?this._parser.registerCsiHandler(z,O):this._parser.registerCsiHandler(z,(H=>!F(H.params[0],this._optionsService.rawOptions.windowOptions)||O(H)))}registerDcsHandler(z,O){return this._parser.registerDcsHandler(z,new T.DcsHandler(O))}registerEscHandler(z,O){return this._parser.registerEscHandler(z,O)}registerOscHandler(z,O){return this._parser.registerOscHandler(z,new j.OscHandler(O))}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 z;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&&((z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&z.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);O.hasWidth(this._activeBuffer.x)&&!O.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const z=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-z),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(z=this._bufferService.cols-1){this._activeBuffer.x=Math.min(z,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(z,O){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=z,this._activeBuffer.y=this._activeBuffer.scrollTop+O):(this._activeBuffer.x=z,this._activeBuffer.y=O),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(z,O){this._restrictCursor(),this._setCursor(this._activeBuffer.x+z,this._activeBuffer.y+O)}cursorUp(z){const O=this._activeBuffer.y-this._activeBuffer.scrollTop;return O>=0?this._moveCursor(0,-Math.min(O,z.params[0]||1)):this._moveCursor(0,-(z.params[0]||1)),!0}cursorDown(z){const O=this._activeBuffer.scrollBottom-this._activeBuffer.y;return O>=0?this._moveCursor(0,Math.min(O,z.params[0]||1)):this._moveCursor(0,z.params[0]||1),!0}cursorForward(z){return this._moveCursor(z.params[0]||1,0),!0}cursorBackward(z){return this._moveCursor(-(z.params[0]||1),0),!0}cursorNextLine(z){return this.cursorDown(z),this._activeBuffer.x=0,!0}cursorPrecedingLine(z){return this.cursorUp(z),this._activeBuffer.x=0,!0}cursorCharAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(z){return this._setCursor(z.length>=2?(z.params[1]||1)-1:0,(z.params[0]||1)-1),!0}charPosAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(z){return this._moveCursor(z.params[0]||1,0),!0}linePosAbsolute(z){return this._setCursor(this._activeBuffer.x,(z.params[0]||1)-1),!0}vPositionRelative(z){return this._moveCursor(0,z.params[0]||1),!0}hVPosition(z){return this.cursorPosition(z),!0}tabClear(z){const O=z.params[0];return O===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:O===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=z.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=z.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(z){const O=z.params[0];return O===1&&(this._curAttrData.bg|=536870912),O!==2&&O!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(z,O,H,V=!1,W=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);re.replaceCells(O,H,this._activeBuffer.getNullCell(this._eraseAttrData()),W),V&&(re.isWrapped=!1)}_resetBufferLine(z,O=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);H&&(H.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),O),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+z),H.isWrapped=!1)}eraseInDisplay(z,O=!1){let H;switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:for(H=this._activeBuffer.y,this._dirtyRowTracker.markDirty(H),this._eraseInBufferLine(H++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);H=this._bufferService.cols&&(this._activeBuffer.lines.get(H+1).isWrapped=!1);H--;)this._resetBufferLine(H,O);this._dirtyRowTracker.markDirty(0);break;case 2:for(H=this._bufferService.rows,this._dirtyRowTracker.markDirty(H-1);H--;)this._resetBufferLine(H,O);this._dirtyRowTracker.markDirty(0);break;case 3:const V=this._activeBuffer.lines.length-this._bufferService.rows;V>0&&(this._activeBuffer.lines.trimStart(V),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-V,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-V,0),this._onScroll.fire(0))}return!0}eraseInLine(z,O=!1){switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,O);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,O)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(z){this._restrictCursor();let O=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let te=pe;for(let B=1;B0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(z){return z.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(z.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(z){return(this._optionsService.rawOptions.termName+"").indexOf(z)===0}setMode(z){for(let O=0;OLe?1:2,be=z.params[0];return ge=be,Ce=O?be===2?4:be===4?oe(re.modes.insertMode):be===12?3:be===20?oe(ie.convertEol):0:be===1?oe(H.applicationCursorKeys):be===3?ie.windowOptions.setWinLines?pe===80?2:pe===132?1:0:0:be===6?oe(H.origin):be===7?oe(H.wraparound):be===8?3:be===9?oe(V==="X10"):be===12?oe(ie.cursorBlink):be===25?oe(!re.isCursorHidden):be===45?oe(H.reverseWraparound):be===66?oe(H.applicationKeypad):be===67?4:be===1e3?oe(V==="VT200"):be===1002?oe(V==="DRAG"):be===1003?oe(V==="ANY"):be===1004?oe(H.sendFocus):be===1005?4:be===1006?oe(W==="SGR"):be===1015?4:be===1016?oe(W==="SGR_PIXELS"):be===1048?1:be===47||be===1047||be===1049?oe(te===B):be===2004?oe(H.bracketedPasteMode):0,re.triggerDataEvent(`${f.C0.ESC}[${O?"":"?"}${ge};${Ce}$y`),!0;var ge,Ce}_updateAttrColor(z,O,H,V,W){return O===2?(z|=50331648,z&=-16777216,z|=C.AttributeData.fromColorRGB([H,V,W])):O===5&&(z&=-50331904,z|=33554432|255&H),z}_extractColor(z,O,H){const V=[0,0,-1,0,0,0];let W=0,re=0;do{if(V[re+W]=z.params[O+re],z.hasSubParams(O+re)){const le=z.getSubParams(O+re);let pe=0;do V[1]===5&&(W=1),V[re+pe+1+W]=le[pe];while(++pe=2||V[1]===2&&re+W>=5)break;V[1]&&(W=1)}while(++re+O5)&&(z=1),O.extended.underlineStyle=z,O.fg|=268435456,z===0&&(O.fg&=-268435457),O.updateExtended()}_processSGR0(z){z.fg=x.DEFAULT_ATTR_DATA.fg,z.bg=x.DEFAULT_ATTR_DATA.bg,z.extended=z.extended.clone(),z.extended.underlineStyle=0,z.extended.underlineColor&=-67108864,z.updateExtended()}charAttributes(z){if(z.length===1&&z.params[0]===0)return this._processSGR0(this._curAttrData),!0;const O=z.length;let H;const V=this._curAttrData;for(let W=0;W=30&&H<=37?(V.fg&=-50331904,V.fg|=16777216|H-30):H>=40&&H<=47?(V.bg&=-50331904,V.bg|=16777216|H-40):H>=90&&H<=97?(V.fg&=-50331904,V.fg|=16777224|H-90):H>=100&&H<=107?(V.bg&=-50331904,V.bg|=16777224|H-100):H===0?this._processSGR0(V):H===1?V.fg|=134217728:H===3?V.bg|=67108864:H===4?(V.fg|=268435456,this._processUnderline(z.hasSubParams(W)?z.getSubParams(W)[0]:1,V)):H===5?V.fg|=536870912:H===7?V.fg|=67108864:H===8?V.fg|=1073741824:H===9?V.fg|=2147483648:H===2?V.bg|=134217728:H===21?this._processUnderline(2,V):H===22?(V.fg&=-134217729,V.bg&=-134217729):H===23?V.bg&=-67108865:H===24?(V.fg&=-268435457,this._processUnderline(0,V)):H===25?V.fg&=-536870913:H===27?V.fg&=-67108865:H===28?V.fg&=-1073741825:H===29?V.fg&=2147483647:H===39?(V.fg&=-67108864,V.fg|=16777215&x.DEFAULT_ATTR_DATA.fg):H===49?(V.bg&=-67108864,V.bg|=16777215&x.DEFAULT_ATTR_DATA.bg):H===38||H===48||H===58?W+=this._extractColor(z,W,V):H===53?V.bg|=1073741824:H===55?V.bg&=-1073741825:H===59?(V.extended=V.extended.clone(),V.extended.underlineColor=-1,V.updateExtended()):H===100?(V.fg&=-67108864,V.fg|=16777215&x.DEFAULT_ATTR_DATA.fg,V.bg&=-67108864,V.bg|=16777215&x.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",H);return!0}deviceStatus(z){switch(z.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const O=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${O};${H}R`)}return!0}deviceStatusPrivate(z){if(z.params[0]===6){const O=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${O};${H}R`)}return!0}softReset(z){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=x.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(z){const O=z.params[0]||1;switch(O){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 H=O%2==1;return this._optionsService.options.cursorBlink=H,!0}setScrollRegion(z){const O=z.params[0]||1;let H;return(z.length<2||(H=z.params[1])>this._bufferService.rows||H===0)&&(H=this._bufferService.rows),H>O&&(this._activeBuffer.scrollTop=O-1,this._activeBuffer.scrollBottom=H-1,this._setCursor(0,0)),!0}windowOptions(z){if(!F(z.params[0],this._optionsService.rawOptions.windowOptions))return!0;const O=z.length>1?z.params[1]:0;switch(z.params[0]){case 14:O!==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(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:O!==0&&O!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),O!==0&&O!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:O!==0&&O!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),O!==0&&O!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(z){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(z){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(z){return this._windowTitle=z,this._onTitleChange.fire(z),!0}setIconName(z){return this._iconName=z,!0}setOrReportIndexedColor(z){const O=[],H=z.split(";");for(;H.length>1;){const V=H.shift(),W=H.shift();if(/^\d+$/.exec(V)){const re=parseInt(V);if(Z(re))if(W==="?")O.push({type:0,index:re});else{const le=(0,D.parseColor)(W);le&&O.push({type:1,index:re,color:le})}}}return O.length&&this._onColor.fire(O),!0}setHyperlink(z){const O=z.split(";");return!(O.length<2)&&(O[1]?this._createHyperlink(O[0],O[1]):!O[0]&&this._finishHyperlink())}_createHyperlink(z,O){this._getCurrentLinkId()&&this._finishHyperlink();const H=z.split(":");let V;const W=H.findIndex((re=>re.startsWith("id=")));return W!==-1&&(V=H[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:V,uri:O}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(z,O){const H=z.split(";");for(let V=0;V=this._specialColors.length);++V,++O)if(H[V]==="?")this._onColor.fire([{type:0,index:this._specialColors[O]}]);else{const W=(0,D.parseColor)(H[V]);W&&this._onColor.fire([{type:1,index:this._specialColors[O],color:W}])}return!0}setOrReportFgColor(z){return this._setOrReportSpecialColor(z,0)}setOrReportBgColor(z){return this._setOrReportSpecialColor(z,1)}setOrReportCursorColor(z){return this._setOrReportSpecialColor(z,2)}restoreIndexedColor(z){if(!z)return this._onColor.fire([{type:2}]),!0;const O=[],H=z.split(";");for(let V=0;V=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 z=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,z,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=x.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=x.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(z){return this._charsetService.setgLevel(z),!0}screenAlignmentPattern(){const z=new y.CellData;z.content=4194373,z.fg=this._curAttrData.fg,z.bg=this._curAttrData.bg,this._setCursor(0,0);for(let O=0;O(this._coreService.triggerDataEvent(`${f.C0.ESC}${W}${f.C0.ESC}\\`),!0))(z==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:z==='"p'?'P1$r61;1"p':z==="r"?`P1$r${H.scrollTop+1};${H.scrollBottom+1}r`:z==="m"?"P1$r0m":z===" q"?`P1$r${{block:2,underline:4,bar:6}[V.cursorStyle]-(V.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(z,O){this._dirtyRowTracker.markRangeDirty(z,O)}}l.InputHandler=X;let Y=class{constructor(Q){this._bufferService=Q,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Q){Qthis.end&&(this.end=Q)}markRangeDirty(Q,z){Q>z&&(G=Q,Q=z,z=G),Qthis.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Z(Q){return 0<=Q&&Q<256}Y=d([p(0,N.IBufferService)],Y)},844:(o,l)=>{function u(d){for(const p of d)p.dispose();d.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const p=this._disposables.indexOf(d);p!==-1&&this._disposables.splice(p,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var p;this._isDisposed||d===this._value||((p=this._value)==null||p.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},l.toDisposable=function(d){return{dispose:d}},l.disposeArray=u,l.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(p,f,g){this._data[p]||(this._data[p]={}),this._data[p][f]=g}get(p,f){return this._data[p]?this._data[p][f]:void 0}clear(){this._data={}}}l.TwoKeyMap=u,l.FourKeyMap=class{constructor(){this._data=new u}set(d,p,f,g,b){this._data.get(d,p)||this._data.set(d,p,new u),this._data.get(d,p).set(f,g,b)}get(d,p,f,g){var b;return(b=this._data.get(d,p))==null?void 0:b.get(f,g)}clear(){this._data.clear()}}},6114:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const u=l.isNode?"node":navigator.userAgent,d=l.isNode?"node":navigator.platform;l.isFirefox=u.includes("Firefox"),l.isLegacyEdge=u.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(u),l.getSafariVersion=function(){if(!l.isSafari)return 0;const p=u.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),l.isIpad=d==="iPad",l.isIphone=d==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),l.isLinux=d.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(u)},6106:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let u=0;l.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const p=this._getKey(d);if(p===void 0||(u=this._search(p),u===-1)||this._getKey(this._array[u])!==p)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u=this._array.length)&&this._getKey(this._array[u])===d))do p(this._array[u]);while(++u=p;){let g=p+f>>1;const b=this._getKey(this._array[g]);if(b>d)f=g-1;else{if(!(b0&&this._getKey(this._array[g-1])===d;)g--;return g}p=g+1}}return p}}},7226:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const d=u(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),this._start()}flush(){for(;this._iv)return x-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(x-S))}ms`),void this._start();x=v}this.clear()}}class f extends p{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const S=Date.now()+b;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}l.PriorityTaskQueue=f,l.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:f,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const d=u(643);l.updateWindowsModeWrappedState=function(p){const f=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),g=f==null?void 0:f.get(p.cols-1),b=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);b&&g&&(b.isWrapped=g[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&g[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new u;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}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}}l.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,g=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=g}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=d},9092:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const d=u(6349),p=u(7226),f=u(3734),g=u(8437),b=u(4634),S=u(511),k=u(643),x=u(4863),v=u(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(w,y,C){this._hasScrollback=w,this._optionsService=y,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=S.CellData.fromCharData([0,k.NULL_CELL_CHAR,k.NULL_CELL_WIDTH,k.NULL_CELL_CODE]),this._whitespaceCell=S.CellData.fromCharData([0,k.WHITESPACE_CELL_CHAR,k.WHITESPACE_CELL_WIDTH,k.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 d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(w){return w?(this._nullCell.fg=w.fg,this._nullCell.bg=w.bg,this._nullCell.extended=w.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(w){return w?(this._whitespaceCell.fg=w.fg,this._whitespaceCell.bg=w.bg,this._whitespaceCell.extended=w.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(w,y){return new g.BufferLine(this._bufferService.cols,this.getNullCell(w),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const w=this.ybase+this.y-this.ydisp;return w>=0&&wl.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:y}fillViewportRows(w){if(this.lines.length===0){w===void 0&&(w=g.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(w))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(w,y){const C=this.getNullCell(g.DEFAULT_ATTR_DATA);let N=0;const E=this._getCorrectBufferLength(y);if(E>this.lines.maxLength&&(this.lines.maxLength=E),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+j+1?(this.ybase--,j++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(w,C)));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(E0&&(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=E}this.x=Math.min(this.x,w-1),this.y=Math.min(this.y,y-1),j&&(this.y+=j),this.savedX=Math.min(this.savedX,w-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(w,y),this._cols>w))for(let j=0;j.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let w=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,w=!1);let y=0;for(;this._memoryCleanupPosition100)return!0;return w}get _isReflowEnabled(){const w=this._optionsService.rawOptions.windowsPty;return w&&w.buildNumber?this._hasScrollback&&w.backend==="conpty"&&w.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(w,y){this._cols!==w&&(w>this._cols?this._reflowLarger(w,y):this._reflowSmaller(w,y))}_reflowLarger(w,y){const C=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,w,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(C.length>0){const N=(0,b.reflowLargerCreateNewLayout)(this.lines,C);(0,b.reflowLargerApplyNewLayout)(this.lines,N.layout),this._reflowLargerAdjustViewport(w,y,N.countRemoved)}}_reflowLargerAdjustViewport(w,y,C){const N=this.getNullCell(g.DEFAULT_ATTR_DATA);let E=C;for(;E-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;j--){let T=this.lines.get(j);if(!T||!T.isWrapped&&T.getTrimmedLength()<=w)continue;const D=[T];for(;T.isWrapped&&j>0;)T=this.lines.get(--j),D.unshift(T);const I=this.ybase+this.y;if(I>=j&&I0&&(N.push({start:j+D.length+E,newLines:X}),E+=X.length),D.push(...X);let Y=F.length-1,Z=F[Y];Z===0&&(Y--,Z=F[Y]);let Q=D.length-U-1,z=$;for(;Q>=0;){const H=Math.min(z,Z);if(D[Y]===void 0)break;if(D[Y].copyCellsFrom(D[Q],z-H,Z-H,H,!0),Z-=H,Z===0&&(Y--,Z=F[Y]),z-=H,z===0){Q--;const V=Math.max(Q,0);z=(0,b.getWrappedLineTrimmedLength)(D,V,this._cols)}}for(let H=0;H0;)this.ybase===0?this.y0){const j=[],T=[];for(let Y=0;Y=0;Y--)if(F&&F.start>I+U){for(let Z=F.newLines.length-1;Z>=0;Z--)this.lines.set(Y--,F.newLines[Z]);Y++,j.push({index:I+1,amount:F.newLines.length}),U+=F.newLines.length,F=N[++$]}else this.lines.set(Y,T[I--]);let G=0;for(let Y=j.length-1;Y>=0;Y--)j[Y].index+=G,this.lines.onInsertEmitter.fire(j[Y]),G+=j[Y].amount;const X=Math.max(0,D+E-this.lines.maxLength);X>0&&this.lines.onTrimEmitter.fire(X)}}translateBufferLineToString(w,y,C=0,N){const E=this.lines.get(w);return E?E.translateToString(y,C,N):""}getWrappedRangeForLine(w){let y=w,C=w;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;C+10;);return w>=this._cols?this._cols-1:w<0?0:w}nextStop(w){for(w==null&&(w=this.x);!this.tabs[++w]&&w=this._cols?this._cols-1:w<0?0:w}clearMarkers(w){this._isClearing=!0;for(let y=0;y{y.line-=C,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((C=>{y.line>=C.index&&(y.line+=C.amount)}))),y.register(this.lines.onDelete((C=>{y.line>=C.index&&y.lineC.index&&(y.line-=C.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(w){this._isClearing||this.markers.splice(this.markers.indexOf(w),1)}}},8437:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const d=u(3734),p=u(511),f=u(643),g=u(482);l.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let b=0;class S{constructor(x,v,w=!1){this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*x);const y=v||p.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let C=0;C>22,2097152&v?this._combined[x].charCodeAt(this._combined[x].length-1):w]}set(x,v){this._data[3*x+1]=v[f.CHAR_DATA_ATTR_INDEX],v[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[x]=v[1],this._data[3*x+0]=2097152|x|v[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*x+0]=v[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(x){return this._data[3*x+0]>>22}hasWidth(x){return 12582912&this._data[3*x+0]}getFg(x){return this._data[3*x+1]}getBg(x){return this._data[3*x+2]}hasContent(x){return 4194303&this._data[3*x+0]}getCodePoint(x){const v=this._data[3*x+0];return 2097152&v?this._combined[x].charCodeAt(this._combined[x].length-1):2097151&v}isCombined(x){return 2097152&this._data[3*x+0]}getString(x){const v=this._data[3*x+0];return 2097152&v?this._combined[x]:2097151&v?(0,g.stringFromCodePoint)(2097151&v):""}isProtected(x){return 536870912&this._data[3*x+2]}loadCell(x,v){return b=3*x,v.content=this._data[b+0],v.fg=this._data[b+1],v.bg=this._data[b+2],2097152&v.content&&(v.combinedData=this._combined[x]),268435456&v.bg&&(v.extended=this._extendedAttrs[x]),v}setCell(x,v){2097152&v.content&&(this._combined[x]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[x]=v.extended),this._data[3*x+0]=v.content,this._data[3*x+1]=v.fg,this._data[3*x+2]=v.bg}setCellFromCodepoint(x,v,w,y){268435456&y.bg&&(this._extendedAttrs[x]=y.extended),this._data[3*x+0]=v|w<<22,this._data[3*x+1]=y.fg,this._data[3*x+2]=y.bg}addCodepointToCell(x,v,w){let y=this._data[3*x+0];2097152&y?this._combined[x]+=(0,g.stringFromCodePoint)(v):2097151&y?(this._combined[x]=(0,g.stringFromCodePoint)(2097151&y)+(0,g.stringFromCodePoint)(v),y&=-2097152,y|=2097152):y=v|4194304,w&&(y&=-12582913,y|=w<<22),this._data[3*x+0]=y}insertCells(x,v,w){if((x%=this.length)&&this.getWidth(x-1)===2&&this.setCellFromCodepoint(x-1,0,1,w),v=0;--C)this.setCell(x+v+C,this.loadCell(x+C,y));for(let C=0;Cthis.length){if(this._data.buffer.byteLength>=4*w)this._data=new Uint32Array(this._data.buffer,0,w);else{const y=new Uint32Array(w);y.set(this._data),this._data=y}for(let y=this.length;y=x&&delete this._combined[E]}const C=Object.keys(this._extendedAttrs);for(let N=0;N=x&&delete this._extendedAttrs[E]}}return this.length=x,4*w*2=0;--x)if(4194303&this._data[3*x+0])return x+(this._data[3*x+0]>>22);return 0}getNoBgTrimmedLength(){for(let x=this.length-1;x>=0;--x)if(4194303&this._data[3*x+0]||50331648&this._data[3*x+2])return x+(this._data[3*x+0]>>22);return 0}copyCellsFrom(x,v,w,y,C){const N=x._data;if(C)for(let j=y-1;j>=0;j--){for(let T=0;T<3;T++)this._data[3*(w+j)+T]=N[3*(v+j)+T];268435456&N[3*(v+j)+2]&&(this._extendedAttrs[w+j]=x._extendedAttrs[v+j])}else for(let j=0;j=v&&(this._combined[T-v+w]=x._combined[T])}}translateToString(x,v,w,y){v=v??0,w=w??this.length,x&&(w=Math.min(w,this.getTrimmedLength())),y&&(y.length=0);let C="";for(;v>22||1}return y&&y.push(v),C}}l.BufferLine=S},4841:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(o,l)=>{function u(d,p,f){if(p===d.length-1)return d[p].getTrimmedLength();const g=!d[p].hasContent(f-1)&&d[p].getWidth(f-1)===1,b=d[p+1].getWidth(0)===2;return g&&b?f-1:f}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(d,p,f,g,b){const S=[];for(let k=0;k=k&&g0&&(T>y||w[T].getTrimmedLength()===0);T--)j++;j>0&&(S.push(k+w.length-j),S.push(j)),k+=w.length-1}return S},l.reflowLargerCreateNewLayout=function(d,p){const f=[];let g=0,b=p[g],S=0;for(let k=0;ku(d,w,p))).reduce(((v,w)=>v+w));let S=0,k=0,x=0;for(;xv&&(S-=v,k++);const w=d[k].getWidth(S-1)===2;w&&S--;const y=w?f-1:f;g.push(y),x+=y}return g},l.getWrappedLineTrimmedLength=u},5295:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const d=u(8460),p=u(844),f=u(9092);class g extends p.Disposable{constructor(S,k){super(),this._optionsService=S,this._bufferService=k,this._onBufferActivate=this.register(new d.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 f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.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(S){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(S),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(S,k){this._normal.resize(S,k),this._alt.resize(S,k),this.setupTabStops(S)}setupTabStops(S){this._normal.setupTabStops(S),this._alt.setupTabStops(S)}}l.BufferSet=g},511:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const d=u(482),p=u(643),f=u(3734);class g extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(S){const k=new g;return k.setFromCharData(S),k}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let k=!1;if(S[p.CHAR_DATA_CHAR_INDEX].length>2)k=!0;else if(S[p.CHAR_DATA_CHAR_INDEX].length===2){const x=S[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=x&&x<=56319){const v=S[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(x-55296)+v-56320+65536|S[p.CHAR_DATA_WIDTH_INDEX]<<22:k=!0}else k=!0}else this.content=S[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[p.CHAR_DATA_WIDTH_INDEX]<<22;k&&(this.combinedData=S[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=g},643:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const d=u(8460),p=u(844);class f{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new d.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(b){return this._disposables.push(b),b}}l.Marker=f,f._nextId=1},7116:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.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:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(o,l)=>{var u,d,p;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=` -`,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(u||(l.C0=u={})),(function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"})(d||(l.C1=d={})),(function(f){f.ST=`${u.ESC}\\`})(p||(l.C1_ESCAPED=p={}))},7399:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const d=u(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:["'",'"']};l.evaluateKeyboardEvent=function(f,g,b,S){const k={type:0,cancel:!1,key:void 0},x=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?k.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?k.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?k.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(k.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:k.key=f.ctrlKey?"\b":d.C0.DEL,f.altKey&&(k.key=d.C0.ESC+k.key);break;case 9:if(f.shiftKey){k.key=d.C0.ESC+"[Z";break}k.key=d.C0.HT,k.cancel=!0;break;case 13:k.key=f.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,k.cancel=!0;break;case 27:k.key=d.C0.ESC,f.altKey&&(k.key=d.C0.ESC+d.C0.ESC),k.cancel=!0;break;case 37:if(f.metaKey)break;x?(k.key=d.C0.ESC+"[1;"+(x+1)+"D",k.key===d.C0.ESC+"[1;3D"&&(k.key=d.C0.ESC+(b?"b":"[1;5D"))):k.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(f.metaKey)break;x?(k.key=d.C0.ESC+"[1;"+(x+1)+"C",k.key===d.C0.ESC+"[1;3C"&&(k.key=d.C0.ESC+(b?"f":"[1;5C"))):k.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(f.metaKey)break;x?(k.key=d.C0.ESC+"[1;"+(x+1)+"A",b||k.key!==d.C0.ESC+"[1;3A"||(k.key=d.C0.ESC+"[1;5A")):k.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(f.metaKey)break;x?(k.key=d.C0.ESC+"[1;"+(x+1)+"B",b||k.key!==d.C0.ESC+"[1;3B"||(k.key=d.C0.ESC+"[1;5B")):k.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(k.key=d.C0.ESC+"[2~");break;case 46:k.key=x?d.C0.ESC+"[3;"+(x+1)+"~":d.C0.ESC+"[3~";break;case 36:k.key=x?d.C0.ESC+"[1;"+(x+1)+"H":g?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:k.key=x?d.C0.ESC+"[1;"+(x+1)+"F":g?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:f.shiftKey?k.type=2:f.ctrlKey?k.key=d.C0.ESC+"[5;"+(x+1)+"~":k.key=d.C0.ESC+"[5~";break;case 34:f.shiftKey?k.type=3:f.ctrlKey?k.key=d.C0.ESC+"[6;"+(x+1)+"~":k.key=d.C0.ESC+"[6~";break;case 112:k.key=x?d.C0.ESC+"[1;"+(x+1)+"P":d.C0.ESC+"OP";break;case 113:k.key=x?d.C0.ESC+"[1;"+(x+1)+"Q":d.C0.ESC+"OQ";break;case 114:k.key=x?d.C0.ESC+"[1;"+(x+1)+"R":d.C0.ESC+"OR";break;case 115:k.key=x?d.C0.ESC+"[1;"+(x+1)+"S":d.C0.ESC+"OS";break;case 116:k.key=x?d.C0.ESC+"[15;"+(x+1)+"~":d.C0.ESC+"[15~";break;case 117:k.key=x?d.C0.ESC+"[17;"+(x+1)+"~":d.C0.ESC+"[17~";break;case 118:k.key=x?d.C0.ESC+"[18;"+(x+1)+"~":d.C0.ESC+"[18~";break;case 119:k.key=x?d.C0.ESC+"[19;"+(x+1)+"~":d.C0.ESC+"[19~";break;case 120:k.key=x?d.C0.ESC+"[20;"+(x+1)+"~":d.C0.ESC+"[20~";break;case 121:k.key=x?d.C0.ESC+"[21;"+(x+1)+"~":d.C0.ESC+"[21~";break;case 122:k.key=x?d.C0.ESC+"[23;"+(x+1)+"~":d.C0.ESC+"[23~";break;case 123:k.key=x?d.C0.ESC+"[24;"+(x+1)+"~":d.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(b&&!S||!f.altKey||f.metaKey)!b||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?k.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(k.key=d.C0.US),f.key==="@"&&(k.key=d.C0.NUL)):f.keyCode===65&&(k.type=1);else{const v=p[f.keyCode],w=v==null?void 0:v[f.shiftKey?1:0];if(w)k.key=d.C0.ESC+w;else if(f.keyCode>=65&&f.keyCode<=90){const y=f.ctrlKey?f.keyCode-64:f.keyCode+32;let C=String.fromCharCode(y);f.shiftKey&&(C=C.toUpperCase()),k.key=d.C0.ESC+C}else if(f.keyCode===32)k.key=d.C0.ESC+(f.ctrlKey?d.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let y=f.code.slice(3,4);f.shiftKey||(y=y.toLowerCase()),k.key=d.C0.ESC+y,k.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?k.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?k.key=d.C0.NUL:f.keyCode>=51&&f.keyCode<=55?k.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?k.key=d.C0.DEL:f.keyCode===219?k.key=d.C0.ESC:f.keyCode===220?k.key=d.C0.FS:f.keyCode===221&&(k.key=d.C0.GS)}return k}},482:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},l.utf32ToString=function(u,d=0,p=u.length){let f="";for(let g=d;g65535?(b-=65536,f+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):f+=String.fromCharCode(b)}return f},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const p=u.length;if(!p)return 0;let f=0,g=0;if(this._interim){const b=u.charCodeAt(g++);56320<=b&&b<=57343?d[f++]=1024*(this._interim-55296)+b-56320+65536:(d[f++]=this._interim,d[f++]=b),this._interim=0}for(let b=g;b=p)return this._interim=S,f;const k=u.charCodeAt(b);56320<=k&&k<=57343?d[f++]=1024*(S-55296)+k-56320+65536:(d[f++]=S,d[f++]=k)}else S!==65279&&(d[f++]=S)}return f}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const p=u.length;if(!p)return 0;let f,g,b,S,k=0,x=0,v=0;if(this.interim[0]){let C=!1,N=this.interim[0];N&=(224&N)==192?31:(240&N)==224?15:7;let E,j=0;for(;(E=63&this.interim[++j])&&j<4;)N<<=6,N|=E;const T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,D=T-j;for(;v=p)return 0;if(E=u[v++],(192&E)!=128){v--,C=!0;break}this.interim[j++]=E,N<<=6,N|=63&E}C||(T===2?N<128?v--:d[k++]=N:T===3?N<2048||N>=55296&&N<=57343||N===65279||(d[k++]=N):N<65536||N>1114111||(d[k++]=N)),this.interim.fill(0)}const w=p-4;let y=v;for(;y=p)return this.interim[0]=f,k;if(g=u[y++],(192&g)!=128){y--;continue}if(x=(31&f)<<6|63&g,x<128){y--;continue}d[k++]=x}else if((240&f)==224){if(y>=p)return this.interim[0]=f,k;if(g=u[y++],(192&g)!=128){y--;continue}if(y>=p)return this.interim[0]=f,this.interim[1]=g,k;if(b=u[y++],(192&b)!=128){y--;continue}if(x=(15&f)<<12|(63&g)<<6|63&b,x<2048||x>=55296&&x<=57343||x===65279)continue;d[k++]=x}else if((248&f)==240){if(y>=p)return this.interim[0]=f,k;if(g=u[y++],(192&g)!=128){y--;continue}if(y>=p)return this.interim[0]=f,this.interim[1]=g,k;if(b=u[y++],(192&b)!=128){y--;continue}if(y>=p)return this.interim[0]=f,this.interim[1]=g,this.interim[2]=b,k;if(S=u[y++],(192&S)!=128){y--;continue}if(x=(7&f)<<18|(63&g)<<12|(63&b)<<6|63&S,x<65536||x>1114111)continue;d[k++]=x}}return k}}},225:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const d=u(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]],f=[[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 g;l.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let b=0;bk[w][1])return!1;for(;w>=v;)if(x=v+w>>1,S>k[x][1])v=x+1;else{if(!(S=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,S){let k=this.wcwidth(b),x=k===0&&S!==0;if(x){const v=d.UnicodeService.extractWidth(S);v===0?x=!1:v>k&&(k=v)}return d.UnicodeService.createPropertyValue(0,k,x)}}},5981:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const d=u(8460),p=u(844);class f extends p.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,S){if(S!==void 0&&this._syncCalls>S)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let k;for(this._isSyncWriting=!0;k=this._writeBuffer.shift();){this._action(k);const x=this._callbacks.shift();x&&x()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,S){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+=b.length,this._writeBuffer.push(b),this._callbacks.push(S),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(S)}_innerWrite(b=0,S=!0){const k=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const x=this._writeBuffer[this._bufferOffset],v=this._action(x,S);if(v){const y=C=>Date.now()-k>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(k,C);return void v.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(y)}const w=this._callbacks[this._bufferOffset];if(w&&w(),this._bufferOffset++,this._pendingData-=x.length,Date.now()-k>=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()}}l.WriteBuffer=f},5941:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const u=/^([\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})$/,d=/^[\da-f]+$/;function p(f,g){const b=f.toString(16),S=b.length<2?"0"+b:b;switch(g){case 4:return b[0];case 8:return S;case 12:return(S+S).slice(0,3);default:return S+S}}l.parseColor=function(f){if(!f)return;let g=f.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const b=u.exec(g);if(b){const S=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/S*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/S*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/S*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),d.exec(g)&&[3,6,9,12].includes(g.length))){const b=g.length/3,S=[0,0,0];for(let k=0;k<3;++k){const x=parseInt(g.slice(b*k,b*k+b),16);S[k]=b===1?x<<4:b===2?x:b===3?x>>4:x>>8}return S}},l.toRgbString=function(f,g=16){const[b,S,k]=f;return`rgb:${p(b,g)}/${p(S,g)}/${p(k,g)}`}},5770:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const d=u(482),p=u(8742),f=u(5770),g=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(S,k){this._handlers[S]===void 0&&(this._handlers[S]=[]);const x=this._handlers[S];return x.push(k),{dispose:()=>{const v=x.indexOf(k);v!==-1&&x.splice(v,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}reset(){if(this._active.length)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(S,k){if(this.reset(),this._ident=S,this._active=this._handlers[S]||g,this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].hook(k);else this._handlerFb(this._ident,"HOOK",k)}put(S,k,x){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(S,k,x);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(S,k,x))}unhook(S,k=!0){if(this._active.length){let x=!1,v=this._active.length-1,w=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,x=k,w=this._stack.fallThrough,this._stack.paused=!1),!w&&x===!1){for(;v>=0&&(x=this._active[v].unhook(S),x!==!0);v--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,x;v--}for(;v>=0;v--)if(x=this._active[v].unhook(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,x}else this._handlerFb(this._ident,"UNHOOK",S);this._active=g,this._ident=0}};const b=new p.Params;b.addParam(0),l.DcsHandler=class{constructor(S){this._handler=S,this._data="",this._params=b,this._hitLimit=!1}hook(S){this._params=S.length>1||S.params[0]?S.clone():b,this._data="",this._hitLimit=!1}put(S,k,x){this._hitLimit||(this._data+=(0,d.utf32ToString)(S,k,x),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(S){let k=!1;if(this._hitLimit)k=!1;else if(S&&(k=this._handler(this._data,this._params),k instanceof Promise))return k.then((x=>(this._params=b,this._data="",this._hitLimit=!1,x)));return this._params=b,this._data="",this._hitLimit=!1,k}}},2015:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const d=u(844),p=u(8742),f=u(6242),g=u(6351);class b{constructor(v){this.table=new Uint8Array(v)}setDefault(v,w){this.table.fill(v<<4|w)}add(v,w,y,C){this.table[w<<8|v]=y<<4|C}addMany(v,w,y,C){for(let N=0;NT)),w=(j,T)=>v.slice(j,T),y=w(32,127),C=w(0,24);C.push(25),C.push.apply(C,w(28,32));const N=w(0,14);let E;for(E in x.setDefault(1,0),x.addMany(y,0,2,0),N)x.addMany([24,26,153,154],E,3,0),x.addMany(w(128,144),E,3,0),x.addMany(w(144,152),E,3,0),x.add(156,E,0,0),x.add(27,E,11,1),x.add(157,E,4,8),x.addMany([152,158,159],E,0,7),x.add(155,E,11,3),x.add(144,E,11,9);return x.addMany(C,0,3,0),x.addMany(C,1,3,1),x.add(127,1,0,1),x.addMany(C,8,0,8),x.addMany(C,3,3,3),x.add(127,3,0,3),x.addMany(C,4,3,4),x.add(127,4,0,4),x.addMany(C,6,3,6),x.addMany(C,5,3,5),x.add(127,5,0,5),x.addMany(C,2,3,2),x.add(127,2,0,2),x.add(93,1,4,8),x.addMany(y,8,5,8),x.add(127,8,5,8),x.addMany([156,27,24,26,7],8,6,0),x.addMany(w(28,32),8,0,8),x.addMany([88,94,95],1,0,7),x.addMany(y,7,0,7),x.addMany(C,7,0,7),x.add(156,7,0,0),x.add(127,7,0,7),x.add(91,1,11,3),x.addMany(w(64,127),3,7,0),x.addMany(w(48,60),3,8,4),x.addMany([60,61,62,63],3,9,4),x.addMany(w(48,60),4,8,4),x.addMany(w(64,127),4,7,0),x.addMany([60,61,62,63],4,0,6),x.addMany(w(32,64),6,0,6),x.add(127,6,0,6),x.addMany(w(64,127),6,0,0),x.addMany(w(32,48),3,9,5),x.addMany(w(32,48),5,9,5),x.addMany(w(48,64),5,0,6),x.addMany(w(64,127),5,7,0),x.addMany(w(32,48),4,9,5),x.addMany(w(32,48),1,9,2),x.addMany(w(32,48),2,9,2),x.addMany(w(48,127),2,10,0),x.addMany(w(48,80),1,10,0),x.addMany(w(81,88),1,10,0),x.addMany([89,90,92],1,10,0),x.addMany(w(96,127),1,10,0),x.add(80,1,11,9),x.addMany(C,9,0,9),x.add(127,9,0,9),x.addMany(w(28,32),9,0,9),x.addMany(w(32,48),9,9,12),x.addMany(w(48,60),9,8,10),x.addMany([60,61,62,63],9,9,10),x.addMany(C,11,0,11),x.addMany(w(32,128),11,0,11),x.addMany(w(28,32),11,0,11),x.addMany(C,10,0,10),x.add(127,10,0,10),x.addMany(w(28,32),10,0,10),x.addMany(w(48,60),10,8,10),x.addMany([60,61,62,63],10,0,11),x.addMany(w(32,48),10,9,12),x.addMany(C,12,0,12),x.add(127,12,0,12),x.addMany(w(28,32),12,0,12),x.addMany(w(32,48),12,9,12),x.addMany(w(48,64),12,0,11),x.addMany(w(64,127),12,12,13),x.addMany(w(64,127),10,12,13),x.addMany(w(64,127),9,12,13),x.addMany(C,13,13,13),x.addMany(y,13,13,13),x.add(127,13,0,13),x.addMany([27,156,24,26],13,14,0),x.add(S,0,2,0),x.add(S,8,5,8),x.add(S,6,0,6),x.add(S,11,0,11),x.add(S,13,13,13),x})();class k extends d.Disposable{constructor(v=l.VT500_TRANSITION_TABLE){super(),this._transitions=v,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=(w,y,C)=>{},this._executeHandlerFb=w=>{},this._csiHandlerFb=(w,y)=>{},this._escHandlerFb=w=>{},this._errorHandlerFb=w=>w,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,w=[64,126]){let y=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=v.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(v.intermediates){if(v.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let N=0;NE||E>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=E}}if(v.final.length!==1)throw new Error("final must be a single byte");const C=v.final.charCodeAt(0);if(w[0]>C||C>w[1])throw new Error(`final must be in range ${w[0]} .. ${w[1]}`);return y<<=8,y|=C,y}identToString(v){const w=[];for(;v;)w.push(String.fromCharCode(255&v)),v>>=8;return w.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,w){const y=this._identifier(v,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const C=this._escHandlers[y];return C.push(w),{dispose:()=>{const N=C.indexOf(w);N!==-1&&C.splice(N,1)}}}clearEscHandler(v){this._escHandlers[this._identifier(v,[48,126])]&&delete this._escHandlers[this._identifier(v,[48,126])]}setEscHandlerFallback(v){this._escHandlerFb=v}setExecuteHandler(v,w){this._executeHandlers[v.charCodeAt(0)]=w}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,w){const y=this._identifier(v);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const C=this._csiHandlers[y];return C.push(w),{dispose:()=>{const N=C.indexOf(w);N!==-1&&C.splice(N,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,w){return this._dcsParser.registerHandler(this._identifier(v),w)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,w){return this._oscParser.registerHandler(v,w)}clearOscHandler(v){this._oscParser.clearHandler(v)}setOscHandlerFallback(v){this._oscParser.setHandlerFallback(v)}setErrorHandler(v){this._errorHandler=v}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(v,w,y,C,N){this._parseStack.state=v,this._parseStack.handlers=w,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=N}parse(v,w,y){let C,N=0,E=0,j=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,j=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 D=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&D>-1){for(;D>=0&&(C=T[D](this._params),C!==!0);D--)if(C instanceof Promise)return this._parseStack.handlerPos=D,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&D>-1){for(;D>=0&&(C=T[D](),C!==!0);D--)if(C instanceof Promise)return this._parseStack.handlerPos=D,C}this._parseStack.handlers=[];break;case 6:if(N=v[this._parseStack.chunkPos],C=this._dcsParser.unhook(N!==24&&N!==26,y),C)return C;N===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(N=v[this._parseStack.chunkPos],C=this._oscParser.end(N!==24&&N!==26,y),C)return C;N===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,j=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let T=j;T>4){case 2:for(let U=T+1;;++U){if(U>=w||(N=v[U])<32||N>126&&N=w||(N=v[U])<32||N>126&&N=w||(N=v[U])<32||N>126&&N=w||(N=v[U])<32||N>126&&N=0&&(C=D[I](this._params),C!==!0);I--)if(C instanceof Promise)return this._preserveStack(3,D,I,E,T),C;I<0&&this._csiHandlerFb(this._collect<<8|N,this._params),this.precedingJoinState=0;break;case 8:do switch(N){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(N-48)}while(++T47&&N<60);T--;break;case 9:this._collect<<=8,this._collect|=N;break;case 10:const $=this._escHandlers[this._collect<<8|N];let F=$?$.length-1:-1;for(;F>=0&&(C=$[F](),C!==!0);F--)if(C instanceof Promise)return this._preserveStack(4,$,F,E,T),C;F<0&&this._escHandlerFb(this._collect<<8|N),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|N,this._params);break;case 13:for(let U=T+1;;++U)if(U>=w||(N=v[U])===24||N===26||N===27||N>127&&N=w||(N=v[U])<32||N>127&&N{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const d=u(5770),p=u(482),f=[];l.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,b){this._handlers[g]===void 0&&(this._handlers[g]=[]);const S=this._handlers[g];return S.push(b),{dispose:()=>{const k=S.indexOf(b);k!==-1&&S.splice(k,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,b,S){if(this._active.length)for(let k=this._active.length-1;k>=0;k--)this._active[k].put(g,b,S);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(g,b,S))}start(){this.reset(),this._state=1}put(g,b,S){if(this._state!==3){if(this._state===1)for(;b0&&this._put(g,b,S)}}end(g,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let S=!1,k=this._active.length-1,x=!1;if(this._stack.paused&&(k=this._stack.loopPosition-1,S=b,x=this._stack.fallThrough,this._stack.paused=!1),!x&&S===!1){for(;k>=0&&(S=this._active[k].end(g),S!==!0);k--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=k,this._stack.fallThrough=!1,S;k--}for(;k>=0;k--)if(S=this._active[k].end(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=k,this._stack.fallThrough=!0,S}else this._handlerFb(this._id,"END",g);this._active=f,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,b,S){this._hitLimit||(this._data+=(0,p.utf32ToString)(g,b,S),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let b=!1;if(this._hitLimit)b=!1;else if(g&&(b=this._handler(this._data),b instanceof Promise))return b.then((S=>(this._data="",this._hitLimit=!1,S)));return this._data="",this._hitLimit=!1,b}}},8742:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const u=2147483647;class d{static fromArray(f){const g=new d;if(!f.length)return g;for(let b=Array.isArray(f[0])?1:0;b256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new d(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let g=0;g>8,S=255&this._subParamsIdx[g];S-b>0&&f.push(Array.prototype.slice.call(this._subParams,b,S))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>u?u:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>u?u:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const g=this._subParamsIdx[f]>>8,b=255&this._subParamsIdx[f];return b-g>0?this._subParams.subarray(g,b):null}getSubParamsAll(){const f={};for(let g=0;g>8,S=255&this._subParamsIdx[g];S-b>0&&(f[g]=this._subParams.slice(b,S))}return f}addDigit(f){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,S=b[g-1];b[g-1]=~S?Math.min(10*S+f,u):f}}l.Params=d},5741:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const p={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(p),d.dispose=()=>this._wrappedAddonDispose(p),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let p=0;p{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const d=u(3785),p=u(511);l.BufferApiView=class{constructor(f,g){this._buffer=f,this.type=g}init(f){return this._buffer=f,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(f){const g=this._buffer.lines.get(f);if(g)return new d.BufferLineApiView(g)}getNullCell(){return new p.CellData}}},3785:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const d=u(511);l.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,f){if(!(p<0||p>=this._line.length))return f?(this._line.loadCell(p,f),f):this._line.loadCell(p,new d.CellData)}translateToString(p,f,g){return this._line.translateToString(p,f,g)}}},8285:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const d=u(8771),p=u(8460),f=u(844);class g extends f.Disposable{constructor(S){super(),this._core=S,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.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)}}l.BufferNamespaceApi=g},7975:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,(p=>d(p.toArray())))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,((p,f)=>d(p,f.toArray())))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(o,l,u){var d=this&&this.__decorate||function(x,v,w,y){var C,N=arguments.length,E=N<3?v:y===null?y=Object.getOwnPropertyDescriptor(v,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(x,v,w,y);else for(var j=x.length-1;j>=0;j--)(C=x[j])&&(E=(N<3?C(E):N>3?C(v,w,E):C(v,w))||E);return N>3&&E&&Object.defineProperty(v,w,E),E},p=this&&this.__param||function(x,v){return function(w,y){v(w,y,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const f=u(8460),g=u(844),b=u(5295),S=u(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let k=l.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(x){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(x.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(x.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(x,this))}resize(x,v){this.cols=x,this.rows=v,this.buffers.resize(x,v),this._onResize.fire({cols:x,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(x,v=!1){const w=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===x.fg&&y.getBg(0)===x.bg||(y=w.getBlankLine(x,v),this._cachedBlankLine=y),y.isWrapped=v;const C=w.ybase+w.scrollTop,N=w.ybase+w.scrollBottom;if(w.scrollTop===0){const E=w.lines.isFull;N===w.lines.length-1?E?w.lines.recycle().copyFrom(y):w.lines.push(y.clone()):w.lines.splice(N+1,0,y.clone()),E?this.isUserScrolling&&(w.ydisp=Math.max(w.ydisp-1,0)):(w.ybase++,this.isUserScrolling||w.ydisp++)}else{const E=N-C+1;w.lines.shiftElements(C+1,E-1,-1),w.lines.set(N,y.clone())}this.isUserScrolling||(w.ydisp=w.ybase),this._onScroll.fire(w.ydisp)}scrollLines(x,v,w){const y=this.buffer;if(x<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else x+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const C=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+x,y.ybase),0),C!==y.ydisp&&(v||this._onScroll.fire(y.ydisp))}};l.BufferService=k=d([p(0,S.IOptionsService)],k)},7994:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(o,l,u){var d=this&&this.__decorate||function(y,C,N,E){var j,T=arguments.length,D=T<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,N):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,C,N,E);else for(var I=y.length-1;I>=0;I--)(j=y[I])&&(D=(T<3?j(D):T>3?j(C,N,D):j(C,N))||D);return T>3&&D&&Object.defineProperty(C,N,D),D},p=this&&this.__param||function(y,C){return function(N,E){C(N,E,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const f=u(2585),g=u(8460),b=u(844),S={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 k(y,C){let N=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(N|=64,N|=y.action):(N|=3&y.button,4&y.button&&(N|=64),8&y.button&&(N|=128),y.action===32?N|=32:y.action!==0||C||(N|=3)),N}const x=String.fromCharCode,v={DEFAULT:y=>{const C=[k(y,!1)+32,y.col+32,y.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${x(C[0])}${x(C[1])}${x(C[2])}`},SGR:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${k(y,!0)};${y.col};${y.row}${C}`},SGR_PIXELS:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${k(y,!0)};${y.x};${y.y}${C}`}};let w=l.CoreMouseService=class extends b.Disposable{constructor(y,C){super(),this._bufferService=y,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const N of Object.keys(S))this.addProtocol(N,S[N]);for(const N of Object.keys(v))this.addEncoding(N,v[N]);this.reset()}addProtocol(y,C){this._protocols[y]=C}addEncoding(y,C){this._encodings[y]=C}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 C=this._encodings[this._activeEncoding](y);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!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,C,N){if(N){if(y.x!==C.x||y.y!==C.y)return!1}else if(y.col!==C.col||y.row!==C.row)return!1;return y.button===C.button&&y.action===C.action&&y.ctrl===C.ctrl&&y.alt===C.alt&&y.shift===C.shift}};l.CoreMouseService=w=d([p(0,f.IBufferService),p(1,f.ICoreService)],w)},6975:function(o,l,u){var d=this&&this.__decorate||function(w,y,C,N){var E,j=arguments.length,T=j<3?y:N===null?N=Object.getOwnPropertyDescriptor(y,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,C,N);else for(var D=w.length-1;D>=0;D--)(E=w[D])&&(T=(j<3?E(T):j>3?E(y,C,T):E(y,C))||T);return j>3&&T&&Object.defineProperty(y,C,T),T},p=this&&this.__param||function(w,y){return function(C,N){y(C,N,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const f=u(1439),g=u(8460),b=u(844),S=u(2585),k=Object.freeze({insertMode:!1}),x=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=l.CoreService=class extends b.Disposable{constructor(w,y,C){super(),this._bufferService=w,this._logService=y,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(k),this.decPrivateModes=(0,f.clone)(x)}reset(){this.modes=(0,f.clone)(k),this.decPrivateModes=(0,f.clone)(x)}triggerDataEvent(w,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${w}"`,(()=>w.split("").map((N=>N.charCodeAt(0))))),this._onData.fire(w)}triggerBinaryEvent(w){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${w}"`,(()=>w.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(w))}};l.CoreService=v=d([p(0,S.IBufferService),p(1,S.ILogService),p(2,S.IOptionsService)],v)},9074:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const d=u(8055),p=u(8460),f=u(844),g=u(6106);let b=0,S=0;class k extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((w=>w==null?void 0:w.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,f.toDisposable)((()=>this.reset())))}registerDecoration(w){if(w.marker.isDisposed)return;const y=new x(w);if(y){const C=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),C.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const w of this._decorations.values())w.dispose();this._decorations.clear()}*getDecorationsAtCell(w,y,C){let N=0,E=0;for(const j of this._decorations.getKeyIterator(y))N=j.options.x??0,E=N+(j.options.width??1),w>=N&&w{b=E.options.x??0,S=b+(E.options.width??1),w>=b&&w{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const d=u(2585),p=u(8343);class f{constructor(...b){this._entries=new Map;for(const[S,k]of b)this.set(S,k)}set(b,S){const k=this._entries.get(b);return this._entries.set(b,S),k}forEach(b){for(const[S,k]of this._entries.entries())b(S,k)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}l.ServiceCollection=f,l.InstantiationService=class{constructor(){this._services=new f,this._services.set(d.IInstantiationService,this)}setService(g,b){this._services.set(g,b)}getService(g){return this._services.get(g)}createInstance(g,...b){const S=(0,p.getServiceDependencies)(g).sort(((v,w)=>v.index-w.index)),k=[];for(const v of S){const w=this._services.get(v.id);if(!w)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${v.id}.`);k.push(w)}const x=S.length>0?S[0].index:b.length;if(b.length!==x)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${x+1} conflicts with ${b.length} static arguments`);return new g(...b,...k)}}},7866:function(o,l,u){var d=this&&this.__decorate||function(x,v,w,y){var C,N=arguments.length,E=N<3?v:y===null?y=Object.getOwnPropertyDescriptor(v,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(x,v,w,y);else for(var j=x.length-1;j>=0;j--)(C=x[j])&&(E=(N<3?C(E):N>3?C(v,w,E):C(v,w))||E);return N>3&&E&&Object.defineProperty(v,w,E),E},p=this&&this.__param||function(x,v){return function(w,y){v(w,y,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const f=u(844),g=u(2585),b={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let S,k=l.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(x){super(),this._optionsService=x,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),S=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(x){for(let v=0;vJSON.stringify(E))).join(", ")})`);const N=y.apply(this,C);return S.trace(`GlyphRenderer#${y.name} return`,N),N}}},7302:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const d=u(8460),p=u(844),f=u(6114);l.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:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends p.Disposable{constructor(k){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const x={...l.DEFAULT_OPTIONS};for(const v in k)if(v in x)try{const w=k[v];x[v]=this._sanitizeAndValidateOption(v,w)}catch(w){console.error(w)}this.rawOptions=x,this.options={...x},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(k,x){return this.onOptionChange((v=>{v===k&&x(this.rawOptions[k])}))}onMultipleOptionChange(k,x){return this.onOptionChange((v=>{k.indexOf(v)!==-1&&x()}))}_setupOptions(){const k=v=>{if(!(v in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},x=(v,w)=>{if(!(v in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);w=this._sanitizeAndValidateOption(v,w),this.rawOptions[v]!==w&&(this.rawOptions[v]=w,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const w={get:k.bind(this,v),set:x.bind(this,v)};Object.defineProperty(this.options,v,w)}}_sanitizeAndValidateOption(k,x){switch(k){case"cursorStyle":if(x||(x=l.DEFAULT_OPTIONS[k]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(x))throw new Error(`"${x}" is not a valid value for ${k}`);break;case"wordSeparator":x||(x=l.DEFAULT_OPTIONS[k]);break;case"fontWeight":case"fontWeightBold":if(typeof x=="number"&&1<=x&&x<=1e3)break;x=g.includes(x)?x:l.DEFAULT_OPTIONS[k];break;case"cursorWidth":x=Math.floor(x);case"lineHeight":case"tabStopWidth":if(x<1)throw new Error(`${k} cannot be less than 1, value: ${x}`);break;case"minimumContrastRatio":x=Math.max(1,Math.min(21,Math.round(10*x)/10));break;case"scrollback":if((x=Math.min(x,4294967295))<0)throw new Error(`${k} cannot be less than 0, value: ${x}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(x<=0)throw new Error(`${k} cannot be less than or equal to 0, value: ${x}`);break;case"rows":case"cols":if(!x&&x!==0)throw new Error(`${k} must be numeric, value: ${x}`);break;case"windowsPty":x=x??{}}return x}}l.OptionsService=b},2660:function(o,l,u){var d=this&&this.__decorate||function(b,S,k,x){var v,w=arguments.length,y=w<3?S:x===null?x=Object.getOwnPropertyDescriptor(S,k):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(b,S,k,x);else for(var C=b.length-1;C>=0;C--)(v=b[C])&&(y=(w<3?v(y):w>3?v(S,k,y):v(S,k))||y);return w>3&&y&&Object.defineProperty(S,k,y),y},p=this&&this.__param||function(b,S){return function(k,x){S(k,x,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const f=u(2585);let g=l.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const S=this._bufferService.buffer;if(b.id===void 0){const C=S.addMarker(S.ybase+S.y),N={data:b,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(N,C))),this._dataByLinkId.set(N.id,N),N.id}const k=b,x=this._getEntryIdKey(k),v=this._entriesWithId.get(x);if(v)return this.addLineToLink(v.id,S.ybase+S.y),v.id;const w=S.addMarker(S.ybase+S.y),y={id:this._nextId++,key:this._getEntryIdKey(k),data:k,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(y,w))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(b,S){const k=this._dataByLinkId.get(b);if(k&&k.lines.every((x=>x.line!==S))){const x=this._bufferService.buffer.addMarker(S);k.lines.push(x),x.onDispose((()=>this._removeMarkerFromLink(k,x)))}}getLinkData(b){var S;return(S=this._dataByLinkId.get(b))==null?void 0:S.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,S){const k=b.lines.indexOf(S);k!==-1&&(b.lines.splice(k,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};l.OscLinkService=g=d([p(0,f.IBufferService)],g)},8343:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const u="di$target",d="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(p){return p[d]||[]},l.createDecorator=function(p){if(l.serviceRegistry.has(p))return l.serviceRegistry.get(p);const f=function(g,b,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(k,x,v){x[u]===x?x[d].push({id:k,index:v}):(x[d]=[{id:k,index:v}],x[u]=x)})(f,g,S)};return f.toString=()=>p,l.serviceRegistry.set(p,f),f}},2585:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const d=u(8343);var p;l.IBufferService=(0,d.createDecorator)("BufferService"),l.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),l.ICoreService=(0,d.createDecorator)("CoreService"),l.ICharsetService=(0,d.createDecorator)("CharsetService"),l.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(p||(l.LogLevelEnum=p={})),l.ILogService=(0,d.createDecorator)("LogService"),l.IOptionsService=(0,d.createDecorator)("OptionsService"),l.IOscLinkService=(0,d.createDecorator)("OscLinkService"),l.IUnicodeService=(0,d.createDecorator)("UnicodeService"),l.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const d=u(8460),p=u(225);class f{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,S,k=!1){return(16777215&b)<<3|(3&S)<<1|(k?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const b=new p.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let S=0,k=0;const x=b.length;for(let v=0;v=x)return S+this.wcwidth(w);const N=b.charCodeAt(v);56320<=N&&N<=57343?w=1024*(w-55296)+N-56320+65536:S+=this.wcwidth(N)}const y=this.charProperties(w,k);let C=f.extractWidth(y);f.extractShouldJoin(y)&&(C-=f.extractWidth(k)),S+=C,k=y}return S}charProperties(b,S){return this._activeProvider.charProperties(b,S)}}l.UnicodeService=f}},r={};function i(o){var l=r[o];if(l!==void 0)return l.exports;var u=r[o]={exports:{}};return n[o].call(u.exports,u,u.exports,i),u.exports}var a={};return(()=>{var o=a;Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const l=i(9042),u=i(3236),d=i(844),p=i(5741),f=i(8285),g=i(7975),b=i(7090),S=["cols","rows"];class k extends d.Disposable{constructor(v){super(),this._core=this.register(new u.Terminal(v)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const w=C=>this._core.options[C],y=(C,N)=>{this._checkReadonlyOptions(C),this._core.options[C]=N};for(const C in this._core.options){const N={get:w.bind(this,C),set:y.bind(this,C)};Object.defineProperty(this._publicOptions,C,N)}}_checkReadonlyOptions(v){if(S.includes(v))throw new Error(`Option "${v}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.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 f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const v=this._core.coreService.decPrivateModes;let w="none";switch(this._core.coreMouseService.activeProtocol){case"X10":w="x10";break;case"VT200":w="vt200";break;case"DRAG":w="drag";break;case"ANY":w="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:w,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const w in v)this._publicOptions[w]=v[w]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,w=!0){this._core.input(v,w)}resize(v,w){this._verifyIntegers(v,w),this._core.resize(v,w)}open(v){this._core.open(v)}attachCustomKeyEventHandler(v){this._core.attachCustomKeyEventHandler(v)}attachCustomWheelEventHandler(v){this._core.attachCustomWheelEventHandler(v)}registerLinkProvider(v){return this._core.registerLinkProvider(v)}registerCharacterJoiner(v){return this._checkProposedApi(),this._core.registerCharacterJoiner(v)}deregisterCharacterJoiner(v){this._checkProposedApi(),this._core.deregisterCharacterJoiner(v)}registerMarker(v=0){return this._verifyIntegers(v),this._core.registerMarker(v)}registerDecoration(v){return this._checkProposedApi(),this._verifyPositiveIntegers(v.x??0,v.width??0,v.height??0),this._core.registerDecoration(v)}hasSelection(){return this._core.hasSelection()}select(v,w,y){this._verifyIntegers(v,w,y),this._core.select(v,w,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,w){this._verifyIntegers(v,w),this._core.selectLines(v,w)}dispose(){super.dispose()}scrollLines(v){this._verifyIntegers(v),this._core.scrollLines(v)}scrollPages(v){this._verifyIntegers(v),this._core.scrollPages(v)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(v){this._verifyIntegers(v),this._core.scrollToLine(v)}clear(){this._core.clear()}write(v,w){this._core.write(v,w)}writeln(v,w){this._core.write(v),this._core.write(`\r -`,w)}paste(v){this._core.paste(v)}refresh(v,w){this._verifyIntegers(v,w),this._core.refresh(v,w)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return l}_verifyIntegers(...v){for(const w of v)if(w===1/0||isNaN(w)||w%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const w of v)if(w&&(w===1/0||isNaN(w)||w%1!=0||w<0))throw new Error("This API only accepts positive integers")}}o.Terminal=k})(),a})()))})(ab)),ab.exports}var iZ=rZ();function S7(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r{const n=t.current;if(!n)return;const r=new iZ.Terminal({convertEol:!0,disableStdin:!0,fontSize:12,fontFamily:getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:"#1a1a1a",foreground:"#e6e1e0",cursor:"#1a1a1a",selectionBackground:"#2c3441"}}),i=new nZ.FitAddon;r.loadAddon(i),r.open(n);try{i.fit()}catch{}const a=new ResizeObserver(()=>{try{i.fit()}catch{}});a.observe(n);let o=!1,l=0,u=!1,d=!1;async function p(){if(u){d=!0;return}u=!0;try{for(;;){const g=await BR(e,l);if(o)return;if(g.dataBase64&&r.write(S7(g.dataBase64)),l=g.nextOffset,g.eof)break}}catch{}finally{u=!1,d&&!o&&(d=!1,p())}}const f=eL(e,g=>{if(o)return;const b=S7(g.dataBase64);!u&&g.offset===l?(r.write(b),l+=b.length):g.offset+b.length>l&&p()});return p(),()=>{o=!0,f(),a.disconnect(),r.dispose()}},[e]),h.jsx("div",{ref:t,style:{width:"100%",height:"100%"}})}function aZ({experiment:e,project:t,view:n,runs:r,selectedRunId:i,onSelectRun:a,parentExperiment:o,onOpenView:l,onOpenCode:u}){const d=r.filter(p=>p.experimentId===e.id).sort((p,f)=>f.createdAt-p.createdAt);return n==="overview"?h.jsx(eZ,{experiment:e,parentExperiment:o,project:t,runs:d,onOpenLogs:p=>l("terminal",p),onOpenCode:()=>u("files")}):h.jsx(oZ,{experiment:e,expRuns:d,selectedRunId:i,onSelectRun:a})}function oZ({experiment:e,expRuns:t,selectedRunId:n,onSelectRun:r}){const[i,a]=R.useState(null),[o,l]=R.useState(null),[u,d]=R.useState(!1),p=R.useRef(null),f=n&&t.find(v=>v.id===n)||t[0]||null,g=(f==null?void 0:f.status)==="running"||(f==null?void 0:f.status)==="starting",b=!!(f&&g&&(f.cancelRequested||o===f.id)),S=v=>{const w=t.findIndex(y=>y.id===v);return w===-1?t.length:t.length-w},k=R.useRef(null);R.useEffect(()=>{if(k.current===null){k.current=new Set(t.map(w=>w.id));return}const v=t.find(w=>!k.current.has(w.id));for(const w of t)k.current.add(w.id);v&&r(v.id)},[t,r]),R.useEffect(()=>{if(!u)return;const v=w=>{var y;(y=p.current)!=null&&y.contains(w.target)||d(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[u]);async function x(){if(f){a(null),l(f.id);try{await fS(f.id)}catch(v){l(null),a(v instanceof Error?v.message:String(v))}}}return h.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[h.jsxs("div",{className:"term-bar flex items-center gap-2 h-10 py-0 px-2.5 border-b border-b-border shrink-0 [&_.error]:text-sm [&_.error]:text-accent-red [&_.btn]:inline-flex [&_.btn]:items-center [&_.btn]:gap-[5px]",children:[h.jsx("div",{className:"term-title min-w-0 text-md font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),h.jsx("span",{style:{flex:1}}),i&&h.jsx("span",{className:"error",role:"alert",children:i}),g&&h.jsxs("button",{className:`${Kn} ghost`,disabled:b,onClick:()=>void x(),children:[h.jsx(X8,{size:13}),b?"Cancelling…":"Stop"]}),t.length>0&&f&&h.jsxs("div",{className:"run-history relative shrink-0",ref:p,children:[h.jsxs("button",{className:"run-picker inline-flex items-center gap-2 pt-1 pr-1.5 pb-1 pl-2.5 border border-border rounded-md bg-background text-text [&:hover]:bg-surface [&_.run-label]:text-sm [&_.run-label]:font-semibold",title:"Switch run",onClick:()=>d(v=>!v),children:[h.jsxs("span",{className:"run-label",children:["Run ",S(f.id)]}),h.jsx(Ma,{status:b?"cancelling":ss(f)}),h.jsx(Rl,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),u&&h.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] right-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] p-[5px] z-50",children:t.map(v=>h.jsxs("button",{className:`history-item flex items-center gap-2 w-full text-left py-1.5 px-2 text-sm rounded-sm [&:hover]:bg-surface [&.active]:bg-surface [&_.run-label]:font-semibold [&_.when]:ml-auto [&_.when]:text-xs [&_.when]:text-muted ${v.id===(f==null?void 0:f.id)?"active":""}`,onClick:()=>{r(v.id),d(!1)},children:[h.jsxs("span",{className:"run-label",children:["Run ",S(v.id)]}),h.jsx(Ma,{status:ss(v)}),h.jsx("span",{className:"when",children:Gs(v.createdAt)})]},v.id))})]})]}),h.jsx("div",{className:"term-fill flex-1 min-h-0 bg-[var(--term-bg)] pt-1 pr-0 pb-1 pl-1.5",children:f?h.jsx(sZ,{runId:f.id},f.id):h.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-md text-muted",children:"No runs yet — ask the agent to launch one."})})]})}function lZ({value:e,onChange:t,onSave:n,onBlur:r,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:l}){const u=R.useMemo(()=>Zk(e,J_(i)),[e,i]),{ruleCh:d,codeCh:p}=_E(u.length),f=R.useRef(null),g=R.useRef(null),b=()=>{const x=f.current;x&&g.current&&(g.current.scrollTop=x.scrollTop)};R.useLayoutEffect(b,[e]),R.useLayoutEffect(()=>{var N;const x=f.current;if(!x||!a)return;const v=e.split(` -`),w=Math.min(Math.max(Math.trunc(a),1),v.length);let y=0;for(let E=0;E{if((x.metaKey||x.ctrlKey)&&x.key.toLowerCase()==="s"){x.preventDefault(),n();return}if(x.key==="Tab"){x.preventDefault();const v=x.currentTarget,{selectionStart:w,selectionEnd:y}=v,C=e.slice(0,w)+" "+e.slice(y);t(C),requestAnimationFrame(()=>{v.selectionStart=v.selectionEnd=w+1})}},k=`absolute inset-0 m-0 py-3.5 pr-4 ${Gf} ${bE} [scrollbar-gutter:stable]`;return h.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${Gf}`,children:[h.jsx("div",{className:"absolute left-0 top-0 bottom-0 border-r border-r-border-variant pointer-events-none",style:{width:`${d}ch`},"aria-hidden":"true"}),h.jsx("div",{ref:g,className:`file-view-code ${k} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:u.map((x,v)=>h.jsxs("div",{"data-line":v+1,className:"relative",style:{paddingLeft:`${p}ch`},children:[h.jsx("span",{className:`${vE} absolute left-0 pr-[1ch]`,style:{width:`${d}ch`},children:v+1}),Qk(x)?h.jsx("br",{}):x]},v))}),h.jsx("textarea",{ref:f,className:`file-view-editarea ${k} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-[var(--text)] outline-none`,style:{paddingLeft:`${p}ch`},value:e,onChange:x=>t(x.target.value),onScroll:b,onKeyDown:S,onBlur:r,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function cZ({projectId:e,path:t,source:n="repo",sessionId:r,gitRef:i,line:a,branchLabel:o,onOpenFile:l,scrollPosition:u,onScrollPositionChange:d,lineScrollRequest:p,onLineScrollRequestHandled:f}){const[g,b]=R.useState(null),[S,k]=R.useState(null),[x,v]=R.useState(!0),[w,y]=R.useState(0),C=n==="artifacts",N=n==="abs",E=Y2(t),j=t.split("/").slice(0,-1).join("/"),[T,D]=R.useState(!1),[I,$]=R.useState(""),[F,U]=R.useState(!1),[G,X]=R.useState(null),Y=R.useRef(null),Z=R.useRef(u),Q=(g==null?void 0:g.file)??null,z=(g==null?void 0:g.source)==="checkout"?g.file.path:t,O=yE(Q==null?void 0:Q.presentation),H=(g==null?void 0:g.source)==="artifact"&&!C,V=C&&(g==null?void 0:g.source)==="checkout",W=(g==null?void 0:g.source)==="artifact",re=!i&&(g==null?void 0:g.source)==="checkout"&&Q!=null&&!Q.notFound,le=re&&Q!=null&&!Q.binary&&!Q.truncated&&!O&&!(r!=null&&(g==null?void 0:g.source)==="checkout"&&g.file.root==="clone"),pe=le&&!(E&&!T),te=R.useMemo(()=>((Q==null?void 0:Q.content)??"").replace(/\r\n/g,` -`),[Q==null?void 0:Q.content]),B=le&&I!==te,ie=R.useRef(null);R.useEffect(()=>{const De=(Q==null?void 0:Q.content)??"";if(ie.current!==null&&De===ie.current){ie.current=null;return}$(De.replace(/\r\n/g,` -`)),X(null)},[Q==null?void 0:Q.content,t]);const oe=async()=>{if(!le||Q==null||!B||F)return;const De=Q.content.includes(`\r -`)?I.replace(/\n/g,`\r -`):I;U(!0),X(null);try{await qR(e,z,De,{sessionId:r}),ie.current=De,b(ot=>ot&&ot.source==="checkout"?{source:"checkout",file:{...ot.file,content:De}}:ot)}catch(ot){X(ot instanceof Error?ot.message:String(ot))}finally{U(!1)}},[be,ge]=R.useState(!1),[Ce,Le]=R.useState(null),Ue=async()=>{ge(!0),Le(null);try{await GR(e,z,{sessionId:r})}catch(De){Le(De instanceof Error?De.message:String(De))}finally{ge(!1)}},Fe=`${N?UR(t):W?sh(e,t):FR(e,z,{sessionId:r,ref:i})}&v=${w}`;R.useEffect(()=>{let De=!1;v(!0);const ot=async()=>{const Ze=await wD(e,t),ct=(Ze==null?void 0:Ze.presentation)==="text"||(Ze==null?void 0:Ze.presentation)==="unknown",st=Ze&&ct?await vS(e,t):null,xe=Ze===null||ct&&st===null;return{path:t,content:(st==null?void 0:st.content)??"",truncated:(st==null?void 0:st.truncated)??!1,binary:(st==null?void 0:st.binary)??(Ze==null?void 0:Ze.presentation)==="download",notFound:xe,presentation:st?st.binary?"download":"text":(Ze==null?void 0:Ze.presentation)??"download"}},Bt=async()=>{for(const Ze of[`artifacts/${t}`,t]){const ct=await i3(e,Ze,{sessionId:r}).catch(()=>null);if(ct&&!ct.notFound)return ct}return null};return(N?PR(t).then(Ze=>({source:"absolute",file:Ze})):C?ot().then(async Ze=>{if(!Ze.notFound)return{source:"artifact",file:Ze};const ct=await Bt();return ct?{source:"checkout",file:ct}:{source:"artifact",file:Ze}}):i3(e,t,{sessionId:r,ref:i}).then(Ze=>Ze.notFound&&!i?ot().then(ct=>ct.notFound?{source:"checkout",file:Ze}:{source:"artifact",file:ct,checkoutRoot:Ze.root}):{source:"checkout",file:Ze})).then(Ze=>{De||(b(Ze),k(null))}).catch(Ze=>{De||k(Ze.message)}).finally(()=>{De||v(!1)}),()=>{De=!0}},[e,t,n,r,i,w]),R.useLayoutEffect(()=>{const De=Y.current,ot=Z.current;!De||!Q||!ot||(De.scrollTop=ot.top,De.scrollLeft=ot.left)},[Q]);const mt=De=>De.source==="absolute"?"File not found on disk.":C?`File not found in the project's artifacts or the ${r?"session's worktree":"project clone"}.`:i?`File not found on branch ${i}.`:r&&De.source==="checkout"&&De.file.root==="clone"?"This session's worktree isn't available, and the file isn't in the project clone or its artifacts.":`File not found in the ${(De.source==="checkout"?De.file.root:De.checkoutRoot)==="worktree"?"session's worktree":"project clone"} or the project's artifacts.`;return h.jsxs("div",{className:"file-view flex flex-col h-full min-h-0",children:[h.jsxs("div",{className:"file-view-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant text-text shrink-0",children:[h.jsx(th,{size:13,style:{flexShrink:0}}),h.jsx("code",{className:"file-view-path font-mono text-sm text-text flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",title:z,children:z}),o&&h.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 font-mono text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:`Branch: ${o}`,children:[h.jsx(nh,{size:11}),o]}),pe&&(F||B||G)&&h.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-xs shrink-0 ${G?"text-accent-red":"text-muted"}`,title:G??(F?"Saving…":"Unsaved — ⌘S or click away to save"),children:F?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:qt})," Saving…"]}):G?"Save failed":"Unsaved"}),E&&h.jsx("button",{className:`${Xn} ${T?"active":""}`,"data-tip":T?"Rendered view":"View source","data-tip-align":"end","aria-label":T?"Rendered view":"View source",onClick:()=>D(De=>!De),children:h.jsx(Z8,{size:13})}),re&&h.jsx("button",{className:Xn,"data-tip":Ce??"Open in default editor","data-tip-align":"end","aria-label":"Open in default editor",disabled:be,onClick:()=>void Ue(),children:be?h.jsx("span",{className:qt}):h.jsx(xd,{size:13})}),h.jsx("button",{className:Xn,"data-tip":"Reload file","data-tip-align":"end","aria-label":"Reload file",onClick:()=>y(De=>De+1),children:x?h.jsx("span",{className:qt}):h.jsx(iS,{size:13})})]}),!S&&V&&(g==null?void 0:g.source)==="checkout"&&h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:["Not in the project's artifacts — showing the copy from the"," ",g.file.root==="worktree"?"session's worktree":"project clone","."]}),h.jsxs("div",{ref:Y,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:De=>{const ot={top:De.currentTarget.scrollTop,left:De.currentTarget.scrollLeft};Z.current=ot,d==null||d(ot)},children:[!pe&&!S&&!C&&(g==null?void 0:g.source)==="checkout"&&!g.file.notFound&&!i&&r&&g.file.root==="clone"&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:"This session's worktree isn't available — showing the project clone's copy."}),!pe&&!S&&(g==null?void 0:g.source)==="artifact"&&!g.file.notFound&&H&&h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["Not in the ",g.checkoutRoot==="worktree"?"session's worktree":"project clone"," — showing the copy from the project's artifacts."]}),S?h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["Failed to load file: ",S]}):Q===null?h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:"Loading…"}):Q.notFound?h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:g?mt(g):"File not found."}):O?h.jsx(wE,{kind:O,url:Fe,name:t.split("/").pop()??t}):Q.binary?h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["Binary file — no inline preview. ",h.jsx("a",{href:Fe,download:t.split("/").pop()??t,children:"Download"})]}):E&&!T?h.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-[1.5em] [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-[1.25em] [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-[1.1em]",children:W?h.jsx(AE,{projectId:e,folder:j,markdown:Q.content}):h.jsx(La,{text:Q.content,onOpenFile:l&&(De=>l(N&&!De.startsWith("/")?`${j}/${De}`:De,r,i))})}):pe?h.jsx(lZ,{value:I,onChange:De=>{$(De),G&&X(null)},onSave:()=>void oe(),onBlur:()=>void oe(),path:t,highlightLine:a,scrollRequest:p,onScrollRequestHandled:f}):h.jsxs(h.Fragment,{children:[h.jsx(xE,{text:Q.content,path:t,highlightLine:a,scrollRequest:p,onScrollRequestHandled:f}),Q.truncated&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:"File truncated — showing the first 512 KB."})]})]})]})}const ob=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function uZ({projectName:e,onHome:t,onNewProject:n,onRepository:r,onCollapse:i}){const{open:a,setOpen:o,ref:l}=Bo(),u=R.useRef(null);return R.useEffect(()=>{if(!a)return;const d=p=>{var f;p.key==="Escape"&&((f=u.current)==null||f.focus())};return document.addEventListener("keydown",d,!0),()=>document.removeEventListener("keydown",d,!0)},[a]),h.jsxs("div",{className:"rail-brand flex items-center gap-1 h-16 p-2 border-b border-b-border shrink-0 [&_.project-switcher]:relative [&_.project-switcher]:flex-1 [&_.project-switcher]:self-stretch [&_.project-switcher]:min-w-0 [&_.project-back]:shrink-0 [&_.brand]:flex [&_.brand]:items-center [&_.brand]:justify-between [&_.brand]:gap-2 [&_.brand]:w-full [&_.brand]:h-full [&_.brand]:min-w-0 [&_.brand]:font-semibold [&_.brand]:text-base [&_.brand]:text-text [&_.brand]:py-1 [&_.brand]:px-1.5 [&_.brand]:border [&_.brand]:border-transparent [&_.brand]:rounded-sm [&_.brand:hover]:bg-surface [&_.brand:hover]:border-border [&_.brand.open]:bg-surface [&_.brand.open]:border-border [&_.brand_svg]:shrink-0 [&_.brand-project-copy]:flex [&_.brand-project-copy]:flex-col [&_.brand-project-copy]:gap-[3px] [&_.brand-project-copy]:min-w-0 [&_.brand-project-copy]:leading-[1.15] [&_.brand-project-copy]:text-left [&_.brand-project-label]:text-muted [&_.brand-project-label]:text-2xs [&_.brand-project-label]:font-medium [&_.brand-project-label]:tracking-[0.04em] [&_.brand-project-label]:uppercase [&_.brand_.brand-project]:min-w-0 [&_.brand_.brand-project]:overflow-hidden [&_.brand_.brand-project]:text-ellipsis [&_.brand_.brand-project]:whitespace-nowrap [&_.brand_.brand-project]:text-2xl [&_.project-chevron]:text-muted [&_.project-chevron]:opacity-0 [&_.project-chevron]:transition-transform [&_.project-chevron]:duration-120 [&_.project-chevron]:ease-standard [&_.brand:hover_.project-chevron]:opacity-100 [&_.brand.open_.project-chevron]:opacity-100 [&_.brand.open_.project-chevron]:rotate-180 [&_.project-menu]:left-0 [&_.project-menu]:w-52.5 [&_.project-menu]:z-70",children:[h.jsx("button",{className:`${Xn} project-back !text-text`,"aria-label":"All projects",onClick:t,children:h.jsx(Cf,{size:18})}),h.jsxs("div",{className:"project-switcher",ref:l,children:[h.jsxs("button",{ref:u,className:`brand${a?" open":""}`,onClick:()=>o(d=>!d),"aria-expanded":a,children:[h.jsxs("span",{className:"brand-project-copy",children:[h.jsx("span",{className:"brand-project-label",children:"Project"}),h.jsx("span",{className:"brand-project",children:e})]}),h.jsx(Rl,{className:"project-chevron",size:14})]}),a&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu",children:[h.jsx("button",{className:hi,onClick:()=>{o(!1),r()},children:h.jsxs("span",{className:ob,children:[h.jsx(tS,{size:14}),"Configure Repository"]})}),h.jsx("button",{className:hi,onClick:()=>{o(!1),t()},children:h.jsxs("span",{className:ob,children:[h.jsx(TM,{size:14}),"All projects"]})}),h.jsx("button",{className:hi,onClick:()=>{var d;(d=u.current)==null||d.focus(),o(!1),n()},children:h.jsxs("span",{className:ob,children:[h.jsx(vM,{size:14}),"Create a new project"]})})]})]}),i&&h.jsx("button",{className:Xn,"data-tip":"Hide sidebar","data-tip-align":"end","aria-label":"Hide sidebar",onClick:i,children:h.jsx(rS,{size:15})})]})}const k7=["onb-gate-hint text-base font-semibold leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),Bd=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),C7=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-semibold leading-normal","text-text onb-git-hint mt-2"].join(" "),OE=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),E7=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-semibold leading-normal","text-text"].join(" "),A7="Couldn't reach orx. Check it's still running, then re-check.",dZ=["AI/ML","Biology","Physics","Other"];function hZ({onDone:e,preferredAgent:t}){const[n,r]=R.useState(0),[i,a]=R.useState(null),[o,l]=R.useState(),[u,d]=R.useState(!1),[p,f]=R.useState(null),[g,b]=R.useState(null),[S,k]=R.useState(!1),[x,v]=R.useState([]),[w,y]=R.useState(""),[C,N]=R.useState(""),[E,j]=R.useState([]),[T,D]=R.useState(""),[I,$]=R.useState([]),[F,U]=R.useState(!1),G=R.useRef(0),[X,Y]=R.useState(!1),[Z,Q]=R.useState(!1),z=(i==null?void 0:i.some(B=>B.agentReady))??!1,O=o!=null,H=R.useRef(0),V=(B,ie=!1)=>{const oe=++H.current;k(!0),Y(!1),Q(!1),l(void 0);const be=()=>oe===H.current;Promise.allSettled([Tf(B,ie).then(ge=>be()&&a(ge)),uS().then(ge=>be()&&l(ge.gitVersion))]).then(([ge,Ce])=>{be()&&(ge.status==="rejected"&&(Y(!0),a(null)),Ce.status==="rejected"&&(Q(!0),l(void 0)))}).finally(()=>be()&&k(!1))};R.useEffect(()=>V(!1),[]),R.useEffect(()=>{if(i===null)return;const B=i.filter(ie=>ie.agentReady);b(ie=>{var be;if(ie&&B.some(ge=>ge.id===ie))return ie;const oe=t&&B.find(ge=>ge.id===t.harness);return(oe==null?void 0:oe.id)??((be=B[0])==null?void 0:be.id)??null})},[i,t]),R.useEffect(()=>u_(()=>{Tf(!0).then(B=>{a(B),Y(!1)}).catch(()=>Y(!0))}),[]),R.useEffect(()=>{kD().then(B=>{v(B.researchAreas),y(B.otherArea??""),N(B.background??""),j(B.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const B=T.trim();if(B.length<3){$([]),U(!1);return}const ie=++G.current;U(!0);const oe=setTimeout(()=>{dS(B).then(be=>ie===G.current&&$(be)).catch(()=>ie===G.current&&$([])).finally(()=>ie===G.current&&U(!1))},350);return()=>clearTimeout(oe)},[T]);const W=B=>{const ie=E.some(oe=>oe.paperId===B.paperId);j(oe=>oe.some(be=>be.paperId===B.paperId)?oe:[...oe,{paperId:B.paperId,title:T7(B.title)}]),D(""),$([]),ie||Ab(B.paperId).then(oe=>{var ge;const be=(ge=oe.title)==null?void 0:ge.trim();be&&j(Ce=>Ce.map(Le=>Le.paperId===B.paperId?{...Le,title:be}:Le))}).catch(()=>{})},re=B=>j(ie=>ie.filter(oe=>oe.paperId!==B)),le=B=>{v(ie=>ie.includes(B)?ie.filter(oe=>oe!==B):[...ie,B])},pe=x.length>0&&(!x.includes("Other")||w.trim().length>0),te=async()=>{const B=i==null?void 0:i.find(oe=>oe.id===g&&oe.agentReady);if(!B||u)return;const ie=pZ(B);d(!0),f(null);try{const oe=await TR(ie,{researchAreas:x,otherArea:x.includes("Other")?w:null,background:C||null,papers:E});e(oe.project,oe.selection)}catch(oe){f(oe instanceof Error?oe.message:String(oe))}finally{d(!1)}};return h.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${n===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:h.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${n===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:n===0?h.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[h.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[h.jsx("div",{className:"onb-intro-brand text-[4rem] leading-none font-semibold tracking-[-0.035em] mb-10",children:h.jsx(cf,{})}),h.jsx("h2",{className:"onb-title mt-0 mx-0 text-[2.5rem] leading-[1.08] tracking-[-0.035em]",children:"A workspace for your research agents"})]}),h.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[h.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),h.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:"Consolidate your research"}),h.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:"Track experiments, artifacts, compute, skills, and code all in one place."})]})}),h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:"Ground your agents"}),h.jsxs("span",{className:"block text-lg leading-[1.55] text-text",children:["Connected to ",h.jsx(lb,{source:"alphaxiv"}),","," ",h.jsx(lb,{source:"biorxiv"}),", and"," ",h.jsx(lb,{source:"openalex"})," ","to ground your agents in the latest research."]})]})}),h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:"Everything stays local"}),h.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:"Your code, data, and experiment history stay on your machine."})]})})]})]}),h.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:h.jsxs("button",{className:`${Wr} !py-3.5 !px-7 !text-xl !rounded-lg`,onClick:()=>r(1),children:["Continue ",h.jsx(ag,{size:20})]})})]}):n===1?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"onb-eyebrow text-xl font-semibold text-muted mb-4.5",children:[h.jsx(cf,{})," · Step 1 of 2"]}),h.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:"Choose a coding agent"}),h.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:"OpenResearch uses a coding agent already installed on this machine."}),i!==null&&!z&&h.jsx("p",{className:k7,children:"Sign in to at least one agent to continue."}),i!==null&&z&&g===null&&h.jsx("p",{className:k7,children:"Choose a coding agent to continue."}),h.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:i!==null?i.map(B=>h.jsx(gZ,{h:B,selected:g===B.id,onSelect:()=>b(B.id)},B.id)):X?h.jsx("div",{className:Bd,children:A7}):h.jsxs("div",{className:"onb-loading flex items-center gap-2 text-subtext text-md py-2 px-0",children:[h.jsx("span",{className:qt})," Detecting Claude Code, Codex, OpenCode…"]})}),(o===null||Z)&&h.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[h.jsx(bZ,{gitVersion:o,error:Z}),Z?h.jsx("p",{className:C7,children:A7}):h.jsx("p",{className:C7,children:"Git is required for local experiments. Install Git, then re-check."})]}),h.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[h.jsxs("button",{className:ug,onClick:()=>r(0),children:[h.jsx(Cf,{size:12})," Back"]}),(X||Z||o===null||i!==null&&!z)&&h.jsxs("button",{className:ug,onClick:()=>V(!0,!0),disabled:S,children:[h.jsx(rh,{size:12,className:S?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," Re-check"]}),h.jsx("div",{style:{flex:1}}),h.jsxs("button",{className:Wr,onClick:()=>r(2),disabled:S||!z||g===null||!O,title:S?"Waiting for the local tool checks":z?g===null?"Choose your preferred coding agent":Z?"Re-check Git before continuing":o===void 0?"Waiting for the Git check":o===null?"Install Git to continue":void 0:"Sign in to at least one coding agent to continue",children:["Continue ",h.jsx(ag,{size:13})]})]})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"onb-eyebrow text-xl font-semibold text-muted mb-4.5",children:[h.jsx(cf,{})," · Step 2 of 2"]}),h.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:"Tell us about your research"}),h.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:h.jsxs("div",{className:OE,children:[h.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-semibold [&_legend]:mb-1.5",children:[h.jsx("legend",{children:"What areas are you interested in?"}),h.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:"Choose one or more."}),h.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:dZ.map(B=>h.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[h.jsx("input",{type:"checkbox",checked:x.includes(B),onChange:()=>le(B),disabled:u}),h.jsx("span",{children:B})]},B))}),x.includes("Other")&&h.jsx("input",{className:"onb-other-area w-full mt-2",value:w,onChange:B=>y(B.target.value),disabled:u,placeholder:"Tell us your other research area","aria-label":"Other research area"})]}),h.jsx("label",{className:"onb-field-label text-base font-semibold mb-1.5",htmlFor:"onb-background",children:"Research background"}),h.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:C,onChange:B=>N(B.target.value),disabled:u,rows:4,placeholder:"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods."}),h.jsx("label",{className:"onb-field-label text-base font-semibold mb-1.5",htmlFor:"onb-paper-search",children:"Representative papers"}),h.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:"Add papers that represent your research interests, including papers by other authors."}),h.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[h.jsx("input",{id:"onb-paper-search",value:T,onChange:B=>D(B.target.value),disabled:u,placeholder:"Search alphaXiv by title to link a paper…"}),F?h.jsx("div",{className:Bd,children:"Searching alphaXiv…"}):I.length>0?h.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-left [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-md [&_.title]:font-medium [&_.id]:font-mono [&_.id]:text-xs [&_.id]:text-muted",children:I.map(B=>h.jsxs("button",{type:"button",onClick:()=>W(B),disabled:u,children:[h.jsx("span",{className:Sd,children:T7(B.title)}),h.jsx("span",{className:"id",children:B.paperId})]},B.paperId))}):null]}),E.length>0&&h.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:E.map(B=>h.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pr-1 pb-1 pl-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:font-mono [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[h.jsx("span",{className:Sd,children:B.title||B.paperId}),h.jsx("span",{className:"id",children:B.paperId}),h.jsx("button",{type:"button","aria-label":`Remove ${B.paperId}`,onClick:()=>re(B.paperId),disabled:u,children:h.jsx(qr,{size:12})})]},B.paperId))})]})}),!pe&&h.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:x.length===0?"Choose at least one research area to continue.":"Describe your research area to continue."}),h.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[h.jsxs("button",{className:ug,onClick:()=>r(1),disabled:u,children:[h.jsx(Cf,{size:12})," Back"]}),h.jsx("div",{style:{flex:1}}),h.jsx("button",{className:Wr,onClick:()=>void te(),disabled:u||g===null||!pe,children:u?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:qt})," Setting things up…"]}):h.jsxs(h.Fragment,{children:["Get started ",h.jsx(ag,{size:13})]})})]}),g===null&&h.jsx("p",{className:E7,children:"Your selected agent is no longer ready. Go back to Step 1 and choose another."}),p&&h.jsx("p",{className:E7,children:p})]})})})}function lb({source:e}){return h.jsxs("span",{className:"whitespace-nowrap",children:[h.jsx(h_,{source:e,size:18,decorative:!0,className:"mr-1 inline-flex align-[-0.15em] !rounded-none !bg-transparent !p-0 !shadow-none"}),d_[e]]})}function T7(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function fZ(e){return e.agentReady?{cls:"st-done",label:"Signed in"}:e.installed?e.authState==="unknown"?{cls:"st-starting",label:"Unable to verify"}:e.authState==="unsupported"?{cls:"st-starting",label:"Update required"}:e.installed?{cls:"st-starting",label:"Not signed in"}:{cls:"st-idle",label:"Not detected"}:{cls:"st-idle",label:"Not detected"}}function pZ(e){var n,r;const t=((n=e.models[0])==null?void 0:n.id)??null;return{harness:e.id,model:t,permissionMode:((r=e.options)==null?void 0:r.defaultPermissionMode)??null,reasoningLevel:lp(e,t).defaultId}}function mZ({harness:e}){return h.jsx(vv,{harness:e,size:18})}function gZ({h:e,selected:t,onSelect:n}){var l;const r=fZ(e),i=t?{cls:"st-done",label:"Selected"}:r,a=(l=e.version)==null?void 0:l.replace(/\s*\(.*\)$/,""),o=h.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[h.jsxs("span",{className:"onb-card-identity flex items-center gap-2.5 min-w-0",children:[h.jsx(mZ,{harness:e.id}),h.jsx("span",{className:"onb-card-name font-semibold text-base",children:e.name})]}),h.jsxs("span",{className:`${p_} ${i.cls}`,children:[e.agentReady?h.jsx(Di,{size:12,strokeWidth:3}):h.jsx("span",{className:"dot"}),i.label]})]});return e.agentReady?h.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-[5px] bg-background border border-border rounded-lg py-4.5 px-5 onb-agent-choice w-full text-inherit [font:inherit] text-left transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-[0_0_0_1px_var(--accent)]${t?" selected":""}`,"aria-pressed":t,onClick:n,children:[o,h.jsxs("div",{className:`onb-card-detail ${tn}`,children:[e.account??"API key",e.plan?` · ${e.plan}`:""]}),h.jsx("div",{className:Bd,children:[a,e.models.length>0&&`${e.models.length} model${e.models.length===1?"":"s"} — ${e.models.slice(0,3).map(u=>Af(u)).join(", ")}${e.models.length>3?", …":""}`].filter(Boolean).join(" · ")})]}):h.jsxs("div",{className:"onb-card flex flex-col gap-[5px] bg-background border border-border rounded-lg py-4.5 px-5 onb-agent-choice w-full text-inherit [font:inherit] text-left transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-[0_0_0_1px_var(--accent)]",children:[o,h.jsx("div",{className:Bd,children:j2(e.agentNote)})]})}function bZ({gitVersion:e,error:t}){return h.jsxs("div",{className:OE,children:[h.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[h.jsx("span",{className:"onb-card-name font-semibold text-base",children:"Local Git"}),h.jsxs("span",{className:`${p_} ${e?"st-done":t||e===null?"st-failed":"st-starting"}`,children:[e?h.jsx(Di,{size:12,strokeWidth:3}):h.jsx("span",{className:"dot"}),e?"Ready":t?"Check failed":e===null?"Not found":"Checking"]})]}),(e||!t&&e===void 0)&&h.jsx("div",{className:Bd,children:e??"Checking Git…"})]})}function N7(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"research-project"}function vZ(e){const n=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(n)?n:null}function _Z(e){const t=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return t?{owner:t[1],repo:t[2].replace(/\.git$/,"")}:null}function xZ(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function yZ({onCreated:e,onCancel:t}){const[n,r]=R.useState("folder"),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,d]=R.useState(""),[p,f]=R.useState(!1),[g,b]=R.useState(null),[S,k]=R.useState(null),[x,v]=R.useState(!1),[w,y]=R.useState(!1),[C,N]=R.useState(!1),[E,j]=R.useState(null),[T,D]=R.useState(!1),[I,$]=R.useState(void 0),[F,U]=R.useState("research-project"),[G,X]=R.useState(null),[Y,Z]=R.useState(!1),[Q,z]=R.useState(!1),[O,H]=R.useState(""),[V,W]=R.useState(null),[re,le]=R.useState([]),[pe,te]=R.useState(!1),B=R.useRef(0),ie=R.useRef(0),oe=R.useRef(0),be=R.useRef({folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),Ce=(n==="paper"?_Z(V==null?void 0:V.repoUrl):null)??(g!=null&&g.githubOwner&&g.githubRepo?{owner:g.githubOwner,repo:g.githubRepo}:null);R.useEffect(()=>{MR().then(({login:Oe})=>$(Oe)).catch(()=>$(null)),o_().then(Oe=>D(Oe.githubForNewProjects)).catch(()=>{})},[]),R.useEffect(()=>{let Oe=!0;Z(!0);const tt=setTimeout(()=>{RR(i.trim()).then(({repo:it})=>Oe&&U(it)).catch(()=>Oe&&U(N7(i))).finally(()=>Oe&&Z(!1))},150);return()=>{Oe=!1,clearTimeout(tt)}},[i]),R.useEffect(()=>{let Oe=!0;if(X(null),z(!!Ce),!!Ce)return DR(Ce.owner,Ce.repo).then(({canPush:tt})=>{Oe&&tt&&X(`github.com/${Ce.owner}/${Ce.repo}`)}).catch(()=>{}).finally(()=>Oe&&z(!1)),()=>{Oe=!1}},[Ce==null?void 0:Ce.owner,Ce==null?void 0:Ce.repo]),R.useEffect(()=>{if(n!=="paper"||!V||p)return;const Oe=`~/OpenResearch/${N7(i||V.title||V.paperId)}`;Oe!==u&&(b(null),v(!0),d(Oe))},[n,i,V,u,p]),R.useEffect(()=>{const Oe=++ie.current;v(!0),k(null);const tt=setTimeout(()=>{uS(u.trim()).then(it=>{Oe===ie.current&&b(it)}).catch(it=>{Oe===ie.current&&(b(null),k(it instanceof Error?it.message:String(it)))}).finally(()=>{Oe===ie.current&&v(!1)})},u.trim()?200:0);return()=>clearTimeout(tt)},[n,u]),R.useEffect(()=>{const Oe=++B.current;if(n!=="paper"||V){te(!1);return}const tt=O.trim(),it=vZ(tt);if(!it&&tt.length<3){le([]),te(!1);return}te(!0);const jt=setTimeout(()=>{if(it){Ab(it).then(_t=>{var Tt;Oe===B.current&&(W(_t),o||a(((Tt=_t.title)==null?void 0:Tt.trim().slice(0,60))||_t.paperId))}).catch(_t=>Oe===B.current&&j(_t instanceof Error?_t.message:String(_t))).finally(()=>Oe===B.current&&te(!1));return}dS(tt).then(_t=>Oe===B.current&&le(_t)).catch(_t=>Oe===B.current&&j(_t instanceof Error?_t.message:String(_t))).finally(()=>Oe===B.current&&te(!1))},350);return()=>clearTimeout(jt)},[n,V,O,o]);async function Le(Oe){var it;const tt=++B.current;te(!0),j(null);try{const jt=await Ab(Oe);if(tt!==B.current)return;W(jt),le([]),o||a(((it=jt.title)==null?void 0:it.trim().slice(0,60))||jt.paperId)}catch(jt){tt===B.current&&j(jt instanceof Error?jt.message:String(jt))}finally{tt===B.current&&te(!1)}}function Ue(){B.current+=1,oe.current+=1,W(null),H(""),le([]),te(!1),y(!1),d(""),f(!1),o||a("")}function We(Oe){if(Oe===n)return;B.current+=1,oe.current+=1,be.current[n]={name:i,nameTouched:o,path:u,pathTouched:p};const tt=be.current[Oe];r(Oe),j(null),k(null),b(null),te(!1),y(!1),a(tt.name),l(tt.nameTouched),d(tt.path),f(tt.pathTouched)}async function Fe(){if(w)return;const Oe=++oe.current;y(!0),j(null);try{const tt=await NR();if(Oe!==oe.current||!tt)return;if(f(!0),tt!==u&&(b(null),v(!0),d(tt)),n==="folder"&&!o){const it=tt.replace(/[\\/]+$/,"").split(/[\\/]/).pop();it&&a(it)}}catch(tt){Oe===oe.current&&j(tt instanceof Error?tt.message:String(tt))}finally{Oe===oe.current&&y(!1)}}async function mt(Oe){if(Oe.preventDefault(),!!xe){N(!0),j(null);try{const tt=await jR({name:i.trim(),path:u.trim(),createFolder:n==="paper",initializeGit:!0,githubSyncEnabled:T,...n==="paper"&&V?{paperId:V.paperId,cloneUrl:V.repoUrl??void 0}:{}});e(tt.project,tt.githubPublicationError)}catch(tt){j(tt instanceof Error?tt.message:String(tt))}finally{N(!1)}}}const De=(g==null?void 0:g.gitVersion)===null,ot=n==="folder"&&!!u.trim()&&g!==null&&g.exists===!1,Bt=!!u.trim()&&(g==null?void 0:g.exists)===!0&&g.directory===!1,on=n==="paper"&&!!(V!=null&&V.repoUrl)&&(g==null?void 0:g.empty)===!1,Ze=n==="folder"&&((g==null?void 0:g.gitState)==="detached"||(g==null?void 0:g.gitState)==="invalid"),ct=Bt||on,st=Bt?"Choose a different destination. This path is a file, not a folder.":on?"Choose a different destination. The paper repository needs a new or empty folder.":V!=null&&V.repoUrl?(g==null?void 0:g.exists)===!1?"OpenResearch will create this folder and clone the paper's repository into it.":"OpenResearch will clone the paper's repository here and use it as your local workspace.":(g==null?void 0:g.exists)===!1?"OpenResearch will create this folder and initialize it as the local project workspace.":"OpenResearch will use this folder as the local workspace and initialize Git if needed.",xe=!!(i.trim()&&u.trim())&&!C&&!w&&!x&&g!==null&&!S&&!De&&!ot&&!Bt&&!on&&!Ze&&(n!=="paper"||!!(V!=null&&V.repoUrl))&&(!T||typeof I=="string"&&!Y&&!Q),Me=G??`github.com/${I??"you"}/${F}`,Qe=I===void 0||Y||Q?"Checking":G?"Pushes to":"Creates";return h.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-mono [&_.repo-hint]:font-normal [&_.repo-hint]:text-xs [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-left [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-[0_2px_8px_rgb(0_0_0_/_5%)] [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-semibold [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-semibold [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pr-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:pl-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))] [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-left [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-md [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:font-mono [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-md [&_.paper-pick_.title]:font-semibold flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-xs [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.new-project-actions_.primary]:ml-auto [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:mt,children:[h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-md [&_button]:font-semibold [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[h.jsx("button",{type:"button",className:n==="folder"?"active":"","aria-pressed":n==="folder",onClick:()=>We("folder"),children:"From folder"}),h.jsx("button",{type:"button",className:n==="paper"?"active":"","aria-pressed":n==="paper",onClick:()=>We("paper"),children:"From a paper"})]}),n==="paper"&&!V&&h.jsxs("label",{children:["Paper",h.jsx("input",{value:O,onChange:Oe=>H(Oe.target.value),placeholder:"arXiv id, URL, or title",autoFocus:!0}),h.jsx("span",{className:"repo-hint",children:pe?"Searching alphaXiv…":"The public code repository is cloned without credentials."}),re.length>0&&h.jsx("div",{className:"paper-results",children:re.map(Oe=>h.jsxs("button",{type:"button",onClick:()=>void Le(Oe.paperId),children:[h.jsx("span",{className:Sd,children:Oe.title}),h.jsx("span",{className:"id",children:Oe.paperId})]},Oe.paperId))})]}),V&&n==="paper"&&h.jsxs("div",{className:"paper-pick",children:[h.jsxs("div",{className:"meta",children:[h.jsx("div",{className:Sd,children:V.title||V.paperId}),V.repoUrl?h.jsx("div",{className:"id",children:xZ(V.repoUrl)}):h.jsxs("div",{className:"mt-[9px] inline-flex w-fit items-center gap-[5px] rounded-full border border-border-variant bg-background px-[9px] py-1 text-sm font-medium text-subtext",children:[h.jsx(Vj,{size:14})," No public repository"]})]}),h.jsx("button",{type:"button",className:Kn,"aria-label":"Change selected paper",onClick:Ue,children:"Change"})]}),(n!=="paper"||(V==null?void 0:V.repoUrl))&&h.jsxs(h.Fragment,{children:[n==="paper"?h.jsxs("div",{className:"project-location-field",children:[h.jsx("div",{className:"project-location-label",children:V!=null&&V.repoUrl?"Clone destination":"Project location"}),h.jsxs("div",{className:"paper-destination",children:[h.jsx("code",{title:u,children:u}),h.jsx("button",{type:"button",className:Kn,"aria-label":`${V!=null&&V.repoUrl?"Change clone destination":"Change project location"}; current location: ${u}`,"aria-describedby":"paper-destination-description",disabled:w,onClick:()=>void Fe(),children:w?"Choosing…":"Change…"})]}),h.jsx("span",{id:"paper-destination-description",className:`folder-picker-hint${ct?" error":""}`,children:st})]}):h.jsxs("button",{type:"button",className:"folder-picker-control","aria-label":u?`Change project folder; current folder: ${u}`:"Choose or create a project folder",disabled:w,title:u||void 0,onClick:()=>void Fe(),children:[h.jsx(yd,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),h.jsx("span",{className:u?tn:"placeholder",children:w?"Choosing…":u||"Choose or create a folder"}),h.jsx(Xs,{className:"folder-picker-chevron",size:15})]}),u&&h.jsxs("label",{children:[h.jsx("span",{className:"project-field-label",children:"Project name"}),h.jsx("input",{value:i,onChange:Oe=>{l(!0),a(Oe.target.value)},placeholder:"my-research",autoFocus:!0})]}),De&&h.jsx("div",{className:"project-path-notice error",children:"Git is required for experiments but is not installed. Install Git, then restart OpenResearch."}),!De&&u.trim()&&x&&h.jsx("span",{className:`repo-hint ${tn}`,children:"Checking folder…"}),!De&&n==="folder"&&u.trim()&&!x&&(g==null?void 0:g.exists)===!1&&h.jsx("div",{className:"project-path-notice error",children:"That folder no longer exists. Choose it again."}),!De&&n==="folder"&&u.trim()&&!x&&Bt&&h.jsx("div",{className:"project-path-notice error",children:"The selected path is not a folder."}),!De&&n==="folder"&&!x&&(g==null?void 0:g.gitState)==="detached"&&h.jsx("div",{className:"project-path-notice error",children:"Check out a Git branch before importing this folder."}),!De&&n==="folder"&&!x&&(g==null?void 0:g.gitState)==="invalid"&&h.jsx("div",{className:"project-path-notice error",children:"The selected folder contains an invalid Git repository."}),!De&&n==="folder"&&!x&&(g==null?void 0:g.directory)&&g.initialized===!1&&h.jsx("div",{className:"project-path-notice",children:"This folder is not a Git repository. OpenResearch will initialize Git here."}),S&&h.jsx("div",{className:"project-path-notice error",children:S})]}),E&&h.jsx("div",{className:"error",children:E}),(n!=="paper"||(V==null?void 0:V.repoUrl))&&u&&h.jsxs("label",{className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[h.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[h.jsx("input",{className:"m-0",type:"checkbox",checked:T,onChange:Oe=>D(Oe.target.checked),disabled:C}),h.jsx("strong",{className:"text-base font-semibold leading-[1.3] text-text",children:"Sync experiments to GitHub"})]}),h.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext [&_code]:text-sm [&_code]:text-inherit",children:[h.jsxs("span",{children:[Qe," ",h.jsx("code",{children:Me}),"."]}),h.jsx("span",{children:"Experiment branches will be pushed to the remote GitHub repository."}),I===null&&h.jsx("span",{children:"Connect GitHub before creating the project."})]})]}),h.jsxs("div",{className:"actions new-project-actions",children:[t&&h.jsx("button",{type:"button",className:fi,onClick:t,children:"Cancel"}),h.jsx("button",{className:Wr,disabled:!xe,children:C?"Creating…":n==="paper"?V!=null&&V.repoUrl?"Clone paper project":"Create paper project":"Create local project"})]})]})}function IE({onClose:e,onCreated:t}){const n=R.useRef(null),r=R.useRef(e);return r.current=e,R.useEffect(()=>{const i=n.current;if(!i)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(o()[0]??i).focus();const l=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),r.current();return}if(u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!u.altKey&&u.shiftKey){u.preventDefault(),u.stopPropagation();return}if(u.key!=="Tab")return;const d=o();if(d.length===0){u.preventDefault(),i.focus();return}const p=d[0],f=d[d.length-1];u.shiftKey&&document.activeElement===p?(u.preventDefault(),f.focus()):!u.shiftKey&&document.activeElement===f&&(u.preventDefault(),p.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),h.jsx("div",{className:"modal-backdrop fixed inset-0 bg-[rgba(29,_27,_26,_0.42)] flex items-center justify-center p-5 overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:h.jsxs("div",{ref:n,className:"modal w-120 max-w-full max-h-[calc(100vh_-_40px)] overflow-y-auto bg-background border border-border rounded-xl shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)] p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[h.jsx("h2",{id:"new-project-dialog-title",children:"New project"}),h.jsx(yZ,{onCancel:e,onCreated:t})]})})}function j7({projects:e,onOpen:t,onCreated:n,onDeleted:r}){const[i,a]=R.useState(!1),[o,l]=R.useState(null);async function u(d){const p=!!(d.githubUrl||d.githubOwner&&d.githubRepo);if(window.confirm(`Delete project "${d.name}"? - -Its experiments, runs and chats are removed from orx. The local folder (${d.path})${p?" and its GitHub repository":""} are kept.`)){l(d.id);try{await OR(d.id),r(d.id)}catch(g){window.alert(g instanceof Error?g.message:String(g))}finally{l(null)}}}return h.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[h.jsxs("div",{className:"home-inner max-w-155 my-0 mx-auto pt-12 px-6 pb-16",children:[h.jsx("div",{className:"home-brand font-display text-4xl tracking-[-0.02em] mb-9",children:h.jsx(cf,{})}),h.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-2xl [&_h2]:tracking-[-0.01em]",children:[h.jsx("h2",{children:"Projects"}),h.jsxs("button",{className:fi,onClick:()=>a(!0),children:[h.jsx(i_,{size:15})," New project"]})]}),h.jsx("div",{className:"home-list flex flex-col gap-2.5",children:e.length===0?h.jsx("div",{className:"changes-note text-sm text-muted",children:"No projects yet — create one to get started."}):[...e].sort((d,p)=>p.updatedAt-d.updatedAt).map(d=>{const p=!!(d.githubUrl||d.githubOwner&&d.githubRepo),f=d.githubUrl??(d.githubOwner&&d.githubRepo?`https://github.com/${d.githubOwner}/${d.githubRepo}`:null),g=d.githubEnabled?"GitHub syncing on":p?"GitHub syncing off":"local only";return h.jsxs("div",{className:"project-card relative flex flex-col gap-1 text-left py-3.5 px-4 bg-background border border-border rounded-lg cursor-pointer transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-[0_3px_12px_color-mix(in_srgb,_var(--text)_8%,_transparent)] [&_>_:not(.project-card-open,_.project-delete)]:relative [&_>_:not(.project-card-open,_.project-delete)]:z-1 [&_>_:not(.project-card-open,_.project-delete)]:pointer-events-none [&_.project-delete]:absolute [&_.project-delete]:top-2.5 [&_.project-delete]:right-2.5 [&_.project-delete]:z-2 [&_.project-delete]:hidden [&_.project-delete]:p-[5px] [&_.project-delete]:rounded-sm [&_.project-delete]:text-muted [&_.project-delete]:leading-[0] [&:is(:hover,_:focus-within)_.project-delete]:block [&_.name]:font-semibold [&_.name]:text-base [&_.paper]:text-xs [&_.paper]:text-muted [&_.time]:text-xs [&_.time]:text-muted",children:[h.jsx("button",{className:"project-card-open absolute inset-0 rounded-[inherit] [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2","aria-label":`Open ${d.name}`,onClick:()=>t(d.id)}),h.jsx("span",{className:"name",children:d.name}),h.jsxs("span",{className:`project-card-sync [&_a]:pointer-events-auto inline-flex items-center self-start gap-[7px] text-text [&_a]:inline-flex [&_a]:text-subtext [&_a:hover]:text-text ${tn}`,children:[g,d.githubEnabled&&f&&h.jsx("a",{href:f,target:"_blank",rel:"noreferrer","data-tip":"Open repository on GitHub","aria-label":`Open ${d.name} on GitHub`,onClick:b=>b.stopPropagation(),children:h.jsx(Mp,{size:14})})]}),d.paperId&&h.jsxs("span",{className:`paper ${tn}`,children:["arXiv ",d.paperId]}),h.jsxs("span",{className:"time",children:["created ",Gs(d.createdAt)]}),h.jsx("button",{className:"project-delete [&:hover]:text-[var(--danger,_#d33)] [&:hover]:bg-[var(--overlay,_rgba(0,_0,_0,_0.05))]","data-tip":`Delete ${d.name}`,"data-tip-align":"end","aria-label":`Delete ${d.name}`,disabled:o===d.id,onClick:b=>{b.stopPropagation(),u(d)},children:h.jsx(ih,{size:14})})]},d.id)})})]}),i&&h.jsx(IE,{onClose:()=>a(!1),onCreated:(d,p)=>{a(!1),n(d,p)}})]})}const M7=["experiment-table-action inline-flex items-center gap-1.5 py-1.5 px-2.5","border border-border rounded-md bg-background text-text","text-sm font-medium leading-none","[&:hover:not(:disabled)]:bg-surface","[&:hover:not(:disabled)]:border-border-strong [&:disabled]:text-muted","[&:disabled]:cursor-default [&:disabled]:opacity-50","[&.danger]:border-[color-mix(in_oklab,_var(--accent-red)_42%,_var(--border))]","[&.danger]:bg-[color-mix(in_oklab,_var(--accent-red)_6%,_var(--base))]","[&.danger]:text-accent-red [&.danger:hover:not(:disabled)]:border-accent-red","[&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_10%,_var(--base))]","[@container((max-width:_560px))]:[&.danger]:ml-auto"].join(" ");function wZ({runs:e,experiments:t,emptyHint:n,onOpen:r,onOpenLogs:i,onOpenCode:a,onCancel:o}){const[l,u]=R.useState(new Set),[d,p]=R.useState(null),f=new Map;for(const S of e){const k=f.get(S.experimentId);k?k.push(S):f.set(S.experimentId,[S])}for(const S of f.values())S.sort((k,x)=>x.createdAt-k.createdAt);const g=[...t].sort((S,k)=>{var w,y,C,N;const x=((y=(w=f.get(S.id))==null?void 0:w[0])==null?void 0:y.createdAt)??S.createdAt;return(((N=(C=f.get(k.id))==null?void 0:C[0])==null?void 0:N.createdAt)??k.createdAt)-x});if(g.length===0)return h.jsx("div",{className:"empty-state absolute inset-0 flex flex-col items-center justify-center gap-2.5 p-6 text-center text-subtext [&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:leading-normal [&_p]:text-balance [&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext experiments-empty-state [&_p]:text-2xl",children:h.jsx("p",{children:n??"No experiments yet."})});async function b(S){p(null),u(k=>new Set(k).add(S));try{await o(S)}catch(k){u(x=>{const v=new Set(x);return v.delete(S),v}),p(k instanceof Error?k.message:String(k))}}return h.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[d&&h.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:["Stop failed: ",d]}),h.jsx("div",{className:"experiments-table w-full text-md bg-background",role:"list","aria-label":"Experiments",children:g.map(S=>{const k=f.get(S.id)??[],x=k[0]??null,v=k.find(N=>N.status==="running"||N.status==="starting"),w=v??x,y=!!(v&&(v.cancelRequested||l.has(v.id))),C=v?y?"cancelling":ss(v):x?ss(x):"idle";return h.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-[color-mix(in_oklab,_var(--text)_7%,_transparent)] bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(S),children:[h.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[h.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-left text-ellipsis whitespace-nowrap",onClick:N=>{N.stopPropagation(),r(S)},children:S.title||S.slug}),h.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:S.branchName,children:[h.jsx(nh,{size:14,"aria-hidden":"true"}),h.jsx("code",{children:S.branchName})]})]}),h.jsxs("div",{className:"experiment-table-meta [grid-area:meta] self-start flex items-center justify-end gap-4.5 whitespace-nowrap [@container((max-width:_560px))]:flex-col [@container((max-width:_560px))]:items-end [@container((max-width:_560px))]:gap-1.5 [@container((max-width:_400px))]:!flex-row [@container((max-width:_400px))]:!items-center [@container((max-width:_400px))]:flex-wrap [@container((max-width:_400px))]:justify-start [@container((max-width:_400px))]:gap-3",children:[h.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:h.jsx(Ma,{status:C})}),h.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-xs font-medium",children:h.jsxs("span",{children:[k.length," ",k.length===1?"run":"runs"]})}),h.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-xs font-medium whitespace-nowrap",children:h.jsx("span",{children:x?Gs(x.createdAt):"Not run yet"})})]}),h.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":`Actions for ${S.title||S.slug}`,onClick:N=>N.stopPropagation(),children:[h.jsxs("button",{className:M7,disabled:!w,title:w?"Open logs":"No runs yet",onClick:()=>w&&i(S.id,w.id),children:[h.jsx(Uc,{size:15}),"Logs"]}),h.jsxs("button",{className:M7,title:`Browse code on ${S.branchName}`,onClick:()=>a(S.id),children:[h.jsx(ip,{size:15}),"Code"]}),v&&h.jsxs("button",{className:"experiment-table-action inline-flex items-center gap-1.5 py-1.5 px-2.5 border border-border rounded-md bg-background text-text text-sm font-medium leading-none [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:border-border-strong [&:disabled]:text-muted [&:disabled]:cursor-default [&:disabled]:opacity-50 [&.danger]:border-[color-mix(in_oklab,_var(--accent-red)_42%,_var(--border))] [&.danger]:bg-[color-mix(in_oklab,_var(--accent-red)_6%,_var(--base))] [&.danger]:text-accent-red [&.danger:hover:not(:disabled)]:border-accent-red [&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_10%,_var(--base))] [@container((max-width:_560px))]:[&.danger]:ml-auto danger",disabled:y,title:y?"Stop requested":"Stop run",onClick:()=>void b(v.id),children:[h.jsx(X8,{size:15}),y?"Stopping…":"Stop"]})]})]},S.id)})})]})}var zE=q8();function SZ({onClose:e,onCreateProject:t}){const[n,r]=R.useState(!1),[i,a]=R.useState(null),o=R.useRef(null),l=R.useCallback(u=>{n||(r(!0),a(null),u().catch(()=>a("Couldn't save your progress. Try again.")).finally(()=>r(!1)))},[n]);return R.useEffect(()=>{const u=d=>{d.key==="Escape"&&(d.preventDefault(),d.stopPropagation(),l(e))};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[e,l]),R.useEffect(()=>{const u=o.current;if(!u)return;const d=document.activeElement instanceof HTMLElement?document.activeElement:null,p=()=>[...u.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(p()[0]??u).focus();const f=g=>{if(g.key!=="Tab")return;const b=p();if(b.length===0){g.preventDefault(),u.focus();return}const S=b[0],k=b[b.length-1];g.shiftKey&&document.activeElement===S?(g.preventDefault(),k.focus()):!g.shiftKey&&document.activeElement===k&&(g.preventDefault(),S.focus())};return document.addEventListener("keydown",f,!0),()=>{document.removeEventListener("keydown",f,!0),d==null||d.focus()}},[]),zE.createPortal(h.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-[rgba(29,_27,_26,_0.42)] p-5",children:h.jsxs("div",{ref:o,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)]",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[h.jsx("button",{className:`${Xn} !absolute top-3.5 right-3.5`,"aria-label":"Close",onClick:()=>l(e),disabled:n,children:h.jsx(qr,{size:16})}),h.jsxs("div",{className:"mb-5 flex items-center gap-3 pr-8",children:[h.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:h.jsx(c_,{})}),h.jsxs("div",{children:[h.jsx("div",{className:"mb-0.5 text-xs font-semibold tracking-[0.08em] text-primary uppercase",children:"Demo project"}),h.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-3xl leading-tight tracking-[-0.02em]",children:"Welcome to OpenResearch"})]})]}),h.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[h.jsxs("p",{children:["This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's"," ",h.jsx("a",{href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-semibold text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:"nanochat"}),", a repo for training a mini-GPT from scratch."]}),h.jsx("p",{children:"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together."})]}),i&&h.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:i}),h.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[h.jsx("button",{className:fi,onClick:()=>l(t),disabled:n,children:"Create a new project"}),h.jsx("button",{className:Wr,onClick:()=>l(e),disabled:n,children:n?"Saving…":"Explore the demo"})]})]})}),document.body)}function Qn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function Vp(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}bf.prototype=Vp.prototype={constructor:bf,on:function(e,t){var n=this._,r=CZ(e+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a0)for(var n=new Array(i),r=0,i,a;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),D7.hasOwnProperty(t)?{space:D7[t],local:e}:e}function AZ(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Hv&&t.documentElement.namespaceURI===Hv?t.createElement(e):t.createElementNS(n,e)}}function TZ(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function BE(e){var t=Wp(e);return(t.local?TZ:AZ)(t)}function NZ(){}function K2(e){return e==null?NZ:function(){return this.querySelector(e)}}function jZ(e){typeof e!="function"&&(e=K2(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=y&&(y=w+1);!(N=x[y])&&++y=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function tQ(e){e||(e=nQ);function t(f,g){return f&&g?e(f.__data__,g.__data__):!f-!g}for(var n=this._groups,r=n.length,i=new Array(r),a=0;at?1:e>=t?0:NaN}function rQ(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function iQ(){return Array.from(this)}function sQ(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?gQ:typeof t=="function"?vQ:bQ)(e,t,n??"")):Kc(this.node(),e)}function Kc(e,t){return e.style.getPropertyValue(t)||UE(e).getComputedStyle(e,null).getPropertyValue(t)}function xQ(e){return function(){delete this[e]}}function yQ(e,t){return function(){this[e]=t}}function wQ(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function SQ(e,t){return arguments.length>1?this.each((t==null?xQ:typeof t=="function"?wQ:yQ)(e,t)):this.node()[e]}function qE(e){return e.trim().split(/^|\s+/)}function Z2(e){return e.classList||new GE(e)}function GE(e){this._node=e,this._names=qE(e.getAttribute("class")||"")}GE.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 VE(e,t){for(var n=Z2(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function ZQ(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n()=>e;function $v(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:l,dx:u,dy:d,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:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:p}})}$v.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function oJ(e){return!e.ctrlKey&&!e.button}function lJ(){return this.parentNode}function cJ(e,t){return t??{x:e.x,y:e.y}}function uJ(){return navigator.maxTouchPoints||"ontouchstart"in this}function QE(){var e=oJ,t=lJ,n=cJ,r=uJ,i={},a=Vp("start","drag","end"),o=0,l,u,d,p,f=0;function g(C){C.on("mousedown.drag",b).filter(r).on("touchstart.drag",x).on("touchmove.drag",v,aJ).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(C,N){if(!(p||!e.call(this,C,N))){var E=y(this,t.call(this,C,N),C,N,"mouse");E&&(Mi(C.view).on("mousemove.drag",S,Hd).on("mouseup.drag",k,Hd),KE(C.view),cb(C),d=!1,l=C.clientX,u=C.clientY,E("start",C))}}function S(C){if(Bc(C),!d){var N=C.clientX-l,E=C.clientY-u;d=N*N+E*E>f}i.mouse("drag",C)}function k(C){Mi(C.view).on("mousemove.drag mouseup.drag",null),ZE(C.view,d),Bc(C),i.mouse("end",C)}function x(C,N){if(e.call(this,C,N)){var E=C.changedTouches,j=t.call(this,C,N),T=E.length,D,I;for(D=0;D>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?K0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?K0(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=hJ.exec(e))?new pi(t[1],t[2],t[3],1):(t=fJ.exec(e))?new pi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=pJ.exec(e))?K0(t[1],t[2],t[3],t[4]):(t=mJ.exec(e))?K0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=gJ.exec(e))?$7(t[1],t[2]/100,t[3]/100,1):(t=bJ.exec(e))?$7(t[1],t[2]/100,t[3]/100,t[4]):L7.hasOwnProperty(e)?z7(L7[e]):e==="transparent"?new pi(NaN,NaN,NaN,0):null}function z7(e){return new pi(e>>16&255,e>>8&255,e&255,1)}function K0(e,t,n,r){return r<=0&&(e=t=n=NaN),new pi(e,t,n,r)}function xJ(e){return e instanceof vh||(e=Al(e)),e?(e=e.rgb(),new pi(e.r,e.g,e.b,e.opacity)):new pi}function Fv(e,t,n,r){return arguments.length===1?xJ(e):new pi(e,t,n,r??1)}function pi(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Q2(pi,Fv,JE(vh,{brighter(e){return e=e==null?Wf:Math.pow(Wf,e),new pi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$d:Math.pow($d,e),new pi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new pi(Sl(this.r),Sl(this.g),Sl(this.b),Yf(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:B7,formatHex:B7,formatHex8:yJ,formatRgb:H7,toString:H7}));function B7(){return`#${bl(this.r)}${bl(this.g)}${bl(this.b)}`}function yJ(){return`#${bl(this.r)}${bl(this.g)}${bl(this.b)}${bl((isNaN(this.opacity)?1:this.opacity)*255)}`}function H7(){const e=Yf(this.opacity);return`${e===1?"rgb(":"rgba("}${Sl(this.r)}, ${Sl(this.g)}, ${Sl(this.b)}${e===1?")":`, ${e})`}`}function Yf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Sl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function bl(e){return e=Sl(e),(e<16?"0":"")+e.toString(16)}function $7(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new _s(e,t,n,r)}function eA(e){if(e instanceof _s)return new _s(e.h,e.s,e.l,e.opacity);if(e instanceof vh||(e=Al(e)),!e)return new _s;if(e instanceof _s)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-i,u=(a+i)/2;return l?(t===a?o=(n-r)/l+(n0&&u<1?0:o,new _s(o,l,u,e.opacity)}function wJ(e,t,n,r){return arguments.length===1?eA(e):new _s(e,t,n,r??1)}function _s(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Q2(_s,wJ,JE(vh,{brighter(e){return e=e==null?Wf:Math.pow(Wf,e),new _s(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$d:Math.pow($d,e),new _s(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new pi(ub(e>=240?e-240:e+120,i,r),ub(e,i,r),ub(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new _s(F7(this.h),Z0(this.s),Z0(this.l),Yf(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=Yf(this.opacity);return`${e===1?"hsl(":"hsla("}${F7(this.h)}, ${Z0(this.s)*100}%, ${Z0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function F7(e){return e=(e||0)%360,e<0?e+360:e}function Z0(e){return Math.max(0,Math.min(1,e||0))}function ub(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 J2=e=>()=>e;function SJ(e,t){return function(n){return e+n*t}}function kJ(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 CJ(e){return(e=+e)==1?tA:function(t,n){return n-t?kJ(t,n,e):J2(isNaN(t)?n:t)}}function tA(e,t){var n=t-e;return n?SJ(e,n):J2(isNaN(e)?t:e)}const Xf=(function e(t){var n=CJ(t);function r(i,a){var o=n((i=Fv(i)).r,(a=Fv(a)).r),l=n(i.g,a.g),u=n(i.b,a.b),d=tA(i.opacity,a.opacity);return function(p){return i.r=o(p),i.g=l(p),i.b=u(p),i.opacity=d(p),i+""}}return r.gamma=e,r})(1);function EJ(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;in&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,u.push({i:o,x:Ps(r,i)})),n=db.lastIndex;return n180?p+=360:p-d>180&&(d+=360),g.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Ps(d,p)})):p&&f.push(i(f)+"rotate("+p+r)}function l(d,p,f,g){d!==p?g.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Ps(d,p)}):p&&f.push(i(f)+"skewX("+p+r)}function u(d,p,f,g,b,S){if(d!==f||p!==g){var k=b.push(i(b)+"scale(",null,",",null,")");S.push({i:k-4,x:Ps(d,f)},{i:k-2,x:Ps(p,g)})}else(f!==1||g!==1)&&b.push(i(b)+"scale("+f+","+g+")")}return function(d,p){var f=[],g=[];return d=e(d),p=e(p),a(d.translateX,d.translateY,p.translateX,p.translateY,f,g),o(d.rotate,p.rotate,f,g),l(d.skewX,p.skewX,f,g),u(d.scaleX,d.scaleY,p.scaleX,p.scaleY,f,g),d=p=null,function(b){for(var S=-1,k=g.length,x;++S=0&&e._call.call(void 0,t),e=e._next;--Zc}function q7(){Tl=(Zf=Pd.now())+Yp,Zc=od=0;try{FJ()}finally{Zc=0,UJ(),Tl=0}}function PJ(){var e=Pd.now(),t=e-Zf;t>sA&&(Yp-=t,Zf=e)}function UJ(){for(var e,t=Kf,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:Kf=n);ld=e,qv(r)}function qv(e){if(!Zc){od&&(od=clearTimeout(od));var t=e-Tl;t>24?(e<1/0&&(od=setTimeout(q7,e-Pd.now()-Yp)),nd&&(nd=clearInterval(nd))):(nd||(Zf=Pd.now(),nd=setInterval(PJ,sA)),Zc=1,aA(q7))}}function G7(e,t,n){var r=new Qf;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var qJ=Vp("start","end","cancel","interrupt"),GJ=[],lA=0,V7=1,Gv=2,_f=3,W7=4,Vv=5,xf=6;function Xp(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;VJ(e,n,{name:t,index:r,group:i,on:qJ,tween:GJ,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:lA})}function tx(e,t){var n=As(e,t);if(n.state>lA)throw new Error("too late; already scheduled");return n}function ta(e,t){var n=As(e,t);if(n.state>_f)throw new Error("too late; already running");return n}function As(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function VJ(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=oA(a,0,n.time);function a(d){n.state=V7,n.timer.restart(o,n.delay,n.time),n.delay<=d&&o(d-n.delay)}function o(d){var p,f,g,b;if(n.state!==V7)return u();for(p in r)if(b=r[p],b.name===n.name){if(b.state===_f)return G7(o);b.state===W7?(b.state=xf,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete r[p]):+pGv&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function wee(e,t,n){var r,i,a=yee(t)?tx:ta;return function(){var o=a(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}function See(e,t){var n=this._id;return arguments.length<2?As(this.node(),n).on.on(e):this.each(wee(n,e,t))}function kee(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Cee(){return this.on("end.remove",kee(this._id))}function Eee(e){var t=this._name,n=this._id;typeof e!="function"&&(e=K2(e));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o()=>e;function Zee(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){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:i}})}function Na(e,t,n){this.k=e,this.x=t,this.y=n}Na.prototype={constructor:Na,scale:function(e){return e===1?this:new Na(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Na(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 Kp=new Na(1,0,0);hA.prototype=Na.prototype;function hA(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Kp;return e.__zoom}function hb(e){e.stopImmediatePropagation()}function rd(e){e.preventDefault(),e.stopImmediatePropagation()}function Qee(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Jee(){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 Y7(){return this.__zoom||Kp}function ete(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function tte(){return navigator.maxTouchPoints||"ontouchstart"in this}function nte(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function fA(){var e=Qee,t=Jee,n=nte,r=ete,i=tte,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,u=vf,d=Vp("start","zoom","end"),p,f,g,b=500,S=150,k=0,x=10;function v(G){G.property("__zoom",Y7).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",I).filter(i).on("touchstart.zoom",$).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}v.transform=function(G,X,Y,Z){var Q=G.selection?G.selection():G;Q.property("__zoom",Y7),G!==Q?N(G,X,Y,Z):Q.interrupt().each(function(){E(this,arguments).event(Z).start().zoom(null,typeof X=="function"?X.apply(this,arguments):X).end()})},v.scaleBy=function(G,X,Y,Z){v.scaleTo(G,function(){var Q=this.__zoom.k,z=typeof X=="function"?X.apply(this,arguments):X;return Q*z},Y,Z)},v.scaleTo=function(G,X,Y,Z){v.transform(G,function(){var Q=t.apply(this,arguments),z=this.__zoom,O=Y==null?C(Q):typeof Y=="function"?Y.apply(this,arguments):Y,H=z.invert(O),V=typeof X=="function"?X.apply(this,arguments):X;return n(y(w(z,V),O,H),Q,o)},Y,Z)},v.translateBy=function(G,X,Y,Z){v.transform(G,function(){return n(this.__zoom.translate(typeof X=="function"?X.apply(this,arguments):X,typeof Y=="function"?Y.apply(this,arguments):Y),t.apply(this,arguments),o)},null,Z)},v.translateTo=function(G,X,Y,Z,Q){v.transform(G,function(){var z=t.apply(this,arguments),O=this.__zoom,H=Z==null?C(z):typeof Z=="function"?Z.apply(this,arguments):Z;return n(Kp.translate(H[0],H[1]).scale(O.k).translate(typeof X=="function"?-X.apply(this,arguments):-X,typeof Y=="function"?-Y.apply(this,arguments):-Y),z,o)},Z,Q)};function w(G,X){return X=Math.max(a[0],Math.min(a[1],X)),X===G.k?G:new Na(X,G.x,G.y)}function y(G,X,Y){var Z=X[0]-Y[0]*G.k,Q=X[1]-Y[1]*G.k;return Z===G.x&&Q===G.y?G:new Na(G.k,Z,Q)}function C(G){return[(+G[0][0]+ +G[1][0])/2,(+G[0][1]+ +G[1][1])/2]}function N(G,X,Y,Z){G.on("start.zoom",function(){E(this,arguments).event(Z).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(Z).end()}).tween("zoom",function(){var Q=this,z=arguments,O=E(Q,z).event(Z),H=t.apply(Q,z),V=Y==null?C(H):typeof Y=="function"?Y.apply(Q,z):Y,W=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),re=Q.__zoom,le=typeof X=="function"?X.apply(Q,z):X,pe=u(re.invert(V).concat(W/re.k),le.invert(V).concat(W/le.k));return function(te){if(te===1)te=le;else{var B=pe(te),ie=W/B[2];te=new Na(ie,V[0]-B[0]*ie,V[1]-B[1]*ie)}O.zoom(null,te)}})}function E(G,X,Y){return!Y&&G.__zooming||new j(G,X)}function j(G,X){this.that=G,this.args=X,this.active=0,this.sourceEvent=null,this.extent=t.apply(G,X),this.taps=0}j.prototype={event:function(G){return G&&(this.sourceEvent=G),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(G,X){return this.mouse&&G!=="mouse"&&(this.mouse[1]=X.invert(this.mouse[0])),this.touch0&&G!=="touch"&&(this.touch0[1]=X.invert(this.touch0[0])),this.touch1&&G!=="touch"&&(this.touch1[1]=X.invert(this.touch1[0])),this.that.__zoom=X,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(G){var X=Mi(this.that).datum();d.call(G,this.that,new Zee(G,{sourceEvent:this.sourceEvent,target:v,transform:this.that.__zoom,dispatch:d}),X)}};function T(G,...X){if(!e.apply(this,arguments))return;var Y=E(this,X).event(G),Z=this.__zoom,Q=Math.max(a[0],Math.min(a[1],Z.k*Math.pow(2,r.apply(this,arguments)))),z=bs(G);if(Y.wheel)(Y.mouse[0][0]!==z[0]||Y.mouse[0][1]!==z[1])&&(Y.mouse[1]=Z.invert(Y.mouse[0]=z)),clearTimeout(Y.wheel);else{if(Z.k===Q)return;Y.mouse=[z,Z.invert(z)],yf(this),Y.start()}rd(G),Y.wheel=setTimeout(O,S),Y.zoom("mouse",n(y(w(Z,Q),Y.mouse[0],Y.mouse[1]),Y.extent,o));function O(){Y.wheel=null,Y.end()}}function D(G,...X){if(g||!e.apply(this,arguments))return;var Y=G.currentTarget,Z=E(this,X,!0).event(G),Q=Mi(G.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",W,!0),z=bs(G,Y),O=G.clientX,H=G.clientY;KE(G.view),hb(G),Z.mouse=[z,this.__zoom.invert(z)],yf(this),Z.start();function V(re){if(rd(re),!Z.moved){var le=re.clientX-O,pe=re.clientY-H;Z.moved=le*le+pe*pe>k}Z.event(re).zoom("mouse",n(y(Z.that.__zoom,Z.mouse[0]=bs(re,Y),Z.mouse[1]),Z.extent,o))}function W(re){Q.on("mousemove.zoom mouseup.zoom",null),ZE(re.view,Z.moved),rd(re),Z.event(re).end()}}function I(G,...X){if(e.apply(this,arguments)){var Y=this.__zoom,Z=bs(G.changedTouches?G.changedTouches[0]:G,this),Q=Y.invert(Z),z=Y.k*(G.shiftKey?.5:2),O=n(y(w(Y,z),Z,Q),t.apply(this,X),o);rd(G),l>0?Mi(this).transition().duration(l).call(N,O,Z,G):Mi(this).call(v.transform,O,Z,G)}}function $(G,...X){if(e.apply(this,arguments)){var Y=G.touches,Z=Y.length,Q=E(this,X,G.changedTouches.length===Z).event(G),z,O,H,V;for(hb(G),O=0;O`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.`},Ud=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],pA=["Enter"," ","Escape"],mA={"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 Qc;(function(e){e.Strict="strict",e.Loose="loose"})(Qc||(Qc={}));var kl;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(kl||(kl={}));var qd;(function(e){e.Partial="partial",e.Full="full"})(qd||(qd={}));const gA={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Co;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Co||(Co={}));var Jf;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Jf||(Jf={}));var lt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(lt||(lt={}));const X7={[lt.Left]:lt.Right,[lt.Right]:lt.Left,[lt.Top]:lt.Bottom,[lt.Bottom]:lt.Top};function bA(e){return e===null?null:e?"valid":"invalid"}const vA=e=>"id"in e&&"source"in e&&"target"in e,rte=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),rx=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),_h=(e,t=[0,0])=>{const{width:n,height:r}=qa(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},ite=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const a=typeof i=="string";let o=!t.nodeLookup&&!a?i:void 0;t.nodeLookup&&(o=a?t.nodeLookup.get(i):rx(i)?i:t.nodeLookup.get(i.id));const l=o?ep(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Zp(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Qp(n)},xh=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=Zp(n,ep(i)),r=!0)}),r?Qp(n):{x:0,y:0,width:0,height:0}},ix=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{const l=(t.x-n)/i,u=(t.y-r)/i,d=t.width/i,p=t.height/i,f=[];for(const g of e.values()){const{measured:b,selectable:S=!0,hidden:k=!1}=g;if(o&&!S||k)continue;const x=b.width??g.width??g.initialWidth??0,v=b.height??g.height??g.initialHeight??0,{x:w,y}=g.internals.positionAbsolute,C=wA(l,u,d,p,w,y,x,v),N=x*v,E=a&&C>0;(!g.internals.handleBounds||E||C>=N||g.dragging)&&f.push(g)}return f},ste=(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 ate(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function ote({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;const l=ate(e,o),u=xh(l),d=ax(u,t,n,(o==null?void 0:o.minZoom)??i,(o==null?void 0:o.maxZoom)??a,(o==null?void 0:o.padding)??.1);return await r.setViewport(d,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function _A({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:u,y:d}=l?l.internals.positionAbsolute:{x:0,y:0},p=o.origin??r;let f=o.extent||i;if(o.extent==="parent"&&!o.expandParent)if(!l)a==null||a("005",Es.error005());else{const b=l.measured.width,S=l.measured.height;b&&S&&(f=[[u,d],[u+b,d+S]])}else l&&jl(o.extent)&&(f=[[o.extent[0][0]+u,o.extent[0][1]+d],[o.extent[1][0]+u,o.extent[1][1]+d]]);const g=jl(f)?Nl(t,f,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",Es.error015())),{position:{x:g.x-u+(o.measured.width??0)*p[0],y:g.y-d+(o.measured.height??0)*p[1]},positionAbsolute:g}}async function lte({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const a=new Set(e.map(g=>g.id)),o=[];for(const g of n){if(g.deletable===!1)continue;const b=a.has(g.id),S=!b&&g.parentId&&o.find(k=>k.id===g.parentId);(b||S)&&o.push(g)}const l=new Set(t.map(g=>g.id)),u=r.filter(g=>g.deletable!==!1),p=ste(o,u);for(const g of u)l.has(g.id)&&!p.find(S=>S.id===g.id)&&p.push(g);if(!i)return{edges:p,nodes:o};const f=await i({nodes:o,edges:p});return typeof f=="boolean"?f?{edges:p,nodes:o}:{edges:[],nodes:[]}:f}const Jc=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Nl=(e={x:0,y:0},t,n)=>({x:Jc(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Jc(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function xA(e,t,n){const{width:r,height:i}=qa(n),{x:a,y:o}=n.internals.positionAbsolute;return Nl(e,[[a,o],[a+r,o+i]],t)}const K7=(e,t,n)=>en?-Jc(Math.abs(e-n),1,t)/t:0,sx=(e,t,n=15,r=40)=>{const i=K7(e.x,r,t.width-r)*n,a=K7(e.y,r,t.height-r)*n;return[i,a]},Zp=(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)}),Wv=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Qp=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Gd=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=rx(e)?e.internals.positionAbsolute:_h(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},ep=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=rx(e)?e.internals.positionAbsolute:_h(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},yA=(e,t)=>Qp(Zp(Wv(e),Wv(t))),wA=(e,t,n,r,i,a,o,l)=>{const u=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),d=Math.max(0,Math.min(t+r,a+l)-Math.max(t,a));return Math.ceil(u*d)},tp=(e,t)=>wA(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Z7=e=>xs(e.width)&&xs(e.height)&&xs(e.x)&&xs(e.y),xs=e=>!isNaN(e)&&isFinite(e),SA=(e,t)=>(n,r)=>{},yh=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),wh=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return a?yh(l,o):l},eu=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function wc(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 cte(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=wc(e,n),i=wc(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=wc(e.top??e.y??0,n),i=wc(e.bottom??e.y??0,n),a=wc(e.left??e.x??0,t),o=wc(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function ute(e,t,n,r,i,a){const{x:o,y:l}=eu(e,[t,n,r]),{x:u,y:d}=eu({x:e.x+e.width,y:e.y+e.height},[t,n,r]),p=i-u,f=a-d;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(p),bottom:Math.floor(f)}}const ax=(e,t,n,r,i,a)=>{const o=cte(a,t,n),l=(t-o.x)/e.width,u=(n-o.y)/e.height,d=Math.min(l,u),p=Jc(d,r,i),f=e.x+e.width/2,g=e.y+e.height/2,b=t/2-f*p,S=n/2-g*p,k=ute(e,b,S,p,t,n),x={left:Math.min(k.left-o.left,0),top:Math.min(k.top-o.top,0),right:Math.min(k.right-o.right,0),bottom:Math.min(k.bottom-o.bottom,0)};return{x:b-x.left+x.right,y:S-x.top+x.bottom,zoom:p}},Vd=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function jl(e){return e!=null&&e!=="parent"}function qa(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 kA(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 CA(e,t={width:0,height:0},n,r,i){const a={...e},o=r.get(n);if(o){const l=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return a}function Q7(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function dte(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function hte(e){return{...mA,...e||{}}}function _d(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:a,y:o}=ys(e),l=wh({x:a-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:u,y:d}=n?yh(l,t):l;return{xSnapped:u,ySnapped:d,...l}}const ox=e=>({width:e.offsetWidth,height:e.offsetHeight}),EA=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},fte=["INPUT","SELECT","TEXTAREA"];function AA(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:fte.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const TA=e=>"clientX"in e,ys=(e,t)=>{var a,o;const n=TA(e),r=n?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,i=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},J7=(e,t,n,r,i)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:i,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...ox(o)}})};function NA({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:l}){const u=e*.125+i*.375+o*.375+n*.125,d=t*.125+a*.375+l*.375+r*.125,p=Math.abs(u-e),f=Math.abs(d-t);return[u,d,p,f]}function ef(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function e8({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case lt.Left:return[t-ef(t-r,a),n];case lt.Right:return[t+ef(r-t,a),n];case lt.Top:return[t,n-ef(n-i,a)];case lt.Bottom:return[t,n+ef(i-n,a)]}}function jA({sourceX:e,sourceY:t,sourcePosition:n=lt.Bottom,targetX:r,targetY:i,targetPosition:a=lt.Top,curvature:o=.25}){const[l,u]=e8({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[d,p]=e8({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[f,g,b,S]=NA({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:u,targetControlX:d,targetControlY:p});return[`M${e},${t} C${l},${u} ${d},${p} ${r},${i}`,f,g,b,S]}function MA({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,a=n0}const gte=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,bte=(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)),vte=(e,t,n={})=>{var a;if(!e.source||!e.target)return(a=n.onError)==null||a.call(n,"006",Es.error006()),t;const r=n.getEdgeId||gte;let i;return vA(e)?i={...e}:i={...e,id:r(e)},bte(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function RA({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,a,o,l]=MA({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,l]}const t8={[lt.Left]:{x:-1,y:0},[lt.Right]:{x:1,y:0},[lt.Top]:{x:0,y:-1},[lt.Bottom]:{x:0,y:1}},_te=({source:e,sourcePosition:t=lt.Bottom,target:n})=>t===lt.Left||t===lt.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function xte({source:e,sourcePosition:t=lt.Bottom,target:n,targetPosition:r=lt.Top,center:i,offset:a,stepPosition:o}){const l=t8[t],u=t8[r],d={x:e.x+l.x*a,y:e.y+l.y*a},p={x:n.x+u.x*a,y:n.y+u.y*a},f=_te({source:d,sourcePosition:t,target:p}),g=f.x!==0?"x":"y",b=f[g];let S=[],k,x;const v={x:0,y:0},w={x:0,y:0},[,,y,C]=MA({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[g]*u[g]===-1){g==="x"?(k=i.x??d.x+(p.x-d.x)*o,x=i.y??(d.y+p.y)/2):(k=i.x??(d.x+p.x)/2,x=i.y??d.y+(p.y-d.y)*o);const T=[{x:k,y:d.y},{x:k,y:p.y}],D=[{x:d.x,y:x},{x:p.x,y:x}];l[g]===b?S=g==="x"?T:D:S=g==="x"?D:T}else{const T=[{x:d.x,y:p.y}],D=[{x:p.x,y:d.y}];if(g==="x"?S=l.x===b?D:T:S=l.y===b?T:D,t===r){const G=Math.abs(e[g]-n[g]);if(G<=a){const X=Math.min(a-1,a-G);l[g]===b?v[g]=(d[g]>e[g]?-1:1)*X:w[g]=(p[g]>n[g]?-1:1)*X}}if(t!==r){const G=g==="x"?"y":"x",X=l[g]===u[G],Y=d[G]>p[G],Z=d[G]=U?(k=(I.x+$.x)/2,x=S[0].y):(k=S[0].x,x=(I.y+$.y)/2)}const N={x:d.x+v.x,y:d.y+v.y},E={x:p.x+w.x,y:p.y+w.y};return[[e,...N.x!==S[0].x||N.y!==S[0].y?[N]:[],...S,...E.x!==S[S.length-1].x||E.y!==S[S.length-1].y?[E]:[],n],k,x,y,C]}function yte(e,t,n,r){const i=Math.min(n8(e,t)/2,n8(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){const d=e.xn.id===t):e[0])||null}function Xv(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Ste(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const a=new Set;return e.reduce((o,l)=>([l.markerStart||r,l.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const d=Xv(u,t);a.has(d)||(o.push({id:d,color:u.color||n,...u}),a.add(d))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const DA=1e3,kte=10,lx={nodeOrigin:[0,0],nodeExtent:Ud,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Cte={...lx,checkEquality:!0};function cx(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Ete(e,t,n){const r=cx(lx,n);for(const i of e.values())if(i.parentId)dx(i,e,t,r);else{const a=_h(i,r.nodeOrigin),o=jl(i.extent)?i.extent:r.nodeExtent,l=Nl(a,o,qa(i));i.internals.positionAbsolute=l}}function Ate(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const a={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(a):i.type==="target"&&r.push(a)}return{source:n,target:r}}function ux(e){return e==="manual"}function Kv(e,t,n,r={}){var p,f;const i=cx(Cte,r),a={i:0},o=new Map(t),l=i!=null&&i.elevateNodesOnSelect&&!ux(i.zIndexMode)?DA:0;let u=e.length>0,d=!1;t.clear(),n.clear();for(const g of e){let b=o.get(g.id);if(i.checkEquality&&g===(b==null?void 0:b.internals.userNode))t.set(g.id,b);else{const S=_h(g,i.nodeOrigin),k=jl(g.extent)?g.extent:i.nodeExtent,x=Nl(S,k,qa(g));b={...i.defaults,...g,measured:{width:(p=g.measured)==null?void 0:p.width,height:(f=g.measured)==null?void 0:f.height},internals:{positionAbsolute:x,handleBounds:Ate(g,b),z:LA(g,l,i.zIndexMode),userNode:g}},t.set(g.id,b)}(b.measured===void 0||b.measured.width===void 0||b.measured.height===void 0)&&!b.hidden&&(u=!1),g.parentId&&dx(b,t,n,r,a),d||(d=g.selected??!1)}return{nodesInitialized:u,hasSelectedNodes:d}}function Tte(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 dx(e,t,n,r,i){const{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:l,zIndexMode:u}=cx(lx,r),d=e.parentId,p=t.get(d);if(!p){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Tte(e,n),i&&!p.parentId&&p.internals.rootParentIndex===void 0&&u==="auto"&&(p.internals.rootParentIndex=++i.i,p.internals.z=p.internals.z+i.i*kte),i&&p.internals.rootParentIndex!==void 0&&(i.i=p.internals.rootParentIndex);const f=a&&!ux(u)?DA:0,{x:g,y:b,z:S}=Nte(e,p,o,l,f,u),{positionAbsolute:k}=e.internals,x=g!==k.x||b!==k.y;(x||S!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:g,y:b}:k,z:S}})}function LA(e,t,n){const r=xs(e.zIndex)?e.zIndex:0;return ux(n)?r:r+(e.selected?t:0)}function Nte(e,t,n,r,i,a){const{x:o,y:l}=t.internals.positionAbsolute,u=qa(e),d=_h(e,n),p=jl(e.extent)?Nl(d,e.extent,u):d;let f=Nl({x:o+p.x,y:l+p.y},r,u);e.extent==="parent"&&(f=xA(f,u,t));const g=LA(e,i,a),b=t.internals.z??0;return{x:f.x,y:f.y,z:b>=g?b+1:g}}function hx(e,t,n,r=[0,0]){var o;const i=[],a=new Map;for(const l of e){const u=t.get(l.parentId);if(!u)continue;const d=((o=a.get(l.parentId))==null?void 0:o.expandedRect)??Gd(u),p=yA(d,l.rect);a.set(l.parentId,{expandedRect:p,parent:u})}return a.size>0&&a.forEach(({expandedRect:l,parent:u},d)=>{var y;const p=u.internals.positionAbsolute,f=qa(u),g=u.origin??r,b=l.x0||S>0||v||w)&&(i.push({id:d,type:"position",position:{x:u.position.x-b+v,y:u.position.y-S+w}}),(y=n.get(d))==null||y.forEach(C=>{e.some(N=>N.id===C.id)||i.push({id:C.id,type:"position",position:{x:C.position.x+b,y:C.position.y+S}})})),(f.width0){const b=hx(g,t,n,i);d.push(...b)}return{changes:d,updatedInternals:u}}async function Mte({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function a8(e,t,n,r,i,a){let o=i;const l=r.get(o)||new Map;r.set(o,l.set(n,t)),o=`${i}-${e}`;const u=r.get(o)||new Map;if(r.set(o,u.set(n,t)),a){o=`${i}-${e}-${a}`;const d=r.get(o)||new Map;r.set(o,d.set(n,t))}}function OA(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:a,sourceHandle:o=null,targetHandle:l=null}=r,u={edgeId:r.id,source:i,target:a,sourceHandle:o,targetHandle:l},d=`${i}-${o}--${a}-${l}`,p=`${a}-${l}--${i}-${o}`;a8("source",u,p,e,i,o),a8("target",u,d,e,a,l),t.set(r.id,r)}}function IA(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:IA(n,t):!1}function o8(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Rte(e,t,n,r){const i=new Map;for(const[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!IA(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(a);l&&i.set(a,{id:a,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function fb({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,u;const i=[];for(const[d,p]of t){const f=(o=n.get(d))==null?void 0:o.internals.userNode;f&&i.push({...f,position:p.position,dragging:r})}if(!e)return[i[0],i];const a=(l=n.get(e))==null?void 0:l.internals.userNode;return[a?{...a,position:((u=t.get(e))==null?void 0:u.position)||a.position,dragging:r}:i[0],i]}function Dte({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const a={x:n-i.distance.x,y:r-i.distance.y},o=yh(a,t);return{x:o.x-a.x,y:o.y-a.y}}function Lte({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,l=new Map,u=!1,d={x:0,y:0},p=null,f=!1,g=null,b=!1,S=!1,k=null;function x({noDragClassName:w,handleSelector:y,domNode:C,isSelectable:N,nodeId:E,nodeClickDistance:j=0}){g=Mi(C);function T({x:F,y:U}){const{nodeLookup:G,nodeExtent:X,snapGrid:Y,snapToGrid:Z,nodeOrigin:Q,onNodeDrag:z,onSelectionDrag:O,onError:H,updateNodePositions:V}=t();a={x:F,y:U};let W=!1;const re=l.size>1,le=re&&X?Wv(xh(l)):null,pe=re&&Z?Dte({dragItems:l,snapGrid:Y,x:F,y:U}):null;for(const[te,B]of l){if(!G.has(te))continue;let ie={x:F-B.distance.x,y:U-B.distance.y};Z&&(ie=pe?{x:Math.round(ie.x+pe.x),y:Math.round(ie.y+pe.y)}:yh(ie,Y));let oe=null;if(re&&X&&!B.extent&&le){const{positionAbsolute:Ce}=B.internals,Le=Ce.x-le.x+X[0][0],Ue=Ce.x+B.measured.width-le.x2+X[1][0],We=Ce.y-le.y+X[0][1],Fe=Ce.y+B.measured.height-le.y2+X[1][1];oe=[[Le,We],[Ue,Fe]]}const{position:be,positionAbsolute:ge}=_A({nodeId:te,nextPosition:ie,nodeLookup:G,nodeExtent:oe||X,nodeOrigin:Q,onError:H});W=W||B.position.x!==be.x||B.position.y!==be.y,B.position=be,B.internals.positionAbsolute=ge}if(S=S||W,!!W&&(V(l,!0),k&&(r||z||!E&&O))){const[te,B]=fb({nodeId:E,dragItems:l,nodeLookup:G});r==null||r(k,l,te,B),z==null||z(k,te,B),E||O==null||O(k,B)}}async function D(){if(!p)return;const{transform:F,panBy:U,autoPanSpeed:G,autoPanOnNodeDrag:X}=t();if(!X){u=!1,cancelAnimationFrame(o);return}const[Y,Z]=sx(d,p,G);(Y!==0||Z!==0)&&(a.x=(a.x??0)-Y/F[2],a.y=(a.y??0)-Z/F[2],await U({x:Y,y:Z})&&T(a)),o=requestAnimationFrame(D)}function I(F){var re;const{nodeLookup:U,multiSelectionActive:G,nodesDraggable:X,transform:Y,snapGrid:Z,snapToGrid:Q,selectNodesOnDrag:z,onNodeDragStart:O,onSelectionDragStart:H,unselectNodesAndEdges:V}=t();f=!0,(!z||!N)&&!G&&E&&((re=U.get(E))!=null&&re.selected||V()),N&&z&&E&&(e==null||e(E));const W=_d(F.sourceEvent,{transform:Y,snapGrid:Z,snapToGrid:Q,containerBounds:p});if(a=W,l=Rte(U,X,W,E),l.size>0&&(n||O||!E&&H)){const[le,pe]=fb({nodeId:E,dragItems:l,nodeLookup:U});n==null||n(F.sourceEvent,l,le,pe),O==null||O(F.sourceEvent,le,pe),E||H==null||H(F.sourceEvent,pe)}}const $=QE().clickDistance(j).on("start",F=>{const{domNode:U,nodeDragThreshold:G,transform:X,snapGrid:Y,snapToGrid:Z}=t();p=(U==null?void 0:U.getBoundingClientRect())||null,b=!1,S=!1,k=F.sourceEvent,G===0&&I(F),a=_d(F.sourceEvent,{transform:X,snapGrid:Y,snapToGrid:Z,containerBounds:p}),d=ys(F.sourceEvent,p)}).on("drag",F=>{const{autoPanOnNodeDrag:U,transform:G,snapGrid:X,snapToGrid:Y,nodeDragThreshold:Z,nodeLookup:Q}=t(),z=_d(F.sourceEvent,{transform:G,snapGrid:X,snapToGrid:Y,containerBounds:p});if(k=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||E&&!Q.has(E))&&(b=!0),!b){if(!u&&U&&f&&(u=!0,D()),!f){const O=ys(F.sourceEvent,p),H=O.x-d.x,V=O.y-d.y;Math.sqrt(H*H+V*V)>Z&&I(F)}(a.x!==z.xSnapped||a.y!==z.ySnapped)&&l&&f&&(d=ys(F.sourceEvent,p),T(z))}}).on("end",F=>{if(!f||b){b&&l.size>0&&t().updateNodePositions(l,!1);return}if(u=!1,f=!1,cancelAnimationFrame(o),l.size>0){const{nodeLookup:U,updateNodePositions:G,onNodeDragStop:X,onSelectionDragStop:Y}=t();if(S&&(G(l,!1),S=!1),i||X||!E&&Y){const[Z,Q]=fb({nodeId:E,dragItems:l,nodeLookup:U,dragging:!1});i==null||i(F.sourceEvent,l,Z,Q),X==null||X(F.sourceEvent,Z,Q),E||Y==null||Y(F.sourceEvent,Q)}}}).filter(F=>{const U=F.target;return!F.button&&(!w||!o8(U,`.${w}`,C))&&(!y||o8(U,y,C))});g.call($)}function v(){g==null||g.on(".drag",null)}return{update:x,destroy:v}}function Ote(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())tp(i,Gd(a))>0&&r.push(a);return r}const Ite=250;function zte(e,t,n,r){var l,u;let i=[],a=1/0;const o=Ote(e,n,t+Ite);for(const d of o){const p=[...((l=d.internals.handleBounds)==null?void 0:l.source)??[],...((u=d.internals.handleBounds)==null?void 0:u.target)??[]];for(const f of p){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:g,y:b}=Ml(d,f,f.position,!0),S=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(b-e.y,2));S>t||(S1){const d=r.type==="source"?"target":"source";return i.find(p=>p.type===d)??i[0]}return i[0]}function zA(e,t,n,r,i,a=!1){var d,p,f;const o=r.get(e);if(!o)return null;const l=i==="strict"?(d=o.internals.handleBounds)==null?void 0:d[t]:[...((p=o.internals.handleBounds)==null?void 0:p.source)??[],...((f=o.internals.handleBounds)==null?void 0:f.target)??[]],u=(n?l==null?void 0:l.find(g=>g.id===n):l==null?void 0:l[0])??null;return u&&a?{...u,...Ml(o,u,u.position,!0)}:u}function BA(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Bte(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const HA=()=>!0;function Hte(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:l,nodeLookup:u,lib:d,autoPanOnConnect:p,flowId:f,panBy:g,cancelConnection:b,onConnectStart:S,onConnect:k,onConnectEnd:x,isValidConnection:v=HA,onReconnectEnd:w,updateConnection:y,getTransform:C,getFromHandle:N,autoPanSpeed:E,dragThreshold:j=1,handleDomNode:T}){const D=EA(e.target);let I=0,$;const{x:F,y:U}=ys(e),G=BA(a,T),X=l==null?void 0:l.getBoundingClientRect();let Y=!1;if(!X||!G)return;const Z=zA(i,G,r,u,t);if(!Z)return;let Q=ys(e,X),z=!1,O=null,H=!1,V=null;function W(){if(!p||!X)return;const[be,ge]=sx(Q,X,E);g({x:be,y:ge}),I=requestAnimationFrame(W)}const re={...Z,nodeId:i,type:G,position:Z.position},le=u.get(i);let te={inProgress:!0,isValid:null,from:Ml(le,re,lt.Left,!0),fromHandle:re,fromPosition:re.position,fromNode:le,to:Q,toHandle:null,toPosition:X7[re.position],toNode:null,pointer:Q};function B(){Y=!0,y(te),S==null||S(e,{nodeId:i,handleId:r,handleType:G})}j===0&&B();function ie(be){if(!Y){const{x:Fe,y:mt}=ys(be),De=Fe-F,ot=mt-U;if(!(De*De+ot*ot>j*j))return;B()}if(!N()||!re){oe(be);return}const ge=C();Q=ys(be,X),$=zte(wh(Q,ge,!1,[1,1]),n,u,re),z||(W(),z=!0);const Ce=$A(be,{handle:$,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:v,doc:D,lib:d,flowId:f,nodeLookup:u});V=Ce.handleDomNode,O=Ce.connection,H=Bte(!!$,Ce.isValid);const Le=u.get(i),Ue=Le?Ml(Le,re,lt.Left,!0):te.from,We={...te,from:Ue,isValid:H,to:Ce.toHandle&&H?eu({x:Ce.toHandle.x,y:Ce.toHandle.y},ge):Q,toHandle:Ce.toHandle,toPosition:H&&Ce.toHandle?Ce.toHandle.position:X7[re.position],toNode:Ce.toHandle?u.get(Ce.toHandle.nodeId):null,pointer:Q};y(We),te=We}function oe(be){if(!("touches"in be&&be.touches.length>0)){if(Y){($||V)&&O&&H&&(k==null||k(O));const{inProgress:ge,...Ce}=te,Le={...Ce,toPosition:te.toHandle?te.toPosition:null};x==null||x(be,Le),a&&(w==null||w(be,Le))}b(),cancelAnimationFrame(I),z=!1,H=!1,O=null,V=null,D.removeEventListener("mousemove",ie),D.removeEventListener("mouseup",oe),D.removeEventListener("touchmove",ie),D.removeEventListener("touchend",oe)}}D.addEventListener("mousemove",ie),D.addEventListener("mouseup",oe),D.addEventListener("touchmove",ie),D.addEventListener("touchend",oe)}function $A(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:l,flowId:u,isValidConnection:d=HA,nodeLookup:p}){const f=a==="target",g=t?o.querySelector(`.${l}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:b,y:S}=ys(e),k=o.elementFromPoint(b,S),x=k!=null&&k.classList.contains(`${l}-flow__handle`)?k:g,v={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const w=BA(void 0,x),y=x.getAttribute("data-nodeid"),C=x.getAttribute("data-handleid"),N=x.classList.contains("connectable"),E=x.classList.contains("connectableend");if(!y||!w)return v;const j={source:f?y:r,sourceHandle:f?C:i,target:f?r:y,targetHandle:f?i:C};v.connection=j;const D=N&&E&&(n===Qc.Strict?f&&w==="source"||!f&&w==="target":y!==r||C!==i);v.isValid=D&&d(j),v.toHandle=zA(y,w,C,p,n,!0)}return v}const Zv={onPointerDown:Hte,isValid:$A};function $te({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=Mi(e);function a({translateExtent:l,width:u,height:d,zoomStep:p=1,pannable:f=!0,zoomable:g=!0,inversePan:b=!1}){const S=y=>{if(y.sourceEvent.type!=="wheel"||!t)return;const C=n(),N=y.sourceEvent.ctrlKey&&Vd()?10:1,E=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*p,j=C[2]*Math.pow(2,E*N);t.scaleTo(j)};let k=[0,0];const x=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(k=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},v=y=>{const C=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const N=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],E=[N[0]-k[0],N[1]-k[1]];k=N;const j=r()*Math.max(C[2],Math.log(C[2]))*(b?-1:1),T={x:C[0]-E[0]*j,y:C[1]-E[1]*j},D=[[0,0],[u,d]];t.setViewportConstrained({x:T.x,y:T.y,zoom:C[2]},D,l)},w=fA().on("start",x).on("zoom",f?v:null).on("zoom.wheel",g?S:null);i.call(w,{})}function o(){i.on("zoom",null)}return{update:a,destroy:o,pointer:bs}}const Jp=e=>({x:e.x,y:e.y,zoom:e.k}),pb=({x:e,y:t,zoom:n})=>Kp.translate(e,t).scale(n),Mc=(e,t)=>e.target.closest(`.${t}`),FA=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Fte=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,mb=(e,t=0,n=Fte,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},PA=e=>{const t=e.ctrlKey&&Vd()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Pte({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:d}){return p=>{if(Mc(p,t))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(p.ctrlKey&&o){const x=bs(p),v=PA(p),w=f*Math.pow(2,v);r.scaleTo(n,w,x,p);return}const g=p.deltaMode===1?20:1;let b=i===kl.Vertical?0:p.deltaX*g,S=i===kl.Horizontal?0:p.deltaY*g;!Vd()&&p.shiftKey&&i!==kl.Vertical&&(b=p.deltaY*g,S=0),r.translateBy(n,-(b/f)*a,-(S/f)*a,{internal:!0});const k=Jp(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(p,k),e.panScrollTimeout=setTimeout(()=>{d==null||d(p,k),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(p,k))}}function Ute({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const a=r.type==="wheel",o=!t&&a&&!r.ctrlKey,l=Mc(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,i)}}function qte({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,o,l;if((a=r.sourceEvent)!=null&&a.internal)return;const i=Jp(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function Gte({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{var o,l;e.usedRightMouseButton=!!(n&&FA(t,e.mouseButton??0)),(o=a.sourceEvent)!=null&&o.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!((l=a.sourceEvent)!=null&&l.internal)&&(i==null||i(a.sourceEvent,Jp(a.transform)))}}function Vte({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,a&&FA(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const u=Jp(o.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,u)},n?150:0)}}}function Wte({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:l,noPanClassName:u,lib:d,connectionInProgress:p}){return f=>{var x;const g=e||t,b=n&&f.ctrlKey,S=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Mc(f,`${d}-flow__node`)||Mc(f,`${d}-flow__edge`)))return!0;if(!r&&!g&&!i&&!a&&!n||o||p&&!S||Mc(f,l)&&S||Mc(f,u)&&(!S||i&&S&&!e)||!n&&f.ctrlKey&&S)return!1;if(!n&&f.type==="touchstart"&&((x=f.touches)==null?void 0:x.length)>1)return f.preventDefault(),!1;if(!g&&!i&&!b&&S||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const k=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||S)&&k}}function Yte({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:u}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),f=fA().scaleExtent([t,n]).translateExtent(r),g=Mi(e).call(f);w({x:i.x,y:i.y,zoom:Jc(i.zoom,t,n)},[[0,0],[p.width,p.height]],r);const b=g.on("wheel.zoom"),S=g.on("dblclick.zoom");f.wheelDelta(PA);async function k($,F){return g?new Promise(U=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?vd:vf).transform(mb(g,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>U(!0)),$)}):!1}function x({noWheelClassName:$,noPanClassName:F,onPaneContextMenu:U,userSelectionActive:G,panOnScroll:X,panOnDrag:Y,panOnScrollMode:Z,panOnScrollSpeed:Q,preventScrolling:z,zoomOnPinch:O,zoomOnScroll:H,zoomOnDoubleClick:V,zoomActivationKeyPressed:W,lib:re,onTransformChange:le,connectionInProgress:pe,paneClickDistance:te,selectionOnDrag:B}){G&&!d.isZoomingOrPanning&&v();const ie=X&&!W&&!G;f.clickDistance(B?1/0:!xs(te)||te<0?0:te);const oe=ie?Pte({zoomPanValues:d,noWheelClassName:$,d3Selection:g,d3Zoom:f,panOnScrollMode:Z,panOnScrollSpeed:Q,zoomOnPinch:O,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:l}):Ute({noWheelClassName:$,preventScrolling:z,d3ZoomHandler:b});g.on("wheel.zoom",oe,{passive:!1});const be=qte({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:o});f.on("start",be);const ge=Gte({zoomPanValues:d,panOnDrag:Y,onPaneContextMenu:!!U,onPanZoom:a,onTransformChange:le});f.on("zoom",ge);const Ce=Vte({zoomPanValues:d,panOnDrag:Y,panOnScroll:X,onPaneContextMenu:U,onPanZoomEnd:l,onDraggingChange:u});f.on("end",Ce);const Le=Wte({zoomActivationKeyPressed:W,panOnDrag:Y,zoomOnScroll:H,panOnScroll:X,zoomOnDoubleClick:V,zoomOnPinch:O,userSelectionActive:G,noPanClassName:F,noWheelClassName:$,lib:re,connectionInProgress:pe});f.filter(Le),V?g.on("dblclick.zoom",S):g.on("dblclick.zoom",null)}function v(){f.on("zoom",null)}async function w($,F,U){const G=pb($),X=f==null?void 0:f.constrain()(G,F,U);return X&&await k(X),X}async function y($,F){const U=pb($);return await k(U,F),U}function C($){if(g){const F=pb($),U=g.property("__zoom");(U.k!==$.zoom||U.x!==$.x||U.y!==$.y)&&(f==null||f.transform(g,F,null,{sync:!0}))}}function N(){const $=g?hA(g.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}async function E($,F){return g?new Promise(U=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?vd:vf).scaleTo(mb(g,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>U(!0)),$)}):!1}async function j($,F){return g?new Promise(U=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?vd:vf).scaleBy(mb(g,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>U(!0)),$)}):!1}function T($){f==null||f.scaleExtent($)}function D($){f==null||f.translateExtent($)}function I($){const F=!xs($)||$<0?0:$;f==null||f.clickDistance(F)}return{update:x,destroy:v,setViewport:y,setViewportConstrained:w,getViewport:N,scaleTo:E,scaleBy:j,setScaleExtent:T,setTranslateExtent:D,syncViewport:C,setClickDistance:I}}var tu;(function(e){e.Line="line",e.Handle="handle"})(tu||(tu={}));function Xte({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){const o=e-t,l=n-r,u=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&i&&(u[0]=u[0]*-1),l&&a&&(u[1]=u[1]*-1),u}function l8(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function So(e,t){return Math.max(0,t-e)}function ko(e,t){return Math.max(0,e-t)}function tf(e,t,n){return Math.max(0,t-e,e-n)}function c8(e,t){return e?!t:t}function Kte(e,t,n,r,i,a,o,l){let{affectsX:u,affectsY:d}=t;const{isHorizontal:p,isVertical:f}=t,g=p&&f,{xSnapped:b,ySnapped:S}=n,{minWidth:k,maxWidth:x,minHeight:v,maxHeight:w}=r,{x:y,y:C,width:N,height:E,aspectRatio:j}=e;let T=Math.floor(p?b-e.pointerX:0),D=Math.floor(f?S-e.pointerY:0);const I=N+(u?-T:T),$=E+(d?-D:D),F=-a[0]*N,U=-a[1]*E;let G=tf(I,k,x),X=tf($,v,w);if(o){let Q=0,z=0;u&&T<0?Q=So(y+T+F,o[0][0]):!u&&T>0&&(Q=ko(y+I+F,o[1][0])),d&&D<0?z=So(C+D+U,o[0][1]):!d&&D>0&&(z=ko(C+$+U,o[1][1])),G=Math.max(G,Q),X=Math.max(X,z)}if(l){let Q=0,z=0;u&&T>0?Q=ko(y+T,l[0][0]):!u&&T<0&&(Q=So(y+I,l[1][0])),d&&D>0?z=ko(C+D,l[0][1]):!d&&D<0&&(z=So(C+$,l[1][1])),G=Math.max(G,Q),X=Math.max(X,z)}if(i){if(p){const Q=tf(I/j,v,w)*j;if(G=Math.max(G,Q),o){let z=0;!u&&!d||u&&!d&&g?z=ko(C+U+I/j,o[1][1])*j:z=So(C+U+(u?T:-T)/j,o[0][1])*j,G=Math.max(G,z)}if(l){let z=0;!u&&!d||u&&!d&&g?z=So(C+I/j,l[1][1])*j:z=ko(C+(u?T:-T)/j,l[0][1])*j,G=Math.max(G,z)}}if(f){const Q=tf($*j,k,x)/j;if(X=Math.max(X,Q),o){let z=0;!u&&!d||d&&!u&&g?z=ko(y+$*j+F,o[1][0])/j:z=So(y+(d?D:-D)*j+F,o[0][0])/j,X=Math.max(X,z)}if(l){let z=0;!u&&!d||d&&!u&&g?z=So(y+$*j,l[1][0])/j:z=ko(y+(d?D:-D)*j,l[0][0])/j,X=Math.max(X,z)}}}D=D+(D<0?X:-X),T=T+(T<0?G:-G),i&&(g?I>$*j?D=(c8(u,d)?-T:T)/j:T=(c8(u,d)?-D:D)*j:p?(D=T/j,d=u):(T=D*j,u=d));const Y=u?y+T:y,Z=d?C+D:C;return{width:N+(u?-T:T),height:E+(d?-D:D),x:a[0]*T*(u?-1:1)+Y,y:a[1]*D*(d?-1:1)+Z}}const UA={width:0,height:0,x:0,y:0},Zte={...UA,pointerX:0,pointerY:0,aspectRatio:1};function Qte(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,l=n[0]*a,u=n[1]*o;return[[r-l,i-u],[r+a-l,i+o-u]]}function Jte({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const a=Mi(e);let o={controlDirection:l8("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:d,boundaries:p,keepAspectRatio:f,resizeDirection:g,onResizeStart:b,onResize:S,onResizeEnd:k,shouldResize:x}){let v={...UA},w={...Zte};o={boundaries:p,resizeDirection:g,keepAspectRatio:f,controlDirection:l8(d)};let y,C=null,N=[],E,j,T,D=!1;const I=QE().on("start",$=>{const{nodeLookup:F,transform:U,snapGrid:G,snapToGrid:X,nodeOrigin:Y,paneDomNode:Z}=n();if(y=F.get(t),!y)return;C=(Z==null?void 0:Z.getBoundingClientRect())??null;const{xSnapped:Q,ySnapped:z}=_d($.sourceEvent,{transform:U,snapGrid:G,snapToGrid:X,containerBounds:C});v={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={...v,pointerX:Q,pointerY:z,aspectRatio:v.width/v.height},E=void 0,j=jl(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(E=F.get(y.parentId)),E&&y.extent==="parent"&&(j=[[0,0],[E.measured.width,E.measured.height]]),N=[],T=void 0;for(const[O,H]of F)if(H.parentId===t&&(N.push({id:O,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const V=Qte(H,y,H.origin??Y);T?T=[[Math.min(V[0][0],T[0][0]),Math.min(V[0][1],T[0][1])],[Math.max(V[1][0],T[1][0]),Math.max(V[1][1],T[1][1])]]:T=V}b==null||b($,{...v})}).on("drag",$=>{const{transform:F,snapGrid:U,snapToGrid:G,nodeOrigin:X}=n(),Y=_d($.sourceEvent,{transform:F,snapGrid:U,snapToGrid:G,containerBounds:C}),Z=[];if(!y)return;const{x:Q,y:z,width:O,height:H}=v,V={},W=y.origin??X,{width:re,height:le,x:pe,y:te}=Kte(w,o.controlDirection,Y,o.boundaries,o.keepAspectRatio,W,j,T),B=re!==O,ie=le!==H,oe=pe!==Q&&B,be=te!==z&&ie;if(!oe&&!be&&!B&&!ie)return;if((oe||be||W[0]===1||W[1]===1)&&(V.x=oe?pe:v.x,V.y=be?te:v.y,v.x=V.x,v.y=V.y,N.length>0)){const Ue=pe-Q,We=te-z;for(const Fe of N)Fe.position={x:Fe.position.x-Ue+W[0]*(re-O),y:Fe.position.y-We+W[1]*(le-H)},Z.push(Fe)}if((B||ie)&&(V.width=B&&(!o.resizeDirection||o.resizeDirection==="horizontal")?re:v.width,V.height=ie&&(!o.resizeDirection||o.resizeDirection==="vertical")?le:v.height,v.width=V.width,v.height=V.height),E&&y.expandParent){const Ue=W[0]*(V.width??0);V.x&&V.x{D&&(k==null||k($,{...v}),i==null||i({...v}),D=!1)});a.call(I)}function u(){a.on(".drag",null)}return{update:l,destroy:u}}var gb={exports:{}},bb={},vb={exports:{}},_b={};/** - * @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 u8;function ene(){if(u8)return _b;u8=1;var e=eh();function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function l(f,g){var b=g(),S=r({inst:{value:b,getSnapshot:g}}),k=S[0].inst,x=S[1];return a(function(){k.value=b,k.getSnapshot=g,u(k)&&x({inst:k})},[f,b,g]),i(function(){return u(k)&&x({inst:k}),f(function(){u(k)&&x({inst:k})})},[f]),o(b),b}function u(f){var g=f.getSnapshot;f=f.value;try{var b=g();return!n(f,b)}catch{return!0}}function d(f,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return _b.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,_b}var d8;function tne(){return d8||(d8=1,vb.exports=ene()),vb.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 h8;function nne(){if(h8)return bb;h8=1;var e=eh(),t=tne();function n(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,l=e.useMemo,u=e.useDebugValue;return bb.useSyncExternalStoreWithSelector=function(d,p,f,g,b){var S=a(null);if(S.current===null){var k={hasValue:!1,value:null};S.current=k}else k=S.current;S=l(function(){function v(E){if(!w){if(w=!0,y=E,E=g(E),b!==void 0&&k.hasValue){var j=k.value;if(b(j,E))return C=j}return C=E}if(j=C,r(y,E))return j;var T=g(E);return b!==void 0&&b(j,T)?(y=E,j):(y=E,C=T)}var w=!1,y,C,N=f===void 0?null:f;return[function(){return v(p())},N===null?void 0:function(){return v(N())}]},[p,f,g,b]);var x=i(d,S[0],S[1]);return o(function(){k.hasValue=!0,k.value=x},[x]),u(x),x},bb}var f8;function rne(){return f8||(f8=1,gb.exports=nne()),gb.exports}var ine=rne();const sne=rp(ine),ane={},p8=e=>{let t;const n=new Set,r=(p,f)=>{const g=typeof p=="function"?p(t):p;if(!Object.is(g,t)){const b=t;t=f??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(S=>S(t,b))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>d,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(ane?"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()}},d=t=e(r,i,u);return u},one=e=>e?p8(e):p8,{useDebugValue:lne}=gj,{useSyncExternalStoreWithSelector:cne}=sne,une=e=>e;function qA(e,t=une,n){const r=cne(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return lne(r),r}const m8=(e,t)=>{const n=one(e),r=(i,a=t)=>qA(n,i,a);return Object.assign(r,n),r},dne=(e,t)=>e?m8(e,t):m8;function An(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,i]of e)if(!Object.is(i,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}const em=R.createContext(null),hne=em.Provider,GA=Es.error001("react");function Ft(e,t){const n=R.useContext(em);if(n===null)throw new Error(GA);return qA(n,e,t)}function Nn(){const e=R.useContext(em);if(e===null)throw new Error(GA);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const g8={display:"none"},fne={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},VA="react-flow__node-desc",WA="react-flow__edge-desc",pne="react-flow__aria-live",mne=e=>e.ariaLiveMessage,gne=e=>e.ariaLabelConfig;function bne({rfId:e}){const t=Ft(mne);return h.jsx("div",{id:`${pne}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:fne,children:t})}function vne({rfId:e,disableKeyboardA11y:t}){const n=Ft(gne);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${VA}-${e}`,style:g8,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${WA}-${e}`,style:g8,children:n["edge.a11yDescription.default"]}),!t&&h.jsx(bne,{rfId:e})]})}const tm=R.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},a)=>{const o=`${e}`.split("-");return h.jsx("div",{className:Qn(["react-flow__panel",n,...o]),style:r,ref:a,...i,children:t})});tm.displayName="Panel";const b8="https://reactflow.dev?utm_source=attribution";function _ne({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:h.jsx(tm,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${b8}`,children:h.jsx("a",{href:b8,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const xne=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}},nf=e=>e.id;function yne(e,t){return An(e.selectedNodes.map(nf),t.selectedNodes.map(nf))&&An(e.selectedEdges.map(nf),t.selectedEdges.map(nf))}function wne({onSelectionChange:e}){const t=Nn(),{selectedNodes:n,selectedEdges:r}=Ft(xne,yne);return R.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(a=>a(i))},[n,r,e]),null}const Sne=e=>!!e.onSelectionChangeHandlers;function kne({onSelectionChange:e}){const t=Ft(Sne);return e||t?h.jsx(wne,{onSelectionChange:e}):null}const YA=[0,0],Cne={x:0,y:0,zoom:1},Ene=["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"],v8=[...Ene,"rfId"],Ane=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}),_8={translateExtent:Ud,nodeOrigin:YA,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Tne(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:u}=Ft(Ane,An),d=Nn();R.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{p.current=_8,l()}),[]);const p=R.useRef(_8);return R.useEffect(()=>{for(const f of v8){const g=e[f],b=p.current[f];g!==b&&(typeof e[f]>"u"||(f==="nodes"?t(g):f==="edges"?n(g):f==="minZoom"?r(g):f==="maxZoom"?i(g):f==="translateExtent"?a(g):f==="nodeExtent"?o(g):f==="ariaLabelConfig"?d.setState({ariaLabelConfig:hte(g)}):f==="fitView"?d.setState({fitViewQueued:g}):f==="fitViewOptions"?d.setState({fitViewOptions:g}):d.setState({[f]:g})))}p.current=e},v8.map(f=>e[f])),null}function x8(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Nne(e){var r;const[t,n]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){n(e);return}const i=x8(),a=()=>n(i!=null&&i.matches?"dark":"light");return a(),i==null||i.addEventListener("change",a),()=>{i==null||i.removeEventListener("change",a)}},[e]),t!==null?t:(r=x8())!=null&&r.matches?"dark":"light"}const y8=typeof document<"u"?document:null;function Wd(e=null,t={target:y8,actInsideInputWithModifier:!0}){const[n,r]=R.useState(!1),i=R.useRef(!1),a=R.useRef(new Set([])),[o,l]=R.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` -`).replace(` - -`,` -+`).split(` -`)),p=d.reduce((f,g)=>f.concat(...g),[]);return[d,p]}return[[],[]]},[e]);return R.useEffect(()=>{const u=(t==null?void 0:t.target)??y8,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const p=b=>{var x,v;if(i.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!i.current||i.current&&!d)&&AA(b))return!1;const k=S8(b.code,l);if(a.current.add(b[k]),w8(o,a.current,!1)){const w=((v=(x=b.composedPath)==null?void 0:x.call(b))==null?void 0:v[0])||b.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(i.current||!y)&&b.preventDefault(),r(!0)}},f=b=>{const S=S8(b.code,l);w8(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(b[S]),b.key==="Meta"&&a.current.clear(),i.current=!1},g=()=>{a.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",p),u==null||u.addEventListener("keyup",f),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{u==null||u.removeEventListener("keydown",p),u==null||u.removeEventListener("keyup",f),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function w8(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function S8(e,t){return t.includes(e)?"code":"key"}const jne=()=>{const e=Nn();return R.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,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},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:i,minZoom:a,maxZoom:o,panZoom:l}=e.getState(),u=ax(t,r,i,a,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(u,{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:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;const{x:l,y:u}=o.getBoundingClientRect(),d={x:t.x-l,y:t.y-u},p=n.snapGrid??i,f=n.snapToGrid??a;return wh(d,r,f,p)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:a}=r.getBoundingClientRect(),o=eu(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function XA(e,t){const n=[],r=new Map,i=[];for(const a of e)if(a.type==="add"){i.push(a);continue}else if(a.type==="remove"||a.type==="replace")r.set(a.id,[a]);else{const o=r.get(a.id);o?o.push(a):r.set(a.id,[a])}for(const a of t){const o=r.get(a.id);if(!o){n.push(a);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...a};for(const u of o)Mne(u,l);n.push(l)}return i.length&&i.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function Mne(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 Rne(e,t){return XA(e,t)}function Dne(e,t){return XA(e,t)}function fl(e,t){return{id:e,type:"select",selected:t}}function Rc(e,t=new Set,n=!1){const r=[];for(const[i,a]of e){const o=t.has(i);!(a.selected===void 0&&!o)&&a.selected!==o&&(n&&(a.selected=o),r.push(fl(a.id,o)))}return r}function k8({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,o]of e.entries()){const l=t.get(o.id),u=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;u!==void 0&&u!==o&&n.push({id:o.id,item:o,type:"replace"}),u===void 0&&n.push({item:o,type:"add",index:a})}for(const[a]of t)r.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function C8(e){return{id:e.id,type:"remove"}}const Lne=SA();function One(e,t,n={}){return vte(e,t,{...n,onError:n.onError??Lne})}const E8=e=>rte(e),Ine=e=>vA(e);function KA(e){return R.forwardRef(e)}const zne=typeof window<"u"?R.useLayoutEffect:R.useEffect;function A8(e){const[t,n]=R.useState(BigInt(0)),[r]=R.useState(()=>Bne(()=>n(i=>i+BigInt(1))));return zne(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function Bne(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const ZA=R.createContext(null);function Hne({children:e}){const t=Nn(),n=R.useCallback(l=>{const{nodes:u=[],setNodes:d,hasDefaultNodes:p,onNodesChange:f,nodeLookup:g,fitViewQueued:b,onNodesChangeMiddlewareMap:S}=t.getState();let k=u;for(const v of l)k=typeof v=="function"?v(k):v;let x=k8({items:k,lookup:g});for(const v of S.values())x=v(x);p&&d(k),x.length>0?f==null||f(x):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:v,nodes:w,setNodes:y}=t.getState();v&&y(w)})},[]),r=A8(n),i=R.useCallback(l=>{const{edges:u=[],setEdges:d,hasDefaultEdges:p,onEdgesChange:f,edgeLookup:g}=t.getState();let b=u;for(const S of l)b=typeof S=="function"?S(b):S;p?d(b):f&&f(k8({items:b,lookup:g}))},[]),a=A8(i),o=R.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return h.jsx(ZA.Provider,{value:o,children:e})}function $ne(){const e=R.useContext(ZA);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Fne=e=>!!e.panZoom;function fx(){const e=jne(),t=Nn(),n=$ne(),r=Ft(Fne),i=R.useMemo(()=>{const a=f=>t.getState().nodeLookup.get(f),o=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},u=f=>{var v,w;const{nodeLookup:g,nodeOrigin:b}=t.getState(),S=E8(f)?f:g.get(f.id),k=S.parentId?CA(S.position,S.measured,S.parentId,g,b):S.position,x={...S,position:k,width:((v=S.measured)==null?void 0:v.width)??S.width,height:((w=S.measured)==null?void 0:w.height)??S.height};return Gd(x)},d=(f,g,b={replace:!1})=>{o(S=>S.map(k=>{if(k.id===f){const x=typeof g=="function"?g(k):g;return b.replace&&E8(x)?x:{...k,...x}}return k}))},p=(f,g,b={replace:!1})=>{l(S=>S.map(k=>{if(k.id===f){const x=typeof g=="function"?g(k):g;return b.replace&&Ine(x)?x:{...k,...x}}return k}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var g;return(g=a(f))==null?void 0:g.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(g=>({...g}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:o,setEdges:l,addNodes:f=>{const g=Array.isArray(f)?f:[f];n.nodeQueue.push(b=>[...b,...g])},addEdges:f=>{const g=Array.isArray(f)?f:[f];n.edgeQueue.push(b=>[...b,...g])},toObject:()=>{const{nodes:f=[],edges:g=[],transform:b}=t.getState(),[S,k,x]=b;return{nodes:f.map(v=>({...v})),edges:g.map(v=>({...v})),viewport:{x:S,y:k,zoom:x}}},deleteElements:async({nodes:f=[],edges:g=[]})=>{const{nodes:b,edges:S,onNodesDelete:k,onEdgesDelete:x,triggerNodeChanges:v,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:C}=t.getState(),{nodes:N,edges:E}=await lte({nodesToRemove:f,edgesToRemove:g,nodes:b,edges:S,onBeforeDelete:C}),j=E.length>0,T=N.length>0;if(j){const D=E.map(C8);x==null||x(E),w(D)}if(T){const D=N.map(C8);k==null||k(N),v(D)}return(T||j)&&(y==null||y({nodes:N,edges:E})),{deletedNodes:N,deletedEdges:E}},getIntersectingNodes:(f,g=!0,b)=>{const S=Z7(f),k=S?f:u(f),x=b!==void 0;return k?(b||t.getState().nodes).filter(v=>{const w=t.getState().nodeLookup.get(v.id);if(w&&!S&&(v.id===f.id||!w.internals.positionAbsolute))return!1;const y=Gd(x?v:w),C=tp(y,k);return g&&C>0||C>=y.width*y.height||C>=k.width*k.height}):[]},isNodeIntersecting:(f,g,b=!0)=>{const k=Z7(f)?f:u(f);if(!k)return!1;const x=tp(k,g);return b&&x>0||x>=g.width*g.height||x>=k.width*k.height},updateNode:d,updateNodeData:(f,g,b={replace:!1})=>{d(f,S=>{const k=typeof g=="function"?g(S):g;return b.replace?{...S,data:k}:{...S,data:{...S.data,...k}}},b)},updateEdge:p,updateEdgeData:(f,g,b={replace:!1})=>{p(f,S=>{const k=typeof g=="function"?g(S):g;return b.replace?{...S,data:k}:{...S,data:{...S.data,...k}}},b)},getNodesBounds:f=>{const{nodeLookup:g,nodeOrigin:b}=t.getState();return ite(f,{nodeLookup:g,nodeOrigin:b})},getHandleConnections:({type:f,id:g,nodeId:b})=>{var S;return Array.from(((S=t.getState().connectionLookup.get(`${b}-${f}${g?`-${g}`:""}`))==null?void 0:S.values())??[])},getNodeConnections:({type:f,handleId:g,nodeId:b})=>{var S;return Array.from(((S=t.getState().connectionLookup.get(`${b}${f?g?`-${f}-${g}`:`-${f}`:""}`))==null?void 0:S.values())??[])},fitView:async f=>{const g=t.getState().fitViewResolver??dte();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:g}),n.nodeQueue.push(b=>[...b]),g.promise}}},[]);return R.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const T8=e=>e.selected,Pne=typeof window<"u"?window:void 0;function Une({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Nn(),{deleteElements:r}=fx(),i=Wd(e,{actInsideInputWithModifier:!1}),a=Wd(t,{target:Pne});R.useEffect(()=>{if(i){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(T8),edges:o.filter(T8)}),n.setState({nodesSelectionActive:!1})}},[i]),R.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function qne(e){const t=Nn();R.useEffect(()=>{const n=()=>{var i,a,o,l;if(!e.current||!(((a=(i=e.current).checkVisibility)==null?void 0:a.call(i))??!0))return!1;const r=ox(e.current);(r.height===0||r.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",Es.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 nm={position:"absolute",width:"100%",height:"100%",top:0,left:0},Gne=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Vne({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=kl.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:d,minZoom:p,maxZoom:f,zoomActivationKeyCode:g,preventScrolling:b=!0,children:S,noWheelClassName:k,noPanClassName:x,onViewportChange:v,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:C}){const N=Nn(),E=R.useRef(null),{userSelectionActive:j,lib:T,connectionInProgress:D}=Ft(Gne,An),I=Wd(g),$=R.useRef();qne(E);const F=R.useCallback(U=>{v==null||v({x:U[0],y:U[1],zoom:U[2]}),w||N.setState({transform:U})},[v,w]);return R.useEffect(()=>{if(E.current){$.current=Yte({domNode:E.current,minZoom:p,maxZoom:f,translateExtent:d,viewport:u,onDraggingChange:Y=>N.setState(Z=>Z.paneDragging===Y?Z:{paneDragging:Y}),onPanZoomStart:(Y,Z)=>{const{onViewportChangeStart:Q,onMoveStart:z}=N.getState();z==null||z(Y,Z),Q==null||Q(Z)},onPanZoom:(Y,Z)=>{const{onViewportChange:Q,onMove:z}=N.getState();z==null||z(Y,Z),Q==null||Q(Z)},onPanZoomEnd:(Y,Z)=>{const{onViewportChangeEnd:Q,onMoveEnd:z}=N.getState();z==null||z(Y,Z),Q==null||Q(Z)}});const{x:U,y:G,zoom:X}=$.current.getViewport();return N.setState({panZoom:$.current,transform:[U,G,X],domNode:E.current.closest(".react-flow")}),()=>{var Y;(Y=$.current)==null||Y.destroy()}}},[]),R.useEffect(()=>{var U;(U=$.current)==null||U.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:I,preventScrolling:b,noPanClassName:x,userSelectionActive:j,noWheelClassName:k,lib:T,onTransformChange:F,connectionInProgress:D,selectionOnDrag:C,paneClickDistance:y})},[e,t,n,r,i,a,o,l,I,b,x,j,k,T,F,D,C,y]),h.jsx("div",{className:"react-flow__renderer",ref:E,style:nm,children:S})}const Wne=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Yne(){const{userSelectionActive:e,userSelectionRect:t}=Ft(Wne,An);return e&&t?h.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 xb=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Xne=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Kne({isSelecting:e,selectionKeyPressed:t,selectionMode:n=qd.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:u,onPaneClick:d,onPaneContextMenu:p,onPaneScroll:f,onPaneMouseEnter:g,onPaneMouseMove:b,onPaneMouseLeave:S,children:k}){const x=R.useRef(0),v=Nn(),{userSelectionActive:w,elementsSelectable:y,dragging:C,panBy:N,autoPanSpeed:E}=Ft(Xne,An),j=y&&(e||w),T=R.useRef(null),D=R.useRef(),I=R.useRef(new Set),$=R.useRef(new Set),F=R.useRef(!1),U=R.useRef(!1),G=R.useRef({x:0,y:0}),X=R.useRef(!1),Y=B=>{if(U.current||F.current||v.getState().connection.inProgress){U.current=!1,F.current=!1;return}d==null||d(B),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},Z=B=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){B.preventDefault();return}p==null||p(B)},Q=f?B=>f(B):void 0,z=B=>{U.current&&(B.stopPropagation(),U.current=!1)},O=B=>{var Fe,mt;const{domNode:ie,transform:oe}=v.getState();if(D.current=ie==null?void 0:ie.getBoundingClientRect(),!D.current)return;const be=B.target===T.current;if(!be&&!!B.target.closest(".nokey")||!e||!(o&&be||t)||B.button!==0||!B.isPrimary)return;(mt=(Fe=B.target)==null?void 0:Fe.setPointerCapture)==null||mt.call(Fe,B.pointerId),U.current=!1;const{x:Le,y:Ue}=ys(B.nativeEvent,D.current),We=wh({x:Le,y:Ue},oe);v.setState({userSelectionRect:{width:0,height:0,startX:We.x,startY:We.y,x:Le,y:Ue}}),be||(B.stopPropagation(),B.preventDefault())};function H(B,ie){const{userSelectionRect:oe}=v.getState();if(!oe)return;const{transform:be,nodeLookup:ge,edgeLookup:Ce,connectionLookup:Le,triggerNodeChanges:Ue,triggerEdgeChanges:We,defaultEdgeOptions:Fe}=v.getState(),mt={x:oe.startX,y:oe.startY},{x:De,y:ot}=eu(mt,be),Bt={startX:mt.x,startY:mt.y,x:Bst.id)),$.current=new Set;const ct=(Fe==null?void 0:Fe.selectable)??!0;for(const st of I.current){const xe=Le.get(st);if(xe)for(const{edgeId:Me}of xe.values()){const Ge=Ce.get(Me);Ge&&(Ge.selectable??ct)&&$.current.add(Me)}}if(!Q7(on,I.current)){const st=Rc(ge,I.current,!0);Ue(st)}if(!Q7(Ze,$.current)){const st=Rc(Ce,$.current);We(st)}v.setState({userSelectionRect:Bt,userSelectionActive:!0,nodesSelectionActive:!1})}function V(){if(!i||!D.current)return;const[B,ie]=sx(G.current,D.current,E);N({x:B,y:ie}).then(oe=>{if(!U.current||!oe){x.current=requestAnimationFrame(V);return}const{x:be,y:ge}=G.current;H(be,ge),x.current=requestAnimationFrame(V)})}const W=()=>{cancelAnimationFrame(x.current),x.current=0,X.current=!1};R.useEffect(()=>()=>W(),[]);const re=B=>{const{userSelectionRect:ie,transform:oe,resetSelectedElements:be}=v.getState();if(!D.current||!ie)return;const{x:ge,y:Ce}=ys(B.nativeEvent,D.current);G.current={x:ge,y:Ce};const Le=eu({x:ie.startX,y:ie.startY},oe);if(!U.current){const Ue=t?0:a;if(Math.hypot(ge-Le.x,Ce-Le.y)<=Ue)return;be(),l==null||l(B)}U.current=!0,X.current||(V(),X.current=!0),H(ge,Ce)},le=B=>{var ie,oe;if(!j){B.target===T.current&&v.getState().connection.inProgress&&(F.current=!0);return}B.button===0&&((oe=(ie=B.target)==null?void 0:ie.releasePointerCapture)==null||oe.call(ie,B.pointerId),!w&&B.target===T.current&&v.getState().userSelectionRect&&(Y==null||Y(B)),v.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(u==null||u(B),v.setState({nodesSelectionActive:I.current.size>0})),W())},pe=B=>{var ie,oe;(oe=(ie=B.target)==null?void 0:ie.releasePointerCapture)==null||oe.call(ie,B.pointerId),W()},te=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:Qn(["react-flow__pane",{draggable:te,dragging:C,selection:e}]),onClick:j?void 0:xb(Y,T),onContextMenu:xb(Z,T),onWheel:xb(Q,T),onPointerEnter:j?void 0:g,onPointerMove:j?re:b,onPointerUp:le,onPointerCancel:j?pe:void 0,onPointerDownCapture:j?O:void 0,onClickCapture:j?z:void 0,onPointerLeave:S,ref:T,style:nm,children:[k,h.jsx(Yne,{})]})}function Qv({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:l,onError:u}=t.getState(),d=l.get(e);if(!d){u==null||u("012",Es.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&o)&&(a({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):i([e])}function QA({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){const l=Nn(),[u,d]=R.useState(!1),p=R.useRef();return R.useEffect(()=>{p.current=Lte({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{Qv({id:f,store:l,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),R.useEffect(()=>{if(!(t||!e.current||!p.current))return p.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{var f;(f=p.current)==null||f.destroy()}},[n,r,t,a,e,i,o]),u}const Zne=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function JA(){const e=Nn();return R.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:a,nodesDraggable:o,onError:l,updateNodePositions:u,nodeLookup:d,nodeOrigin:p}=e.getState(),f=new Map,g=Zne(o),b=i?a[0]:5,S=i?a[1]:5,k=n.direction.x*b*n.factor,x=n.direction.y*S*n.factor;for(const[,v]of d){if(!g(v))continue;let w={x:v.internals.positionAbsolute.x+k,y:v.internals.positionAbsolute.y+x};i&&(w=yh(w,a));const{position:y,positionAbsolute:C}=_A({nodeId:v.id,nextPosition:w,nodeLookup:d,nodeExtent:r,nodeOrigin:p,onError:l});v.position=y,v.internals.positionAbsolute=C,f.set(v.id,v)}u(f)},[])}const px=R.createContext(null),Qne=px.Provider;px.Consumer;const eT=()=>R.useContext(px),Jne=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),tT=R.createContext(null);function ere({children:e}){const t=Ft(Jne,An);return h.jsx(tT.Provider,{value:t,children:e})}function tre(){const e=R.useContext(tT);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const nre={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},rre=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:l,toHandle:u,isValid:d}=o;if(!l&&!i)return nre;const p=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:p,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:a===Qc.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:p&&d}};function ire({type:e="source",position:t=lt.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:l,children:u,className:d,onMouseDown:p,onTouchStart:f,...g},b){var X,Y;const S=o||null,k=e==="target",x=Nn(),v=eT(),{connectOnClick:w,noPanClassName:y,rfId:C}=tre(),{connectingFrom:N,connectingTo:E,clickConnecting:j,isPossibleEndHandle:T,connectionInProcess:D,clickConnectionInProcess:I,valid:$}=Ft(rre(v,S,e),An);v||(Y=(X=x.getState()).onError)==null||Y.call(X,"010",Es.error010());const F=Z=>{const{defaultEdgeOptions:Q,onConnect:z,hasDefaultEdges:O}=x.getState(),H={...Q,...Z};if(O){const{edges:V,setEdges:W,onError:re}=x.getState();W(One(H,V,{onError:re}))}z==null||z(H),l==null||l(H)},U=Z=>{if(!v)return;const Q=TA(Z.nativeEvent);if(i&&(Q&&Z.button===0||!Q)){const z=x.getState();Zv.onPointerDown(Z.nativeEvent,{handleDomNode:Z.currentTarget,autoPanOnConnect:z.autoPanOnConnect,connectionMode:z.connectionMode,connectionRadius:z.connectionRadius,domNode:z.domNode,nodeLookup:z.nodeLookup,lib:z.lib,isTarget:k,handleId:S,nodeId:v,flowId:z.rfId,panBy:z.panBy,cancelConnection:z.cancelConnection,onConnectStart:z.onConnectStart,onConnectEnd:(...O)=>{var H,V;return(V=(H=x.getState()).onConnectEnd)==null?void 0:V.call(H,...O)},updateConnection:z.updateConnection,onConnect:F,isValidConnection:n||((...O)=>{var H,V;return((V=(H=x.getState()).isValidConnection)==null?void 0:V.call(H,...O))??!0}),getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:z.autoPanSpeed,dragThreshold:z.connectionDragThreshold})}Q?p==null||p(Z):f==null||f(Z)},G=Z=>{const{onClickConnectStart:Q,onClickConnectEnd:z,connectionClickStartHandle:O,connectionMode:H,isValidConnection:V,lib:W,rfId:re,nodeLookup:le,connection:pe}=x.getState();if(!v||!O&&!i)return;if(!O){Q==null||Q(Z.nativeEvent,{nodeId:v,handleId:S,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:v,type:e,id:S}});return}const te=EA(Z.target),B=n||V,{connection:ie,isValid:oe}=Zv.isValid(Z.nativeEvent,{handle:{nodeId:v,id:S,type:e},connectionMode:H,fromNodeId:O.nodeId,fromHandleId:O.id||null,fromType:O.type,isValidConnection:B,flowId:re,doc:te,lib:W,nodeLookup:le});oe&&ie&&F(ie);const be=structuredClone(pe);delete be.inProgress,be.toPosition=be.toHandle?be.toHandle.position:null,z==null||z(Z,be),x.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":S,"data-nodeid":v,"data-handlepos":t,"data-id":`${C}-${v}-${S}-${e}`,className:Qn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,d,{source:!k,target:k,connectable:r,connectablestart:i,connectableend:a,clickconnecting:j,connectingfrom:N,connectingto:E,valid:$,connectionindicator:r&&(!D||T)&&(D||I?a:i)}]),onMouseDown:U,onTouchStart:U,onClick:w?G:void 0,ref:b,...g,children:u})}const Oo=R.memo(KA(ire));function sre({data:e,isConnectable:t,sourcePosition:n=lt.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(Oo,{type:"source",position:n,isConnectable:t})]})}function are({data:e,isConnectable:t,targetPosition:n=lt.Top,sourcePosition:r=lt.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(Oo,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(Oo,{type:"source",position:r,isConnectable:t})]})}function ore(){return null}function lre({data:e,isConnectable:t,targetPosition:n=lt.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(Oo,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const np={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},N8={input:sre,default:are,output:lre,group:ore};function cre(e){var t,n,r,i;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??((i=e.style)==null?void 0:i.height)}}const ure=e=>{const{width:t,height:n,x:r,y:i}=xh(e.nodeLookup,{filter:a=>!!a.selected});return{width:xs(t)?t:null,height:xs(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function dre({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Nn(),{width:i,height:a,transformString:o,userSelectionActive:l}=Ft(ure,An),u=JA(),d=R.useRef(null);R.useEffect(()=>{var b;n||(b=d.current)==null||b.focus({preventScroll:!0})},[n]);const p=!l&&i!==null&&a!==null;if(QA({nodeRef:d,disabled:!p}),!p)return null;const f=e?b=>{const S=r.getState().nodes.filter(k=>k.selected);e(b,S)}:void 0,g=b=>{Object.prototype.hasOwnProperty.call(np,b.key)&&(b.preventDefault(),u({direction:np[b.key],factor:b.shiftKey?4:1}))};return h.jsx("div",{className:Qn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:h.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:i,height:a}})})}const j8=typeof window<"u"?window:void 0,hre=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function nT({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:d,selectionOnDrag:p,selectionMode:f,onSelectionStart:g,onSelectionEnd:b,multiSelectionKeyCode:S,panActivationKeyCode:k,zoomActivationKeyCode:x,elementsSelectable:v,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:N,panOnScrollMode:E,zoomOnDoubleClick:j,panOnDrag:T,autoPanOnSelection:D,defaultViewport:I,translateExtent:$,minZoom:F,maxZoom:U,preventScrolling:G,onSelectionContextMenu:X,noWheelClassName:Y,noPanClassName:Z,disableKeyboardA11y:Q,onViewportChange:z,isControlledViewport:O}){const{nodesSelectionActive:H,userSelectionActive:V}=Ft(hre,An),W=Wd(d,{target:j8}),re=Wd(k,{target:j8}),le=re||T,pe=re||C,te=p&&le!==!0,B=W||V||te;return Une({deleteKeyCode:u,multiSelectionKeyCode:S}),h.jsx(Vne,{onPaneContextMenu:a,elementsSelectable:v,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:pe,panOnScrollSpeed:N,panOnScrollMode:E,zoomOnDoubleClick:j,panOnDrag:!W&&le,defaultViewport:I,translateExtent:$,minZoom:F,maxZoom:U,zoomActivationKeyCode:x,preventScrolling:G,noWheelClassName:Y,noPanClassName:Z,onViewportChange:z,isControlledViewport:O,paneClickDistance:l,selectionOnDrag:te,children:h.jsxs(Kne,{onSelectionStart:g,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:le,autoPanOnSelection:D,isSelecting:!!B,selectionMode:f,selectionKeyPressed:W,paneClickDistance:l,selectionOnDrag:te,children:[e,H&&h.jsx(dre,{onSelectionContextMenu:X,noPanClassName:Z,disableKeyboardA11y:Q})]})})}nT.displayName="FlowRenderer";const fre=R.memo(nT),pre=e=>t=>e?ix(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 mre(e){return Ft(R.useCallback(pre(e),[e]),An)}const gre=e=>e.updateNodeInternals;function bre(){const e=Ft(gre),[t]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const a=i.target.getAttribute("data-id");r.set(a,{id:a,nodeElement:i.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function vre({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=Nn(),a=R.useRef(null),o=R.useRef(null),l=R.useRef(e.sourcePosition),u=R.useRef(e.targetPosition),d=R.useRef(t),p=n&&!!e.internals.handleBounds;return R.useEffect(()=>{a.current&&!e.hidden&&(!p||o.current!==a.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(a.current),o.current=a.current)},[p,e.hidden]),R.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),R.useEffect(()=>{if(a.current){const f=d.current!==t,g=l.current!==e.sourcePosition,b=u.current!==e.targetPosition;(f||g||b)&&(d.current=t,l.current=e.sourcePosition,u.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function _re({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:l,elementsSelectable:u,nodesConnectable:d,nodesFocusable:p,resizeObserver:f,noDragClassName:g,noPanClassName:b,disableKeyboardA11y:S,rfId:k,nodeTypes:x,nodeClickDistance:v,onError:w}){const{node:y,internals:C,isParent:N}=Ft(B=>{const ie=B.nodeLookup.get(e),oe=B.parentLookup.has(e);return{node:ie,internals:ie.internals,isParent:oe}},An);let E=y.type||"default",j=(x==null?void 0:x[E])||N8[E];j===void 0&&(w==null||w("003",Es.error003(E)),E="default",j=(x==null?void 0:x.default)||N8.default);const T=!!(y.draggable||l&&typeof y.draggable>"u"),D=!!(y.selectable||u&&typeof y.selectable>"u"),I=!!(y.connectable||d&&typeof y.connectable>"u"),$=!!(y.focusable||p&&typeof y.focusable>"u"),F=Nn(),U=kA(y),G=vre({node:y,nodeType:E,hasDimensions:U,resizeObserver:f}),X=QA({nodeRef:G,disabled:y.hidden||!T,noDragClassName:g,handleSelector:y.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:v}),Y=JA();if(y.hidden)return null;const Z=qa(y),Q=cre(y),z=D||T||t||n||r||i,O=n?B=>n(B,{...C.userNode}):void 0,H=r?B=>r(B,{...C.userNode}):void 0,V=i?B=>i(B,{...C.userNode}):void 0,W=a?B=>a(B,{...C.userNode}):void 0,re=o?B=>o(B,{...C.userNode}):void 0,le=B=>{const{selectNodesOnDrag:ie,nodeDragThreshold:oe}=F.getState();D&&(!ie||!T||oe>0)&&Qv({id:e,store:F,nodeRef:G}),t&&t(B,{...C.userNode})},pe=B=>{if(!(AA(B.nativeEvent)||S)){if(pA.includes(B.key)&&D){const ie=B.key==="Escape";Qv({id:e,store:F,unselect:ie,nodeRef:G})}else if(T&&y.selected&&Object.prototype.hasOwnProperty.call(np,B.key)){B.preventDefault();const{ariaLabelConfig:ie}=F.getState();F.setState({ariaLiveMessage:ie["node.a11yDescription.ariaLiveMessage"]({direction:B.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),Y({direction:np[B.key],factor:B.shiftKey?4:1})}}},te=()=>{var Le;if(S||!((Le=G.current)!=null&&Le.matches(":focus-visible")))return;const{transform:B,width:ie,height:oe,autoPanOnNodeFocus:be,setCenter:ge}=F.getState();if(!be)return;ix(new Map([[e,y]]),{x:0,y:0,width:ie,height:oe},B,!0).length>0||ge(y.position.x+Z.width/2,y.position.y+Z.height/2,{zoom:B[2]})};return h.jsx("div",{className:Qn(["react-flow__node",`react-flow__node-${E}`,{[b]:T},y.className,{selected:y.selected,selectable:D,parent:N,draggable:T,dragging:X}]),ref:G,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:z?"all":"none",visibility:U?"visible":"hidden",...y.style,...Q},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:O,onMouseMove:H,onMouseLeave:V,onContextMenu:W,onClick:le,onDoubleClick:re,onKeyDown:$?pe:void 0,tabIndex:$?0:void 0,onFocus:$?te:void 0,role:y.ariaRole??($?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${VA}-${k}`,"aria-label":y.ariaLabel,...y.domAttributes,children:h.jsx(Qne,{value:e,children:h.jsx(j,{id:e,data:y.data,type:E,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:D,draggable:T,deletable:y.deletable??!0,isConnectable:I,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:X,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...Z})})})}var xre=R.memo(_re);const yre=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function rT(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=Ft(yre,An),o=mre(e.onlyRenderVisibleElements),l=bre();return h.jsx("div",{className:"react-flow__nodes",style:nm,children:o.map(u=>h.jsx(xre,{id:u,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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},u))})}rT.displayName="NodeRenderer";const wre=R.memo(rT);function Sre(e){return Ft(R.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const a=n.nodeLookup.get(i.source),o=n.nodeLookup.get(i.target);a&&o&&mte({sourceNode:a,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),An)}const kre=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return h.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Cre=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return h.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},M8={[Jf.Arrow]:kre,[Jf.ArrowClosed]:Cre};function Ere(e){const t=Nn();return R.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(M8,e)?M8[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",Es.error009(e)),null)},[e])}const Are=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const u=Ere(t);return u?h.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0",children:h.jsx(u,{color:n,strokeWidth:o})}):null},iT=({defaultColor:e,rfId:t})=>{const n=Ft(a=>a.edges),r=Ft(a=>a.defaultEdgeOptions),i=R.useMemo(()=>Ste(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:i.map(a=>h.jsx(Are,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};iT.displayName="MarkerDefinitions";var Tre=R.memo(iT);function sT({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:u,className:d,...p}){const[f,g]=R.useState({x:1,y:0,width:0,height:0}),b=Qn(["react-flow__edge-textwrapper",d]),S=R.useRef(null);return R.useEffect(()=>{if(S.current){const k=S.current.getBBox();g({x:k.x,y:k.y,width:k.width,height:k.height})}},[n]),n?h.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:b,visibility:f.width?"visible":"hidden",...p,children:[i&&h.jsx("rect",{width:f.width+2*o[0],x:-o[0],y:-o[1],height:f.height+2*o[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),h.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:S,style:r,children:n}),u]}):null}sT.displayName="EdgeText";const Nre=R.memo(sT);function rm({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:u,interactionWidth:d=20,...p}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{...p,d:e,fill:"none",className:Qn(["react-flow__edge-path",p.className])}),d?h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&xs(t)&&xs(n)?h.jsx(Nre,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:u}):null]})}function R8({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===lt.Left||e===lt.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function aT({sourceX:e,sourceY:t,sourcePosition:n=lt.Bottom,targetX:r,targetY:i,targetPosition:a=lt.Top}){const[o,l]=R8({pos:n,x1:e,y1:t,x2:r,y2:i}),[u,d]=R8({pos:a,x1:r,y1:i,x2:e,y2:t}),[p,f,g,b]=NA({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${o},${l} ${u},${d} ${r},${i}`,p,f,g,b]}function oT(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,label:u,labelStyle:d,labelShowBg:p,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:b,style:S,markerEnd:k,markerStart:x,interactionWidth:v})=>{const[w,y,C]=aT({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l}),N=e.isInternal?void 0:t;return h.jsx(rm,{id:N,path:w,labelX:y,labelY:C,label:u,labelStyle:d,labelShowBg:p,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:b,style:S,markerEnd:k,markerStart:x,interactionWidth:v})})}const jre=oT({isInternal:!1}),lT=oT({isInternal:!0});jre.displayName="SimpleBezierEdge";lT.displayName="SimpleBezierEdgeInternal";function cT(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:f,style:g,sourcePosition:b=lt.Bottom,targetPosition:S=lt.Top,markerEnd:k,markerStart:x,pathOptions:v,interactionWidth:w})=>{const[y,C,N]=Yv({sourceX:n,sourceY:r,sourcePosition:b,targetX:i,targetY:a,targetPosition:S,borderRadius:v==null?void 0:v.borderRadius,offset:v==null?void 0:v.offset,stepPosition:v==null?void 0:v.stepPosition}),E=e.isInternal?void 0:t;return h.jsx(rm,{id:E,path:y,labelX:C,labelY:N,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:f,style:g,markerEnd:k,markerStart:x,interactionWidth:w})})}const uT=cT({isInternal:!1}),dT=cT({isInternal:!0});uT.displayName="SmoothStepEdge";dT.displayName="SmoothStepEdgeInternal";function hT(e){return R.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return h.jsx(uT,{...n,id:r,pathOptions:R.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const Mre=hT({isInternal:!1}),fT=hT({isInternal:!0});Mre.displayName="StepEdge";fT.displayName="StepEdgeInternal";function pT(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:f,style:g,markerEnd:b,markerStart:S,interactionWidth:k})=>{const[x,v,w]=RA({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return h.jsx(rm,{id:y,path:x,labelX:v,labelY:w,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:f,style:g,markerEnd:b,markerStart:S,interactionWidth:k})})}const Rre=pT({isInternal:!1}),mT=pT({isInternal:!0});Rre.displayName="StraightEdge";mT.displayName="StraightEdgeInternal";function gT(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=lt.Bottom,targetPosition:l=lt.Top,label:u,labelStyle:d,labelShowBg:p,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:b,style:S,markerEnd:k,markerStart:x,pathOptions:v,interactionWidth:w})=>{const[y,C,N]=jA({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l,curvature:v==null?void 0:v.curvature}),E=e.isInternal?void 0:t;return h.jsx(rm,{id:E,path:y,labelX:C,labelY:N,label:u,labelStyle:d,labelShowBg:p,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:b,style:S,markerEnd:k,markerStart:x,interactionWidth:w})})}const Dre=gT({isInternal:!1}),bT=gT({isInternal:!0});Dre.displayName="BezierEdge";bT.displayName="BezierEdgeInternal";const D8={default:bT,straight:mT,step:fT,smoothstep:dT,simplebezier:lT},L8={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},Lre=(e,t,n)=>n===lt.Left?e-t:n===lt.Right?e+t:e,Ore=(e,t,n)=>n===lt.Top?e-t:n===lt.Bottom?e+t:e,O8="react-flow__edgeupdater";function I8({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:l}){return h.jsx("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:Qn([O8,`${O8}-${l}`]),cx:Lre(t,r,e),cy:Ore(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Ire({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:l,targetPosition:u,onReconnect:d,onReconnectStart:p,onReconnectEnd:f,setReconnecting:g,setUpdateHover:b}){const S=Nn(),k=(C,N)=>{if(C.button!==0)return;const{autoPanOnConnect:E,domNode:j,connectionMode:T,connectionRadius:D,lib:I,onConnectStart:$,cancelConnection:F,nodeLookup:U,rfId:G,panBy:X,updateConnection:Y}=S.getState(),Z=N.type==="target",Q=(H,V)=>{g(!1),f==null||f(H,n,N.type,V)},z=H=>d==null?void 0:d(n,H),O=(H,V)=>{g(!0),p==null||p(C,n,N.type),$==null||$(H,V)};Zv.onPointerDown(C.nativeEvent,{autoPanOnConnect:E,connectionMode:T,connectionRadius:D,domNode:j,handleId:N.id,nodeId:N.nodeId,nodeLookup:U,isTarget:Z,edgeUpdaterType:N.type,lib:I,flowId:G,cancelConnection:F,panBy:X,isValidConnection:(...H)=>{var V,W;return((W=(V=S.getState()).isValidConnection)==null?void 0:W.call(V,...H))??!0},onConnect:z,onConnectStart:O,onConnectEnd:(...H)=>{var V,W;return(W=(V=S.getState()).onConnectEnd)==null?void 0:W.call(V,...H)},onReconnectEnd:Q,updateConnection:Y,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},x=C=>k(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),v=C=>k(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>b(!0),y=()=>b(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(I8,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:x,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&h.jsx(I8,{position:u,centerX:a,centerY:o,radius:t,onMouseDown:v,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function zre({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:l,onMouseMove:u,onMouseLeave:d,reconnectRadius:p,onReconnect:f,onReconnectStart:g,onReconnectEnd:b,rfId:S,edgeTypes:k,noPanClassName:x,onError:v,disableKeyboardA11y:w}){let y=Ft(ge=>ge.edgeLookup.get(e));const C=Ft(ge=>ge.defaultEdgeOptions);y=C?{...C,...y}:y;let N=y.type||"default",E=(k==null?void 0:k[N])||D8[N];E===void 0&&(v==null||v("011",Es.error011(N)),N="default",E=(k==null?void 0:k.default)||D8.default);const j=!!(y.focusable||t&&typeof y.focusable>"u"),T=typeof f<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),D=!!(y.selectable||r&&typeof y.selectable>"u"),I=R.useRef(null),[$,F]=R.useState(!1),[U,G]=R.useState(!1),X=Nn(),{zIndex:Y=y.zIndex,sourceX:Z,sourceY:Q,targetX:z,targetY:O,sourcePosition:H,targetPosition:V}=Ft(R.useCallback(ge=>{const Ce=ge.nodeLookup.get(y.source),Le=ge.nodeLookup.get(y.target);if(!Ce||!Le)return L8;const Ue=wte({id:e,sourceNode:Ce,targetNode:Le,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:ge.connectionMode,onError:v}),We=pte({selected:y.selected,zIndex:y.zIndex,sourceNode:Ce,targetNode:Le,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode});return{...Ue||L8,zIndex:We}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),An),W=R.useMemo(()=>y.markerStart?`url('#${Xv(y.markerStart,S)}')`:void 0,[y.markerStart,S]),re=R.useMemo(()=>y.markerEnd?`url('#${Xv(y.markerEnd,S)}')`:void 0,[y.markerEnd,S]);if(y.hidden||Z===null||Q===null||z===null||O===null)return null;const le=ge=>{var We;const{addSelectedEdges:Ce,unselectNodesAndEdges:Le,multiSelectionActive:Ue}=X.getState();D&&(X.setState({nodesSelectionActive:!1}),y.selected&&Ue?(Le({nodes:[],edges:[y]}),(We=I.current)==null||We.blur()):Ce([e])),i&&i(ge,y)},pe=a?ge=>{a(ge,{...y})}:void 0,te=o?ge=>{o(ge,{...y})}:void 0,B=l?ge=>{l(ge,{...y})}:void 0,ie=u?ge=>{u(ge,{...y})}:void 0,oe=d?ge=>{d(ge,{...y})}:void 0,be=ge=>{var Ce;if(!w&&pA.includes(ge.key)&&D){const{unselectNodesAndEdges:Le,addSelectedEdges:Ue}=X.getState();ge.key==="Escape"?((Ce=I.current)==null||Ce.blur(),Le({edges:[y]})):Ue([e])}};return h.jsx("svg",{style:{zIndex:Y},children:h.jsxs("g",{className:Qn(["react-flow__edge",`react-flow__edge-${N}`,y.className,x,{selected:y.selected,animated:y.animated,inactive:!D&&!i,updating:$,selectable:D}]),onClick:le,onDoubleClick:pe,onContextMenu:te,onMouseEnter:B,onMouseMove:ie,onMouseLeave:oe,onKeyDown:j?be:void 0,tabIndex:j?0:void 0,role:y.ariaRole??(j?"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":j?`${WA}-${S}`:void 0,ref:I,...y.domAttributes,children:[!U&&h.jsx(E,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:D,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:Z,sourceY:Q,targetX:z,targetY:O,sourcePosition:H,targetPosition:V,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:W,markerEnd:re,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),T&&h.jsx(Ire,{edge:y,isReconnectable:T,reconnectRadius:p,onReconnect:f,onReconnectStart:g,onReconnectEnd:b,sourceX:Z,sourceY:Q,targetX:z,targetY:O,sourcePosition:H,targetPosition:V,setUpdateHover:F,setReconnecting:G})]})})}var Bre=R.memo(zre);const Hre=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function vT({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:p,reconnectRadius:f,onEdgeDoubleClick:g,onReconnectStart:b,onReconnectEnd:S,disableKeyboardA11y:k}){const{edgesFocusable:x,edgesReconnectable:v,elementsSelectable:w,onError:y}=Ft(Hre,An),C=Sre(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(Tre,{defaultColor:e,rfId:n}),C.map(N=>h.jsx(Bre,{id:N,edgesFocusable:x,edgesReconnectable:v,elementsSelectable:w,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:l,onMouseMove:u,onMouseLeave:d,onClick:p,reconnectRadius:f,onDoubleClick:g,onReconnectStart:b,onReconnectEnd:S,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:k},N))]})}vT.displayName="EdgeRenderer";const $re=R.memo(vT),Fre=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Pre({children:e}){const t=Ft(Fre);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Ure(e){const t=fx(),n=R.useRef(!1);R.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const qre=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Gre(e){const t=Ft(qre),n=Nn();return R.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Vre(e){return e.connection.inProgress?{...e.connection,to:wh(e.connection.to,e.transform)}:{...e.connection}}function Wre(e){return Vre}function Yre(e){const t=Wre();return Ft(t,An)}const Xre=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Kre({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:a,height:o,isValid:l,inProgress:u}=Ft(Xre,An);return!(a&&i&&u)?null:h.jsx("svg",{style:e,width:a,height:o,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:Qn(["react-flow__connection",bA(l)]),children:h.jsx(_T,{style:t,type:n,CustomComponent:r,isValid:l})})})}const _T=({style:e,type:t=Co.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:a,fromNode:o,fromHandle:l,fromPosition:u,to:d,toNode:p,toHandle:f,toPosition:g,pointer:b}=Yre();if(!i)return;if(n)return h.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:a.x,fromY:a.y,toX:d.x,toY:d.y,fromPosition:u,toPosition:g,connectionStatus:bA(r),toNode:p,toHandle:f,pointer:b});let S="";const k={sourceX:a.x,sourceY:a.y,sourcePosition:u,targetX:d.x,targetY:d.y,targetPosition:g};switch(t){case Co.Bezier:[S]=jA(k);break;case Co.SimpleBezier:[S]=aT(k);break;case Co.Step:[S]=Yv({...k,borderRadius:0});break;case Co.SmoothStep:[S]=Yv(k);break;default:[S]=RA(k)}return h.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:e})};_T.displayName="ConnectionLine";const Zre={};function z8(e=Zre){R.useRef(e),Nn(),R.useEffect(()=>{},[e])}function Qre(){Nn(),R.useRef(!1),R.useEffect(()=>{},[])}function xT({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:p,onSelectionContextMenu:f,onSelectionStart:g,onSelectionEnd:b,connectionLineType:S,connectionLineStyle:k,connectionLineComponent:x,connectionLineContainerStyle:v,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:N,panActivationKeyCode:E,zoomActivationKeyCode:j,deleteKeyCode:T,onlyRenderVisibleElements:D,elementsSelectable:I,defaultViewport:$,translateExtent:F,minZoom:U,maxZoom:G,preventScrolling:X,defaultMarkerColor:Y,zoomOnScroll:Z,zoomOnPinch:Q,panOnScroll:z,panOnScrollSpeed:O,panOnScrollMode:H,zoomOnDoubleClick:V,panOnDrag:W,autoPanOnSelection:re,onPaneClick:le,onPaneMouseEnter:pe,onPaneMouseMove:te,onPaneMouseLeave:B,onPaneScroll:ie,onPaneContextMenu:oe,paneClickDistance:be,nodeClickDistance:ge,onEdgeContextMenu:Ce,onEdgeMouseEnter:Le,onEdgeMouseMove:Ue,onEdgeMouseLeave:We,reconnectRadius:Fe,onReconnect:mt,onReconnectStart:De,onReconnectEnd:ot,noDragClassName:Bt,noWheelClassName:on,noPanClassName:Ze,disableKeyboardA11y:ct,nodeExtent:st,rfId:xe,viewport:Me,onViewportChange:Ge}){return z8(e),z8(t),Qre(),Ure(n),Gre(Me),h.jsx(fre,{onPaneClick:le,onPaneMouseEnter:pe,onPaneMouseMove:te,onPaneMouseLeave:B,onPaneContextMenu:oe,onPaneScroll:ie,paneClickDistance:be,deleteKeyCode:T,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,onSelectionStart:g,onSelectionEnd:b,multiSelectionKeyCode:N,panActivationKeyCode:E,zoomActivationKeyCode:j,elementsSelectable:I,zoomOnScroll:Z,zoomOnPinch:Q,zoomOnDoubleClick:V,panOnScroll:z,panOnScrollSpeed:O,panOnScrollMode:H,panOnDrag:W,autoPanOnSelection:re,defaultViewport:$,translateExtent:F,minZoom:U,maxZoom:G,onSelectionContextMenu:f,preventScrolling:X,noDragClassName:Bt,noWheelClassName:on,noPanClassName:Ze,disableKeyboardA11y:ct,onViewportChange:Ge,isControlledViewport:!!Me,children:h.jsxs(Pre,{children:[h.jsx($re,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:mt,onReconnectStart:De,onReconnectEnd:ot,onlyRenderVisibleElements:D,onEdgeContextMenu:Ce,onEdgeMouseEnter:Le,onEdgeMouseMove:Ue,onEdgeMouseLeave:We,reconnectRadius:Fe,defaultMarkerColor:Y,noPanClassName:Ze,disableKeyboardA11y:ct,rfId:xe}),h.jsx(Kre,{style:k,type:S,component:x,containerStyle:v}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(wre,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:p,nodeClickDistance:ge,onlyRenderVisibleElements:D,noPanClassName:Ze,noDragClassName:Bt,disableKeyboardA11y:ct,nodeExtent:st,rfId:xe}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}xT.displayName="GraphView";const Jre=R.memo(xT),eie=SA(),B8=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u=.5,maxZoom:d=2,nodeOrigin:p,nodeExtent:f,zIndexMode:g="basic"}={})=>{const b=new Map,S=new Map,k=new Map,x=new Map,v=r??t??[],w=n??e??[],y=p??[0,0],C=f??Ud;OA(k,x,v);const{nodesInitialized:N}=Kv(w,b,S,{nodeOrigin:y,nodeExtent:C,zIndexMode:g});let E=[0,0,1];if(o&&i&&a){const j=xh(b,{filter:$=>!!(($.width||$.initialWidth)&&($.height||$.initialHeight))}),{x:T,y:D,zoom:I}=ax(j,i,a,u,d,(l==null?void 0:l.padding)??.1);E=[T,D,I]}return{rfId:"1",width:i??0,height:a??0,transform:E,nodes:w,nodesInitialized:N,nodeLookup:b,parentLookup:S,edges:v,edgeLookup:x,connectionLookup:k,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:d,translateExtent:Ud,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Qc.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:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...gA},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:eie,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:mA,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},tie=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:p,nodeExtent:f,zIndexMode:g})=>dne((b,S)=>{async function k(){const{nodeLookup:x,panZoom:v,fitViewOptions:w,fitViewResolver:y,width:C,height:N,minZoom:E,maxZoom:j}=S();v&&(await ote({nodes:x,width:C,height:N,panZoom:v,minZoom:E,maxZoom:j},w),y==null||y.resolve(!0),b({fitViewResolver:null}))}return{...B8({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:p,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:x=>{const{nodeLookup:v,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:N,zIndexMode:E,nodesSelectionActive:j}=S(),{nodesInitialized:T,hasSelectedNodes:D}=Kv(x,v,w,{nodeOrigin:y,nodeExtent:f,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:E}),I=j&&D;N&&T?(k(),b({nodes:x,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):b({nodes:x,nodesInitialized:T,nodesSelectionActive:I})},setEdges:x=>{const{connectionLookup:v,edgeLookup:w}=S();OA(v,w,x),b({edges:x})},setDefaultNodesAndEdges:(x,v)=>{if(x){const{setNodes:w}=S();w(x),b({hasDefaultNodes:!0})}if(v){const{setEdges:w}=S();w(v),b({hasDefaultEdges:!0})}},updateNodeInternals:x=>{const{triggerNodeChanges:v,nodeLookup:w,parentLookup:y,domNode:C,nodeOrigin:N,nodeExtent:E,debug:j,fitViewQueued:T,zIndexMode:D}=S(),{changes:I,updatedInternals:$}=jte(x,w,y,C,N,E,D);$&&(Ete(w,y,{nodeOrigin:N,nodeExtent:E,zIndexMode:D}),T?(k(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),(I==null?void 0:I.length)>0&&(j&&console.log("React Flow: trigger node changes",I),v==null||v(I)))},updateNodePositions:(x,v=!1)=>{const w=[];let y=[];const{nodeLookup:C,triggerNodeChanges:N,connection:E,updateConnection:j,onNodesChangeMiddlewareMap:T}=S();for(const[D,I]of x){const $=C.get(D),F=!!($!=null&&$.expandParent&&($!=null&&$.parentId)&&(I!=null&&I.position)),U={id:D,type:"position",position:F?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:v};if($&&E.inProgress&&E.fromNode.id===$.id){const G=Ml($,E.fromHandle,lt.Left,!0);j({...E,from:G})}F&&$.parentId&&w.push({id:D,parentId:$.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),y.push(U)}if(w.length>0){const{parentLookup:D,nodeOrigin:I}=S(),$=hx(w,C,D,I);y.push(...$)}for(const D of T.values())y=D(y);N(y)},triggerNodeChanges:x=>{const{onNodesChange:v,setNodes:w,nodes:y,hasDefaultNodes:C,debug:N}=S();if(x!=null&&x.length){if(C){const E=Rne(x,y);w(E)}N&&console.log("React Flow: trigger node changes",x),v==null||v(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:v,setEdges:w,edges:y,hasDefaultEdges:C,debug:N}=S();if(x!=null&&x.length){if(C){const E=Dne(x,y);w(E)}N&&console.log("React Flow: trigger edge changes",x),v==null||v(x)}},addSelectedNodes:x=>{const{multiSelectionActive:v,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:N}=S();if(v){const E=x.map(j=>fl(j,!0));C(E);return}C(Rc(y,new Set([...x]),!0)),N(Rc(w))},addSelectedEdges:x=>{const{multiSelectionActive:v,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:N}=S();if(v){const E=x.map(j=>fl(j,!0));N(E);return}N(Rc(w,new Set([...x]))),C(Rc(y,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:v}={})=>{const{edges:w,nodes:y,nodeLookup:C,triggerNodeChanges:N,triggerEdgeChanges:E}=S(),j=x||y,T=v||w,D=[];for(const $ of j){if(!$.selected)continue;const F=C.get($.id);F&&(F.selected=!1),D.push(fl($.id,!1))}const I=[];for(const $ of T)$.selected&&I.push(fl($.id,!1));N(D),E(I)},setMinZoom:x=>{const{panZoom:v,maxZoom:w}=S();v==null||v.setScaleExtent([x,w]),b({minZoom:x})},setMaxZoom:x=>{const{panZoom:v,minZoom:w}=S();v==null||v.setScaleExtent([w,x]),b({maxZoom:x})},setTranslateExtent:x=>{var v;(v=S().panZoom)==null||v.setTranslateExtent(x),b({translateExtent:x})},resetSelectedElements:()=>{const{edges:x,nodes:v,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:C}=S();if(!C)return;const N=v.reduce((j,T)=>T.selected?[...j,fl(T.id,!1)]:j,[]),E=x.reduce((j,T)=>T.selected?[...j,fl(T.id,!1)]:j,[]);w(N),y(E)},setNodeExtent:x=>{const{nodes:v,nodeLookup:w,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:N,nodeExtent:E,zIndexMode:j}=S();x[0][0]===E[0][0]&&x[0][1]===E[0][1]&&x[1][0]===E[1][0]&&x[1][1]===E[1][1]||(Kv(v,w,y,{nodeOrigin:C,nodeExtent:x,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:j}),b({nodeExtent:x}))},panBy:x=>{const{transform:v,width:w,height:y,panZoom:C,translateExtent:N}=S();return Mte({delta:x,panZoom:C,transform:v,translateExtent:N,width:w,height:y})},setCenter:async(x,v,w)=>{const{width:y,height:C,maxZoom:N,panZoom:E}=S();if(!E)return!1;const j=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:N;return await E.setViewport({x:y/2-x*j,y:C/2-v*j,zoom:j},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{b({connection:{...gA}})},updateConnection:x=>{b({connection:x})},reset:()=>b({...B8()})}},Object.is);function nie({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:u,fitView:d,nodeOrigin:p,nodeExtent:f,zIndexMode:g,children:b}){const[S]=R.useState(()=>tie({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:d,minZoom:o,maxZoom:l,fitViewOptions:u,nodeOrigin:p,nodeExtent:f,zIndexMode:g}));return h.jsx(hne,{value:S,children:h.jsx(Hne,{children:h.jsx(ere,{children:b})})})}function rie({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:l,fitViewOptions:u,minZoom:d,maxZoom:p,nodeOrigin:f,nodeExtent:g,zIndexMode:b}){return R.useContext(em)?h.jsx(h.Fragment,{children:e}):h.jsx(nie,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:l,initialFitViewOptions:u,initialMinZoom:d,initialMaxZoom:p,nodeOrigin:f,nodeExtent:g,zIndexMode:b,children:e})}const iie={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function sie({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:l,onEdgeClick:u,onInit:d,onMove:p,onMoveStart:f,onMoveEnd:g,onConnect:b,onConnectStart:S,onConnectEnd:k,onClickConnectStart:x,onClickConnectEnd:v,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:N,onNodeDoubleClick:E,onNodeDragStart:j,onNodeDrag:T,onNodeDragStop:D,onNodesDelete:I,onEdgesDelete:$,onDelete:F,onSelectionChange:U,onSelectionDragStart:G,onSelectionDrag:X,onSelectionDragStop:Y,onSelectionContextMenu:Z,onSelectionStart:Q,onSelectionEnd:z,onBeforeDelete:O,connectionMode:H,connectionLineType:V=Co.Bezier,connectionLineStyle:W,connectionLineComponent:re,connectionLineContainerStyle:le,deleteKeyCode:pe="Backspace",selectionKeyCode:te="Shift",selectionOnDrag:B=!1,selectionMode:ie=qd.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:be=Vd()?"Meta":"Control",zoomActivationKeyCode:ge=Vd()?"Meta":"Control",snapToGrid:Ce,snapGrid:Le,onlyRenderVisibleElements:Ue=!1,selectNodesOnDrag:We,nodesDraggable:Fe,autoPanOnNodeFocus:mt,nodesConnectable:De,nodesFocusable:ot,nodeOrigin:Bt=YA,edgesFocusable:on,edgesReconnectable:Ze,elementsSelectable:ct=!0,defaultViewport:st=Cne,minZoom:xe=.5,maxZoom:Me=2,translateExtent:Ge=Ud,preventScrolling:Qe=!0,nodeExtent:Oe,defaultMarkerColor:tt="#b1b1b7",zoomOnScroll:it=!0,zoomOnPinch:jt=!0,panOnScroll:_t=!1,panOnScrollSpeed:Tt=.5,panOnScrollMode:ut=kl.Free,zoomOnDoubleClick:xn=!0,panOnDrag:dr=!0,onPaneClick:Or,onPaneMouseEnter:os,onPaneMouseMove:ls,onPaneMouseLeave:gi,onPaneScroll:pr,onPaneContextMenu:Ts,paneClickDistance:Jn=1,nodeClickDistance:Xr=0,children:Kr,onReconnect:yn,onReconnectStart:mn,onReconnectEnd:bi,onEdgeContextMenu:Ns,onEdgeDoubleClick:Ui,onEdgeMouseEnter:Sr,onEdgeMouseMove:mr,onEdgeMouseLeave:Pt,reconnectRadius:er=10,onNodesChange:Zr,onEdgesChange:Qr,noDragClassName:ft="nodrag",noWheelClassName:In="nowheel",noPanClassName:tr="nopan",fitView:Je,fitViewOptions:Nt,connectOnClick:na,attributionPosition:pn,proOptions:kr,defaultEdgeOptions:Cr,elevateNodesOnSelect:Jr=!0,elevateEdgesOnSelect:Er=!1,disableKeyboardA11y:Ut=!1,autoPanOnConnect:Ir,autoPanOnNodeDrag:Qt,autoPanOnSelection:gr=!0,autoPanSpeed:qi,connectionRadius:Hn,isValidConnection:zr,onError:ra,style:Gi,id:ia,nodeDragThreshold:js,connectionDragThreshold:ei,viewport:vi,onViewportChange:nr,width:rr,height:Rn,colorMode:ln="light",debug:sa,onScroll:cs,ariaLabelConfig:ti,zIndexMode:Ga="basic",...ir},aa){const cn=ia||"1",Ms=Nne(ln),gn=R.useCallback(Ar=>{Ar.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),cs==null||cs(Ar)},[cs]);return h.jsx("div",{"data-testid":"rf__wrapper",...ir,onScroll:gn,style:{...Gi,...iie},ref:aa,className:Qn(["react-flow",i,Ms]),id:ia,role:"application",children:h.jsxs(rie,{nodes:e,edges:t,width:rr,height:Rn,fitView:Je,fitViewOptions:Nt,minZoom:xe,maxZoom:Me,nodeOrigin:Bt,nodeExtent:Oe,zIndexMode:Ga,children:[h.jsx(Tne,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:b,onConnectStart:S,onConnectEnd:k,onClickConnectStart:x,onClickConnectEnd:v,nodesDraggable:Fe,autoPanOnNodeFocus:mt,nodesConnectable:De,nodesFocusable:ot,edgesFocusable:on,edgesReconnectable:Ze,elementsSelectable:ct,elevateNodesOnSelect:Jr,elevateEdgesOnSelect:Er,minZoom:xe,maxZoom:Me,nodeExtent:Oe,onNodesChange:Zr,onEdgesChange:Qr,snapToGrid:Ce,snapGrid:Le,connectionMode:H,translateExtent:Ge,connectOnClick:na,defaultEdgeOptions:Cr,fitView:Je,fitViewOptions:Nt,onNodesDelete:I,onEdgesDelete:$,onDelete:F,onNodeDragStart:j,onNodeDrag:T,onNodeDragStop:D,onSelectionDrag:X,onSelectionDragStart:G,onSelectionDragStop:Y,onMove:p,onMoveStart:f,onMoveEnd:g,noPanClassName:tr,nodeOrigin:Bt,rfId:cn,autoPanOnConnect:Ir,autoPanOnNodeDrag:Qt,autoPanSpeed:qi,onError:ra,connectionRadius:Hn,isValidConnection:zr,selectNodesOnDrag:We,nodeDragThreshold:js,connectionDragThreshold:ei,onBeforeDelete:O,debug:sa,ariaLabelConfig:ti,zIndexMode:Ga}),h.jsx(Jre,{onInit:d,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:N,onNodeDoubleClick:E,nodeTypes:a,edgeTypes:o,connectionLineType:V,connectionLineStyle:W,connectionLineComponent:re,connectionLineContainerStyle:le,selectionKeyCode:te,selectionOnDrag:B,selectionMode:ie,deleteKeyCode:pe,multiSelectionKeyCode:be,panActivationKeyCode:oe,zoomActivationKeyCode:ge,onlyRenderVisibleElements:Ue,defaultViewport:st,translateExtent:Ge,minZoom:xe,maxZoom:Me,preventScrolling:Qe,zoomOnScroll:it,zoomOnPinch:jt,zoomOnDoubleClick:xn,panOnScroll:_t,panOnScrollSpeed:Tt,panOnScrollMode:ut,panOnDrag:dr,autoPanOnSelection:gr,onPaneClick:Or,onPaneMouseEnter:os,onPaneMouseMove:ls,onPaneMouseLeave:gi,onPaneScroll:pr,onPaneContextMenu:Ts,paneClickDistance:Jn,nodeClickDistance:Xr,onSelectionContextMenu:Z,onSelectionStart:Q,onSelectionEnd:z,onReconnect:yn,onReconnectStart:mn,onReconnectEnd:bi,onEdgeContextMenu:Ns,onEdgeDoubleClick:Ui,onEdgeMouseEnter:Sr,onEdgeMouseMove:mr,onEdgeMouseLeave:Pt,reconnectRadius:er,defaultMarkerColor:tt,noDragClassName:ft,noWheelClassName:In,noPanClassName:tr,rfId:cn,disableKeyboardA11y:Ut,nodeExtent:Oe,viewport:vi,onViewportChange:nr}),h.jsx(kne,{onSelectionChange:U}),Kr,h.jsx(_ne,{proOptions:kr,position:pn}),h.jsx(vne,{rfId:cn,disableKeyboardA11y:Ut})]})})}var aie=KA(sie);function oie({dimensions:e,lineWidth:t,variant:n,className:r}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Qn(["react-flow__background-pattern",n,r])})}function lie({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:Qn(["react-flow__background-pattern","dots",t])})}var Ra;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ra||(Ra={}));const cie={[Ra.Dots]:1,[Ra.Lines]:1,[Ra.Cross]:6},uie=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function yT({id:e,variant:t=Ra.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:l,style:u,className:d,patternClassName:p}){const f=R.useRef(null),{transform:g,patternId:b}=Ft(uie,An),S=r||cie[t],k=t===Ra.Dots,x=t===Ra.Cross,v=Array.isArray(n)?n:[n,n],w=[v[0]*g[2]||1,v[1]*g[2]||1],y=S*g[2],C=Array.isArray(a)?a:[a,a],N=x?[y,y]:w,E=[C[0]*g[2]||1+N[0]/2,C[1]*g[2]||1+N[1]/2],j=`${b}${e||""}`;return h.jsxs("svg",{className:Qn(["react-flow__background",d]),style:{...u,...nm,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:f,"data-testid":"rf__background",children:[h.jsx("pattern",{id:j,x:g[0]%w[0],y:g[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:k?h.jsx(lie,{radius:y/2,className:p}):h.jsx(oie,{dimensions:N,lineWidth:i,variant:t,className:p})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${j})`})]})}yT.displayName="Background";const die=R.memo(yT);function hie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function fie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function pie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.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 mie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 gie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 rf({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:Qn(["react-flow__controls-button",t]),...n,children:e})}const bie=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function wT({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:l,onInteractiveChange:u,className:d,children:p,position:f="bottom-left",orientation:g="vertical","aria-label":b}){const S=Nn(),{isInteractive:k,minZoomReached:x,maxZoomReached:v,ariaLabelConfig:w}=Ft(bie,An),{zoomIn:y,zoomOut:C,fitView:N}=fx(),E=()=>{y(),a==null||a()},j=()=>{C(),o==null||o()},T=()=>{N(i),l==null||l()},D=()=>{S.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),u==null||u(!k)},I=g==="horizontal"?"horizontal":"vertical";return h.jsxs(tm,{className:Qn(["react-flow__controls",I,d]),position:f,style:e,"data-testid":"rf__controls","aria-label":b??w["controls.ariaLabel"],children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(rf,{onClick:E,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:v,children:h.jsx(hie,{})}),h.jsx(rf,{onClick:j,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:x,children:h.jsx(fie,{})})]}),n&&h.jsx(rf,{className:"react-flow__controls-fitview",onClick:T,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:h.jsx(pie,{})}),r&&h.jsx(rf,{className:"react-flow__controls-interactive",onClick:D,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:k?h.jsx(gie,{}):h.jsx(mie,{})}),p]})}wT.displayName="Controls";R.memo(wT);function vie({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:l,strokeWidth:u,className:d,borderRadius:p,shapeRendering:f,selected:g,onClick:b}){const{background:S,backgroundColor:k}=a||{},x=o||S||k;return h.jsx("rect",{className:Qn(["react-flow__minimap-node",{selected:g},d]),x:t,y:n,rx:p,ry:p,width:r,height:i,style:{fill:x,stroke:l,strokeWidth:u},shapeRendering:f,onClick:b?v=>b(v,e):void 0})}const _ie=R.memo(vie),xie=e=>e.nodes.map(t=>t.id),yb=e=>e instanceof Function?e:()=>e;function yie({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=_ie,onClick:o}){const l=Ft(xie,An),u=yb(t),d=yb(e),p=yb(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:l.map(g=>h.jsx(Sie,{id:g,nodeColorFunc:u,nodeStrokeColorFunc:d,nodeClassNameFunc:p,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:f},g))})}function wie({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:l,onClick:u}){const{node:d,x:p,y:f,width:g,height:b}=Ft(S=>{const k=S.nodeLookup.get(e);if(!k)return{node:void 0,x:0,y:0,width:0,height:0};const x=k.internals.userNode,{x:v,y:w}=k.internals.positionAbsolute,{width:y,height:C}=qa(x);return{node:x,x:v,y:w,width:y,height:C}},An);return!d||d.hidden||!kA(d)?null:h.jsx(l,{x:p,y:f,width:g,height:b,style:d.style,selected:!!d.selected,className:r(d),color:t(d),borderRadius:i,strokeColor:n(d),strokeWidth:a,shapeRendering:o,onClick:u,id:d.id})}const Sie=R.memo(wie);var kie=R.memo(yie);const Cie=200,Eie=150,Aie=e=>!e.hidden,Tie=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?yA(xh(e.nodeLookup,{filter:Aie}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Nie="react-flow__minimap-desc";function ST({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:u,maskColor:d,maskStrokeColor:p,maskStrokeWidth:f,position:g="bottom-right",onClick:b,onNodeClick:S,pannable:k=!1,zoomable:x=!1,ariaLabel:v,inversePan:w,zoomStep:y=1,offsetScale:C=5}){const N=Nn(),E=R.useRef(null),{boundingRect:j,viewBB:T,rfId:D,panZoom:I,translateExtent:$,flowWidth:F,flowHeight:U,ariaLabelConfig:G}=Ft(Tie,An),X=(e==null?void 0:e.width)??Cie,Y=(e==null?void 0:e.height)??Eie,Z=j.width/X,Q=j.height/Y,z=Math.max(Z,Q),O=z*X,H=z*Y,V=C*z,W=j.x-(O-j.width)/2-V,re=j.y-(H-j.height)/2-V,le=O+V*2,pe=H+V*2,te=`${Nie}-${D}`,B=R.useRef(0),ie=R.useRef();B.current=z,R.useEffect(()=>{if(E.current&&I)return ie.current=$te({domNode:E.current,panZoom:I,getTransform:()=>N.getState().transform,getViewScale:()=>B.current}),()=>{var Ce;(Ce=ie.current)==null||Ce.destroy()}},[I]),R.useEffect(()=>{var Ce;(Ce=ie.current)==null||Ce.update({translateExtent:$,width:F,height:U,inversePan:w,pannable:k,zoomStep:y,zoomable:x})},[k,x,w,y,$,F,U]);const oe=b?Ce=>{var We;const[Le,Ue]=((We=ie.current)==null?void 0:We.pointer(Ce))||[0,0];b(Ce,{x:Le,y:Ue})}:void 0,be=S?R.useCallback((Ce,Le)=>{const Ue=N.getState().nodeLookup.get(Le).internals.userNode;S(Ce,Ue)},[]):void 0,ge=v??G["minimap.ariaLabel"];return h.jsx(tm,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*z: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 o=="number"?o:void 0},className:Qn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:X,height:Y,viewBox:`${W} ${re} ${le} ${pe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":te,ref:E,onClick:oe,children:[ge&&h.jsx("title",{id:te,children:ge}),h.jsx(kie,{onClick:be,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:l}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-V},${re-V}h${le+V*2}v${pe+V*2}h${-le-V*2}z - M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ST.displayName="MiniMap";R.memo(ST);const jie=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Mie={[tu.Line]:"right",[tu.Handle]:"bottom-right"};function Rie({nodeId:e,position:t,variant:n=tu.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:l=10,minHeight:u=10,maxWidth:d=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:g,autoScale:b=!0,shouldResize:S,onResizeStart:k,onResize:x,onResizeEnd:v}){const w=eT(),y=typeof e=="string"?e:w,C=Nn(),N=R.useRef(null),E=n===tu.Handle,j=Ft(R.useCallback(jie(E&&b),[E,b]),An),T=R.useRef(null),D=t??Mie[n];R.useEffect(()=>{if(!(!N.current||!y))return T.current||(T.current=Jte({domNode:N.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:$,transform:F,snapGrid:U,snapToGrid:G,nodeOrigin:X,domNode:Y}=C.getState();return{nodeLookup:$,transform:F,snapGrid:U,snapToGrid:G,nodeOrigin:X,paneDomNode:Y}},onChange:($,F)=>{const{triggerNodeChanges:U,nodeLookup:G,parentLookup:X,nodeOrigin:Y}=C.getState(),Z=[],Q={x:$.x,y:$.y},z=G.get(y);if(z&&z.expandParent&&z.parentId){const O=z.origin??Y,H=$.width??z.measured.width??0,V=$.height??z.measured.height??0,W={id:z.id,parentId:z.parentId,rect:{width:H,height:V,...CA({x:$.x??z.position.x,y:$.y??z.position.y},{width:H,height:V},z.parentId,G,O)}},re=hx([W],G,X,Y);Z.push(...re),Q.x=$.x?Math.max(O[0]*H,$.x):void 0,Q.y=$.y?Math.max(O[1]*V,$.y):void 0}if(Q.x!==void 0&&Q.y!==void 0){const O={id:y,type:"position",position:{...Q}};Z.push(O)}if($.width!==void 0&&$.height!==void 0){const H={id:y,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:$.width,height:$.height}};Z.push(H)}for(const O of F){const H={...O,type:"position"};Z.push(H)}U(Z)},onEnd:({width:$,height:F})=>{const U={id:y,type:"dimensions",resizing:!1,dimensions:{width:$,height:F}};C.getState().triggerNodeChanges([U])}})),T.current.update({controlPosition:D,boundaries:{minWidth:l,minHeight:u,maxWidth:d,maxHeight:p},keepAspectRatio:f,resizeDirection:g,onResizeStart:k,onResize:x,onResizeEnd:v,shouldResize:S}),()=>{var $;($=T.current)==null||$.destroy()}},[D,l,u,d,p,f,k,x,v,S]);const I=D.split("-");return h.jsx("div",{className:Qn(["react-flow__resize-control","nodrag",...I,n,r]),ref:N,style:{...i,scale:j,...o&&{[E?"backgroundColor":"borderColor"]:o}},children:a})}R.memo(Rie);function Die(){const[e,t]=R.useState(0),[n,r]=R.useState(0);return{ref:R.useCallback(a=>{if(!a)return;function o(){t(a.offsetWidth),r(a.offsetHeight)}const l=new ResizeObserver(o),u=new MutationObserver(o);return l.observe(a),u.observe(a,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),o(),()=>{l.disconnect(),u.disconnect()}},[]),offsetWidth:e,offsetHeight:n}}const sf=8;function Lie(e,t){const{offsetWidth:n,offsetHeight:r}=t,[{viewHeight:i,viewWidth:a},o]=R.useState({viewWidth:0,viewHeight:0});R.useEffect(()=>{function p(){o({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",p),p(),()=>window.removeEventListener("resize",p)},[]);let l=0,u=0,d=0;if(e){const{distance:p}=e;switch(e.anchor){case"left":l=e.x-n-p,u=e.y+e.height/2-r/2;break;case"right":l=e.x+e.width+p,u=e.y+e.height/2-r/2;break;case"below":l=e.x+e.width/2-n/2,u=e.y+e.height+p;break;case"above":l=e.x+e.width/2-n/2,u=e.y-r-p;break}const f=l,g=u;l=Math.min(Math.max(l,sf),a-n-sf),u=Math.min(Math.max(u,sf),i-r-sf),d=e.anchor==="left"||e.anchor==="right"?g-u:f-l}return{x:l,y:u,arrowAdjustment:d}}const wb=380,Sb=12,Oie=350,Iie=150,Jv=new EventTarget;function zie(){Jv.dispatchEvent(new Event("move"))}function Bie(e,t){const[n,r]=R.useState(null),i=R.useRef(void 0),a=R.useRef(void 0);R.useEffect(()=>{const d=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current),r(null)};return Jv.addEventListener("move",d),()=>{Jv.removeEventListener("move",d),window.clearTimeout(i.current),window.clearTimeout(a.current)}},[]),R.useEffect(()=>{r(d=>{var f;if(!d)return d;const p=((f=e.current)==null?void 0:f.getBoundingClientRect())??null;return p&&d.x===p.x&&d.y===p.y&&d.width===p.width&&d.height===p.height?d:p})},[e,t]);const o=R.useCallback(()=>{window.clearTimeout(a.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>{var d;r(((d=e.current)==null?void 0:d.getBoundingClientRect())??null)},Oie)},[e]),l=R.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(a.current),a.current=window.setTimeout(()=>r(null),Iie)},[]),u=R.useCallback(()=>window.clearTimeout(a.current),[]);return{rect:n,onMouseEnter:o,onMouseLeave:l,keepOpen:u}}function Hie(e){const t=new Date(e),n=t.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return t.toLocaleDateString(void 0,n)}function $ie({exp:e,runs:t,latestRun:n,parentSlug:r,anchor:i,onOpenLogs:a,onOpenCode:o,onMouseEnter:l,onMouseLeave:u}){const d=Die(),p=i.right+Sb+wb<=window.innerWidth,f=i.x-Sb-wb>=0,g=p?"right":f?"left":i.y>window.innerHeight/2?"above":"below",{x:b,y:S}=Lie({x:i.x,y:i.y,width:i.width,height:i.height,anchor:g,distance:Sb},d),[k,x]=R.useState(null),v=e.parentExperimentId&&(n!=null&&n.commitSha)?n.id:null;R.useEffect(()=>{if(x(null),!v)return;let $=!1;return HR(v).then(F=>{let U=F.diff;if(F.truncated){const Z=U.lastIndexOf(` -diff --git `);U=Z!==-1?U.slice(0,Z+1):U.slice(0,U.lastIndexOf(` -`)+1)}let G=[];try{G=U.trim()?Av(U):[]}catch{return}if(F.truncated&&G.every(Z=>Z.hunks.length===0))return;let X=0,Y=0;for(const Z of G){const Q=W2(Z);X+=Q.additions,Y+=Q.deletions}$||x({fileCount:G.length,additions:X,deletions:Y,truncated:F.truncated})}).catch(()=>{}),()=>{$=!0}},[v]);const w={done:0,failed:0,cancelled:0,live:0};for(const $ of t)$.status==="done"?w.done+=1:$.status==="failed"?w.failed+=1:$.status==="cancelled"?w.cancelled+=1:w.live+=1;const y=n?Nf((n.endedAt??Date.now())-n.createdAt):null,C=(n==null?void 0:n.status)==="failed"&&n.resultMarkdown?n.resultMarkdown:null,N=e.description||(C?null:n==null?void 0:n.resultMarkdown)||null,E=R.useRef(null),[j,T]=R.useState(!1),[D,I]=R.useState(!1);return R.useEffect(()=>{T(!1)},[N]),R.useEffect(()=>{const $=E.current;$&&I($.scrollHeight>$.clientHeight+1)},[N,j]),zE.createPortal(h.jsxs("div",{ref:d.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] py-3.5 px-4 text-sm text-text [&_.hc-mono]:font-mono [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:font-mono [&_.hc-slug]:text-md [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-[color-mix(in_oklab,_var(--border)_55%,_var(--text))] [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-xs [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:font-mono [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-2xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-mono]:min-w-0 [&_.hc-foot_.hc-mono]:overflow-hidden [&_.hc-foot_.hc-mono]:text-ellipsis [&_.hc-foot_.hc-mono]:whitespace-nowrap",style:{width:wb,left:b,top:S,visibility:d.offsetHeight===0?"hidden":void 0},onMouseEnter:l,onMouseLeave:u,children:[h.jsxs("div",{className:"hc-head",children:[h.jsx("span",{className:"hc-slug",children:e.slug}),h.jsx(Ma,{status:n?ss(n):"idle"})]}),e.title&&h.jsx("div",{className:"hc-title",children:e.title}),h.jsxs("div",{className:"hc-actions",children:[a&&h.jsxs("button",{type:"button",onClick:a,children:[h.jsx(Uc,{size:13}),"Logs"]}),h.jsxs("button",{type:"button",onClick:o,children:[h.jsx(ip,{size:13}),"Code"]})]}),N&&h.jsx("div",{className:`hc-body${j?" expanded":""}`,ref:E,children:N}),N&&(D||j)&&h.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>T($=>!$),children:j?"Show less":"Show more"}),C&&h.jsx("div",{className:"hc-failure",children:C}),h.jsxs("div",{className:"hc-stats",children:[h.jsxs("span",{children:[t.length===1?"1 run":`${t.length} runs`,w.done>0&&` · ${w.done} done`,w.failed>0&&` · ${w.failed} failed`,w.cancelled>0&&` · ${w.cancelled} cancelled`,w.live>0&&` · ${w.live} live`]}),n&&l_(n.backend)&&h.jsx(N2,{backend:n.backend}),y&&h.jsx("span",{children:y}),n&&h.jsx("span",{children:Gs(n.createdAt)})]}),h.jsxs("div",{className:"hc-git",children:[h.jsxs("div",{className:"hc-git-row",children:[h.jsxs("span",{className:"hc-branch",title:e.branchName,children:[h.jsx(nh,{size:12}),e.branchName]}),r&&h.jsxs("span",{children:["from ",h.jsx("span",{className:"hc-mono",children:r})]})]}),k&&k.fileCount>0&&h.jsx("div",{className:"hc-git-row",title:`Committed changes vs ${r??"parent"}${k.truncated?" (diff truncated — counts are lower bounds)":""}`,children:h.jsxs("span",{children:[k.truncated&&"≥ ",h.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",k.additions]})," ",h.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",k.deletions]})," · ",k.fileCount===1&&!k.truncated?"1 file":`${k.fileCount}${k.truncated?"+":""} files`]})})]}),h.jsxs("div",{className:"hc-foot",children:[h.jsxs("span",{className:"hc-mono",children:["$ ",e.runCommand]}),h.jsxs("span",{children:["created ",Hie(e.createdAt)]})]})]}),document.body)}const H8=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-md [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),Fie=264,$8=132,wf=44,Pie=72,Uie=148,qie=44;function Gie(e){const t=new Map(e.map(a=>[a.id,{exp:a,children:[]}])),n=[];for(const a of e){const o=t.get(a.id),l=a.parentExperimentId?t.get(a.parentExperimentId):void 0;l?l.children.push(o):n.push(o)}const r=(a,o)=>a.exp.createdAt-o.exp.createdAt,i=a=>{a.children.sort(r),a.children.forEach(i)};return n.sort(r),n.forEach(i),n}function Vie(e,t){const n=new Map,r=l=>{const u=n.get(l)??1+l.children.reduce((d,p)=>d+r(p),0);return n.set(l,u),u},i=new Map,a=l=>{const u=i.get(l)??(t(l)||l.children.some(a));return i.set(l,u),u};function o(l){if(t(l)){const p=[];let f=0;for(const g of l.children)a(g)?p.push(...o(g)):f+=r(g);return f>0&&p.push({kind:"elided",id:`el-${l.exp.id}`,count:f,children:[]}),[{kind:"exp",exp:l.exp,children:p}]}if(!a(l))return[];let u=0;const d=[];return(function p(f){u+=1;for(const g of f.children)t(g)?d.push(...o(g)):a(g)?p(g):u+=r(g)})(l),[{kind:"elided",id:`el-${l.exp.id}`,count:u,children:d}]}return e.flatMap(o)}function e_(e){return e.kind==="exp"?Fie:Uie}function af(e){return e.kind==="exp"?e.exp.id:e.id}function Sf(e){if(e.children.length===0)return e_(e);const t=e.children.reduce((n,r)=>n+Sf(r),0)+wf*(e.children.length-1);return Math.max(e_(e),t)}function Wie(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const Yie=R.memo(function({data:t}){const{exp:n,latestRun:r,runs:i,isBaseline:a,parentSlug:o,githubOwner:l,githubRepo:u,onOpenView:d,onOpenCode:p}=t,f=r?ss(r):void 0,g=f==="running"||f==="starting"||f==="cancelling",b=a?"Baseline":g?"Running":"Experiment",S=i.slice(-8),k=R.useRef(null),x=Bie(k,t);return h.jsxs("div",{ref:k,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-[0_1px_2px_rgba(0,_0,_0,_0.04)] text-md transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-[0_2px_8px_rgba(0,_0,_0,_0.08)] [&.live]:border-accent-teal [&.live]:shadow-[0_2px_12px_rgba(32,_154,_132,_0.2)] [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-left [&_.node-overview-link]:cursor-pointer [&_.node-overview-link:hover_.node-slug]:underline [&_.node-overview-link:hover_.node-slug]:underline-offset-[3px] [&_.node-overview-link:focus-visible]:outline-2 [&_.node-overview-link:focus-visible]:outline-solid [&_.node-overview-link:focus-visible]:outline-accent [&_.node-overview-link:focus-visible]:outline-offset-4 [&_.node-overview-link:focus-visible]:rounded-xs [&_.node-eyebrow]:flex [&_.node-eyebrow]:items-center [&_.node-eyebrow]:justify-between [&_.node-eyebrow]:gap-2 [&_.node-eyebrow]:mb-1.5 [&_.node-eyebrow]:text-2xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:font-mono [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-2xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-xs [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ml-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${g?"live":""}`,onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,children:[h.jsx(Oo,{type:"target",position:lt.Top}),h.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",onClick:()=>d(n.id,"overview"),onKeyDown:v=>{v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),d(n.id,"overview"))},children:[h.jsxs("div",{className:"node-eyebrow",children:[h.jsx("span",{children:b}),h.jsx(Ma,{status:f??"idle"})]}),h.jsx("div",{className:"node-head",children:h.jsx("span",{className:"node-slug",children:n.slug})}),(n.title||n.description)&&h.jsx("div",{className:"node-title",children:n.title||n.description}),h.jsxs("div",{className:"node-meta",children:[h.jsx("span",{children:"Runs"}),S.length>0?h.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:S.map(v=>h.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-[color-mix(in_oklab,_var(--accent-red)_55%,_transparent)] [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${Wie(ss(v))}`,title:ss(v)},v.id))}):h.jsx("span",{children:"no runs"}),h.jsx("span",{style:{flex:1}}),r&&h.jsx("span",{children:Gs(r.createdAt)})]})]}),h.jsxs("div",{className:"node-actions",onClick:v=>v.stopPropagation(),children:[i.length>0&&h.jsxs("button",{className:"node-action",title:"Open logs",onClick:()=>d(n.id,"terminal"),children:[h.jsx(Uc,{size:13}),"Logs"]}),h.jsxs("button",{className:"node-action",title:`Browse code on ${n.branchName}`,onClick:()=>p(n.id,n.branchName,"files"),children:[h.jsx(ip,{size:13}),"Code"]}),l&&u&&h.jsx("a",{className:"node-action node-action-ext",title:`Open ${n.branchName} on GitHub`,"aria-label":`Open ${n.branchName} on GitHub`,href:op(l,u,n.branchName),target:"_blank",rel:"noopener noreferrer",onClick:v=>v.stopPropagation(),children:h.jsx(Mp,{size:13})})]}),h.jsx(Oo,{type:"source",position:lt.Bottom}),x.rect&&h.jsx($ie,{exp:n,runs:i,latestRun:r,parentSlug:o,anchor:x.rect,onOpenLogs:i.length>0?()=>d(n.id,"terminal"):void 0,onOpenCode:()=>p(n.id,n.branchName,"files"),onMouseEnter:x.keepOpen,onMouseLeave:x.onMouseLeave})]})}),Xie=R.memo(function({data:t}){const{count:n,onShowProjectScope:r}=t;return h.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-[color-mix(in_oklab,_var(--text)_3%,_transparent)] text-muted text-2xs font-medium text-left transition-[border-color,color] duration-120 ease-standard [&:hover]:border-text [&:hover]:text-text [&_.elided-node-label]:flex [&_.elided-node-label]:flex-col [&_.elided-node-label]:leading-[1.3] [&_.elided-node-sub]:text-muted",role:"button",tabIndex:0,title:"Switch to Entire project to see all experiments",onClick:r,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),r())},children:[h.jsx(Oo,{type:"target",position:lt.Top}),h.jsx(J8,{size:14}),h.jsxs("span",{className:"elided-node-label",children:[n," ",n===1?"experiment":"experiments",h.jsx("span",{className:"elided-node-sub",children:"other tasks"})]}),h.jsx(Oo,{type:"source",position:lt.Bottom})]})}),Kie={exp:Yie,elided:Xie},kT={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},Zie={...kT.style,strokeDasharray:"4 4"};function Qie({experiments:e,runs:t,project:n,onOpenView:r,onOpenCode:i,agentSessionId:a,onShowProjectScope:o}){const{nodes:l,edges:u}=R.useMemo(()=>{const d=new Map;for(const v of t){const w=d.get(v.experimentId);w?w.push(v):d.set(v.experimentId,[v])}for(const v of d.values())v.sort((w,y)=>w.createdAt-y.createdAt);const p=[],f=[],g=v=>!a||v.exp.chatSessionId===a,b=Vie(Gie(e),g),S=new Map(e.map(v=>[v.id,v.slug]));function k(v,w,y){const C=w-e_(v)/2;if(v.kind==="exp"){const j=d.get(v.exp.id)??[];p.push({id:v.exp.id,type:"exp",position:{x:C,y},data:{exp:v.exp,latestRun:j[j.length-1]??null,runs:j,isBaseline:!v.exp.parentExperimentId,parentSlug:v.exp.parentExperimentId?S.get(v.exp.parentExperimentId)??null:null,githubOwner:n.githubEnabled?n.githubOwner:"",githubRepo:n.githubEnabled?n.githubRepo:"",onOpenView:r,onOpenCode:i}})}else p.push({id:v.id,type:"elided",position:{x:C,y:y+($8-qie)/2},data:{count:v.count,onShowProjectScope:o}});if(v.children.length===0)return;const N=v.children.reduce((j,T)=>j+Sf(T),0)+wf*(v.children.length-1);let E=w-N/2;for(const j of v.children){const T=Sf(j),D=v.kind==="elided"||j.kind==="elided";f.push({id:`e-${af(v)}-${af(j)}`,source:af(v),target:af(j),...D?{style:Zie}:{}}),k(j,E+T/2,y+$8+Pie),E+=T+wf}}let x=0;for(const v of b){const w=Sf(v);k(v,x+w/2,0),x+=w+wf}return{nodes:p,edges:f}},[e,t,r,i,n.githubOwner,n.githubRepo,n.githubEnabled,a,o]);return e.length===0?h.jsxs("div",{className:H8,children:[h.jsx("p",{className:"empty-state-title",children:"No experiments yet"}),h.jsx("p",{className:"empty-state-hint",children:"Ask the agent in chat to create and run your first experiment."})]}):l.length===0&&a?h.jsxs("div",{className:H8,children:[h.jsx("p",{className:"empty-state-title",children:"No experiments from the current task yet"}),h.jsx("p",{className:"empty-state-hint",children:"Ask in this task to create one, or switch to Entire project to see all experiments."})]}):h.jsx(aie,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:l,edges:u,nodeTypes:Kie,defaultEdgeOptions:kT,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:zie,minZoom:.15,fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},children:h.jsx(die,{variant:Ra.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},a??"project")}const F8=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-md [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" "),kb=(e,t)=>e.id===t.id&&e.view===t.view,cl=(e,t)=>e.path===t.path&&(e.source??"repo")===(t.source??"repo")&&e.sessionId===t.sessionId&&e.ref===t.ref,mx=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,of=(e,t,n)=>`${e}:${t??""}:${mx(n)}`,CT=e=>({...e,lineScrollRequest:void 0});function Cb(e){return typeof e=="object"&&"path"in e?CT(e):e}const Sc=(e,t)=>e.branch===t.branch;function Mr(e){return typeof e=="string"?`home:${e}`:"code"in e?`code:${e.branch}`:"kind"in e?e.kind==="plan"?`plan:${e.promptId}`:`subagent:${e.spawnPartId}`:"path"in e?`file:${mx(e)}`:`experiment:${e.id}:${e.view}`}function P8(e,t=!1){const n={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1};if(e===cd&&t){const r={path:Ef,source:"artifacts"};return{...n,rightTab:r,tabHistory:[r],fileTabs:[r],panelOpen:!0}}if(e===oS){const r=[{path:"nanochat-base-training-curves.svg",source:"artifacts"},{path:"nanochat-sft-training-curves.svg",source:"artifacts"},{path:"nanochat-training-throughput.svg",source:"artifacts"},{path:"nanochat-core-evaluation.svg",source:"artifacts"}];return{...n,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,panelOpen:!0}}if(e===lS){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...n,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,panelOpen:!0}}return n}function Jie(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ese(e,t,n,r,i){let a=e,o;const l=t==null?void 0:t.replace(/\/+$/,""),u=r==null?void 0:r.replace(/\/+$/,"");if(a.startsWith("artifacts/"))return a=a.slice(10),a?{path:a,source:"artifacts"}:null;if(a==="~"||a.startsWith("~/"))return{path:a,source:"abs"};const d=g=>{const b=x=>x.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[S,k]=[b(a),b(g)];return S===k?"":S.startsWith(`${k}/`)?S.slice(k.length).replace(/^\/+/,""):null},p=a.startsWith("/")&&u?d(u):null,f=a.startsWith("/")&&l?d(l):null;if(!a.startsWith("/"))o=n;else{if(p!==null)return p?{path:p,source:"artifacts"}:null;if(f!==null)a=f;else{const g=i?Jie(i):"[^/]+",b=a.match(new RegExp(`/files/${g}/(.+)$`)),S=b?null:a.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),k=b||S?null:a.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(b)return{path:b[1],source:"artifacts"};S?(o=S[1],a=S[2]):k&&(a=k[1])}}return a?a.startsWith("/")?{path:a,source:"abs"}:{path:a,sessionId:o}:null}function tse(e,t){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??t}const t_="orx:panel-width",ET="orx:experiments-view";function nse(){try{return localStorage.getItem(ET)==="tree"?"tree":"table"}catch{return"table"}}const Yd=360,rse=10,ise=272,sse=380,ase=ise+56,ose=80,lse=48;function kf(){return Math.max(Yd,window.innerWidth-ase-sse)}function cse(){const e=kf();try{const t=Number(localStorage.getItem(t_));if(Number.isFinite(t)&&t>=Yd)return Math.min(t,e)}catch{}return Math.max(Yd,Math.min(760,e,Math.round(window.innerWidth*.42)))}function id(e,t){const n=e.findIndex(i=>i.id===t.id);if(n<0)return[...e,t];const r=e.slice();return r[n]=t,r}function U8(e){const t=R.useRef(e);return t.current.size===e.size&&[...e].every(([r,i])=>t.current.get(r)===i)||(t.current=e),t.current}function use(){var Wa,ds;const[e,t]=R.useState(null),[n,r]=R.useState(null),i=R.useRef(void 0);i.current=n==null?void 0:n.tourCompleted;const a=R.useRef(!1),[o,l]=R.useState(null),u=R.useRef(null),[d,p]=R.useState(null),[f,g]=R.useState([]),[b,S]=R.useState([]),k=R.useRef(b);k.current=b;const x=R.useRef(new Map),v=R.useRef(new Set),w=R.useRef(null),y=R.useRef(!1),C=R.useRef(new Map),N=R.useRef(new Map),E=R.useRef(0),j=R.useRef(f);j.current=f;const[T,D]=R.useState(null),[I,$]=R.useState(nse),[F,U]=R.useState("project"),G=R.useRef(null),{open:X,setOpen:Y,ref:Z}=Bo(G),[Q,z]=R.useState(null),[O,H]=R.useState(!1),V=f.every(se=>se.chatSessionId),W=Q&&V?F:"project",re=R.useMemo(()=>W!=="agent"?f:f.filter(se=>se.chatSessionId===Q),[f,W,Q]),le=R.useMemo(()=>{if(W!=="agent")return b;const se=new Set(re.map(we=>we.id));return b.filter(we=>se.has(we.experimentId))},[b,re,W]);R.useEffect(()=>{try{localStorage.setItem(ET,I)}catch{}},[I]);const[pe,te]=R.useState(null),[B,ie]=R.useState("experiments"),[oe,be]=R.useState([]),[ge,Ce]=R.useState(!1),[Le,Ue]=R.useState(!1),[We,Fe]=R.useState(!1),[mt,De]=R.useState([]),[ot,Bt]=R.useState([]),on=R.useRef(new Map),Ze=R.useRef(0),[ct,st]=R.useState([]),[xe,Me]=R.useState([]),[Ge,Qe]=R.useState([]),[Oe,tt]=R.useState("files"),[it,jt]=R.useState(new Set),[_t,Tt]=R.useState(!1),[ut,xn]=R.useState(!1),[dr,Or]=R.useState(cse),[os,ls]=R.useState(!0),[gi,pr]=R.useState(!1),[Ts,Jn]=R.useState(!1),[Xr,Kr]=R.useState("chat"),[yn,mn]=R.useState(null),bi=R.useRef(new Map),Ns=R.useRef(P8()),Ui=R.useRef(null),Sr=R.useRef(!1),mr=R.useRef(oe);mr.current=oe;const Pt=R.useCallback(se=>{Sr.current=!1;const we=Mr(se),Ee=[...mr.current.filter(Ve=>Mr(Ve)!==we),Cb(se)];mr.current=Ee,be(Ee),ie(se)},[]),er=R.useCallback((se,we)=>{Sr.current=!1;const Ee=Mr(se),Ve=mr.current.filter(vt=>Mr(vt)!==Ee);if(mr.current=Ve,be(Ve),!we)return;const qe=Ve[Ve.length-1];qe?ie(qe):(Tt(!1),xn(!1))},[]),Zr=R.useCallback(se=>{se!=="chat"&&(Sr.current=!1),Kr(se)},[]);Ns.current={rightTab:Cb(B),tabHistory:oe,experimentsTabOpen:ge,filesTabOpen:Le,artifactsTabOpen:We,expTabs:mt,fileTabs:ot,planTabs:ct,subagentTabs:xe,codeTabs:Ge,filesView:Oe,filesToggled:it,selectedRunId:pe,scope:F,panelOpen:_t,panelMax:ut};const Qr=R.useCallback(se=>{const we=Ui.current;if(we===se)return;we&&bi.current.set(we,Ns.current);let Ee=se?bi.current.get(se):void 0;if(!Ee){const Ve=se===cd&&i.current===!1&&!a.current;Ve&&(a.current=!0,H(!0)),Ee=P8(se??void 0,Ve)}if(se&&Sr.current){Sr.current=!1;const Ve="experiments";Ee={...Ee,rightTab:Ve,tabHistory:[...Ee.tabHistory.filter(qe=>Mr(qe)!==Mr(Ve)),Ve],experimentsTabOpen:!0,panelOpen:!0}}ie(Ee.rightTab),mr.current=Ee.tabHistory,be(Ee.tabHistory),Ce(Ee.experimentsTabOpen),Ue(Ee.filesTabOpen),Fe(Ee.artifactsTabOpen),De(Ee.expTabs),Bt(Ee.fileTabs),st(Ee.planTabs),Me(Ee.subagentTabs),Qe(Ee.codeTabs),tt(Ee.filesView),jt(Ee.filesToggled),te(Ee.selectedRunId),U(Ee.scope),Tt(Ee.panelOpen),xn(Ee.panelMax),Ui.current=se,z(se)},[]),ft=(n==null?void 0:n.onboardingCompleted)??!1,[In,tr]=R.useState(!1),Je=R.useCallback(()=>tr(!0),[]),Nt=R.useCallback(async()=>{const se=await r3({tourCompleted:!0});r(we=>we&&{...we,tourCompleted:se.tourCompleted}),tr(!1)},[]),na=R.useCallback(async()=>{await Nt(),Jn(!0)},[Nt]);R.useEffect(()=>{!d||!lg(d)||gi||!ft||n!=null&&n.tourCompleted||Je()},[d,gi,ft,Je,n==null?void 0:n.tourCompleted]);const pn=R.useRef(d);pn.current=d;const kr=R.useCallback(()=>{Kr("chat"),Ce(!0),Pt("experiments"),Tt(!0),Ui.current||(Sr.current=!0)},[Pt]),Cr=R.useCallback(()=>{l(null),t(null),r(null),Promise.allSettled([ER(),AR()]).then(([se,we])=>{const Ee=[];se.status==="fulfilled"?(t(se.value),p(Ve=>{var qe;return Ve&&se.value.some(vt=>vt.id===Ve)?Ve:((qe=se.value[0])==null?void 0:qe.id)??null})):Ee.push("projects"),we.status==="fulfilled"?(u.current=we.value.preferredAgent,r(we.value)):Ee.push("settings"),Ee.length>0&&l(`Couldn't load OpenResearch ${Ee.join(" and ")}.`)})},[]);R.useEffect(()=>{Cr()},[Cr]);const Jr=R.useRef(Promise.resolve()),Er=R.useRef(0),Ut=R.useCallback(se=>{const we=++Er.current;r(Ve=>Ve&&{...Ve,preferredAgent:se});const Ee=Jr.current.then(()=>r3({preferredAgent:se})).then(Ve=>{u.current=Ve.preferredAgent,we===Er.current&&r(qe=>qe&&{...qe,preferredAgent:Ve.preferredAgent})}).catch(Ve=>{throw we===Er.current&&r(qe=>qe&&{...qe,preferredAgent:u.current}),Ve});return Jr.current=Ee.catch(()=>{}),Ee},[]);R.useEffect(()=>{const se=()=>Or(we=>Math.min(we,kf()));return window.addEventListener("resize",se),()=>window.removeEventListener("resize",se)},[]);const Ir=R.useCallback(se=>{y.current=!1,C.current.clear(),N.current.clear();const we=++E.current;zR(se).then(Ee=>{if(pn.current!==se||w.current!==se||E.current!==we)return;C.current=new Map(Ee.map(qe=>[qe.id,qe]));const Ve=[...N.current.values()].some(qe=>{const vt=C.current.get(qe.id);return!vt||vt.status!=="running"&&vt.updatedAt<=qe.updatedAt});N.current.clear();for(const qe of Ee){const vt=x.current.get(qe.id);(!vt||vt.updatedAt{const vt=new Map(Ee.map(ne=>[ne.id,ne]));for(const ne of qe){const fe=vt.get(ne.id);(!fe||fe.updatedAt<=ne.updatedAt)&&vt.set(ne.id,ne)}return[...vt.values()]}),y.current=!0,Ve&&kr()}).catch(()=>{E.current===we&&N.current.clear()})},[kr]);R.useEffect(()=>{if(!d)return;const se=Ui.current;se&&bi.current.set(se,Ns.current),Ui.current=null,Sr.current=!1,z(null),w.current=d,x.current.clear(),v.current.clear(),LR(d).catch(()=>{}),g([]),S([]),D(null),te(null),De([]),Bt([]),H(!1),st([]),Me([]),Qe([]),tt("files"),jt(new Set),mr.current=[],be([]),ie("experiments"),Ce(!1),Ue(!1),Fe(!1),Tt(!1),xn(!1),U("project"),IR(d).then(g).catch(()=>{}),Ir(d),s3(d).then(D).catch(()=>{})},[Ir,d]);const Qt=R.useCallback(()=>{const se=pn.current;se&&s3(se).then(D).catch(()=>{})},[]),gr=R.useCallback(()=>{Qt(),Kr("chat"),Fe(!0),Pt("artifacts"),Tt(!0)},[Qt,Pt]);sL({onReconnect:()=>{const se=pn.current;se&&(w.current=se,x.current.clear(),v.current.clear(),Ir(se))},onRun:se=>{if(se.projectId!==pn.current||se.projectId!==w.current)return;const we=x.current.get(se.id),Ee=v.current.has(se.id);if(we&&we.updatedAt>se.updatedAt||(x.current.set(se.id,se),v.current.add(se.id),S(vt=>id(vt,se)),se.status!=="running"||(we==null?void 0:we.status)==="running"))return;const Ve=C.current.get(se.id),qe=y.current&&(!Ve||Ve.status!=="running"&&Ve.updatedAt<=se.updatedAt);Ee&&we||qe?kr():y.current||N.current.set(se.id,se)},onExperiment:se=>{se.projectId===pn.current&&g(we=>id(we,se))},onProject:se=>{t(we=>we?id(we,se):[se])},onArtifacts:se=>{se===pn.current&&Qt()}});const qi=R.useCallback(()=>U("project"),[]),Hn=R.useCallback((se,we="overview")=>{const Ee={id:se,view:we};De(Ve=>Ve.some(qe=>kb(qe,Ee))?Ve:[...Ve,Ee]),Pt(Ee),Tt(!0)},[Pt]),zr=R.useCallback(se=>{const we=k.current.filter(Ve=>Ve.id===se||Ve.id.startsWith(se)),Ee=we.length===1?we[0]:null;Ee&&(te(Ee.id),Hn(Ee.experimentId,"terminal"))},[Hn]),ra=R.useMemo(()=>new Map(f.map(se=>{var we;return[se.id,((we=se.title)==null?void 0:we.trim())||se.slug||"Experiment"]})),[f]),Gi=U8(ra),ia=R.useMemo(()=>{const se=new Map;for(const we of b)se.set(we.id,Gi.get(we.experimentId)??"Experiment");return se},[Gi,b]),js=U8(ia),ei=R.useCallback(se=>{const we=js.get(se);if(we)return we;const Ee=[...js].filter(([Ve])=>Ve.startsWith(se));return Ee.length===1?Ee[0][1]:""},[js]),vi=R.useCallback(se=>{const we=Gi.get(se);if(we)return we;const Ee=[...Gi].filter(([Ve])=>Ve.startsWith(se));return Ee.length===1?Ee[0][1]:""},[Gi]),nr=R.useCallback(se=>{const we=j.current.filter(Ee=>Ee.id===se||Ee.id.startsWith(se));we.length===1&&Hn(we[0].id,"overview")},[Hn]),rr=R.useCallback(se=>{const we=mt.findIndex(Ee=>kb(Ee,se));we!==-1&&(De(Ee=>Ee.filter((Ve,qe)=>qe!==we)),er(se,Mr(B)===Mr(se)))},[mt,er,B]),Rn=R.useCallback(se=>{const we=CT(se);Bt(Ee=>{const Ve=Ee.findIndex(vt=>cl(vt,se));if(Ve===-1)return[...Ee,we];const qe=Ee.slice();return qe[Ve]=we,qe}),Pt(se),Tt(!0)},[Pt]),ln=R.useCallback((se,we,Ee,Ve,qe,vt)=>{const ne=e==null?void 0:e.find(nt=>nt.id===d),fe=ese(se,ne==null?void 0:ne.repoPath,we,(ne==null?void 0:ne.artifactsDir)??(ne==null?void 0:ne.filesDir),ne==null?void 0:ne.slug);if(!fe)return;const Se=qe?j.current.find(nt=>nt.id===qe||qe.length>=6&&nt.id.startsWith(qe)):void 0,Te=Ee??(Se==null?void 0:Se.branchName),ze=fe.source==null||fe.source==="repo";Te&&ze&&(fe.ref=Te),vt&&!fe.ref&&ze&&(fe.branchLabel=vt),Ve!=null&&(fe.line=Ve,fe.lineScrollRequest=++Ze.current),Rn(fe)},[e,d,Rn]),sa=R.useCallback(se=>Rn({path:se,source:"artifacts"}),[Rn]),cs=R.useCallback((se,we,Ee,Ve,qe)=>ln(se,we,qe,Ee,Ve),[ln]),ti=R.useCallback(se=>{const we=ot.findIndex(Ee=>cl(Ee,se));we!==-1&&(Bt(Ee=>Ee.filter((Ve,qe)=>qe!==we)),d&&on.current.delete(of(d,Q,se)),Q===cd&&cl(se,{path:Ef,source:"artifacts"})&&H(!1),er(se,Mr(B)===Mr(se)))},[Q,ot,er,d,B]),Ga=R.useCallback(se=>{se.lineScrollRequest!==void 0&&ie(we=>typeof we!="object"||!("path"in we)||!cl(we,se)||we.lineScrollRequest!==se.lineScrollRequest?we:Cb(we))},[]),ir=R.useCallback((se,we,Ee)=>{const Ve={kind:"plan",sessionId:we,promptId:Ee,plan:se};st(qe=>{const vt=qe.findIndex(fe=>fe.promptId===Ee);if(vt===-1)return[...qe,Ve];const ne=qe.slice();return ne[vt]=Ve,ne}),Pt(Ve),Tt(!0)},[Pt]),aa=R.useCallback(se=>{const we=ct.findIndex(Ee=>Ee.promptId===se.promptId);we!==-1&&(st(Ee=>Ee.filter((Ve,qe)=>qe!==we)),er(se,Mr(B)===Mr(se)))},[er,ct,B]),cn=R.useCallback((se,we,Ee)=>{const Ve={kind:"subagent",sessionId:se,spawnPartId:we,label:Ee};Me(qe=>qe.some(vt=>vt.spawnPartId===we)?qe:[...qe,Ve]),Pt(Ve),Tt(!0)},[Pt]),Ms=R.useCallback(se=>{const we=xe.findIndex(Ee=>Ee.spawnPartId===se.spawnPartId);we!==-1&&(Me(Ee=>Ee.filter((Ve,qe)=>qe!==we)),er(se,Mr(B)===Mr(se)))},[er,B,xe]),[gn,Ar]=R.useState({});R.useEffect(()=>{if(Ar(ne=>{const fe=new Set(xe.map(Se=>Se.spawnPartId));return Object.keys(ne).every(Se=>fe.has(Se))?ne:Object.fromEntries(Object.entries(ne).filter(([Se])=>fe.has(Se)))}),xe.length===0)return;let se=!0;const we=new Set,Ee=(ne,fe,Se)=>{Ar(Te=>{var nt;let ze=Te;for(const Zt of fe)if(!(Se&&we.has(Zt.spawnPartId)))for(const Nr of ne){const $n=O2(Nr.parts,Zt.spawnPartId);if(!$n)continue;Se||we.add(Zt.spawnPartId);const ri={label:YV($n),running:((nt=$n.state)==null?void 0:nt.status)==="running"},xi=ze[Zt.spawnPartId];(!xi||xi.label!==ri.label||xi.running!==ri.running)&&(ze===Te&&(ze={...Te}),ze[Zt.spawnPartId]=ri);break}return ze})};let Ve=0;const qe=()=>{const ne=++Ve;for(const fe of new Set(xe.map(Se=>Se.sessionId)))ud(fe).then(({messages:Se})=>{se&&ne===Ve&&Ee(Se,xe.filter(Te=>Te.sessionId===fe),!0)}).catch(()=>{})};qe();const vt=wd(ne=>{if(ne.type==="reconnected"){we.clear(),qe();return}if(ne.type!=="message")return;const fe=xe.filter(Se=>Se.sessionId===ne.sessionId);fe.length&&Ee([ne.message],fe,!1)});return()=>{se=!1,vt()}},[xe]);const Br=R.useCallback((se,we,Ee="files")=>{const Ve={code:!0,experimentId:se,branch:we,view:Ee,toggled:new Set};Qe(qe=>qe.some(vt=>Sc(vt,Ve))?qe.map(vt=>Sc(vt,Ve)?{...vt,experimentId:se,view:Ee}:vt):[...qe,Ve]),Pt(Ve),Tt(!0)},[Pt]),Vi=R.useCallback((se,we)=>{Qe(Ee=>Ee.map(Ve=>Sc(Ve,se)?{...Ve,...we}:Ve))},[]),Bl=R.useCallback(se=>{const we=Ge.findIndex(Ee=>Sc(Ee,se));we!==-1&&(Qe(Ee=>Ee.filter((Ve,qe)=>qe!==we)),er(se,Mr(B)===Mr(se)))},[Ge,er,B]),Hl=R.useCallback(()=>{Kr("chat"),Ue(!0),Pt("files"),Tt(!0)},[Pt]),oa=R.useCallback(se=>{se==="experiments"?Ce(!1):se==="files"?Ue(!1):Fe(!1),er(se,B===se)},[er,B]),Rs=se=>{se.preventDefault(),se.currentTarget.setPointerCapture(se.pointerId);const Ee=document.body.style.userSelect;document.body.style.userSelect="none";const Ve=ut,qe=se.clientX,vt=dr;let ne=!1;function fe(){window.removeEventListener("pointermove",Se),window.removeEventListener("pointerup",fe),window.removeEventListener("pointercancel",fe),document.body.style.userSelect=Ee}function Se(Te){if(Ve){const Nr=Te.clientX-qe;if(ne||Nrnt+ose){xn(!0);return}xn(!1);const Zt=Math.min(Math.max(ze,Yd),nt);Or(Zt);try{localStorage.setItem(t_,String(Zt))}catch{}}window.addEventListener("pointermove",Se),window.addEventListener("pointerup",fe),window.addEventListener("pointercancel",fe)},$o=(se,we)=>{t(Ee=>Ee?id(Ee,se):[se]),p(se.id),pr(!1),we&&(mn({projectId:se.id,message:we}),Zr("git"))},$l=se=>{t(we=>we&&we.filter(Ee=>Ee.id!==se)),d===se&&p(null)},br=typeof B=="object"&&"id"in B?B:null,nn=typeof B=="object"&&"path"in B?B:null,us=Q===cd&&O?ot.find(se=>cl(se,{path:Ef,source:"artifacts"})):void 0,Fo=us?[us]:[],Ds=us?ot.filter(se=>!cl(se,us)):ot,ni=typeof B=="object"&&"kind"in B&&B.kind==="plan"?B:null,Hr=typeof B=="object"&&"kind"in B&&B.kind==="subagent"?B:null,Va=typeof B=="object"&&"code"in B?B:null,Tr=Va?Ge.find(se=>Sc(se,Va))??null:null,Ls=se=>h.jsx(wo,{active:nn!==null&&cl(nn,se),label:se.path.split("/").pop()||se.path,icon:h.jsx(eS,{size:12,style:{flexShrink:0}}),onSelect:()=>Pt(se),onClose:()=>ti(se)},`file:${mx(se)}`),St=(e==null?void 0:e.find(se=>se.id===d))??null,_i=br?f.find(se=>se.id===br.id)??null:null,Wi=Tr?f.find(se=>se.id===Tr.experimentId)??null:null;if(o)return h.jsx("div",{className:"app flex flex-col h-full",children:h.jsxs("div",{className:F8,children:[h.jsx("p",{children:o}),h.jsx("button",{className:Wr,onClick:Cr,children:"Retry"})]})});if(e===null||n===null)return h.jsx("div",{className:"app flex flex-col h-full",children:h.jsx("div",{className:F8,children:h.jsx("span",{className:qt})})});if(e.length===0)return h.jsx("div",{className:"app flex flex-col h-full",children:ft?h.jsx(j7,{projects:e,onOpen:p,onCreated:$o,onDeleted:$l}):h.jsx(hZ,{preferredAgent:n.preferredAgent,onDone:(se,we)=>{XG(),u.current=we,t([se]),p(se.id),r(Ee=>({...Ee??{tourCompleted:!1},onboardingCompleted:!0,preferredAgent:we}))}})});const Yi=h.jsx(uZ,{projectName:((Wa=e.find(se=>se.id===d))==null?void 0:Wa.name)??"",onHome:()=>pr(!0),onNewProject:()=>Jn(!0),onRepository:()=>Zr("git"),onCollapse:()=>ls(!1)});return h.jsxs("div",{className:"app flex flex-col h-full",children:[h.jsx(Mq,{}),gi?h.jsx(j7,{projects:e,onOpen:se=>{p(se),pr(!1)},onCreated:$o,onDeleted:$l}):h.jsxs("div",{className:"app-body flex flex-1 min-h-0 py-0 px-3.5",children:[d&&h.jsx(aW,{projectId:d,projectName:(St==null?void 0:St.name)??"",paperId:(ds=e.find(se=>se.id===d))==null?void 0:ds.paperId,railHeader:Yi,railOpen:os,onShowRail:()=>ls(!0),mainView:Xr,onSelectMainView:Zr,experimentsActive:Xr==="chat"&&_t&&B==="experiments",filesActive:Xr==="chat"&&_t&&B==="files",artifactsActive:Xr==="chat"&&_t&&B==="artifacts",onOpenExperiments:kr,onOpenArtifacts:gr,onOpenFile:cs,onOpenRun:zr,runExperimentName:ei,onOpenExperiment:nr,experimentName:vi,onOpenPlan:ir,onOpenSubagent:cn,onOpenWorktree:Hl,onOpenDemoWelcome:St&&lg(St.id)?Je:void 0,onActiveSessionChange:Qr,preferredAgent:n.preferredAgent,onPreferredAgentChange:Ut,children:Xr==="skills"?h.jsx(QK,{project:St}):Xr!=="chat"?h.jsx(DG,{tab:Xr,project:St,githubPublicationError:yn&&yn.projectId===(St==null?void 0:St.id)?yn.message:null,onProjectUpdate:se=>{t(we=>we?id(we,se):[se]),se.githubEnabled&&mn(null)},onSelectTab:Zr}):null}),Xr==="chat"&&_t&&h.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-2.5 mr-0 mb-2.5 ml-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-[0_12px_40px_color-mix(in_oklab,_var(--text)_22%,_transparent)] floating-panel border border-border rounded-lg 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 ${ut?"max":""}`,style:ut?void 0:{width:dr},"data-onboarding":"experiments",children:[h.jsx("div",{className:`panel-resizer absolute left-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] [&:active]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] ${ut?"cursor-e-resize":"cursor-col-resize"}`,title:ut?"Drag right to restore panel":"Drag to resize panel",onPointerDown:Rs}),h.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pr-1.5 pb-0 pl-2 h-10 border-b border-b-border bg-background shrink-0",children:[h.jsxs("div",{className:"tab-strip flex items-end gap-0.5 flex-1 min-w-0 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[Fo.map(Ls),Le&&h.jsx(wo,{active:B==="files",label:"Files",icon:h.jsx(yd,{size:12,style:{flexShrink:0}}),onSelect:()=>Pt("files"),onClose:()=>oa("files")}),We&&h.jsx(wo,{active:B==="artifacts",label:"Artifacts",icon:h.jsx(r_,{size:12,style:{flexShrink:0}}),onSelect:()=>Pt("artifacts"),onClose:()=>oa("artifacts")}),ge&&h.jsx(wo,{active:B==="experiments",label:"Experiments",icon:h.jsx(Eb,{size:12,style:{flexShrink:0}}),onSelect:()=>Pt("experiments"),onClose:()=>oa("experiments")}),mt.map(se=>{const we=f.find(Ee=>Ee.id===se.id);return h.jsx(wo,{active:br!==null&&kb(br,se),label:we?we.title||we.slug:"…",icon:se.view==="overview"?h.jsx(W8,{size:12,style:{flexShrink:0}}):h.jsx(Uc,{size:12,style:{flexShrink:0}}),onSelect:()=>Pt(se),onClose:()=>rr(se)},`${se.id}:${se.view}`)}),Ds.map(Ls),ct.map(se=>h.jsx(wo,{active:ni!==null&&ni.promptId===se.promptId,label:"Plan",icon:h.jsx(s_,{size:12,style:{flexShrink:0}}),onSelect:()=>Pt(se),onClose:()=>aa(se)},`plan:${se.promptId}`)),xe.map(se=>{var we,Ee;return h.jsx(wo,{active:Hr!==null&&Hr.spawnPartId===se.spawnPartId,label:((we=gn[se.spawnPartId])==null?void 0:we.label)??se.label??"Sub-agent",shimmer:((Ee=gn[se.spawnPartId])==null?void 0:Ee.running)??!1,icon:h.jsx(aS,{size:12,style:{flexShrink:0}}),onSelect:()=>Pt(se),onClose:()=>Ms(se)},`subagent:${se.spawnPartId}`)}),Ge.map(se=>{const we=f.find(Ee=>Ee.id===se.experimentId);return h.jsx(wo,{active:Tr!==null&&Sc(Tr,se),label:(we==null?void 0:we.slug)??se.branch,icon:h.jsx(yd,{size:12,style:{flexShrink:0}}),onSelect:()=>Pt(se),onClose:()=>Bl(se)},`code:${se.branch}`)})]}),h.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[h.jsx("button",{className:Xn,title:ut?"Restore panel":"Expand panel","aria-label":ut?"Restore panel":"Expand panel",onClick:()=>xn(se=>!se),children:ut?h.jsx($M,{size:14}):h.jsx(zM,{size:14})}),h.jsx("button",{className:Xn,title:"Close panel","aria-label":"Close panel",onClick:()=>{Sr.current=!1,Tt(!1),xn(!1)},children:h.jsx(qr,{size:14})})]})]}),B==="artifacts"?h.jsx("div",{className:Aa,children:St&&h.jsx(VK,{project:St,artifacts:T,onChanged:Qt,onOpenFile:sa,onOpenStorage:()=>Zr("storage")},St.id)}):B==="experiments"?h.jsxs("div",{className:Aa,children:[h.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[h.jsx("span",{style:{flex:1}}),h.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[h.jsxs("div",{className:"option-picker relative inline-flex",ref:Z,children:[h.jsx("button",{ref:G,className:`${ah} experiment-scope-trigger w-6.5 h-6.5 rounded-sm${W==="agent"?" active":""}`,title:`Experiment filter: ${W==="agent"?"Current task":"Entire project"}`,"aria-label":"Filter experiments","aria-expanded":X,onClick:()=>Y(se=>!se),children:h.jsx(yM,{size:16,strokeWidth:2.5})}),X&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right experiment-scope-menu [&_.model-item]:whitespace-nowrap [&_.model-item:disabled]:text-muted [&_.model-item:disabled]:cursor-default [&_.model-item:disabled:hover]:bg-transparent",children:[h.jsxs("button",{className:hi,"aria-pressed":W==="agent",disabled:!Q||!V,title:Q?V?void 0:"Current task filtering is unavailable for unattributed experiments":"Open a task to filter to its experiments",onClick:()=>{U("agent"),Y(!1)},children:[h.jsx("span",{children:"Current task"}),W==="agent"&&h.jsx(Di,{size:13})]}),h.jsxs("button",{className:hi,"aria-pressed":W==="project",onClick:()=>{U("project"),Y(!1)},children:[h.jsx("span",{children:"Entire project"}),W==="project"&&h.jsx(Di,{size:13})]})]})]}),h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:font-semibold [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":"Experiment view",children:[h.jsx("button",{className:I==="table"?"active":"","aria-pressed":I==="table",onClick:()=>$("table"),children:"Table"}),h.jsx("button",{className:I==="tree"?"active":"","aria-pressed":I==="tree",onClick:()=>$("tree"),children:"Tree"})]})]})]}),h.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:I==="tree"?St&&h.jsx(Qie,{experiments:f,runs:le,project:St,onOpenView:Hn,onOpenCode:Br,agentSessionId:W==="agent"?Q:null,onShowProjectScope:qi}):h.jsx(wZ,{runs:le,emptyHint:W==="agent"&&f.length>0?"No experiments from the current task yet. Switch to Entire project to see all experiments.":void 0,experiments:re,onOpen:se=>{Hn(se.id,"overview")},onOpenLogs:(se,we)=>{te(we),Hn(se,"terminal")},onOpenCode:se=>{const we=f.find(Ee=>Ee.id===se);we&&Br(we.id,we.branchName,"files")},onCancel:fS})})]}):B==="files"?h.jsx("div",{className:Aa,children:St?h.jsx(OK,{sessionId:Q??void 0,project:St,view:Oe,toggled:it,onViewChange:tt,onToggledChange:jt,onOpenFile:ln},`files:${Q??`project:${St.id}`}`):h.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:h.jsx("div",{className:Dc,children:h.jsxs("div",{className:"wt-empty flex flex-col items-center gap-2.5 py-12 px-6 text-center text-muted [&_>_svg]:text-subtext [&_p]:m-0 [&_p]:max-w-80 [&_p]:text-sm",children:[h.jsx(tS,{size:22}),h.jsx("p",{children:"Select a project to browse its files."})]})})})}):nn?h.jsx("div",{className:Aa,children:d&&h.jsx(cZ,{projectId:d,path:nn.path,source:nn.source,sessionId:nn.source==="artifacts"?Q??void 0:nn.sessionId,gitRef:nn.ref,line:nn.line,branchLabel:tse(nn,St==null?void 0:St.baselineBranch),onOpenFile:ln,scrollPosition:on.current.get(of(d,Q,nn)),onScrollPositionChange:se=>{on.current.set(of(d,Q,nn),se)},lineScrollRequest:nn.lineScrollRequest,onLineScrollRequestHandled:()=>Ga(nn)},of(d,Q,nn))}):ni?h.jsx("div",{className:Aa,children:h.jsx("div",{className:"pane-content flex-1 min-h-0 relative plan-tab-content overflow-y-auto bg-background py-4.5 px-6 [&_.md]:max-w-readable",children:h.jsx(La,{text:ni.plan,onOpenFile:se=>ln(se,ni.sessionId)})})}):Hr?h.jsx(oW,{sessionId:Hr.sessionId,spawnPartId:Hr.spawnPartId,onOpenFile:se=>ln(se,Hr.sessionId),onOpenRun:zr,runExperimentName:ei,onOpenExperiment:nr,experimentName:vi,onOpenSubagent:(se,we)=>cn(Hr.sessionId,se,we)},Hr.spawnPartId):Tr?h.jsx("div",{className:Aa,children:d&&St&&Tr&&Wi&&h.jsx(DK,{projectId:d,project:St,experiment:Wi,view:Tr.view,toggled:Tr.toggled,onViewChange:se=>Vi(Tr,{view:se}),onToggledChange:se=>Vi(Tr,{toggled:se}),onOpenFile:(se,we,Ee)=>ln(se,we,Ee,void 0,void 0,Wi.branchName)},`code:${Tr.branch}`)}):h.jsx("div",{className:Aa,children:br&&_i&&St&&h.jsx(aZ,{experiment:_i,project:St,view:br.view,runs:b,selectedRunId:pe,onSelectRun:te,parentExperiment:f.find(se=>se.id===_i.parentExperimentId)??null,onOpenView:(se,we)=>{we&&te(we),Hn(_i.id,se)},onOpenCode:se=>Br(_i.id,_i.branchName,se)},`${br.id}:${br.view}`)})]})]}),Ts&&h.jsx(IE,{onClose:()=>Jn(!1),onCreated:(se,we)=>{Jn(!1),$o(se,we)}}),In&&!gi&&St&&lg(St.id)&&h.jsx(SZ,{onClose:Nt,onCreateProject:na})]})}wj.createRoot(document.getElementById("root")).render(h.jsx(R.StrictMode,{children:h.jsx(use,{})})); diff --git a/ui/dist/assets/index-CFPQ5Tuj.js b/ui/dist/assets/index-CSO9Nj35.js similarity index 56% rename from ui/dist/assets/index-CFPQ5Tuj.js rename to ui/dist/assets/index-CSO9Nj35.js index 321ea2a9..f1b9568b 100644 --- a/ui/dist/assets/index-CFPQ5Tuj.js +++ b/ui/dist/assets/index-CSO9Nj35.js @@ -1,4 +1,4 @@ -var P5=e=>{throw TypeError(e)};var U5=(e,t,n)=>t.has(e)||P5("Cannot "+n);var En=(e,t,n)=>(U5(e,t,"read from private field"),n?n.call(e):t.get(e)),ji=(e,t,n)=>t.has(e)?P5("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Tr=(e,t,n,r)=>(U5(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var q5=(e,t,n,r)=>({set _(i){Tr(e,t,i,n)},get _(){return En(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function sp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eg={exports:{}},Zu={};/** +var G5=e=>{throw TypeError(e)};var V5=(e,t,n)=>t.has(e)||G5("Cannot "+n);var Cn=(e,t,n)=>(V5(e,t,"read from private field"),n?n.call(e):t.get(e)),Ti=(e,t,n)=>t.has(e)?G5("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ar=(e,t,n,r)=>(V5(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var W5=(e,t,n,r)=>({set _(i){Ar(e,t,i,n)},get _(){return Cn(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function op(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ng={exports:{}},Qu={};/** * @license React * react-jsx-runtime.production.js * @@ -6,7 +6,7 @@ var P5=e=>{throw TypeError(e)};var U5=(e,t,n)=>t.has(e)||P5("Cannot "+n);var En= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var G5;function lj(){if(G5)return Zu;G5=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var l in i)l!=="key"&&(a[l]=i[l])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:a}}return Zu.Fragment=t,Zu.jsx=n,Zu.jsxs=n,Zu}var V5;function cj(){return V5||(V5=1,eg.exports=lj()),eg.exports}var h=cj(),tg={exports:{}},xt={};/** + */var Y5;function pj(){if(Y5)return Qu;Y5=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var l in i)l!=="key"&&(a[l]=i[l])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:a}}return Qu.Fragment=t,Qu.jsx=n,Qu.jsxs=n,Qu}var X5;function mj(){return X5||(X5=1,ng.exports=pj()),ng.exports}var h=mj(),rg={exports:{}},_t={};/** * @license React * react.production.js * @@ -14,7 +14,7 @@ var P5=e=>{throw TypeError(e)};var U5=(e,t,n)=>t.has(e)||P5("Cannot "+n);var En= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var W5;function uj(){if(W5)return xt;W5=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),g=Symbol.iterator;function b(H){return H===null||typeof H!="object"?null:(H=g&&H[g]||H["@@iterator"],typeof H=="function"?H:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,x={};function _(H,G,W){this.props=H,this.context=G,this.refs=x,this.updater=W||k}_.prototype.isReactComponent={},_.prototype.setState=function(H,G){if(typeof H!="object"&&typeof H!="function"&&H!=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,H,G,"setState")},_.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function w(){}w.prototype=_.prototype;function y(H,G,W){this.props=H,this.context=G,this.refs=x,this.updater=W||k}var C=y.prototype=new w;C.constructor=y,S(C,_.prototype),C.isPureReactComponent=!0;var T=Array.isArray;function E(){}var j={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function D(H,G,W){var re=W.ref;return{$$typeof:e,type:H,key:G,ref:re!==void 0?re:null,props:W}}function z(H,G){return D(H.type,G,H.props)}function $(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function F(H){var G={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(W){return G[W]})}var U=/\/+/g;function V(H,G){return typeof H=="object"&&H!==null&&H.key!=null?F(""+H.key):G.toString(36)}function X(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(E,E):(H.status="pending",H.then(function(G){H.status==="pending"&&(H.status="fulfilled",H.value=G)},function(G){H.status==="pending"&&(H.status="rejected",H.reason=G)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function Y(H,G,W,re,ce){var pe=typeof H;(pe==="undefined"||pe==="boolean")&&(H=null);var ne=!1;if(H===null)ne=!0;else switch(pe){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(H.$$typeof){case e:case t:ne=!0;break;case m:return ne=H._init,Y(ne(H._payload),G,W,re,ce)}}if(ne)return ce=ce(H),ne=re===""?"."+V(H,0):re,T(ce)?(W="",ne!=null&&(W=ne.replace(U,"$&/")+"/"),Y(ce,G,W,"",function(oe){return oe})):ce!=null&&($(ce)&&(ce=z(ce,W+(ce.key==null||H&&H.key===ce.key?"":(""+ce.key).replace(U,"$&/")+"/")+ne)),G.push(ce)),1;ne=0;var B=re===""?".":re+":";if(T(H))for(var se=0;se{throw TypeError(e)};var U5=(e,t,n)=>t.has(e)||P5("Cannot "+n);var En= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var X5;function hj(){return X5||(X5=1,(function(e){function t(Y,Q){var te=Y.length;Y.push(Q);e:for(;0>>1,O=Y[I];if(0>>1;Ii(W,te))rei(ce,W)?(Y[I]=ce,Y[re]=te,I=re):(Y[I]=W,Y[G]=te,I=G);else if(rei(ce,te))Y[I]=ce,Y[re]=te,I=re;else break e}}return Q}function i(Y,Q){var te=Y.sortIndex-Q.sortIndex;return te!==0?te:Y.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var u=[],d=[],m=1,f=null,g=3,b=!1,k=!1,S=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function C(Y){for(var Q=n(d);Q!==null;){if(Q.callback===null)r(d);else if(Q.startTime<=Y)r(d),Q.sortIndex=Q.expirationTime,t(u,Q);else break;Q=n(d)}}function T(Y){if(S=!1,C(Y),!k)if(n(u)!==null)k=!0,E||(E=!0,F());else{var Q=n(d);Q!==null&&X(T,Q.startTime-Y)}}var E=!1,j=-1,N=5,D=-1;function z(){return x?!0:!(e.unstable_now()-DY&&z());){var I=f.callback;if(typeof I=="function"){f.callback=null,g=f.priorityLevel;var O=I(f.expirationTime<=Y);if(Y=e.unstable_now(),typeof O=="function"){f.callback=O,C(Y),Q=!0;break t}f===n(u)&&r(u),C(Y)}else r(u);f=n(u)}if(f!==null)Q=!0;else{var H=n(d);H!==null&&X(T,H.startTime-Y),Q=!1}}break e}finally{f=null,g=te,b=!1}Q=void 0}}finally{Q?F():E=!1}}}var F;if(typeof y=="function")F=function(){y($)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,V=U.port2;U.port1.onmessage=$,F=function(){V.postMessage(null)}}else F=function(){_($,0)};function X(Y,Q){j=_(function(){Y(e.unstable_now())},Q)}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(Y){Y.callback=null},e.unstable_forceFrameRate=function(Y){0>Y||125I?(Y.sortIndex=te,t(d,Y),n(u)===null&&Y===n(d)&&(S?(w(j),j=-1):S=!0,X(T,te-I))):(Y.sortIndex=O,t(u,Y),k||b||(k=!0,E||(E=!0,F()))),Y},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(Y){var Q=g;return function(){var te=g;g=Q;try{return Y.apply(this,arguments)}finally{g=te}}}})(ig)),ig}var K5;function fj(){return K5||(K5=1,rg.exports=hj()),rg.exports}var sg={exports:{}},Dr={};/** + */var Q5;function vj(){return Q5||(Q5=1,(function(e){function t(Y,Q){var te=Y.length;Y.push(Q);e:for(;0>>1,O=Y[I];if(0>>1;Ii(W,te))rei(ce,W)?(Y[I]=ce,Y[re]=te,I=re):(Y[I]=W,Y[G]=te,I=G);else if(rei(ce,te))Y[I]=ce,Y[re]=te,I=re;else break e}}return Q}function i(Y,Q){var te=Y.sortIndex-Q.sortIndex;return te!==0?te:Y.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],d=[],m=1,f=null,g=3,b=!1,k=!1,S=!1,x=!1,v=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function C(Y){for(var Q=n(d);Q!==null;){if(Q.callback===null)r(d);else if(Q.startTime<=Y)r(d),Q.sortIndex=Q.expirationTime,t(c,Q);else break;Q=n(d)}}function N(Y){if(S=!1,C(Y),!k)if(n(c)!==null)k=!0,E||(E=!0,F());else{var Q=n(d);Q!==null&&X(N,Q.startTime-Y)}}var E=!1,M=-1,T=5,D=-1;function z(){return x?!0:!(e.unstable_now()-DY&&z());){var I=f.callback;if(typeof I=="function"){f.callback=null,g=f.priorityLevel;var O=I(f.expirationTime<=Y);if(Y=e.unstable_now(),typeof O=="function"){f.callback=O,C(Y),Q=!0;break t}f===n(c)&&r(c),C(Y)}else r(c);f=n(c)}if(f!==null)Q=!0;else{var H=n(d);H!==null&&X(N,H.startTime-Y),Q=!1}}break e}finally{f=null,g=te,b=!1}Q=void 0}}finally{Q?F():E=!1}}}var F;if(typeof y=="function")F=function(){y($)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,V=U.port2;U.port1.onmessage=$,F=function(){V.postMessage(null)}}else F=function(){v($,0)};function X(Y,Q){M=v(function(){Y(e.unstable_now())},Q)}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(Y){Y.callback=null},e.unstable_forceFrameRate=function(Y){0>Y||125I?(Y.sortIndex=te,t(d,Y),n(c)===null&&Y===n(d)&&(S?(w(M),M=-1):S=!0,X(N,te-I))):(Y.sortIndex=O,t(c,Y),k||b||(k=!0,E||(E=!0,F()))),Y},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(Y){var Q=g;return function(){var te=g;g=Q;try{return Y.apply(this,arguments)}finally{g=te}}}})(ag)),ag}var J5;function _j(){return J5||(J5=1,sg.exports=vj()),sg.exports}var og={exports:{}},Rr={};/** * @license React * react-dom.production.js * @@ -30,7 +30,7 @@ var P5=e=>{throw TypeError(e)};var U5=(e,t,n)=>t.has(e)||P5("Cannot "+n);var En= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Z5;function pj(){if(Z5)return Dr;Z5=1;var e=sh();function t(u){var d="https://react.dev/errors/"+u;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),sg.exports=pj(),sg.exports}/** + */var e3;function xj(){if(e3)return Rr;e3=1;var e=ah();function t(c){var d="https://react.dev/errors/"+c;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),og.exports=xj(),og.exports}/** * @license React * react-dom-client.production.js * @@ -38,410 +38,405 @@ var P5=e=>{throw TypeError(e)};var U5=(e,t,n)=>t.has(e)||P5("Cannot "+n);var En= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var J5;function mj(){if(J5)return Qu;J5=1;var e=fj(),t=sh(),n=G8();function r(s){var c="https://react.dev/errors/"+s;if(1O||(s.current=I[O],I[O]=null,O--)}function W(s,c){O++,I[O]=s.current,s.current=c}var re=H(null),ce=H(null),pe=H(null),ne=H(null);function B(s,c){switch(W(pe,c),W(ce,s),W(re,null),c.nodeType){case 9:case 11:s=(s=c.documentElement)&&(s=s.namespaceURI)?d5(s):0;break;default:if(s=c.tagName,c=c.namespaceURI)c=d5(c),s=h5(c,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}G(re),W(re,s)}function se(){G(re),G(ce),G(pe)}function oe(s){s.memoizedState!==null&&W(ne,s);var c=re.current,p=h5(c,s.type);c!==p&&(W(ce,s),W(re,p))}function _e(s){ce.current===s&&(G(re),G(ce)),ne.current===s&&(G(ne),Wu._currentValue=te)}var be,Ce;function Le(s){if(be===void 0)try{throw Error()}catch(p){var c=p.stack.trim().match(/\n( *(at )?)/);be=c&&c[1]||"",Ce=-1O||(s.current=I[O],I[O]=null,O--)}function W(s,u){O++,I[O]=s.current,s.current=u}var re=H(null),ce=H(null),me=H(null),ne=H(null);function B(s,u){switch(W(me,u),W(ce,s),W(re,null),u.nodeType){case 9:case 11:s=(s=u.documentElement)&&(s=s.namespaceURI)?p5(s):0;break;default:if(s=u.tagName,u=u.namespaceURI)u=p5(u),s=m5(u,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}G(re),W(re,s)}function se(){G(re),G(ce),G(me)}function le(s){s.memoizedState!==null&&W(ne,s);var u=re.current,p=m5(u,s.type);u!==p&&(W(ce,s),W(re,p))}function _e(s){ce.current===s&&(G(re),G(ce)),ne.current===s&&(G(ne),Yu._currentValue=te)}var be,Ce;function Le(s){if(be===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);be=u&&u[1]||"",Ce=-1)":-1A||de[v]!==we[A]){var Ee=` -`+de[v].replace(" at new "," at ");return s.displayName&&Ee.includes("")&&(Ee=Ee.replace("",s.displayName)),Ee}while(1<=v&&0<=A);break}}}finally{Fe=!1,Error.prepareStackTrace=p}return(p=s?s.displayName||s.name:"")?Le(p):""}function Pe(s,c){switch(s.tag){case 26:case 27:case 5:return Le(s.type);case 16:return Le("Lazy");case 13:return s.child!==c&&c!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return Ve(s.type,!1);case 11:return Ve(s.type.render,!1);case 1:return Ve(s.type,!0);case 31:return Le("Activity");default:return""}}function dt(s){try{var c="",p=null;do c+=Pe(s,p),p=s,s=s.return;while(s);return c}catch(v){return` -Error generating stack: `+v.message+` -`+v.stack}}var Qe=Object.prototype.hasOwnProperty,qe=e.unstable_scheduleCallback,ut=e.unstable_cancelCallback,Zt=e.unstable_shouldYield,Dt=e.unstable_requestPaint,Ge=e.unstable_now,rt=e.unstable_getCurrentPriorityLevel,ve=e.unstable_ImmediatePriority,je=e.unstable_UserBlockingPriority,Ue=e.unstable_NormalPriority,Je=e.unstable_LowPriority,De=e.unstable_IdlePriority,tt=e.log,it=e.unstable_setDisableYieldValue,Tt=null,yt=null;function Xt(s){if(typeof tt=="function"&&it(s),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(Tt,s)}catch{}}var ht=Math.clz32?Math.clz32:Un,sn=Math.log,mn=Math.LN2;function Un(s){return s>>>=0,s===0?32:31-(sn(s)/mn|0)|0}var Gi=256,Vi=262144,Rs=4194304;function Nr(s){var c=s&42;if(c!==0)return c;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function pi(s,c,p){var v=s.pendingLanes;if(v===0)return 0;var A=0,M=s.suspendedLanes,q=s.pingedLanes;s=s.warmLanes;var J=v&134217727;return J!==0?(v=J&~M,v!==0?A=Nr(v):(q&=J,q!==0?A=Nr(q):p||(p=J&~s,p!==0&&(A=Nr(p))))):(J=v&~M,J!==0?A=Nr(J):q!==0?A=Nr(q):p||(p=v&~s,p!==0&&(A=Nr(p)))),A===0?0:c!==0&&c!==A&&(c&M)===0&&(M=A&-A,p=c&-c,M>=p||M===32&&(p&4194048)!==0)?c:A}function mr(s,c){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&c)===0}function Wo(s,c){switch(s){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 Jr(){var s=Rs;return Rs<<=1,(Rs&62914560)===0&&(Rs=4194304),s}function Qt(s){for(var c=[],p=0;31>p;p++)c.push(s);return c}function cn(s,c){s.pendingLanes|=c,c!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function mi(s,c,p,v,A,M){var q=s.pendingLanes;s.pendingLanes=p,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=p,s.entangledLanes&=p,s.errorRecoveryDisabledLanes&=p,s.shellSuspendCounter=0;var J=s.entanglements,de=s.expirationTimes,we=s.hiddenUpdates;for(p=q&~p;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var Xa=/[\n"\\]/g;function wn(s){return s.replace(Xa,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Yi(s,c,p,v,A,M,q,J){s.name="",q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?s.type=q:s.removeAttribute("type"),c!=null?q==="number"?(c===0&&s.value===""||s.value!=c)&&(s.value=""+Dn(c)):s.value!==""+Dn(c)&&(s.value=""+Dn(c)):q!=="submit"&&q!=="reset"||s.removeAttribute("value"),c!=null?Os(s,q,Dn(c)):p!=null?Os(s,q,Dn(p)):v!=null&&s.removeAttribute("value"),A==null&&M!=null&&(s.defaultChecked=!!M),A!=null&&(s.checked=A&&typeof A!="function"&&typeof A!="symbol"),J!=null&&typeof J!="function"&&typeof J!="symbol"&&typeof J!="boolean"?s.name=""+Dn(J):s.removeAttribute("name")}function en(s,c,p,v,A,M,q,J){if(M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(s.type=M),c!=null||p!=null){if(!(M!=="submit"&&M!=="reset"||c!=null)){Ls(s);return}p=p!=null?""+Dn(p):"",c=c!=null?""+Dn(c):p,J||c===s.value||(s.value=c),s.defaultValue=c}v=v??A,v=typeof v!="function"&&typeof v!="symbol"&&!!v,s.checked=J?s.checked:!!v,s.defaultChecked=!!v,q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"&&(s.name=q),Ls(s)}function Os(s,c,p){c==="number"&&$r(s.ownerDocument)===s||s.defaultValue===""+p||(s.defaultValue=""+p)}function gn(s,c,p,v){if(s=s.options,c){c={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ja=!1;if(Wn)try{var Hs={};Object.defineProperty(Hs,"passive",{get:function(){Ja=!0}}),window.addEventListener("test",Hs,Hs),window.removeEventListener("test",Hs,Hs)}catch{Ja=!1}var wr=null,br=null,ps=null;function Sr(){if(ps)return ps;var s,c=br,p=c.length,v,A="value"in wr?wr.value:wr.textContent,M=A.length;for(s=0;s=pu),vx=" ",_x=!1;function xx(s,c){switch(s){case"keyup":return jT.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yx(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Yl=!1;function RT(s,c){switch(s){case"compositionend":return yx(c);case"keypress":return c.which!==32?null:(_x=!0,vx);case"textInput":return s=c.data,s===vx&&_x?null:s;default:return null}}function DT(s,c){if(Yl)return s==="compositionend"||!am&&xx(s,c)?(s=Sr(),ps=br=wr=null,Yl=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:p,offset:c-s};s=v}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=Nx(p)}}function Mx(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?Mx(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function Rx(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var c=$r(s.document);c instanceof s.HTMLIFrameElement;){try{var p=typeof c.contentWindow.location.href=="string"}catch{p=!1}if(p)s=c.contentWindow;else break;c=$r(s.document)}return c}function cm(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}var FT=Wn&&"documentMode"in document&&11>=document.documentMode,Xl=null,um=null,vu=null,dm=!1;function Dx(s,c,p){var v=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;dm||Xl==null||Xl!==$r(v)||(v=Xl,"selectionStart"in v&&cm(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),vu&&bu(vu,v)||(vu=v,v=g0(um,"onSelect"),0>=q,A-=q,Fs=1<<32-ht(c)+A|p<kt?(Ot=nt,nt=null):Ot=nt.sibling;var qt=Se(ge,nt,ye[kt],Te);if(qt===null){nt===null&&(nt=Ot);break}s&&nt&&qt.alternate===null&&c(ge,nt),he=M(qt,he,kt),Ut===null?ct=qt:Ut.sibling=qt,Ut=qt,nt=Ot}if(kt===ye.length)return p(ge,nt),zt&&ha(ge,kt),ct;if(nt===null){for(;ktkt?(Ot=nt,nt=null):Ot=nt.sibling;var ko=Se(ge,nt,qt.value,Te);if(ko===null){nt===null&&(nt=Ot);break}s&&nt&&ko.alternate===null&&c(ge,nt),he=M(ko,he,kt),Ut===null?ct=ko:Ut.sibling=ko,Ut=ko,nt=Ot}if(qt.done)return p(ge,nt),zt&&ha(ge,kt),ct;if(nt===null){for(;!qt.done;kt++,qt=ye.next())qt=Ne(ge,qt.value,Te),qt!==null&&(he=M(qt,he,kt),Ut===null?ct=qt:Ut.sibling=qt,Ut=qt);return zt&&ha(ge,kt),ct}for(nt=v(nt);!qt.done;kt++,qt=ye.next())qt=ke(nt,ge,kt,qt.value,Te),qt!==null&&(s&&qt.alternate!==null&&nt.delete(qt.key===null?kt:qt.key),he=M(qt,he,kt),Ut===null?ct=qt:Ut.sibling=qt,Ut=qt);return s&&nt.forEach(function(oj){return c(ge,oj)}),zt&&ha(ge,kt),ct}function ln(ge,he,ye,Te){if(typeof ye=="object"&&ye!==null&&ye.type===S&&ye.key===null&&(ye=ye.props.children),typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case b:e:{for(var ct=ye.key;he!==null;){if(he.key===ct){if(ct=ye.type,ct===S){if(he.tag===7){p(ge,he.sibling),Te=A(he,ye.props.children),Te.return=ge,ge=Te;break e}}else if(he.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===N&&rl(ct)===he.type){p(ge,he.sibling),Te=A(he,ye.props),ku(Te,ye),Te.return=ge,ge=Te;break e}p(ge,he);break}else c(ge,he);he=he.sibling}ye.type===S?(Te=Qo(ye.props.children,ge.mode,Te,ye.key),Te.return=ge,ge=Te):(Te=Dh(ye.type,ye.key,ye.props,null,ge.mode,Te),ku(Te,ye),Te.return=ge,ge=Te)}return q(ge);case k:e:{for(ct=ye.key;he!==null;){if(he.key===ct)if(he.tag===4&&he.stateNode.containerInfo===ye.containerInfo&&he.stateNode.implementation===ye.implementation){p(ge,he.sibling),Te=A(he,ye.children||[]),Te.return=ge,ge=Te;break e}else{p(ge,he);break}else c(ge,he);he=he.sibling}Te=vm(ye,ge.mode,Te),Te.return=ge,ge=Te}return q(ge);case N:return ye=rl(ye),ln(ge,he,ye,Te)}if(X(ye))return et(ge,he,ye,Te);if(F(ye)){if(ct=F(ye),typeof ct!="function")throw Error(r(150));return ye=ct.call(ye),mt(ge,he,ye,Te)}if(typeof ye.then=="function")return ln(ge,he,$h(ye),Te);if(ye.$$typeof===y)return ln(ge,he,Ih(ge,ye),Te);Fh(ge,ye)}return typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint"?(ye=""+ye,he!==null&&he.tag===6?(p(ge,he.sibling),Te=A(he,ye),Te.return=ge,ge=Te):(p(ge,he),Te=bm(ye,ge.mode,Te),Te.return=ge,ge=Te),q(ge)):p(ge,he)}return function(ge,he,ye,Te){try{Su=0;var ct=ln(ge,he,ye,Te);return ac=null,ct}catch(nt){if(nt===sc||nt===Bh)throw nt;var Ut=ki(29,nt,null,ge.mode);return Ut.lanes=Te,Ut.return=ge,Ut}finally{}}}var sl=n4(!0),r4=n4(!1),ao=!1;function jm(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Mm(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function oo(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function lo(s,c,p){var v=s.updateQueue;if(v===null)return null;if(v=v.shared,(Gt&2)!==0){var A=v.pending;return A===null?c.next=c:(c.next=A.next,A.next=c),v.pending=c,c=Rh(s),$x(s,null,p),c}return Mh(s,v,c,p),Rh(s)}function Cu(s,c,p){if(c=c.updateQueue,c!==null&&(c=c.shared,(p&4194048)!==0)){var v=c.lanes;v&=s.pendingLanes,p|=v,c.lanes=p,Ds(s,p)}}function Rm(s,c){var p=s.updateQueue,v=s.alternate;if(v!==null&&(v=v.updateQueue,p===v)){var A=null,M=null;if(p=p.firstBaseUpdate,p!==null){do{var q={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};M===null?A=M=q:M=M.next=q,p=p.next}while(p!==null);M===null?A=M=c:M=M.next=c}else A=M=c;p={baseState:v.baseState,firstBaseUpdate:A,lastBaseUpdate:M,shared:v.shared,callbacks:v.callbacks},s.updateQueue=p;return}s=p.lastBaseUpdate,s===null?p.firstBaseUpdate=c:s.next=c,p.lastBaseUpdate=c}var Dm=!1;function Eu(){if(Dm){var s=ic;if(s!==null)throw s}}function Au(s,c,p,v){Dm=!1;var A=s.updateQueue;ao=!1;var M=A.firstBaseUpdate,q=A.lastBaseUpdate,J=A.shared.pending;if(J!==null){A.shared.pending=null;var de=J,we=de.next;de.next=null,q===null?M=we:q.next=we,q=de;var Ee=s.alternate;Ee!==null&&(Ee=Ee.updateQueue,J=Ee.lastBaseUpdate,J!==q&&(J===null?Ee.firstBaseUpdate=we:J.next=we,Ee.lastBaseUpdate=de))}if(M!==null){var Ne=A.baseState;q=0,Ee=we=de=null,J=M;do{var Se=J.lane&-536870913,ke=Se!==J.lane;if(ke?(Lt&Se)===Se:(v&Se)===Se){Se!==0&&Se===rc&&(Dm=!0),Ee!==null&&(Ee=Ee.next={lane:0,tag:J.tag,payload:J.payload,callback:null,next:null});e:{var et=s,mt=J;Se=c;var ln=p;switch(mt.tag){case 1:if(et=mt.payload,typeof et=="function"){Ne=et.call(ln,Ne,Se);break e}Ne=et;break e;case 3:et.flags=et.flags&-65537|128;case 0:if(et=mt.payload,Se=typeof et=="function"?et.call(ln,Ne,Se):et,Se==null)break e;Ne=f({},Ne,Se);break e;case 2:ao=!0}}Se=J.callback,Se!==null&&(s.flags|=64,ke&&(s.flags|=8192),ke=A.callbacks,ke===null?A.callbacks=[Se]:ke.push(Se))}else ke={lane:Se,tag:J.tag,payload:J.payload,callback:J.callback,next:null},Ee===null?(we=Ee=ke,de=Ne):Ee=Ee.next=ke,q|=Se;if(J=J.next,J===null){if(J=A.shared.pending,J===null)break;ke=J,J=ke.next,ke.next=null,A.lastBaseUpdate=ke,A.shared.pending=null}}while(!0);Ee===null&&(de=Ne),A.baseState=de,A.firstBaseUpdate=we,A.lastBaseUpdate=Ee,M===null&&(A.shared.lanes=0),po|=q,s.lanes=q,s.memoizedState=Ne}}function i4(s,c){if(typeof s!="function")throw Error(r(191,s));s.call(c)}function s4(s,c){var p=s.callbacks;if(p!==null)for(s.callbacks=null,s=0;sM?M:8;var q=Y.T,J={};Y.T=J,Qm(s,!1,c,p);try{var de=A(),we=Y.S;if(we!==null&&we(J,de),de!==null&&typeof de=="object"&&typeof de.then=="function"){var Ee=KT(de,v);ju(s,c,Ee,Ni(s))}else ju(s,c,v,Ni(s))}catch(Ne){ju(s,c,{then:function(){},status:"rejected",reason:Ne},Ni())}finally{Q.p=M,q!==null&&J.types!==null&&(q.types=J.types),Y.T=q}}function nN(){}function Km(s,c,p,v){if(s.tag!==5)throw Error(r(476));var A=z4(s).queue;I4(s,A,c,te,p===null?nN:function(){return B4(s),p(v)})}function z4(s){var c=s.memoizedState;if(c!==null)return c;c={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:te},next:null};var p={};return c.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:p},next:null},s.memoizedState=c,s=s.alternate,s!==null&&(s.memoizedState=c),c}function B4(s){var c=z4(s);c.next===null&&(c=s.alternate.memoizedState),ju(s,c.next.queue,{},Ni())}function Zm(){return Cr(Wu)}function H4(){return Pn().memoizedState}function $4(){return Pn().memoizedState}function rN(s){for(var c=s.return;c!==null;){switch(c.tag){case 24:case 3:var p=Ni();s=oo(p);var v=lo(c,s,p);v!==null&&(ai(v,c,p),Cu(v,c,p)),c={cache:Em()},s.payload=c;return}c=c.return}}function iN(s,c,p){var v=Ni();p={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Zh(s)?P4(c,p):(p=mm(s,c,p,v),p!==null&&(ai(p,s,v),U4(p,c,v)))}function F4(s,c,p){var v=Ni();ju(s,c,p,v)}function ju(s,c,p,v){var A={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(Zh(s))P4(c,A);else{var M=s.alternate;if(s.lanes===0&&(M===null||M.lanes===0)&&(M=c.lastRenderedReducer,M!==null))try{var q=c.lastRenderedState,J=M(q,p);if(A.hasEagerState=!0,A.eagerState=J,Si(J,q))return Mh(s,c,A,0),un===null&&jh(),!1}catch{}finally{}if(p=mm(s,c,A,v),p!==null)return ai(p,s,v),U4(p,c,v),!0}return!1}function Qm(s,c,p,v){if(v={lane:2,revertLane:j1(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},Zh(s)){if(c)throw Error(r(479))}else c=mm(s,p,v,2),c!==null&&ai(c,s,2)}function Zh(s){var c=s.alternate;return s===wt||c!==null&&c===wt}function P4(s,c){lc=qh=!0;var p=s.pending;p===null?c.next=c:(c.next=p.next,p.next=c),s.pending=c}function U4(s,c,p){if((p&4194048)!==0){var v=c.lanes;v&=s.pendingLanes,p|=v,c.lanes=p,Ds(s,p)}}var Mu={readContext:Cr,use:Wh,useCallback:Bn,useContext:Bn,useEffect:Bn,useImperativeHandle:Bn,useLayoutEffect:Bn,useInsertionEffect:Bn,useMemo:Bn,useReducer:Bn,useRef:Bn,useState:Bn,useDebugValue:Bn,useDeferredValue:Bn,useTransition:Bn,useSyncExternalStore:Bn,useId:Bn,useHostTransitionStatus:Bn,useFormState:Bn,useActionState:Bn,useOptimistic:Bn,useMemoCache:Bn,useCacheRefresh:Bn};Mu.useEffectEvent=Bn;var q4={readContext:Cr,use:Wh,useCallback:function(s,c){return Gr().memoizedState=[s,c===void 0?null:c],s},useContext:Cr,useEffect:A4,useImperativeHandle:function(s,c,p){p=p!=null?p.concat([s]):null,Xh(4194308,4,M4.bind(null,c,s),p)},useLayoutEffect:function(s,c){return Xh(4194308,4,s,c)},useInsertionEffect:function(s,c){Xh(4,2,s,c)},useMemo:function(s,c){var p=Gr();c=c===void 0?null:c;var v=s();if(al){Xt(!0);try{s()}finally{Xt(!1)}}return p.memoizedState=[v,c],v},useReducer:function(s,c,p){var v=Gr();if(p!==void 0){var A=p(c);if(al){Xt(!0);try{p(c)}finally{Xt(!1)}}}else A=c;return v.memoizedState=v.baseState=A,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:A},v.queue=s,s=s.dispatch=iN.bind(null,wt,s),[v.memoizedState,s]},useRef:function(s){var c=Gr();return s={current:s},c.memoizedState=s},useState:function(s){s=Gm(s);var c=s.queue,p=F4.bind(null,wt,c);return c.dispatch=p,[s.memoizedState,p]},useDebugValue:Ym,useDeferredValue:function(s,c){var p=Gr();return Xm(p,s,c)},useTransition:function(){var s=Gm(!1);return s=I4.bind(null,wt,s.queue,!0,!1),Gr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,c,p){var v=wt,A=Gr();if(zt){if(p===void 0)throw Error(r(407));p=p()}else{if(p=c(),un===null)throw Error(r(349));(Lt&127)!==0||d4(v,c,p)}A.memoizedState=p;var M={value:p,getSnapshot:c};return A.queue=M,A4(f4.bind(null,v,M,s),[s]),v.flags|=2048,uc(9,{destroy:void 0},h4.bind(null,v,M,p,c),null),p},useId:function(){var s=Gr(),c=un.identifierPrefix;if(zt){var p=Ps,v=Fs;p=(v&~(1<<32-ht(v)-1)).toString(32)+p,c="_"+c+"R_"+p,p=Gh++,0<\/script>",M=M.removeChild(M.firstChild);break;case"select":M=typeof v.is=="string"?q.createElement("select",{is:v.is}):q.createElement("select"),v.multiple?M.multiple=!0:v.size&&(M.size=v.size);break;default:M=typeof v.is=="string"?q.createElement(A,{is:v.is}):q.createElement(A)}}M[pt]=c,M[_t]=v;e:for(q=c.child;q!==null;){if(q.tag===5||q.tag===6)M.appendChild(q.stateNode);else if(q.tag!==4&&q.tag!==27&&q.child!==null){q.child.return=q,q=q.child;continue}if(q===c)break e;for(;q.sibling===null;){if(q.return===null||q.return===c)break e;q=q.return}q.sibling.return=q.return,q=q.sibling}c.stateNode=M;e:switch(Ar(M,A,v),A){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&va(c)}}return _n(c),h1(c,c.type,s===null?null:s.memoizedProps,c.pendingProps,p),null;case 6:if(s&&c.stateNode!=null)s.memoizedProps!==v&&va(c);else{if(typeof v!="string"&&c.stateNode===null)throw Error(r(166));if(s=pe.current,tc(c)){if(s=c.stateNode,p=c.memoizedProps,v=null,A=kr,A!==null)switch(A.tag){case 27:case 5:v=A.memoizedProps}s[pt]=c,s=!!(s.nodeValue===p||v!==null&&v.suppressHydrationWarning===!0||c5(s.nodeValue,p)),s||io(c,!0)}else s=b0(s).createTextNode(v),s[pt]=c,c.stateNode=s}return _n(c),null;case 31:if(p=c.memoizedState,s===null||s.memoizedState!==null){if(v=tc(c),p!==null){if(s===null){if(!v)throw Error(r(318));if(s=c.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[pt]=c}else Jo(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;_n(c),s=!1}else p=wm(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),s=!0;if(!s)return c.flags&256?(Ei(c),c):(Ei(c),null);if((c.flags&128)!==0)throw Error(r(558))}return _n(c),null;case 13:if(v=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(A=tc(c),v!==null&&v.dehydrated!==null){if(s===null){if(!A)throw Error(r(318));if(A=c.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[pt]=c}else Jo(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;_n(c),A=!1}else A=wm(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=A),A=!0;if(!A)return c.flags&256?(Ei(c),c):(Ei(c),null)}return Ei(c),(c.flags&128)!==0?(c.lanes=p,c):(p=v!==null,s=s!==null&&s.memoizedState!==null,p&&(v=c.child,A=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(A=v.alternate.memoizedState.cachePool.pool),M=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(M=v.memoizedState.cachePool.pool),M!==A&&(v.flags|=2048)),p!==s&&p&&(c.child.flags|=8192),n0(c,c.updateQueue),_n(c),null);case 4:return se(),s===null&&L1(c.stateNode.containerInfo),_n(c),null;case 10:return pa(c.type),_n(c),null;case 19:if(G(Fn),v=c.memoizedState,v===null)return _n(c),null;if(A=(c.flags&128)!==0,M=v.rendering,M===null)if(A)Du(v,!1);else{if(Hn!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(M=Uh(s),M!==null){for(c.flags|=128,Du(v,!1),s=M.updateQueue,c.updateQueue=s,n0(c,s),c.subtreeFlags=0,s=p,p=c.child;p!==null;)Fx(p,s),p=p.sibling;return W(Fn,Fn.current&1|2),zt&&ha(c,v.treeForkCount),c.child}s=s.sibling}v.tail!==null&&Ge()>o0&&(c.flags|=128,A=!0,Du(v,!1),c.lanes=4194304)}else{if(!A)if(s=Uh(M),s!==null){if(c.flags|=128,A=!0,s=s.updateQueue,c.updateQueue=s,n0(c,s),Du(v,!0),v.tail===null&&v.tailMode==="hidden"&&!M.alternate&&!zt)return _n(c),null}else 2*Ge()-v.renderingStartTime>o0&&p!==536870912&&(c.flags|=128,A=!0,Du(v,!1),c.lanes=4194304);v.isBackwards?(M.sibling=c.child,c.child=M):(s=v.last,s!==null?s.sibling=M:c.child=M,v.last=M)}return v.tail!==null?(s=v.tail,v.rendering=s,v.tail=s.sibling,v.renderingStartTime=Ge(),s.sibling=null,p=Fn.current,W(Fn,A?p&1|2:p&1),zt&&ha(c,v.treeForkCount),s):(_n(c),null);case 22:case 23:return Ei(c),Om(),v=c.memoizedState!==null,s!==null?s.memoizedState!==null!==v&&(c.flags|=8192):v&&(c.flags|=8192),v?(p&536870912)!==0&&(c.flags&128)===0&&(_n(c),c.subtreeFlags&6&&(c.flags|=8192)):_n(c),p=c.updateQueue,p!==null&&n0(c,p.retryQueue),p=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==p&&(c.flags|=2048),s!==null&&G(nl),null;case 24:return p=null,s!==null&&(p=s.memoizedState.cache),c.memoizedState.cache!==p&&(c.flags|=2048),pa(Xn),_n(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function cN(s,c){switch(xm(c),c.tag){case 1:return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return pa(Xn),se(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 26:case 27:case 5:return _e(c),null;case 31:if(c.memoizedState!==null){if(Ei(c),c.alternate===null)throw Error(r(340));Jo()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 13:if(Ei(c),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Jo()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return G(Fn),null;case 4:return se(),null;case 10:return pa(c.type),null;case 22:case 23:return Ei(c),Om(),s!==null&&G(nl),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 24:return pa(Xn),null;case 25:return null;default:return null}}function py(s,c){switch(xm(c),c.tag){case 3:pa(Xn),se();break;case 26:case 27:case 5:_e(c);break;case 4:se();break;case 31:c.memoizedState!==null&&Ei(c);break;case 13:Ei(c);break;case 19:G(Fn);break;case 10:pa(c.type);break;case 22:case 23:Ei(c),Om(),s!==null&&G(nl);break;case 24:pa(Xn)}}function Lu(s,c){try{var p=c.updateQueue,v=p!==null?p.lastEffect:null;if(v!==null){var A=v.next;p=A;do{if((p.tag&s)===s){v=void 0;var M=p.create,q=p.inst;v=M(),q.destroy=v}p=p.next}while(p!==A)}}catch(J){nn(c,c.return,J)}}function ho(s,c,p){try{var v=c.updateQueue,A=v!==null?v.lastEffect:null;if(A!==null){var M=A.next;v=M;do{if((v.tag&s)===s){var q=v.inst,J=q.destroy;if(J!==void 0){q.destroy=void 0,A=c;var de=p,we=J;try{we()}catch(Ee){nn(A,de,Ee)}}}v=v.next}while(v!==M)}}catch(Ee){nn(c,c.return,Ee)}}function my(s){var c=s.updateQueue;if(c!==null){var p=s.stateNode;try{s4(c,p)}catch(v){nn(s,s.return,v)}}}function gy(s,c,p){p.props=ol(s.type,s.memoizedProps),p.state=s.memoizedState;try{p.componentWillUnmount()}catch(v){nn(s,c,v)}}function Ou(s,c){try{var p=s.ref;if(p!==null){switch(s.tag){case 26:case 27:case 5:var v=s.stateNode;break;case 30:v=s.stateNode;break;default:v=s.stateNode}typeof p=="function"?s.refCleanup=p(v):p.current=v}}catch(A){nn(s,c,A)}}function Us(s,c){var p=s.ref,v=s.refCleanup;if(p!==null)if(typeof v=="function")try{v()}catch(A){nn(s,c,A)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(A){nn(s,c,A)}else p.current=null}function by(s){var c=s.type,p=s.memoizedProps,v=s.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":p.autoFocus&&v.focus();break e;case"img":p.src?v.src=p.src:p.srcSet&&(v.srcset=p.srcSet)}}catch(A){nn(s,s.return,A)}}function f1(s,c,p){try{var v=s.stateNode;MN(v,s.type,p,c),v[_t]=c}catch(A){nn(s,s.return,A)}}function vy(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&_o(s.type)||s.tag===4}function p1(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||vy(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&_o(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function m1(s,c,p){var v=s.tag;if(v===5||v===6)s=s.stateNode,c?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(s,c):(c=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,c.appendChild(s),p=p._reactRootContainer,p!=null||c.onclick!==null||(c.onclick=Fr));else if(v!==4&&(v===27&&_o(s.type)&&(p=s.stateNode,c=null),s=s.child,s!==null))for(m1(s,c,p),s=s.sibling;s!==null;)m1(s,c,p),s=s.sibling}function r0(s,c,p){var v=s.tag;if(v===5||v===6)s=s.stateNode,c?p.insertBefore(s,c):p.appendChild(s);else if(v!==4&&(v===27&&_o(s.type)&&(p=s.stateNode),s=s.child,s!==null))for(r0(s,c,p),s=s.sibling;s!==null;)r0(s,c,p),s=s.sibling}function _y(s){var c=s.stateNode,p=s.memoizedProps;try{for(var v=s.type,A=c.attributes;A.length;)c.removeAttributeNode(A[0]);Ar(c,v,p),c[pt]=s,c[_t]=p}catch(M){nn(s,s.return,M)}}var _a=!1,Qn=!1,g1=!1,xy=typeof WeakSet=="function"?WeakSet:Set,vr=null;function uN(s,c){if(s=s.containerInfo,z1=k0,s=Rx(s),cm(s)){if("selectionStart"in s)var p={start:s.selectionStart,end:s.selectionEnd};else e:{p=(p=s.ownerDocument)&&p.defaultView||window;var v=p.getSelection&&p.getSelection();if(v&&v.rangeCount!==0){p=v.anchorNode;var A=v.anchorOffset,M=v.focusNode;v=v.focusOffset;try{p.nodeType,M.nodeType}catch{p=null;break e}var q=0,J=-1,de=-1,we=0,Ee=0,Ne=s,Se=null;t:for(;;){for(var ke;Ne!==p||A!==0&&Ne.nodeType!==3||(J=q+A),Ne!==M||v!==0&&Ne.nodeType!==3||(de=q+v),Ne.nodeType===3&&(q+=Ne.nodeValue.length),(ke=Ne.firstChild)!==null;)Se=Ne,Ne=ke;for(;;){if(Ne===s)break t;if(Se===p&&++we===A&&(J=q),Se===M&&++Ee===v&&(de=q),(ke=Ne.nextSibling)!==null)break;Ne=Se,Se=Ne.parentNode}Ne=ke}p=J===-1||de===-1?null:{start:J,end:de}}else p=null}p=p||{start:0,end:0}}else p=null;for(B1={focusedElem:s,selectionRange:p},k0=!1,vr=c;vr!==null;)if(c=vr,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,vr=s;else for(;vr!==null;){switch(c=vr,M=c.alternate,s=c.flags,c.tag){case 0:if((s&4)!==0&&(s=c.updateQueue,s=s!==null?s.events:null,s!==null))for(p=0;p title"))),Ar(M,v,p),M[pt]=s,Jt(M),v=M;break e;case"link":var q=E5("link","href",A).get(v+(p.href||""));if(q){for(var J=0;Jln&&(q=ln,ln=mt,mt=q);var ge=jx(J,mt),he=jx(J,ln);if(ge&&he&&(ke.rangeCount!==1||ke.anchorNode!==ge.node||ke.anchorOffset!==ge.offset||ke.focusNode!==he.node||ke.focusOffset!==he.offset)){var ye=Ne.createRange();ye.setStart(ge.node,ge.offset),ke.removeAllRanges(),mt>ln?(ke.addRange(ye),ke.extend(he.node,he.offset)):(ye.setEnd(he.node,he.offset),ke.addRange(ye))}}}}for(Ne=[],ke=J;ke=ke.parentNode;)ke.nodeType===1&&Ne.push({element:ke,left:ke.scrollLeft,top:ke.scrollTop});for(typeof J.focus=="function"&&J.focus(),J=0;Jp?32:p,Y.T=null,p=S1,S1=null;var M=go,q=ka;if(ur=0,mc=go=null,ka=0,(Gt&6)!==0)throw Error(r(331));var J=Gt;if(Gt|=4,My(M.current),Ty(M,M.current,q,p),Gt=J,Fu(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(Tt,M)}catch{}return!0}finally{Q.p=A,Y.T=v,Xy(s,c)}}function Zy(s,c,p){c=Ji(p,c),c=n1(s.stateNode,c,2),s=lo(s,c,2),s!==null&&(cn(s,2),qs(s))}function nn(s,c,p){if(s.tag===3)Zy(s,s,p);else for(;c!==null;){if(c.tag===3){Zy(c,s,p);break}else if(c.tag===1){var v=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(mo===null||!mo.has(v))){s=Ji(p,s),p=Q4(2),v=lo(c,p,2),v!==null&&(J4(p,v,c,s),cn(v,2),qs(v));break}}c=c.return}}function A1(s,c,p){var v=s.pingCache;if(v===null){v=s.pingCache=new fN;var A=new Set;v.set(c,A)}else A=v.get(c),A===void 0&&(A=new Set,v.set(c,A));A.has(p)||(_1=!0,A.add(p),s=vN.bind(null,s,c,p),c.then(s,s))}function vN(s,c,p){var v=s.pingCache;v!==null&&v.delete(c),s.pingedLanes|=s.suspendedLanes&p,s.warmLanes&=~p,un===s&&(Lt&p)===p&&(Hn===4||Hn===3&&(Lt&62914560)===Lt&&300>Ge()-a0?(Gt&2)===0&&gc(s,0):x1|=p,pc===Lt&&(pc=0)),qs(s)}function Qy(s,c){c===0&&(c=Jr()),s=Zo(s,c),s!==null&&(cn(s,c),qs(s))}function _N(s){var c=s.memoizedState,p=0;c!==null&&(p=c.retryLane),Qy(s,p)}function xN(s,c){var p=0;switch(s.tag){case 31:case 13:var v=s.stateNode,A=s.memoizedState;A!==null&&(p=A.retryLane);break;case 19:v=s.stateNode;break;case 22:v=s.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(c),Qy(s,p)}function yN(s,c){return qe(s,c)}var f0=null,vc=null,T1=!1,p0=!1,N1=!1,vo=0;function qs(s){s!==vc&&s.next===null&&(vc===null?f0=vc=s:vc=vc.next=s),p0=!0,T1||(T1=!0,SN())}function Fu(s,c){if(!N1&&p0){N1=!0;do for(var p=!1,v=f0;v!==null;){if(s!==0){var A=v.pendingLanes;if(A===0)var M=0;else{var q=v.suspendedLanes,J=v.pingedLanes;M=(1<<31-ht(42|s)+1)-1,M&=A&~(q&~J),M=M&201326741?M&201326741|1:M?M|2:0}M!==0&&(p=!0,n5(v,M))}else M=Lt,M=pi(v,v===un?M:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(M&3)===0||mr(v,M)||(p=!0,n5(v,M));v=v.next}while(p);N1=!1}}function wN(){Jy()}function Jy(){p0=T1=!1;var s=0;vo!==0&&DN()&&(s=vo);for(var c=Ge(),p=null,v=f0;v!==null;){var A=v.next,M=e5(v,c);M===0?(v.next=null,p===null?f0=A:p.next=A,A===null&&(vc=p)):(p=v,(s!==0||(M&3)!==0)&&(p0=!0)),v=A}ur!==0&&ur!==5||Fu(s),vo!==0&&(vo=0)}function e5(s,c){for(var p=s.suspendedLanes,v=s.pingedLanes,A=s.expirationTimes,M=s.pendingLanes&-62914561;0J)break;var Ee=de.transferSize,Ne=de.initiatorType;Ee&&u5(Ne)&&(de=de.responseEnd,q+=Ee*(de"u"?null:document;function w5(s,c,p){var v=_c;if(v&&typeof c=="string"&&c){var A=wn(c);A='link[rel="'+s+'"][href="'+A+'"]',typeof p=="string"&&(A+='[crossorigin="'+p+'"]'),y5.has(A)||(y5.add(A),s={rel:s,crossOrigin:p,href:c},v.querySelector(A)===null&&(c=v.createElement("link"),Ar(c,"link",s),Jt(c),v.head.appendChild(c)))}}function PN(s){Ca.D(s),w5("dns-prefetch",s,null)}function UN(s,c){Ca.C(s,c),w5("preconnect",s,c)}function qN(s,c,p){Ca.L(s,c,p);var v=_c;if(v&&s&&c){var A='link[rel="preload"][as="'+wn(c)+'"]';c==="image"&&p&&p.imageSrcSet?(A+='[imagesrcset="'+wn(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(A+='[imagesizes="'+wn(p.imageSizes)+'"]')):A+='[href="'+wn(s)+'"]';var M=A;switch(c){case"style":M=xc(s);break;case"script":M=yc(s)}ss.has(M)||(s=f({rel:"preload",href:c==="image"&&p&&p.imageSrcSet?void 0:s,as:c},p),ss.set(M,s),v.querySelector(A)!==null||c==="style"&&v.querySelector(Gu(M))||c==="script"&&v.querySelector(Vu(M))||(c=v.createElement("link"),Ar(c,"link",s),Jt(c),v.head.appendChild(c)))}}function GN(s,c){Ca.m(s,c);var p=_c;if(p&&s){var v=c&&typeof c.as=="string"?c.as:"script",A='link[rel="modulepreload"][as="'+wn(v)+'"][href="'+wn(s)+'"]',M=A;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":M=yc(s)}if(!ss.has(M)&&(s=f({rel:"modulepreload",href:s},c),ss.set(M,s),p.querySelector(A)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(Vu(M)))return}v=p.createElement("link"),Ar(v,"link",s),Jt(v),p.head.appendChild(v)}}}function VN(s,c,p){Ca.S(s,c,p);var v=_c;if(v&&s){var A=qn(v).hoistableStyles,M=xc(s);c=c||"default";var q=A.get(M);if(!q){var J={loading:0,preload:null};if(q=v.querySelector(Gu(M)))J.loading=5;else{s=f({rel:"stylesheet",href:s,"data-precedence":c},p),(p=ss.get(M))&&G1(s,p);var de=q=v.createElement("link");Jt(de),Ar(de,"link",s),de._p=new Promise(function(we,Ee){de.onload=we,de.onerror=Ee}),de.addEventListener("load",function(){J.loading|=1}),de.addEventListener("error",function(){J.loading|=2}),J.loading|=4,_0(q,c,v)}q={type:"stylesheet",instance:q,count:1,state:J},A.set(M,q)}}}function WN(s,c){Ca.X(s,c);var p=_c;if(p&&s){var v=qn(p).hoistableScripts,A=yc(s),M=v.get(A);M||(M=p.querySelector(Vu(A)),M||(s=f({src:s,async:!0},c),(c=ss.get(A))&&V1(s,c),M=p.createElement("script"),Jt(M),Ar(M,"link",s),p.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},v.set(A,M))}}function YN(s,c){Ca.M(s,c);var p=_c;if(p&&s){var v=qn(p).hoistableScripts,A=yc(s),M=v.get(A);M||(M=p.querySelector(Vu(A)),M||(s=f({src:s,async:!0,type:"module"},c),(c=ss.get(A))&&V1(s,c),M=p.createElement("script"),Jt(M),Ar(M,"link",s),p.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},v.set(A,M))}}function S5(s,c,p,v){var A=(A=pe.current)?v0(A):null;if(!A)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(c=xc(p.href),p=qn(A).hoistableStyles,v=p.get(c),v||(v={type:"style",instance:null,count:0,state:null},p.set(c,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){s=xc(p.href);var M=qn(A).hoistableStyles,q=M.get(s);if(q||(A=A.ownerDocument||A,q={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},M.set(s,q),(M=A.querySelector(Gu(s)))&&!M._p&&(q.instance=M,q.state.loading=5),ss.has(s)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},ss.set(s,p),M||XN(A,s,p,q.state))),c&&v===null)throw Error(r(528,""));return q}if(c&&v!==null)throw Error(r(529,""));return null;case"script":return c=p.async,p=p.src,typeof p=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=yc(p),p=qn(A).hoistableScripts,v=p.get(c),v||(v={type:"script",instance:null,count:0,state:null},p.set(c,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function xc(s){return'href="'+wn(s)+'"'}function Gu(s){return'link[rel="stylesheet"]['+s+"]"}function k5(s){return f({},s,{"data-precedence":s.precedence,precedence:null})}function XN(s,c,p,v){s.querySelector('link[rel="preload"][as="style"]['+c+"]")?v.loading=1:(c=s.createElement("link"),v.preload=c,c.addEventListener("load",function(){return v.loading|=1}),c.addEventListener("error",function(){return v.loading|=2}),Ar(c,"link",p),Jt(c),s.head.appendChild(c))}function yc(s){return'[src="'+wn(s)+'"]'}function Vu(s){return"script[async]"+s}function C5(s,c,p){if(c.count++,c.instance===null)switch(c.type){case"style":var v=s.querySelector('style[data-href~="'+wn(p.href)+'"]');if(v)return c.instance=v,Jt(v),v;var A=f({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return v=(s.ownerDocument||s).createElement("style"),Jt(v),Ar(v,"style",A),_0(v,p.precedence,s),c.instance=v;case"stylesheet":A=xc(p.href);var M=s.querySelector(Gu(A));if(M)return c.state.loading|=4,c.instance=M,Jt(M),M;v=k5(p),(A=ss.get(A))&&G1(v,A),M=(s.ownerDocument||s).createElement("link"),Jt(M);var q=M;return q._p=new Promise(function(J,de){q.onload=J,q.onerror=de}),Ar(M,"link",v),c.state.loading|=4,_0(M,p.precedence,s),c.instance=M;case"script":return M=yc(p.src),(A=s.querySelector(Vu(M)))?(c.instance=A,Jt(A),A):(v=p,(A=ss.get(M))&&(v=f({},p),V1(v,A)),s=s.ownerDocument||s,A=s.createElement("script"),Jt(A),Ar(A,"link",v),s.head.appendChild(A),c.instance=A);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(v=c.instance,c.state.loading|=4,_0(v,p.precedence,s));return c.instance}function _0(s,c,p){for(var v=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=v.length?v[v.length-1]:null,M=A,q=0;q title"):null)}function KN(s,c,p){if(p===1||c.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return s=c.disabled,typeof c.precedence=="string"&&s==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function T5(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function ZN(s,c,p,v){if(p.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var A=xc(v.href),M=c.querySelector(Gu(A));if(M){c=M._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(s.count++,s=y0.bind(s),c.then(s,s)),p.state.loading|=4,p.instance=M,Jt(M);return}M=c.ownerDocument||c,v=k5(v),(A=ss.get(A))&&G1(v,A),M=M.createElement("link"),Jt(M);var q=M;q._p=new Promise(function(J,de){q.onload=J,q.onerror=de}),Ar(M,"link",v),p.instance=M}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(p,c),(c=p.state.preload)&&(p.state.loading&3)===0&&(s.count++,p=y0.bind(s),c.addEventListener("load",p),c.addEventListener("error",p))}}var W1=0;function QN(s,c){return s.stylesheets&&s.count===0&&S0(s,s.stylesheets),0W1?50:800)+c);return s.unsuspend=p,function(){s.unsuspend=null,clearTimeout(v),clearTimeout(A)}}:null}function y0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)S0(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var w0=null;function S0(s,c){s.stylesheets=null,s.unsuspend!==null&&(s.count++,w0=new Map,c.forEach(JN,s),w0=null,y0.call(s))}function JN(s,c){if(!(c.state.loading&4)){var p=w0.get(s);if(p)var v=p.get(null);else{p=new Map,w0.set(s,p);for(var A=s.querySelectorAll("link[data-precedence],style[data-precedence]"),M=0;M"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ng.exports=mj(),ng.exports}var bj=gj();/** +`);for(A=_=0;_A||de[_]!==we[A]){var Ae=` +`+de[_].replace(" at new "," at ");return s.displayName&&Ae.includes("")&&(Ae=Ae.replace("",s.displayName)),Ae}while(1<=_&&0<=A);break}}}finally{$e=!1,Error.prepareStackTrace=p}return(p=s?s.displayName||s.name:"")?Le(p):""}function Fe(s,u){switch(s.tag){case 26:case 27:case 5:return Le(s.type);case 16:return Le("Lazy");case 13:return s.child!==u&&u!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return Ge(s.type,!1);case 11:return Ge(s.type.render,!1);case 1:return Ge(s.type,!0);case 31:return Le("Activity");default:return""}}function ut(s){try{var u="",p=null;do u+=Fe(s,p),p=s,s=s.return;while(s);return u}catch(_){return` +Error generating stack: `+_.message+` +`+_.stack}}var Ke=Object.prototype.hasOwnProperty,Ue=e.unstable_scheduleCallback,ct=e.unstable_cancelCallback,Kt=e.unstable_shouldYield,Rt=e.unstable_requestPaint,qe=e.unstable_now,nt=e.unstable_getCurrentPriorityLevel,ve=e.unstable_ImmediatePriority,je=e.unstable_UserBlockingPriority,Pe=e.unstable_NormalPriority,Ze=e.unstable_LowPriority,De=e.unstable_IdlePriority,et=e.log,rt=e.unstable_setDisableYieldValue,At=null,xt=null;function Xt(s){if(typeof et=="function"&&rt(s),xt&&typeof xt.setStrictMode=="function")try{xt.setStrictMode(At,s)}catch{}}var dt=Math.clz32?Math.clz32:qn,rn=Math.log,mn=Math.LN2;function qn(s){return s>>>=0,s===0?32:31-(rn(s)/mn|0)|0}var Ui=256,qi=262144,Ts=4194304;function Tr(s){var u=s&42;if(u!==0)return u;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function hi(s,u,p){var _=s.pendingLanes;if(_===0)return 0;var A=0,j=s.suspendedLanes,q=s.pingedLanes;s=s.warmLanes;var J=_&134217727;return J!==0?(_=J&~j,_!==0?A=Tr(_):(q&=J,q!==0?A=Tr(q):p||(p=J&~s,p!==0&&(A=Tr(p))))):(J=_&~j,J!==0?A=Tr(J):q!==0?A=Tr(q):p||(p=_&~s,p!==0&&(A=Tr(p)))),A===0?0:u!==0&&u!==A&&(u&j)===0&&(j=A&-A,p=u&-u,j>=p||j===32&&(p&4194048)!==0)?u:A}function pr(s,u){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&u)===0}function Yo(s,u){switch(s){case 1:case 2:case 4:case 8:case 64:return u+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 u+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 Zr(){var s=Ts;return Ts<<=1,(Ts&62914560)===0&&(Ts=4194304),s}function Zt(s){for(var u=[],p=0;31>p;p++)u.push(s);return u}function ln(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function fi(s,u,p,_,A,j){var q=s.pendingLanes;s.pendingLanes=p,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=p,s.entangledLanes&=p,s.errorRecoveryDisabledLanes&=p,s.shellSuspendCounter=0;var J=s.entanglements,de=s.expirationTimes,we=s.hiddenUpdates;for(p=q&~p;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var Xa=/[\n"\\]/g;function wn(s){return s.replace(Xa,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function Vi(s,u,p,_,A,j,q,J){s.name="",q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?s.type=q:s.removeAttribute("type"),u!=null?q==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+Rn(u)):s.value!==""+Rn(u)&&(s.value=""+Rn(u)):q!=="submit"&&q!=="reset"||s.removeAttribute("value"),u!=null?Ms(s,q,Rn(u)):p!=null?Ms(s,q,Rn(p)):_!=null&&s.removeAttribute("value"),A==null&&j!=null&&(s.defaultChecked=!!j),A!=null&&(s.checked=A&&typeof A!="function"&&typeof A!="symbol"),J!=null&&typeof J!="function"&&typeof J!="symbol"&&typeof J!="boolean"?s.name=""+Rn(J):s.removeAttribute("name")}function Jt(s,u,p,_,A,j,q,J){if(j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(s.type=j),u!=null||p!=null){if(!(j!=="submit"&&j!=="reset"||u!=null)){js(s);return}p=p!=null?""+Rn(p):"",u=u!=null?""+Rn(u):p,J||u===s.value||(s.value=u),s.defaultValue=u}_=_??A,_=typeof _!="function"&&typeof _!="symbol"&&!!_,s.checked=J?s.checked:!!_,s.defaultChecked=!!_,q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"&&(s.name=q),js(s)}function Ms(s,u,p){u==="number"&&Hr(s.ownerDocument)===s||s.defaultValue===""+p||(s.defaultValue=""+p)}function gn(s,u,p,_){if(s=s.options,u){u={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ja=!1;if(Yn)try{var Os={};Object.defineProperty(Os,"passive",{get:function(){Ja=!0}}),window.addEventListener("test",Os,Os),window.removeEventListener("test",Os,Os)}catch{Ja=!1}var yr=null,gr=null,hs=null;function Mr(){if(hs)return hs;var s,u=gr,p=u.length,_,A="value"in yr?yr.value:yr.textContent,j=A.length;for(s=0;s=mu),yx=" ",wx=!1;function Sx(s,u){switch(s){case"keyup":return IT.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kx(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Yl=!1;function BT(s,u){switch(s){case"compositionend":return kx(u);case"keypress":return u.which!==32?null:(wx=!0,yx);case"textInput":return s=u.data,s===yx&&wx?null:s;default:return null}}function HT(s,u){if(Yl)return s==="compositionend"||!lm&&Sx(s,u)?(s=Mr(),hs=gr=yr=null,Yl=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1=u)return{node:p,offset:u-s};s=_}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=Rx(p)}}function Lx(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?Lx(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function Ox(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var u=Hr(s.document);u instanceof s.HTMLIFrameElement;){try{var p=typeof u.contentWindow.location.href=="string"}catch{p=!1}if(p)s=u.contentWindow;else break;u=Hr(s.document)}return u}function dm(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u&&(u==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||u==="textarea"||s.contentEditable==="true")}var WT=Yn&&"documentMode"in document&&11>=document.documentMode,Xl=null,hm=null,_u=null,fm=!1;function Ix(s,u,p){var _=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;fm||Xl==null||Xl!==Hr(_)||(_=Xl,"selectionStart"in _&&dm(_)?_={start:_.selectionStart,end:_.selectionEnd}:(_=(_.ownerDocument&&_.ownerDocument.defaultView||window).getSelection(),_={anchorNode:_.anchorNode,anchorOffset:_.anchorOffset,focusNode:_.focusNode,focusOffset:_.focusOffset}),_u&&vu(_u,_)||(_u=_,_=b0(hm,"onSelect"),0<_.length&&(u=new ua("onSelect","select",null,u,p),s.push({event:u,listeners:_}),u.target=Xl)))}function Zo(s,u){var p={};return p[s.toLowerCase()]=u.toLowerCase(),p["Webkit"+s]="webkit"+u,p["Moz"+s]="moz"+u,p}var Kl={animationend:Zo("Animation","AnimationEnd"),animationiteration:Zo("Animation","AnimationIteration"),animationstart:Zo("Animation","AnimationStart"),transitionrun:Zo("Transition","TransitionRun"),transitionstart:Zo("Transition","TransitionStart"),transitioncancel:Zo("Transition","TransitionCancel"),transitionend:Zo("Transition","TransitionEnd")},pm={},zx={};Yn&&(zx=document.createElement("div").style,"AnimationEvent"in window||(delete Kl.animationend.animation,delete Kl.animationiteration.animation,delete Kl.animationstart.animation),"TransitionEvent"in window||delete Kl.transitionend.transition);function Qo(s){if(pm[s])return pm[s];if(!Kl[s])return s;var u=Kl[s],p;for(p in u)if(u.hasOwnProperty(p)&&p in zx)return pm[s]=u[p];return s}var Bx=Qo("animationend"),Hx=Qo("animationiteration"),$x=Qo("animationstart"),YT=Qo("transitionrun"),XT=Qo("transitionstart"),KT=Qo("transitioncancel"),Fx=Qo("transitionend"),Px=new Map,mm="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(" ");mm.push("scrollEnd");function ps(s,u){Px.set(s,u),Br(u,[s])}var jh=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Ki=[],Zl=0,gm=0;function Mh(){for(var s=Zl,u=gm=Zl=0;u>=q,A-=q,Bs=1<<32-dt(u)+A|p<kt?(Lt=tt,tt=null):Lt=tt.sibling;var qt=Se(ge,tt,xe[kt],Te);if(qt===null){tt===null&&(tt=Lt);break}s&&tt&&qt.alternate===null&&u(ge,tt),fe=j(qt,fe,kt),Ut===null?lt=qt:Ut.sibling=qt,Ut=qt,tt=Lt}if(kt===xe.length)return p(ge,tt),It&&pa(ge,kt),lt;if(tt===null){for(;ktkt?(Lt=tt,tt=null):Lt=tt.sibling;var ko=Se(ge,tt,qt.value,Te);if(ko===null){tt===null&&(tt=Lt);break}s&&tt&&ko.alternate===null&&u(ge,tt),fe=j(ko,fe,kt),Ut===null?lt=ko:Ut.sibling=ko,Ut=ko,tt=Lt}if(qt.done)return p(ge,tt),It&&pa(ge,kt),lt;if(tt===null){for(;!qt.done;kt++,qt=xe.next())qt=Ne(ge,qt.value,Te),qt!==null&&(fe=j(qt,fe,kt),Ut===null?lt=qt:Ut.sibling=qt,Ut=qt);return It&&pa(ge,kt),lt}for(tt=_(tt);!qt.done;kt++,qt=xe.next())qt=ke(tt,ge,kt,qt.value,Te),qt!==null&&(s&&qt.alternate!==null&&tt.delete(qt.key===null?kt:qt.key),fe=j(qt,fe,kt),Ut===null?lt=qt:Ut.sibling=qt,Ut=qt);return s&&tt.forEach(function(fj){return u(ge,fj)}),It&&pa(ge,kt),lt}function on(ge,fe,xe,Te){if(typeof xe=="object"&&xe!==null&&xe.type===S&&xe.key===null&&(xe=xe.props.children),typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case b:e:{for(var lt=xe.key;fe!==null;){if(fe.key===lt){if(lt=xe.type,lt===S){if(fe.tag===7){p(ge,fe.sibling),Te=A(fe,xe.props.children),Te.return=ge,ge=Te;break e}}else if(fe.elementType===lt||typeof lt=="object"&<!==null&<.$$typeof===T&&sl(lt)===fe.type){p(ge,fe.sibling),Te=A(fe,xe.props),Cu(Te,xe),Te.return=ge,ge=Te;break e}p(ge,fe);break}else u(ge,fe);fe=fe.sibling}xe.type===S?(Te=el(xe.props.children,ge.mode,Te,xe.key),Te.return=ge,ge=Te):(Te=Lh(xe.type,xe.key,xe.props,null,ge.mode,Te),Cu(Te,xe),Te.return=ge,ge=Te)}return q(ge);case k:e:{for(lt=xe.key;fe!==null;){if(fe.key===lt)if(fe.tag===4&&fe.stateNode.containerInfo===xe.containerInfo&&fe.stateNode.implementation===xe.implementation){p(ge,fe.sibling),Te=A(fe,xe.children||[]),Te.return=ge,ge=Te;break e}else{p(ge,fe);break}else u(ge,fe);fe=fe.sibling}Te=xm(xe,ge.mode,Te),Te.return=ge,ge=Te}return q(ge);case T:return xe=sl(xe),on(ge,fe,xe,Te)}if(X(xe))return Je(ge,fe,xe,Te);if(F(xe)){if(lt=F(xe),typeof lt!="function")throw Error(r(150));return xe=lt.call(xe),pt(ge,fe,xe,Te)}if(typeof xe.then=="function")return on(ge,fe,Fh(xe),Te);if(xe.$$typeof===y)return on(ge,fe,zh(ge,xe),Te);Ph(ge,xe)}return typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint"?(xe=""+xe,fe!==null&&fe.tag===6?(p(ge,fe.sibling),Te=A(fe,xe),Te.return=ge,ge=Te):(p(ge,fe),Te=_m(xe,ge.mode,Te),Te.return=ge,ge=Te),q(ge)):p(ge,fe)}return function(ge,fe,xe,Te){try{ku=0;var lt=on(ge,fe,xe,Te);return ac=null,lt}catch(tt){if(tt===sc||tt===Hh)throw tt;var Ut=wi(29,tt,null,ge.mode);return Ut.lanes=Te,Ut.return=ge,Ut}finally{}}}var ol=sy(!0),ay=sy(!1),ao=!1;function Rm(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Dm(s,u){s=s.updateQueue,u.updateQueue===s&&(u.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function oo(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function lo(s,u,p){var _=s.updateQueue;if(_===null)return null;if(_=_.shared,(Gt&2)!==0){var A=_.pending;return A===null?u.next=u:(u.next=A.next,A.next=u),_.pending=u,u=Dh(s),Ux(s,null,p),u}return Rh(s,_,u,p),Dh(s)}function Eu(s,u,p){if(u=u.updateQueue,u!==null&&(u=u.shared,(p&4194048)!==0)){var _=u.lanes;_&=s.pendingLanes,p|=_,u.lanes=p,Ns(s,p)}}function Lm(s,u){var p=s.updateQueue,_=s.alternate;if(_!==null&&(_=_.updateQueue,p===_)){var A=null,j=null;if(p=p.firstBaseUpdate,p!==null){do{var q={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};j===null?A=j=q:j=j.next=q,p=p.next}while(p!==null);j===null?A=j=u:j=j.next=u}else A=j=u;p={baseState:_.baseState,firstBaseUpdate:A,lastBaseUpdate:j,shared:_.shared,callbacks:_.callbacks},s.updateQueue=p;return}s=p.lastBaseUpdate,s===null?p.firstBaseUpdate=u:s.next=u,p.lastBaseUpdate=u}var Om=!1;function Au(){if(Om){var s=ic;if(s!==null)throw s}}function Tu(s,u,p,_){Om=!1;var A=s.updateQueue;ao=!1;var j=A.firstBaseUpdate,q=A.lastBaseUpdate,J=A.shared.pending;if(J!==null){A.shared.pending=null;var de=J,we=de.next;de.next=null,q===null?j=we:q.next=we,q=de;var Ae=s.alternate;Ae!==null&&(Ae=Ae.updateQueue,J=Ae.lastBaseUpdate,J!==q&&(J===null?Ae.firstBaseUpdate=we:J.next=we,Ae.lastBaseUpdate=de))}if(j!==null){var Ne=A.baseState;q=0,Ae=we=de=null,J=j;do{var Se=J.lane&-536870913,ke=Se!==J.lane;if(ke?(Dt&Se)===Se:(_&Se)===Se){Se!==0&&Se===rc&&(Om=!0),Ae!==null&&(Ae=Ae.next={lane:0,tag:J.tag,payload:J.payload,callback:null,next:null});e:{var Je=s,pt=J;Se=u;var on=p;switch(pt.tag){case 1:if(Je=pt.payload,typeof Je=="function"){Ne=Je.call(on,Ne,Se);break e}Ne=Je;break e;case 3:Je.flags=Je.flags&-65537|128;case 0:if(Je=pt.payload,Se=typeof Je=="function"?Je.call(on,Ne,Se):Je,Se==null)break e;Ne=f({},Ne,Se);break e;case 2:ao=!0}}Se=J.callback,Se!==null&&(s.flags|=64,ke&&(s.flags|=8192),ke=A.callbacks,ke===null?A.callbacks=[Se]:ke.push(Se))}else ke={lane:Se,tag:J.tag,payload:J.payload,callback:J.callback,next:null},Ae===null?(we=Ae=ke,de=Ne):Ae=Ae.next=ke,q|=Se;if(J=J.next,J===null){if(J=A.shared.pending,J===null)break;ke=J,J=ke.next,ke.next=null,A.lastBaseUpdate=ke,A.shared.pending=null}}while(!0);Ae===null&&(de=Ne),A.baseState=de,A.firstBaseUpdate=we,A.lastBaseUpdate=Ae,j===null&&(A.shared.lanes=0),po|=q,s.lanes=q,s.memoizedState=Ne}}function oy(s,u){if(typeof s!="function")throw Error(r(191,s));s.call(u)}function ly(s,u){var p=s.callbacks;if(p!==null)for(s.callbacks=null,s=0;sj?j:8;var q=Y.T,J={};Y.T=J,e1(s,!1,u,p);try{var de=A(),we=Y.S;if(we!==null&&we(J,de),de!==null&&typeof de=="object"&&typeof de.then=="function"){var Ae=nN(de,_);Mu(s,u,Ae,Ai(s))}else Mu(s,u,_,Ai(s))}catch(Ne){Mu(s,u,{then:function(){},status:"rejected",reason:Ne},Ai())}finally{Q.p=j,q!==null&&J.types!==null&&(q.types=J.types),Y.T=q}}function lN(){}function Qm(s,u,p,_){if(s.tag!==5)throw Error(r(476));var A=$y(s).queue;Hy(s,A,u,te,p===null?lN:function(){return Fy(s),p(_)})}function $y(s){var u=s.memoizedState;if(u!==null)return u;u={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:te},next:null};var p={};return u.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:p},next:null},s.memoizedState=u,s=s.alternate,s!==null&&(s.memoizedState=u),u}function Fy(s){var u=$y(s);u.next===null&&(u=s.alternate.memoizedState),Mu(s,u.next.queue,{},Ai())}function Jm(){return kr(Yu)}function Py(){return Un().memoizedState}function Uy(){return Un().memoizedState}function cN(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var p=Ai();s=oo(p);var _=lo(u,s,p);_!==null&&(ii(_,u,p),Eu(_,u,p)),u={cache:Tm()},s.payload=u;return}u=u.return}}function uN(s,u,p){var _=Ai();p={lane:_,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Qh(s)?Gy(u,p):(p=bm(s,u,p,_),p!==null&&(ii(p,s,_),Vy(p,u,_)))}function qy(s,u,p){var _=Ai();Mu(s,u,p,_)}function Mu(s,u,p,_){var A={lane:_,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(Qh(s))Gy(u,A);else{var j=s.alternate;if(s.lanes===0&&(j===null||j.lanes===0)&&(j=u.lastRenderedReducer,j!==null))try{var q=u.lastRenderedState,J=j(q,p);if(A.hasEagerState=!0,A.eagerState=J,yi(J,q))return Rh(s,u,A,0),cn===null&&Mh(),!1}catch{}finally{}if(p=bm(s,u,A,_),p!==null)return ii(p,s,_),Vy(p,u,_),!0}return!1}function e1(s,u,p,_){if(_={lane:2,revertLane:R1(),gesture:null,action:_,hasEagerState:!1,eagerState:null,next:null},Qh(s)){if(u)throw Error(r(479))}else u=bm(s,p,_,2),u!==null&&ii(u,s,2)}function Qh(s){var u=s.alternate;return s===yt||u!==null&&u===yt}function Gy(s,u){lc=Gh=!0;var p=s.pending;p===null?u.next=u:(u.next=p.next,p.next=u),s.pending=u}function Vy(s,u,p){if((p&4194048)!==0){var _=u.lanes;_&=s.pendingLanes,p|=_,u.lanes=p,Ns(s,p)}}var Ru={readContext:kr,use:Yh,useCallback:Bn,useContext:Bn,useEffect:Bn,useImperativeHandle:Bn,useLayoutEffect:Bn,useInsertionEffect:Bn,useMemo:Bn,useReducer:Bn,useRef:Bn,useState:Bn,useDebugValue:Bn,useDeferredValue:Bn,useTransition:Bn,useSyncExternalStore:Bn,useId:Bn,useHostTransitionStatus:Bn,useFormState:Bn,useActionState:Bn,useOptimistic:Bn,useMemoCache:Bn,useCacheRefresh:Bn};Ru.useEffectEvent=Bn;var Wy={readContext:kr,use:Yh,useCallback:function(s,u){return Ur().memoizedState=[s,u===void 0?null:u],s},useContext:kr,useEffect:jy,useImperativeHandle:function(s,u,p){p=p!=null?p.concat([s]):null,Kh(4194308,4,Ly.bind(null,u,s),p)},useLayoutEffect:function(s,u){return Kh(4194308,4,s,u)},useInsertionEffect:function(s,u){Kh(4,2,s,u)},useMemo:function(s,u){var p=Ur();u=u===void 0?null:u;var _=s();if(ll){Xt(!0);try{s()}finally{Xt(!1)}}return p.memoizedState=[_,u],_},useReducer:function(s,u,p){var _=Ur();if(p!==void 0){var A=p(u);if(ll){Xt(!0);try{p(u)}finally{Xt(!1)}}}else A=u;return _.memoizedState=_.baseState=A,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:A},_.queue=s,s=s.dispatch=uN.bind(null,yt,s),[_.memoizedState,s]},useRef:function(s){var u=Ur();return s={current:s},u.memoizedState=s},useState:function(s){s=Wm(s);var u=s.queue,p=qy.bind(null,yt,u);return u.dispatch=p,[s.memoizedState,p]},useDebugValue:Km,useDeferredValue:function(s,u){var p=Ur();return Zm(p,s,u)},useTransition:function(){var s=Wm(!1);return s=Hy.bind(null,yt,s.queue,!0,!1),Ur().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,p){var _=yt,A=Ur();if(It){if(p===void 0)throw Error(r(407));p=p()}else{if(p=u(),cn===null)throw Error(r(349));(Dt&127)!==0||py(_,u,p)}A.memoizedState=p;var j={value:p,getSnapshot:u};return A.queue=j,jy(gy.bind(null,_,j,s),[s]),_.flags|=2048,uc(9,{destroy:void 0},my.bind(null,_,j,p,u),null),p},useId:function(){var s=Ur(),u=cn.identifierPrefix;if(It){var p=Hs,_=Bs;p=(_&~(1<<32-dt(_)-1)).toString(32)+p,u="_"+u+"R_"+p,p=Vh++,0<\/script>",j=j.removeChild(j.firstChild);break;case"select":j=typeof _.is=="string"?q.createElement("select",{is:_.is}):q.createElement("select"),_.multiple?j.multiple=!0:_.size&&(j.size=_.size);break;default:j=typeof _.is=="string"?q.createElement(A,{is:_.is}):q.createElement(A)}}j[ft]=u,j[vt]=_;e:for(q=u.child;q!==null;){if(q.tag===5||q.tag===6)j.appendChild(q.stateNode);else if(q.tag!==4&&q.tag!==27&&q.child!==null){q.child.return=q,q=q.child;continue}if(q===u)break e;for(;q.sibling===null;){if(q.return===null||q.return===u)break e;q=q.return}q.sibling.return=q.return,q=q.sibling}u.stateNode=j;e:switch(Er(j,A,_),A){case"button":case"input":case"select":case"textarea":_=!!_.autoFocus;break e;case"img":_=!0;break e;default:_=!1}_&&xa(u)}}return _n(u),p1(u,u.type,s===null?null:s.memoizedProps,u.pendingProps,p),null;case 6:if(s&&u.stateNode!=null)s.memoizedProps!==_&&xa(u);else{if(typeof _!="string"&&u.stateNode===null)throw Error(r(166));if(s=me.current,tc(u)){if(s=u.stateNode,p=u.memoizedProps,_=null,A=Sr,A!==null)switch(A.tag){case 27:case 5:_=A.memoizedProps}s[ft]=u,s=!!(s.nodeValue===p||_!==null&&_.suppressHydrationWarning===!0||h5(s.nodeValue,p)),s||io(u,!0)}else s=v0(s).createTextNode(_),s[ft]=u,u.stateNode=s}return _n(u),null;case 31:if(p=u.memoizedState,s===null||s.memoizedState!==null){if(_=tc(u),p!==null){if(s===null){if(!_)throw Error(r(318));if(s=u.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[ft]=u}else tl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;_n(u),s=!1}else p=km(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),s=!0;if(!s)return u.flags&256?(ki(u),u):(ki(u),null);if((u.flags&128)!==0)throw Error(r(558))}return _n(u),null;case 13:if(_=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(A=tc(u),_!==null&&_.dehydrated!==null){if(s===null){if(!A)throw Error(r(318));if(A=u.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[ft]=u}else tl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;_n(u),A=!1}else A=km(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=A),A=!0;if(!A)return u.flags&256?(ki(u),u):(ki(u),null)}return ki(u),(u.flags&128)!==0?(u.lanes=p,u):(p=_!==null,s=s!==null&&s.memoizedState!==null,p&&(_=u.child,A=null,_.alternate!==null&&_.alternate.memoizedState!==null&&_.alternate.memoizedState.cachePool!==null&&(A=_.alternate.memoizedState.cachePool.pool),j=null,_.memoizedState!==null&&_.memoizedState.cachePool!==null&&(j=_.memoizedState.cachePool.pool),j!==A&&(_.flags|=2048)),p!==s&&p&&(u.child.flags|=8192),r0(u,u.updateQueue),_n(u),null);case 4:return se(),s===null&&I1(u.stateNode.containerInfo),_n(u),null;case 10:return ga(u.type),_n(u),null;case 19:if(G(Pn),_=u.memoizedState,_===null)return _n(u),null;if(A=(u.flags&128)!==0,j=_.rendering,j===null)if(A)Lu(_,!1);else{if(Hn!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(j=qh(s),j!==null){for(u.flags|=128,Lu(_,!1),s=j.updateQueue,u.updateQueue=s,r0(u,s),u.subtreeFlags=0,s=p,p=u.child;p!==null;)qx(p,s),p=p.sibling;return W(Pn,Pn.current&1|2),It&&pa(u,_.treeForkCount),u.child}s=s.sibling}_.tail!==null&&qe()>l0&&(u.flags|=128,A=!0,Lu(_,!1),u.lanes=4194304)}else{if(!A)if(s=qh(j),s!==null){if(u.flags|=128,A=!0,s=s.updateQueue,u.updateQueue=s,r0(u,s),Lu(_,!0),_.tail===null&&_.tailMode==="hidden"&&!j.alternate&&!It)return _n(u),null}else 2*qe()-_.renderingStartTime>l0&&p!==536870912&&(u.flags|=128,A=!0,Lu(_,!1),u.lanes=4194304);_.isBackwards?(j.sibling=u.child,u.child=j):(s=_.last,s!==null?s.sibling=j:u.child=j,_.last=j)}return _.tail!==null?(s=_.tail,_.rendering=s,_.tail=s.sibling,_.renderingStartTime=qe(),s.sibling=null,p=Pn.current,W(Pn,A?p&1|2:p&1),It&&pa(u,_.treeForkCount),s):(_n(u),null);case 22:case 23:return ki(u),zm(),_=u.memoizedState!==null,s!==null?s.memoizedState!==null!==_&&(u.flags|=8192):_&&(u.flags|=8192),_?(p&536870912)!==0&&(u.flags&128)===0&&(_n(u),u.subtreeFlags&6&&(u.flags|=8192)):_n(u),p=u.updateQueue,p!==null&&r0(u,p.retryQueue),p=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),_=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(_=u.memoizedState.cachePool.pool),_!==p&&(u.flags|=2048),s!==null&&G(il),null;case 24:return p=null,s!==null&&(p=s.memoizedState.cache),u.memoizedState.cache!==p&&(u.flags|=2048),ga(Xn),_n(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function mN(s,u){switch(wm(u),u.tag){case 1:return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return ga(Xn),se(),s=u.flags,(s&65536)!==0&&(s&128)===0?(u.flags=s&-65537|128,u):null;case 26:case 27:case 5:return _e(u),null;case 31:if(u.memoizedState!==null){if(ki(u),u.alternate===null)throw Error(r(340));tl()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 13:if(ki(u),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(r(340));tl()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return G(Pn),null;case 4:return se(),null;case 10:return ga(u.type),null;case 22:case 23:return ki(u),zm(),s!==null&&G(il),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 24:return ga(Xn),null;case 25:return null;default:return null}}function b4(s,u){switch(wm(u),u.tag){case 3:ga(Xn),se();break;case 26:case 27:case 5:_e(u);break;case 4:se();break;case 31:u.memoizedState!==null&&ki(u);break;case 13:ki(u);break;case 19:G(Pn);break;case 10:ga(u.type);break;case 22:case 23:ki(u),zm(),s!==null&&G(il);break;case 24:ga(Xn)}}function Ou(s,u){try{var p=u.updateQueue,_=p!==null?p.lastEffect:null;if(_!==null){var A=_.next;p=A;do{if((p.tag&s)===s){_=void 0;var j=p.create,q=p.inst;_=j(),q.destroy=_}p=p.next}while(p!==A)}}catch(J){tn(u,u.return,J)}}function ho(s,u,p){try{var _=u.updateQueue,A=_!==null?_.lastEffect:null;if(A!==null){var j=A.next;_=j;do{if((_.tag&s)===s){var q=_.inst,J=q.destroy;if(J!==void 0){q.destroy=void 0,A=u;var de=p,we=J;try{we()}catch(Ae){tn(A,de,Ae)}}}_=_.next}while(_!==j)}}catch(Ae){tn(u,u.return,Ae)}}function v4(s){var u=s.updateQueue;if(u!==null){var p=s.stateNode;try{ly(u,p)}catch(_){tn(s,s.return,_)}}}function _4(s,u,p){p.props=cl(s.type,s.memoizedProps),p.state=s.memoizedState;try{p.componentWillUnmount()}catch(_){tn(s,u,_)}}function Iu(s,u){try{var p=s.ref;if(p!==null){switch(s.tag){case 26:case 27:case 5:var _=s.stateNode;break;case 30:_=s.stateNode;break;default:_=s.stateNode}typeof p=="function"?s.refCleanup=p(_):p.current=_}}catch(A){tn(s,u,A)}}function $s(s,u){var p=s.ref,_=s.refCleanup;if(p!==null)if(typeof _=="function")try{_()}catch(A){tn(s,u,A)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(A){tn(s,u,A)}else p.current=null}function x4(s){var u=s.type,p=s.memoizedProps,_=s.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":p.autoFocus&&_.focus();break e;case"img":p.src?_.src=p.src:p.srcSet&&(_.srcset=p.srcSet)}}catch(A){tn(s,s.return,A)}}function m1(s,u,p){try{var _=s.stateNode;zN(_,s.type,p,u),_[vt]=u}catch(A){tn(s,s.return,A)}}function y4(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&_o(s.type)||s.tag===4}function g1(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||y4(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&_o(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function b1(s,u,p){var _=s.tag;if(_===5||_===6)s=s.stateNode,u?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(s,u):(u=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,u.appendChild(s),p=p._reactRootContainer,p!=null||u.onclick!==null||(u.onclick=$r));else if(_!==4&&(_===27&&_o(s.type)&&(p=s.stateNode,u=null),s=s.child,s!==null))for(b1(s,u,p),s=s.sibling;s!==null;)b1(s,u,p),s=s.sibling}function i0(s,u,p){var _=s.tag;if(_===5||_===6)s=s.stateNode,u?p.insertBefore(s,u):p.appendChild(s);else if(_!==4&&(_===27&&_o(s.type)&&(p=s.stateNode),s=s.child,s!==null))for(i0(s,u,p),s=s.sibling;s!==null;)i0(s,u,p),s=s.sibling}function w4(s){var u=s.stateNode,p=s.memoizedProps;try{for(var _=s.type,A=u.attributes;A.length;)u.removeAttributeNode(A[0]);Er(u,_,p),u[ft]=s,u[vt]=p}catch(j){tn(s,s.return,j)}}var ya=!1,Qn=!1,v1=!1,S4=typeof WeakSet=="function"?WeakSet:Set,br=null;function gN(s,u){if(s=s.containerInfo,H1=C0,s=Ox(s),dm(s)){if("selectionStart"in s)var p={start:s.selectionStart,end:s.selectionEnd};else e:{p=(p=s.ownerDocument)&&p.defaultView||window;var _=p.getSelection&&p.getSelection();if(_&&_.rangeCount!==0){p=_.anchorNode;var A=_.anchorOffset,j=_.focusNode;_=_.focusOffset;try{p.nodeType,j.nodeType}catch{p=null;break e}var q=0,J=-1,de=-1,we=0,Ae=0,Ne=s,Se=null;t:for(;;){for(var ke;Ne!==p||A!==0&&Ne.nodeType!==3||(J=q+A),Ne!==j||_!==0&&Ne.nodeType!==3||(de=q+_),Ne.nodeType===3&&(q+=Ne.nodeValue.length),(ke=Ne.firstChild)!==null;)Se=Ne,Ne=ke;for(;;){if(Ne===s)break t;if(Se===p&&++we===A&&(J=q),Se===j&&++Ae===_&&(de=q),(ke=Ne.nextSibling)!==null)break;Ne=Se,Se=Ne.parentNode}Ne=ke}p=J===-1||de===-1?null:{start:J,end:de}}else p=null}p=p||{start:0,end:0}}else p=null;for($1={focusedElem:s,selectionRange:p},C0=!1,br=u;br!==null;)if(u=br,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,br=s;else for(;br!==null;){switch(u=br,j=u.alternate,s=u.flags,u.tag){case 0:if((s&4)!==0&&(s=u.updateQueue,s=s!==null?s.events:null,s!==null))for(p=0;p title"))),Er(j,_,p),j[ft]=s,Qt(j),_=j;break e;case"link":var q=N5("link","href",A).get(_+(p.href||""));if(q){for(var J=0;Jon&&(q=on,on=pt,pt=q);var ge=Dx(J,pt),fe=Dx(J,on);if(ge&&fe&&(ke.rangeCount!==1||ke.anchorNode!==ge.node||ke.anchorOffset!==ge.offset||ke.focusNode!==fe.node||ke.focusOffset!==fe.offset)){var xe=Ne.createRange();xe.setStart(ge.node,ge.offset),ke.removeAllRanges(),pt>on?(ke.addRange(xe),ke.extend(fe.node,fe.offset)):(xe.setEnd(fe.node,fe.offset),ke.addRange(xe))}}}}for(Ne=[],ke=J;ke=ke.parentNode;)ke.nodeType===1&&Ne.push({element:ke,left:ke.scrollLeft,top:ke.scrollTop});for(typeof J.focus=="function"&&J.focus(),J=0;Jp?32:p,Y.T=null,p=C1,C1=null;var j=go,q=Ea;if(cr=0,mc=go=null,Ea=0,(Gt&6)!==0)throw Error(r(331));var J=Gt;if(Gt|=4,L4(j.current),M4(j,j.current,q,p),Gt=J,Pu(0,!1),xt&&typeof xt.onPostCommitFiberRoot=="function")try{xt.onPostCommitFiberRoot(At,j)}catch{}return!0}finally{Q.p=A,Y.T=_,Q4(s,u)}}function e5(s,u,p){u=Zi(p,u),u=i1(s.stateNode,u,2),s=lo(s,u,2),s!==null&&(ln(s,2),Fs(s))}function tn(s,u,p){if(s.tag===3)e5(s,s,p);else for(;u!==null;){if(u.tag===3){e5(u,s,p);break}else if(u.tag===1){var _=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof _.componentDidCatch=="function"&&(mo===null||!mo.has(_))){s=Zi(p,s),p=t4(2),_=lo(u,p,2),_!==null&&(n4(p,_,u,s),ln(_,2),Fs(_));break}}u=u.return}}function N1(s,u,p){var _=s.pingCache;if(_===null){_=s.pingCache=new _N;var A=new Set;_.set(u,A)}else A=_.get(u),A===void 0&&(A=new Set,_.set(u,A));A.has(p)||(y1=!0,A.add(p),s=kN.bind(null,s,u,p),u.then(s,s))}function kN(s,u,p){var _=s.pingCache;_!==null&&_.delete(u),s.pingedLanes|=s.suspendedLanes&p,s.warmLanes&=~p,cn===s&&(Dt&p)===p&&(Hn===4||Hn===3&&(Dt&62914560)===Dt&&300>qe()-o0?(Gt&2)===0&&gc(s,0):w1|=p,pc===Dt&&(pc=0)),Fs(s)}function t5(s,u){u===0&&(u=Zr()),s=Jo(s,u),s!==null&&(ln(s,u),Fs(s))}function CN(s){var u=s.memoizedState,p=0;u!==null&&(p=u.retryLane),t5(s,p)}function EN(s,u){var p=0;switch(s.tag){case 31:case 13:var _=s.stateNode,A=s.memoizedState;A!==null&&(p=A.retryLane);break;case 19:_=s.stateNode;break;case 22:_=s.stateNode._retryCache;break;default:throw Error(r(314))}_!==null&&_.delete(u),t5(s,p)}function AN(s,u){return Ue(s,u)}var p0=null,vc=null,j1=!1,m0=!1,M1=!1,vo=0;function Fs(s){s!==vc&&s.next===null&&(vc===null?p0=vc=s:vc=vc.next=s),m0=!0,j1||(j1=!0,NN())}function Pu(s,u){if(!M1&&m0){M1=!0;do for(var p=!1,_=p0;_!==null;){if(s!==0){var A=_.pendingLanes;if(A===0)var j=0;else{var q=_.suspendedLanes,J=_.pingedLanes;j=(1<<31-dt(42|s)+1)-1,j&=A&~(q&~J),j=j&201326741?j&201326741|1:j?j|2:0}j!==0&&(p=!0,s5(_,j))}else j=Dt,j=hi(_,_===cn?j:0,_.cancelPendingCommit!==null||_.timeoutHandle!==-1),(j&3)===0||pr(_,j)||(p=!0,s5(_,j));_=_.next}while(p);M1=!1}}function TN(){n5()}function n5(){m0=j1=!1;var s=0;vo!==0&&HN()&&(s=vo);for(var u=qe(),p=null,_=p0;_!==null;){var A=_.next,j=r5(_,u);j===0?(_.next=null,p===null?p0=A:p.next=A,A===null&&(vc=p)):(p=_,(s!==0||(j&3)!==0)&&(m0=!0)),_=A}cr!==0&&cr!==5||Pu(s),vo!==0&&(vo=0)}function r5(s,u){for(var p=s.suspendedLanes,_=s.pingedLanes,A=s.expirationTimes,j=s.pendingLanes&-62914561;0J)break;var Ae=de.transferSize,Ne=de.initiatorType;Ae&&f5(Ne)&&(de=de.responseEnd,q+=Ae*(de"u"?null:document;function C5(s,u,p){var _=_c;if(_&&typeof u=="string"&&u){var A=wn(u);A='link[rel="'+s+'"][href="'+A+'"]',typeof p=="string"&&(A+='[crossorigin="'+p+'"]'),k5.has(A)||(k5.add(A),s={rel:s,crossOrigin:p,href:u},_.querySelector(A)===null&&(u=_.createElement("link"),Er(u,"link",s),Qt(u),_.head.appendChild(u)))}}function YN(s){Aa.D(s),C5("dns-prefetch",s,null)}function XN(s,u){Aa.C(s,u),C5("preconnect",s,u)}function KN(s,u,p){Aa.L(s,u,p);var _=_c;if(_&&s&&u){var A='link[rel="preload"][as="'+wn(u)+'"]';u==="image"&&p&&p.imageSrcSet?(A+='[imagesrcset="'+wn(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(A+='[imagesizes="'+wn(p.imageSizes)+'"]')):A+='[href="'+wn(s)+'"]';var j=A;switch(u){case"style":j=xc(s);break;case"script":j=yc(s)}rs.has(j)||(s=f({rel:"preload",href:u==="image"&&p&&p.imageSrcSet?void 0:s,as:u},p),rs.set(j,s),_.querySelector(A)!==null||u==="style"&&_.querySelector(Vu(j))||u==="script"&&_.querySelector(Wu(j))||(u=_.createElement("link"),Er(u,"link",s),Qt(u),_.head.appendChild(u)))}}function ZN(s,u){Aa.m(s,u);var p=_c;if(p&&s){var _=u&&typeof u.as=="string"?u.as:"script",A='link[rel="modulepreload"][as="'+wn(_)+'"][href="'+wn(s)+'"]',j=A;switch(_){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":j=yc(s)}if(!rs.has(j)&&(s=f({rel:"modulepreload",href:s},u),rs.set(j,s),p.querySelector(A)===null)){switch(_){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(Wu(j)))return}_=p.createElement("link"),Er(_,"link",s),Qt(_),p.head.appendChild(_)}}}function QN(s,u,p){Aa.S(s,u,p);var _=_c;if(_&&s){var A=Gn(_).hoistableStyles,j=xc(s);u=u||"default";var q=A.get(j);if(!q){var J={loading:0,preload:null};if(q=_.querySelector(Vu(j)))J.loading=5;else{s=f({rel:"stylesheet",href:s,"data-precedence":u},p),(p=rs.get(j))&&W1(s,p);var de=q=_.createElement("link");Qt(de),Er(de,"link",s),de._p=new Promise(function(we,Ae){de.onload=we,de.onerror=Ae}),de.addEventListener("load",function(){J.loading|=1}),de.addEventListener("error",function(){J.loading|=2}),J.loading|=4,x0(q,u,_)}q={type:"stylesheet",instance:q,count:1,state:J},A.set(j,q)}}}function JN(s,u){Aa.X(s,u);var p=_c;if(p&&s){var _=Gn(p).hoistableScripts,A=yc(s),j=_.get(A);j||(j=p.querySelector(Wu(A)),j||(s=f({src:s,async:!0},u),(u=rs.get(A))&&Y1(s,u),j=p.createElement("script"),Qt(j),Er(j,"link",s),p.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},_.set(A,j))}}function ej(s,u){Aa.M(s,u);var p=_c;if(p&&s){var _=Gn(p).hoistableScripts,A=yc(s),j=_.get(A);j||(j=p.querySelector(Wu(A)),j||(s=f({src:s,async:!0,type:"module"},u),(u=rs.get(A))&&Y1(s,u),j=p.createElement("script"),Qt(j),Er(j,"link",s),p.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},_.set(A,j))}}function E5(s,u,p,_){var A=(A=me.current)?_0(A):null;if(!A)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(u=xc(p.href),p=Gn(A).hoistableStyles,_=p.get(u),_||(_={type:"style",instance:null,count:0,state:null},p.set(u,_)),_):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){s=xc(p.href);var j=Gn(A).hoistableStyles,q=j.get(s);if(q||(A=A.ownerDocument||A,q={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},j.set(s,q),(j=A.querySelector(Vu(s)))&&!j._p&&(q.instance=j,q.state.loading=5),rs.has(s)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},rs.set(s,p),j||tj(A,s,p,q.state))),u&&_===null)throw Error(r(528,""));return q}if(u&&_!==null)throw Error(r(529,""));return null;case"script":return u=p.async,p=p.src,typeof p=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=yc(p),p=Gn(A).hoistableScripts,_=p.get(u),_||(_={type:"script",instance:null,count:0,state:null},p.set(u,_)),_):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function xc(s){return'href="'+wn(s)+'"'}function Vu(s){return'link[rel="stylesheet"]['+s+"]"}function A5(s){return f({},s,{"data-precedence":s.precedence,precedence:null})}function tj(s,u,p,_){s.querySelector('link[rel="preload"][as="style"]['+u+"]")?_.loading=1:(u=s.createElement("link"),_.preload=u,u.addEventListener("load",function(){return _.loading|=1}),u.addEventListener("error",function(){return _.loading|=2}),Er(u,"link",p),Qt(u),s.head.appendChild(u))}function yc(s){return'[src="'+wn(s)+'"]'}function Wu(s){return"script[async]"+s}function T5(s,u,p){if(u.count++,u.instance===null)switch(u.type){case"style":var _=s.querySelector('style[data-href~="'+wn(p.href)+'"]');if(_)return u.instance=_,Qt(_),_;var A=f({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return _=(s.ownerDocument||s).createElement("style"),Qt(_),Er(_,"style",A),x0(_,p.precedence,s),u.instance=_;case"stylesheet":A=xc(p.href);var j=s.querySelector(Vu(A));if(j)return u.state.loading|=4,u.instance=j,Qt(j),j;_=A5(p),(A=rs.get(A))&&W1(_,A),j=(s.ownerDocument||s).createElement("link"),Qt(j);var q=j;return q._p=new Promise(function(J,de){q.onload=J,q.onerror=de}),Er(j,"link",_),u.state.loading|=4,x0(j,p.precedence,s),u.instance=j;case"script":return j=yc(p.src),(A=s.querySelector(Wu(j)))?(u.instance=A,Qt(A),A):(_=p,(A=rs.get(j))&&(_=f({},p),Y1(_,A)),s=s.ownerDocument||s,A=s.createElement("script"),Qt(A),Er(A,"link",_),s.head.appendChild(A),u.instance=A);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(_=u.instance,u.state.loading|=4,x0(_,p.precedence,s));return u.instance}function x0(s,u,p){for(var _=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=_.length?_[_.length-1]:null,j=A,q=0;q<_.length;q++){var J=_[q];if(J.dataset.precedence===u)j=J;else if(j!==A)break}j?j.parentNode.insertBefore(s,j.nextSibling):(u=p.nodeType===9?p.head:p,u.insertBefore(s,u.firstChild))}function W1(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.title==null&&(s.title=u.title)}function Y1(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.integrity==null&&(s.integrity=u.integrity)}var y0=null;function N5(s,u,p){if(y0===null){var _=new Map,A=y0=new Map;A.set(p,_)}else A=y0,_=A.get(p),_||(_=new Map,A.set(p,_));if(_.has(s))return _;for(_.set(s,null),p=p.getElementsByTagName(s),A=0;A title"):null)}function nj(s,u,p){if(p===1||u.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return s=u.disabled,typeof u.precedence=="string"&&s==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function M5(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function rj(s,u,p,_){if(p.type==="stylesheet"&&(typeof _.media!="string"||matchMedia(_.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var A=xc(_.href),j=u.querySelector(Vu(A));if(j){u=j._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(s.count++,s=w0.bind(s),u.then(s,s)),p.state.loading|=4,p.instance=j,Qt(j);return}j=u.ownerDocument||u,_=A5(_),(A=rs.get(A))&&W1(_,A),j=j.createElement("link"),Qt(j);var q=j;q._p=new Promise(function(J,de){q.onload=J,q.onerror=de}),Er(j,"link",_),p.instance=j}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(p,u),(u=p.state.preload)&&(p.state.loading&3)===0&&(s.count++,p=w0.bind(s),u.addEventListener("load",p),u.addEventListener("error",p))}}var X1=0;function ij(s,u){return s.stylesheets&&s.count===0&&k0(s,s.stylesheets),0X1?50:800)+u);return s.unsuspend=p,function(){s.unsuspend=null,clearTimeout(_),clearTimeout(A)}}:null}function w0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)k0(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var S0=null;function k0(s,u){s.stylesheets=null,s.unsuspend!==null&&(s.count++,S0=new Map,u.forEach(sj,s),S0=null,w0.call(s))}function sj(s,u){if(!(u.state.loading&4)){var p=S0.get(s);if(p)var _=p.get(null);else{p=new Map,S0.set(s,p);for(var A=s.querySelectorAll("link[data-precedence],style[data-precedence]"),j=0;j"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ig.exports=yj(),ig.exports}var Sj=wj();/** * @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 V8=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + */const W8=(...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 vj=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + */const kj=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 _j=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/** + */const Cj=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 t3=e=>{const t=_j(e);return t.charAt(0).toUpperCase()+t.slice(1)};/** + */const i3=e=>{const t=Cj(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 ag={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"};/** + */var lg={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 xj=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},yj=R.createContext({}),wj=()=>R.useContext(yj),Sj=R.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...l},u)=>{const{size:d=24,strokeWidth:m=2,absoluteStrokeWidth:f=!1,color:g="currentColor",className:b=""}=wj()??{},k=r??f?Number(n??m)*24/Number(t??d):n??m;return R.createElement("svg",{ref:u,...ag,width:t??d??ag.width,height:t??d??ag.height,stroke:e??g,strokeWidth:k,className:V8("lucide",b,i),...!a&&!xj(l)&&{"aria-hidden":"true"},...l},[...o.map(([S,x])=>R.createElement(S,x)),...Array.isArray(a)?a:[a]])});/** + */const Ej=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Aj=R.createContext({}),Tj=()=>R.useContext(Aj),Nj=R.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...l},c)=>{const{size:d=24,strokeWidth:m=2,absoluteStrokeWidth:f=!1,color:g="currentColor",className:b=""}=Tj()??{},k=r??f?Number(n??m)*24/Number(t??d):n??m;return R.createElement("svg",{ref:c,...lg,width:t??d??lg.width,height:t??d??lg.height,stroke:e??g,strokeWidth:k,className:W8("lucide",b,i),...!a&&!Ej(l)&&{"aria-hidden":"true"},...l},[...o.map(([S,x])=>R.createElement(S,x)),...Array.isArray(a)?a:[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 Xe=(e,t)=>{const n=R.forwardRef(({className:r,...i},a)=>R.createElement(Sj,{ref:a,iconNode:t,className:V8(`lucide-${vj(t3(e))}`,`lucide-${e}`,r),...i}));return n.displayName=t3(e),n};/** + */const Ye=(e,t)=>{const n=R.forwardRef(({className:r,...i},a)=>R.createElement(Nj,{ref:a,iconNode:t,className:W8(`lucide-${kj(i3(e))}`,`lucide-${e}`,r),...i}));return n.displayName=i3(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 kj=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Tf=Xe("arrow-left",kj);/** + */const jj=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Nf=Ye("arrow-left",jj);/** * @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 Cj=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],og=Xe("arrow-right",Cj);/** + */const Mj=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],cg=Ye("arrow-right",Mj);/** * @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 Ej=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Aj=Xe("arrow-up-right",Ej);/** + */const Rj=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Dj=Ye("arrow-up-right",Rj);/** * @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 Tj=[["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"}]],Nj=Xe("blocks",Tj);/** + */const Lj=[["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"}]],Oj=Ye("blocks",Lj);/** * @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 jj=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],W8=Xe("book-open",jj);/** + */const Ij=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Y8=Ye("book-open",Ij);/** * @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 Mj=[["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"}]],Rj=Xe("boxes",Mj);/** + */const zj=[["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"}]],Bj=Ye("boxes",zj);/** * @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 Dj=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],Lj=Xe("calendar-days",Dj);/** + */const Hj=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],$j=Ye("calendar-days",Hj);/** * @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 Oj=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16c.5-2 1.5-7 4-7 2 0 2 3 4 3 2.5 0 4.5-5 5-7",key:"lw07rv"}]],Y8=Xe("chart-spline",Oj);/** + */const Fj=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16c.5-2 1.5-7 4-7 2 0 2 3 4 3 2.5 0 4.5-5 5-7",key:"lw07rv"}]],X8=Ye("chart-spline",Fj);/** * @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 Ij=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Oi=Xe("check",Ij);/** + */const Pj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Di=Ye("check",Pj);/** * @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 zj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zl=Xe("chevron-down",zj);/** + */const Uj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Bl=Ye("chevron-down",Uj);/** * @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 Bj=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],X8=Xe("chevron-left",Bj);/** + */const qj=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],K8=Ye("chevron-left",qj);/** * @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 Hj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ta=Xe("chevron-right",Hj);/** + */const Gj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ea=Ye("chevron-right",Gj);/** * @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 $j=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Fj=Xe("circle-alert",$j);/** + */const Vj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Wj=Ye("circle-alert",Vj);/** * @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 Pj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Uj=Xe("circle-question-mark",Pj);/** + */const Yj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Xj=Ye("circle-question-mark",Yj);/** * @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 qj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],K8=Xe("circle-stop",qj);/** + */const Kj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],Z8=Ye("circle-stop",Kj);/** * @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 Gj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Z8=Xe("circle-x",Gj);/** + */const Zj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Q8=Ye("circle-x",Zj);/** * @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 Vj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],Wj=Xe("clock-3",Vj);/** + */const Qj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],Jj=Ye("clock-3",Qj);/** * @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 Yj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Xj=Xe("clock",Yj);/** + */const eM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],tM=Ye("clock",eM);/** * @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 Kj=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Q8=Xe("code",Kj);/** + */const nM=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],J8=Ye("code",nM);/** * @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 Zj=[["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"}]],n_=Xe("copy",Zj);/** + */const rM=[["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"}]],s_=Ye("copy",rM);/** * @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 Qj=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],J8=Xe("corner-down-left",Qj);/** + */const iM=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],eS=Ye("corner-down-left",iM);/** * @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 Jj=[["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"}]],eM=Xe("cpu",Jj);/** + */const sM=[["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"}]],aM=Ye("cpu",sM);/** * @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 tM=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],nM=Xe("download",tM);/** + */const oM=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],lM=Ye("download",oM);/** * @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 rM=[["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"}]],eS=Xe("ellipsis",rM);/** + */const cM=[["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"}]],tS=Ye("ellipsis",cM);/** * @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 iM=[["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"}]],Cd=Xe("external-link",iM);/** + */const uM=[["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"}]],Ed=Ye("external-link",uM);/** * @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 sM=[["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"}]],tS=Xe("file-code",sM);/** + */const dM=[["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"}]],nS=Ye("file-code",dM);/** * @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 aM=[["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"}]],ah=Xe("file-text",aM);/** + */const hM=[["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"}]],oh=Ye("file-text",hM);/** * @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 oM=[["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:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]],lM=Xe("file-up",oM);/** + */const fM=[["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:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]],pM=Ye("file-up",fM);/** * @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 cM=[["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"}]],Eb=Xe("flask-conical",cM);/** + */const mM=[["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"}]],Nb=Ye("flask-conical",mM);/** * @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 uM=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 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.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],nS=Xe("folder-git-2",uM);/** + */const gM=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 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.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],rS=Ye("folder-git-2",gM);/** * @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 dM=[["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"}]],Ed=Xe("folder-open",dM);/** + */const bM=[["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"}]],Ad=Ye("folder-open",bM);/** * @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 hM=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["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"}]],fM=Xe("folder-plus",hM);/** + */const vM=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["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"}]],_M=Ye("folder-plus",vM);/** * @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 pM=[["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"}]],ap=Xe("folder-tree",pM);/** + */const xM=[["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"}]],lp=Ye("folder-tree",xM);/** * @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 mM=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],gM=Xe("funnel",mM);/** + */const yM=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],wM=Ye("funnel",yM);/** * @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 bM=[["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"}]],oh=Xe("git-branch",bM);/** + */const SM=[["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"}]],lh=Ye("git-branch",SM);/** * @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 vM=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],_M=Xe("git-commit-horizontal",vM);/** + */const kM=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],CM=Ye("git-commit-horizontal",kM);/** * @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 xM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],yM=Xe("globe",xM);/** + */const EM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],AM=Ye("globe",EM);/** * @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 wM=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],SM=Xe("history",wM);/** + */const TM=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],NM=Ye("history",TM);/** * @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 kM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],CM=Xe("info",kM);/** + */const jM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],MM=Ye("info",jM);/** * @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 EM=[["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"}]],AM=Xe("laptop",EM);/** + */const RM=[["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"}]],DM=Ye("laptop",RM);/** * @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 TM=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],NM=Xe("lightbulb",TM);/** + */const LM=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],OM=Ye("lightbulb",LM);/** * @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 jM=[["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"}]],n3=Xe("lock",jM);/** + */const IM=[["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"}]],s3=Ye("lock",IM);/** * @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 MM=[["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"}]],RM=Xe("maximize-2",MM);/** + */const zM=[["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"}]],BM=Ye("maximize-2",zM);/** * @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 DM=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],rS=Xe("message-square-quote",DM);/** + */const HM=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],iS=Ye("message-square-quote",HM);/** * @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 LM=[["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"}]],OM=Xe("minimize-2",LM);/** + */const $M=[["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"}]],FM=Ye("minimize-2",$M);/** * @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 IM=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],zM=Xe("monitor",IM);/** + */const PM=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],UM=Ye("monitor",PM);/** * @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 BM=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],HM=Xe("moon",BM);/** + */const qM=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],GM=Ye("moon",qM);/** * @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 $M=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],FM=Xe("mouse-pointer-click",$M);/** + */const VM=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],WM=Ye("mouse-pointer-click",VM);/** * @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 PM=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],r_=Xe("package",PM);/** + */const YM=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],a_=Ye("package",YM);/** * @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 UM=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],iS=Xe("panel-left",UM);/** + */const XM=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],sS=Ye("panel-left",XM);/** * @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 qM=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],GM=Xe("paperclip",qM);/** + */const KM=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],ZM=Ye("paperclip",KM);/** * @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 VM=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],op=Xe("pencil",VM);/** + */const QM=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],cp=Ye("pencil",QM);/** * @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 WM=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],i_=Xe("plus",WM);/** + */const JM=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],o_=Ye("plus",JM);/** * @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 YM=[["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"}]],lh=Xe("refresh-cw",YM);/** + */const eR=[["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"}]],ch=Ye("refresh-cw",eR);/** * @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 XM=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],KM=Xe("rotate-ccw",XM);/** + */const tR=[["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"}]],aS=Ye("rotate-cw",tR);/** * @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 ZM=[["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"}]],sS=Xe("rotate-cw",ZM);/** + */const nR=[["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"}]],l_=Ye("scroll-text",nR);/** * @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 QM=[["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"}]],s_=Xe("scroll-text",QM);/** + */const rR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],iR=Ye("search",rR);/** * @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 JM=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],eR=Xe("search",JM);/** + */const sR=[["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"}]],a3=Ye("server",sR);/** * @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 tR=[["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"}]],r3=Xe("server",tR);/** + */const aR=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],oR=Ye("settings-2",aR);/** * @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 nR=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],rR=Xe("settings-2",nR);/** + */const lR=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],cR=Ye("settings",lR);/** * @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 iR=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],sR=Xe("settings",iR);/** + */const uR=[["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"}]],dR=Ye("sliders-horizontal",uR);/** * @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 aR=[["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"}]],oR=Xe("sliders-horizontal",aR);/** + */const hR=[["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"}]],oS=Ye("square-terminal",hR);/** * @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 lR=[["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"}]],aS=Xe("square-terminal",lR);/** + */const fR=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],pR=Ye("sun",fR);/** * @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 cR=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],uR=Xe("sun",cR);/** + */const mR=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Wc=Ye("terminal",mR);/** * @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 dR=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Wc=Xe("terminal",dR);/** + */const gR=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],bR=Ye("toggle-right",gR);/** * @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 hR=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],fR=Xe("toggle-right",hR);/** + */const vR=[["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"}]],uh=Ye("trash-2",vR);/** * @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 pR=[["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"}]],ch=Xe("trash-2",pR);/** + */const _R=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],xR=Ye("triangle-alert",_R);/** * @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 mR=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],gR=Xe("triangle-alert",mR);/** + */const yR=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],wR=Ye("upload",yR);/** * @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 bR=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],vR=Xe("upload",bR);/** + */const SR=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],c_=Ye("users",SR);/** * @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 _R=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],oS=Xe("users",_R);/** - * @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 xR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Yr=Xe("x",xR),lg="demo_nanochat_v1",Nf="PROJECT.md",cg=e=>e.startsWith("demo_"),pd="chat_demo_nanochat_v1",lS="chat_demo_nanochat_figures_v1",cS="chat_demo_nanochat_literature_v1";function ls(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}async function Fa(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 Et=e=>fetch(e).then(t=>Fa(t)),It=(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=>Fa(n)),lp=(e,t)=>fetch(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(n=>Fa(n)),uS=(e,t)=>fetch(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(n=>Fa(n)),yR=()=>Et("/api/projects").then(e=>e.projects),wR=()=>Et("/api/settings/ui-state"),i3=e=>It("/api/settings/ui-state",e),SR=(e,t)=>It("/api/onboarding/complete",{...e,...t}),dS=(e="")=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return Et(`/api/project-path/status${t}`)},kR=()=>It("/api/project-path/pick").then(e=>e.path),CR=e=>It("/api/projects",e),hS=e=>Et(`/api/papers/search?q=${encodeURIComponent(e)}`).then(t=>t.papers),ER=()=>Et("/api/github/account"),AR=e=>Et(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`),TR=(e,t)=>Et(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(t)}`),Ab=e=>Et(`/api/papers/resolve?id=${encodeURIComponent(e)}`).then(t=>t.paper),NR=e=>It(`/api/projects/${e}/open`).then(t=>t.project),jR=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})`)}}),MR=e=>Et(`/api/projects/${e}/experiments`).then(t=>t.experiments),RR=e=>Et(`/api/projects/${e}/runs`).then(t=>t.runs),fS=()=>Et("/api/instances").then(e=>e.instances),pS=e=>It(`/api/runs/${e}/cancel`).then(()=>{}),DR=(e,t)=>Et(`/api/runs/${e}/log?offset=${t}`),LR=e=>Et(`/api/runs/${e}/diff`),OR=e=>Et(`/api/experiments/${e}/diff`),a_=(e,t=new URLSearchParams)=>(e.sessionId&&t.set("sessionId",e.sessionId),e.ref&&t.set("ref",e.ref),t),s3=(e,t,n={})=>Et(`/api/projects/${e}/file?${a_(n,new URLSearchParams({path:t}))}`),IR=(e,t,n={})=>`/api/projects/${e}/file/raw?${a_(n,new URLSearchParams({path:t}))}`,zR=e=>Et(`/api/files/abs?path=${encodeURIComponent(e)}`),BR=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,HR=(e,t,n,r={})=>uS(`/api/projects/${e}/file`,{path:t,content:n,sessionId:r.sessionId}),$R=(e,t,n={})=>It(`/api/projects/${e}/file/open`,{path:t,sessionId:n.sessionId}),Tb=(e,t={})=>{const n=a_(t).toString();return Et(`/api/projects/${e}/code-tree${n?`?${n}`:""}`)},mS=e=>Et(`/api/chat/sessions/${e}/worktree`),cp=(e,t,n)=>`https://github.com/${e}/${t}/tree/${n.split("/").map(encodeURIComponent).join("/")}`,FR=()=>Et("/api/settings/hf"),PR=e=>It("/api/settings/hf",{token:e}),UR=()=>Et("/api/update"),qR=()=>It("/api/update/apply"),GR=e=>It("/api/update/auto",{enabled:e}),VR=(e=!1)=>It("/api/update/install-cli",{force:e}),WR=()=>Et("/api/settings/k8s"),YR=e=>It("/api/settings/k8s",e),XR=()=>Et("/api/settings/modal"),KR=()=>It("/api/settings/modal/provision"),ZR=()=>Et("/api/settings/env").then(e=>e.vars),gS=(e,t)=>It("/api/settings/env",{key:e,value:t}).then(n=>n.vars),QR=e=>fetch(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(t=>Fa(t)).then(t=>t.vars),JR=()=>Et("/api/settings/data-dir"),eD=e=>It("/api/settings/data-dir/validate",{path:e}),tD=e=>It("/api/settings/data-dir/move",{path:e}),nD=()=>Et("/api/settings/ssh").then(e=>e.hosts),rD=e=>It("/api/settings/ssh/preflight",{host:e}),iD=()=>Et("/api/settings/slurm"),sD=e=>It("/api/settings/slurm",e),aD=e=>It("/api/settings/slurm/preflight",{host:e}),oD=()=>Et("/api/settings/ray"),lD=e=>It("/api/settings/ray",e),cD=e=>It("/api/settings/ray/preflight",{address:e??null}),uD=e=>Et(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`),bS=e=>It("/api/settings/compute/default",e),dD=()=>Et("/api/settings/local"),hD=()=>Et("/api/settings/openresearch"),a3=e=>Et(`/api/projects/${e}/files`),fD=(e,t)=>fetch(`/api/projects/${e}/files?path=${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>Fa(n)),uh=(e,t)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(t)}`,vS=512e3,pD=(e,t)=>{const n=new Uint8Array(e);if(n.includes(0))return{content:"",binary:!0,truncated:t};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(n,{stream:t}),binary:!1,truncated:t}}catch{return{content:"",binary:!0,truncated:t}}},_S=(e,t)=>fetch(uh(e,t),{headers:{Range:`bytes=0-${vS-1}`}}).then(n=>{var i;if(n.status===404)return null;if(n.status===416&&n.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!n.ok)throw new Error(`HTTP ${n.status}`);const r=Number((i=n.headers.get("content-range"))==null?void 0:i.split("/").pop());return n.arrayBuffer().then(a=>pD(a,Number.isFinite(r)&&r>a.byteLength))}),mD=(e,t)=>uS(`/api/projects/${e}/brief`,{content:t}),gD=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",bD=(e,t)=>fetch(uh(e,t),{method:"HEAD"}).then(n=>{if(n.status===404)return null;if(!n.ok)throw new Error(`HTTP ${n.status}`);const r=n.headers.get("x-openresearch-presentation");return{size:Number(n.headers.get("content-length"))||0,presentation:gD(r)?r:"download"}}),vD=e=>It("/api/settings/git/token",{token:e}),_D=()=>Et("/api/settings/profile"),xD=()=>Et("/api/settings/lit-sources"),yD=e=>It("/api/settings/lit-sources",e),o_=()=>Et("/api/settings/projects"),xS=(e,t)=>It("/api/settings/projects",{githubForNewProjects:e,githubDefaultPromptSeen:t}),wD=e=>Et(`/api/projects/${e}/git`),SD=e=>It(`/api/projects/${e}/git/init`),kD=e=>It(`/api/projects/${e}/github`),CD=e=>It(`/api/projects/${e}/github/disable`),jf=e=>e.displayName??wS(e.id),Nb="default";function up(e,t){var o,l,u;const n=e==null?void 0:e.models.find(d=>d.id===t),r=(n==null?void 0:n.reasoningLevels)??((o=e==null?void 0:e.options)==null?void 0:o.reasoningLevels)??[],i=n==null?void 0:n.defaultReasoningLevel,a=i&&r.some(d=>d.id===i)?i:r.some(d=>d.id===Nb)?Nb:((l=e==null?void 0:e.options)==null?void 0:l.defaultReasoningLevel)??((u=r[0])==null?void 0:u.id)??null;return{choices:r,defaultId:a}}function yS(e,t,n){if(!e)return n;const{choices:r,defaultId:i}=up(e,t);return r.length===0?Nb:n&&r.some(a=>a.id===n)?n:i}const Mf=(e=!1,t=!1)=>{const n=new URLSearchParams;e&&n.set("refresh","1"),t&&n.set("retry","1");const r=n.size>0?`?${n.toString()}`:"";return Et(`/api/harnesses${r}`).then(i=>i.harnesses)},ED=e=>Et(`/api/skills${e?`?project=${encodeURIComponent(e)}`:""}`).then(t=>t.skills),AD=e=>Et(`/api/user-skills${e?`?project=${encodeURIComponent(e)}`:""}`).then(t=>t.skills),TD=e=>It("/api/user-skills",e).then(t=>t.skill),ND=e=>{const t=new URLSearchParams({scope:e.scope,name:e.name});return e.projectId&&t.set("project",e.projectId),fetch(`/api/user-skills?${t.toString()}`,{method:"DELETE"}).then(n=>Fa(n))},jD=()=>Et("/api/harness-skills").then(e=>e.skills),MD=e=>It("/api/user-skills/import",e).then(t=>t.skill);function wS(e){const t=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),n=[],r=[];for(const i of t.split("-"))/^\d+(\.\d+)?$/.test(i)?r.push(i):(r.length&&n.push(r.splice(0).join(".")),n.push(i==="gpt"?"GPT":i.charAt(0).toUpperCase()+i.slice(1)));return r.length&&n.push(r.join(".")),n.join(" ")}const df=e=>Et(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`).then(t=>t.sessions),RD=(e,t,n={})=>It("/api/chat/sessions",{projectId:e,harness:t,...n}).then(r=>r.session),DD=e=>fetch(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(t=>Fa(t)),LD=(e,t)=>lp(`/api/chat/sessions/${e}`,{archived:t}).then(n=>n.session),OD=(e,t)=>lp(`/api/chat/sessions/${e}`,{title:t}).then(n=>n.session),ID=(e,t)=>lp(`/api/chat/sessions/${e}`,{planMode:t}).then(n=>n.session),zD=(e,t)=>lp(`/api/chat/sessions/${e}`,{permissionMode:t}).then(n=>n.session),md=e=>Et(`/api/chat/sessions/${e}/messages`).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),BD=(e,t)=>fetch(`/api/chat/sessions/${e}/queue/${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>Fa(n)),HD=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,o3=(e,t,n={},r,i,a)=>It(`/api/chat/sessions/${e}/message`,{text:t,model:n.model,permissionMode:n.permissionMode,planMode:n.planMode,reasoningLevel:n.reasoningLevel,images:r,annotations:i,mode:a}),$D=(e,t,n)=>It(`/api/chat/sessions/${e}/fork`,{messageId:t,text:n}),FD=(e,t)=>It(`/api/chat/sessions/${e}/branch`,{leafId:t}),PD=e=>It(`/api/chat/sessions/${e}/interrupt`),UD=(e,t)=>It(`/api/chat/sessions/${e}/respond`,t);function Zs(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 Rf(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 Lo(e){const t=["B","KB","MB","GB","TB"];let n=e,r=0;for(;n>=1024&&r10?`${e.slice(0,10)}…`:e}function l_(e){return e?typeof e.kind=="string"?e.kind:typeof e.type=="string"?e.type:"":""}function GD(e){return e?typeof e.flavor=="string"&&e.flavor?e.flavor:typeof e.manifest=="string"&&e.manifest?e.manifest:l_(e)==="ray_job"?"":typeof e.namespace=="string"&&e.namespace?e.namespace:"":""}function c_(){return h.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[h.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),h.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function hf(){return h.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[h.jsx(c_,{}),"OpenResearch"]})}function VD(e,t){if(!t)return e;const n=new Map(e.map(a=>[a.id,a]));let r=n.get(t);if(!r)return e;const i=[];for(;r;)i.push(r),r=r.parentId?n.get(r.parentId):void 0;return i.reverse()}function WD(e,t,n){var o;let r=e;for(;r&&r.role!=="user";)r=r.parentId?t.get(r.parentId):void 0;const i=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,a=(o=n.get(i))==null?void 0:o.filter(l=>l.role===e.role);return a!=null&&a.length?a:[e]}function YD(e,t,n,r){const i=e.filter(d=>!r(d.id)),a=new Map(i.map(d=>[d.id,d])),o=new Map;for(const d of i){const m=d.parentId??null,f=o.get(m);f?f.push(d):o.set(m,[d])}const l=new Set(t.map(d=>d.id)),u=new Map;for(const d of n){const m=WD(d,a,o),f=m.findIndex(g=>l.has(g.id));u.set(d.id,{count:m.length,index:f,prevId:f>0?m[f-1].id:void 0,nextId:f{n.delete(t),n.size===0&&ff.delete(e)}}function KD(e){var t;(t=ff.get(e.runId))==null||t.forEach(n=>n(e))}const jb=new Set;function Ad(e){return jb.add(e),()=>{jb.delete(e)}}function Co(e){jb.forEach(t=>t(e))}const Mb=new Set;function u_(e){return Mb.add(e),()=>{Mb.delete(e)}}function c3(e){Mb.forEach(t=>t(e))}const Rb=new Set;function ZD(e){return Rb.add(e),()=>{Rb.delete(e)}}function ug(e){Rb.forEach(t=>t(e))}const Db=new Set;function QD(e){return Db.add(e),()=>{Db.delete(e)}}function JD(e){Db.forEach(t=>t(e))}function eL(e){const t=R.useRef(e);t.current=e,R.useEffect(()=>{const n=new EventSource("/api/events");let r=!1;n.onerror=()=>{r=!0},n.onopen=()=>{var a,o;r&&(Co({type:"reconnected"}),c3({harness:"*",authState:"unknown"}),(o=(a=t.current).onReconnect)==null||o.call(a)),r=!0};const i=a=>{try{return JSON.parse(a.data)}catch{return null}};return n.addEventListener("run.updated",a=>{const o=i(a);o!=null&&o.run&&t.current.onRun(o.run)}),n.addEventListener("experiment.updated",a=>{const o=i(a);o!=null&&o.experiment&&t.current.onExperiment(o.experiment)}),n.addEventListener("project.updated",a=>{const o=i(a);o!=null&&o.project&&t.current.onProject(o.project)}),n.addEventListener("files.updated",a=>{var l,u;const o=i(a);o!=null&&o.projectId&&((u=(l=t.current).onArtifacts)==null||u.call(l,o.projectId))}),n.addEventListener("run.log",a=>{const o=i(a);o!=null&&o.runId&&KD(o)}),n.addEventListener("chat.session",a=>{const o=i(a);o!=null&&o.session&&Co({type:"session",session:o.session})}),n.addEventListener("chat.session.deleted",a=>{const o=i(a);o!=null&&o.sessionId&&Co({type:"sessionDeleted",sessionId:o.sessionId})}),n.addEventListener("chat.message",a=>{const o=i(a);o!=null&&o.message&&Co({type:"message",sessionId:o.sessionId,message:o.message})}),n.addEventListener("chat.busy",a=>{const o=i(a);o!=null&&o.sessionId&&Co({type:"busy",sessionId:o.sessionId,busy:o.busy})}),n.addEventListener("chat.usage",a=>{const o=i(a);o!=null&&o.sessionId&&o.usage&&Co({type:"usage",sessionId:o.sessionId,usage:o.usage})}),n.addEventListener("chat.queued",a=>{const o=i(a);o!=null&&o.sessionId&&Co({type:"queued",sessionId:o.sessionId,items:o.items??[]})}),n.addEventListener("chat.branch",a=>{const o=i(a);o!=null&&o.sessionId&&Co({type:"branch",sessionId:o.sessionId,activeLeafId:o.activeLeafId??null})}),n.addEventListener("harness.auth",a=>{const o=i(a);o!=null&&o.harness&&o.authState&&c3(o)}),n.addEventListener("datadir.move.progress",a=>{const o=i(a);o&&ug({type:"progress",...o})}),n.addEventListener("datadir.move.done",a=>{const o=i(a);o&&ug({type:"done",path:o.path,oldPathLeft:o.oldPathLeft})}),n.addEventListener("datadir.move.error",a=>{const o=i(a);o&&ug({type:"error",error:o.error})}),n.addEventListener("update.status",a=>{const o=i(a);o&&JD(o)}),()=>n.close()},[])}const tL=` + */const kR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Vr=Ye("x",kR),ug="demo_nanochat_v1",jf="PROJECT.md",dg=e=>e.startsWith("demo_"),md="chat_demo_nanochat_v1",lS="chat_demo_nanochat_figures_v1",cS="chat_demo_nanochat_literature_v1";function as(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}async function Fa(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 Et=e=>fetch(e).then(t=>Fa(t)),Ot=(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=>Fa(n)),up=(e,t)=>fetch(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(n=>Fa(n)),uS=(e,t)=>fetch(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(n=>Fa(n)),CR=()=>Et("/api/projects").then(e=>e.projects),ER=()=>Et("/api/settings/ui-state"),o3=e=>Ot("/api/settings/ui-state",e),AR=(e,t)=>Ot("/api/onboarding/complete",{...e,...t}),dS=(e="")=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return Et(`/api/project-path/status${t}`)},TR=()=>Ot("/api/project-path/pick").then(e=>e.path),NR=e=>Ot("/api/projects",e),hS=e=>Et(`/api/papers/search?q=${encodeURIComponent(e)}`).then(t=>t.papers),jR=()=>Et("/api/github/account"),MR=e=>Et(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`),RR=(e,t)=>Et(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(t)}`),jb=e=>Et(`/api/papers/resolve?id=${encodeURIComponent(e)}`).then(t=>t.paper),DR=e=>Ot(`/api/projects/${e}/open`).then(t=>t.project),LR=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})`)}}),OR=e=>Et(`/api/projects/${e}/experiments`).then(t=>t.experiments),IR=e=>Et(`/api/projects/${e}/runs`).then(t=>t.runs),fS=()=>Et("/api/instances").then(e=>e.instances),pS=e=>Ot(`/api/runs/${e}/cancel`).then(()=>{}),zR=(e,t)=>Et(`/api/runs/${e}/log?offset=${t}`),BR=e=>Et(`/api/runs/${e}/diff`),HR=e=>Et(`/api/experiments/${e}/diff`),u_=(e,t=new URLSearchParams)=>(e.sessionId&&t.set("sessionId",e.sessionId),e.ref&&t.set("ref",e.ref),t),l3=(e,t,n={})=>Et(`/api/projects/${e}/file?${u_(n,new URLSearchParams({path:t}))}`),$R=(e,t,n={})=>`/api/projects/${e}/file/raw?${u_(n,new URLSearchParams({path:t}))}`,FR=e=>Et(`/api/files/abs?path=${encodeURIComponent(e)}`),PR=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,UR=(e,t,n,r={})=>uS(`/api/projects/${e}/file`,{path:t,content:n,sessionId:r.sessionId}),qR=(e,t,n={})=>Ot(`/api/projects/${e}/file/open`,{path:t,sessionId:n.sessionId}),Mb=(e,t={})=>{const n=u_(t).toString();return Et(`/api/projects/${e}/code-tree${n?`?${n}`:""}`)},mS=e=>Et(`/api/chat/sessions/${e}/worktree`),dp=(e,t,n)=>`https://github.com/${e}/${t}/tree/${n.split("/").map(encodeURIComponent).join("/")}`,GR=()=>Et("/api/settings/hf"),VR=e=>Ot("/api/settings/hf",{token:e}),WR=()=>Et("/api/update"),YR=()=>Ot("/api/update/apply"),XR=e=>Ot("/api/update/auto",{enabled:e}),KR=(e=!1)=>Ot("/api/update/install-cli",{force:e}),ZR=()=>Et("/api/settings/k8s"),QR=e=>Ot("/api/settings/k8s",e),JR=()=>Et("/api/settings/modal"),eD=()=>Ot("/api/settings/modal/provision"),tD=()=>Et("/api/settings/env").then(e=>e.vars),gS=(e,t)=>Ot("/api/settings/env",{key:e,value:t}).then(n=>n.vars),nD=e=>fetch(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(t=>Fa(t)).then(t=>t.vars),rD=()=>Et("/api/settings/data-dir"),iD=e=>Ot("/api/settings/data-dir/validate",{path:e}),sD=e=>Ot("/api/settings/data-dir/move",{path:e}),aD=()=>Et("/api/settings/ssh").then(e=>e.hosts),oD=e=>Ot("/api/settings/ssh/preflight",{host:e}),lD=()=>Et("/api/settings/slurm"),cD=e=>Ot("/api/settings/slurm",e),uD=e=>Ot("/api/settings/slurm/preflight",{host:e}),dD=()=>Et("/api/settings/ray"),hD=e=>Ot("/api/settings/ray",e),fD=e=>Ot("/api/settings/ray/preflight",{address:e??null}),pD=e=>Et(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`),bS=e=>Ot("/api/settings/compute/default",e),mD=()=>Et("/api/settings/local"),gD=()=>Et("/api/settings/openresearch"),c3=e=>Et(`/api/projects/${e}/files`),bD=(e,t)=>fetch(`/api/projects/${e}/files?path=${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>Fa(n)),dh=(e,t)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(t)}`,vS=512e3,vD=(e,t)=>{const n=new Uint8Array(e);if(n.includes(0))return{content:"",binary:!0,truncated:t};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(n,{stream:t}),binary:!1,truncated:t}}catch{return{content:"",binary:!0,truncated:t}}},_S=(e,t)=>fetch(dh(e,t),{headers:{Range:`bytes=0-${vS-1}`}}).then(n=>{var i;if(n.status===404)return null;if(n.status===416&&n.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!n.ok)throw new Error(`HTTP ${n.status}`);const r=Number((i=n.headers.get("content-range"))==null?void 0:i.split("/").pop());return n.arrayBuffer().then(a=>vD(a,Number.isFinite(r)&&r>a.byteLength))}),_D=(e,t)=>uS(`/api/projects/${e}/brief`,{content:t}),xD=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",yD=(e,t)=>fetch(dh(e,t),{method:"HEAD"}).then(n=>{if(n.status===404)return null;if(!n.ok)throw new Error(`HTTP ${n.status}`);const r=n.headers.get("x-openresearch-presentation");return{size:Number(n.headers.get("content-length"))||0,presentation:xD(r)?r:"download"}}),wD=e=>Ot("/api/settings/git/token",{token:e}),SD=()=>Et("/api/settings/profile"),kD=()=>Et("/api/settings/lit-sources"),CD=e=>Ot("/api/settings/lit-sources",e),d_=()=>Et("/api/settings/projects"),xS=(e,t)=>Ot("/api/settings/projects",{githubForNewProjects:e,githubDefaultPromptSeen:t}),ED=e=>Et(`/api/projects/${e}/git`),AD=e=>Ot(`/api/projects/${e}/git/init`),TD=e=>Ot(`/api/projects/${e}/github`),ND=e=>Ot(`/api/projects/${e}/github/disable`),Mf=e=>e.displayName??wS(e.id),Rb="default";function hp(e,t){var o,l,c;const n=e==null?void 0:e.models.find(d=>d.id===t),r=(n==null?void 0:n.reasoningLevels)??((o=e==null?void 0:e.options)==null?void 0:o.reasoningLevels)??[],i=n==null?void 0:n.defaultReasoningLevel,a=i&&r.some(d=>d.id===i)?i:r.some(d=>d.id===Rb)?Rb:((l=e==null?void 0:e.options)==null?void 0:l.defaultReasoningLevel)??((c=r[0])==null?void 0:c.id)??null;return{choices:r,defaultId:a}}function yS(e,t,n){if(!e)return n;const{choices:r,defaultId:i}=hp(e,t);return r.length===0?Rb:n&&r.some(a=>a.id===n)?n:i}const Rf=(e=!1,t=!1)=>{const n=new URLSearchParams;e&&n.set("refresh","1"),t&&n.set("retry","1");const r=n.size>0?`?${n.toString()}`:"";return Et(`/api/harnesses${r}`).then(i=>i.harnesses)},jD=e=>Et(`/api/skills${e?`?project=${encodeURIComponent(e)}`:""}`).then(t=>t.skills),MD=e=>Et(`/api/user-skills${e?`?project=${encodeURIComponent(e)}`:""}`).then(t=>t.skills),RD=e=>Ot("/api/user-skills",e).then(t=>t.skill),DD=e=>{const t=new URLSearchParams({scope:e.scope,name:e.name});return e.projectId&&t.set("project",e.projectId),fetch(`/api/user-skills?${t.toString()}`,{method:"DELETE"}).then(n=>Fa(n))},LD=()=>Et("/api/harness-skills").then(e=>e.skills),OD=e=>Ot("/api/user-skills/import",e).then(t=>t.skill);function wS(e){const t=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),n=[],r=[];for(const i of t.split("-"))/^\d+(\.\d+)?$/.test(i)?r.push(i):(r.length&&n.push(r.splice(0).join(".")),n.push(i==="gpt"?"GPT":i.charAt(0).toUpperCase()+i.slice(1)));return r.length&&n.push(r.join(".")),n.join(" ")}const hf=e=>Et(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`).then(t=>t.sessions),ID=(e,t,n={})=>Ot("/api/chat/sessions",{projectId:e,harness:t,...n}).then(r=>r.session),zD=e=>fetch(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(t=>Fa(t)),BD=(e,t)=>up(`/api/chat/sessions/${e}`,{archived:t}).then(n=>n.session),HD=(e,t)=>up(`/api/chat/sessions/${e}`,{title:t}).then(n=>n.session),$D=(e,t)=>up(`/api/chat/sessions/${e}`,{planMode:t}).then(n=>n.session),FD=(e,t)=>up(`/api/chat/sessions/${e}`,{permissionMode:t}).then(n=>n.session),gd=e=>Et(`/api/chat/sessions/${e}/messages`).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),PD=(e,t)=>fetch(`/api/chat/sessions/${e}/queue/${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>Fa(n)),UD=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,u3=(e,t,n={},r,i,a)=>Ot(`/api/chat/sessions/${e}/message`,{text:t,model:n.model,permissionMode:n.permissionMode,planMode:n.planMode,reasoningLevel:n.reasoningLevel,images:r,annotations:i,mode:a}),qD=(e,t,n)=>Ot(`/api/chat/sessions/${e}/fork`,{messageId:t,text:n}),GD=(e,t)=>Ot(`/api/chat/sessions/${e}/branch`,{leafId:t}),VD=e=>Ot(`/api/chat/sessions/${e}/interrupt`),WD=(e,t)=>Ot(`/api/chat/sessions/${e}/respond`,t);function Ks(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 Df(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 Lo(e){const t=["B","KB","MB","GB","TB"];let n=e,r=0;for(;n>=1024&&r10?`${e.slice(0,10)}…`:e}function h_(e){return e?typeof e.kind=="string"?e.kind:typeof e.type=="string"?e.type:"":""}function XD(e){return e?typeof e.flavor=="string"&&e.flavor?e.flavor:typeof e.manifest=="string"&&e.manifest?e.manifest:h_(e)==="ray_job"?"":typeof e.namespace=="string"&&e.namespace?e.namespace:"":""}function f_(){return h.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[h.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),h.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function ff(){return h.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[h.jsx(f_,{}),"OpenResearch"]})}function KD(e,t){if(!t)return e;const n=new Map(e.map(a=>[a.id,a]));let r=n.get(t);if(!r)return e;const i=[];for(;r;)i.push(r),r=r.parentId?n.get(r.parentId):void 0;return i.reverse()}function ZD(e,t,n){var o;let r=e;for(;r&&r.role!=="user";)r=r.parentId?t.get(r.parentId):void 0;const i=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,a=(o=n.get(i))==null?void 0:o.filter(l=>l.role===e.role);return a!=null&&a.length?a:[e]}function QD(e,t,n,r){const i=e.filter(d=>!r(d.id)),a=new Map(i.map(d=>[d.id,d])),o=new Map;for(const d of i){const m=d.parentId??null,f=o.get(m);f?f.push(d):o.set(m,[d])}const l=new Set(t.map(d=>d.id)),c=new Map;for(const d of n){const m=ZD(d,a,o),f=m.findIndex(g=>l.has(g.id));c.set(d.id,{count:m.length,index:f,prevId:f>0?m[f-1].id:void 0,nextId:f{n.delete(t),n.size===0&&pf.delete(e)}}function eL(e){var t;(t=pf.get(e.runId))==null||t.forEach(n=>n(e))}const Db=new Set;function Td(e){return Db.add(e),()=>{Db.delete(e)}}function Co(e){Db.forEach(t=>t(e))}const Lb=new Set;function p_(e){return Lb.add(e),()=>{Lb.delete(e)}}function h3(e){Lb.forEach(t=>t(e))}const Ob=new Set;function tL(e){return Ob.add(e),()=>{Ob.delete(e)}}function hg(e){Ob.forEach(t=>t(e))}const Ib=new Set;function nL(e){return Ib.add(e),()=>{Ib.delete(e)}}function rL(e){Ib.forEach(t=>t(e))}function iL(e){const t=R.useRef(e);t.current=e,R.useEffect(()=>{const n=new EventSource("/api/events");let r=!1;n.onerror=()=>{r=!0},n.onopen=()=>{var a,o;r&&(Co({type:"reconnected"}),h3({harness:"*",authState:"unknown"}),(o=(a=t.current).onReconnect)==null||o.call(a)),r=!0};const i=a=>{try{return JSON.parse(a.data)}catch{return null}};return n.addEventListener("run.updated",a=>{const o=i(a);o!=null&&o.run&&t.current.onRun(o.run)}),n.addEventListener("experiment.updated",a=>{const o=i(a);o!=null&&o.experiment&&t.current.onExperiment(o.experiment)}),n.addEventListener("project.updated",a=>{const o=i(a);o!=null&&o.project&&t.current.onProject(o.project)}),n.addEventListener("files.updated",a=>{var l,c;const o=i(a);o!=null&&o.projectId&&((c=(l=t.current).onArtifacts)==null||c.call(l,o.projectId))}),n.addEventListener("run.log",a=>{const o=i(a);o!=null&&o.runId&&eL(o)}),n.addEventListener("chat.session",a=>{const o=i(a);o!=null&&o.session&&Co({type:"session",session:o.session})}),n.addEventListener("chat.session.deleted",a=>{const o=i(a);o!=null&&o.sessionId&&Co({type:"sessionDeleted",sessionId:o.sessionId})}),n.addEventListener("chat.message",a=>{const o=i(a);o!=null&&o.message&&Co({type:"message",sessionId:o.sessionId,message:o.message})}),n.addEventListener("chat.busy",a=>{const o=i(a);o!=null&&o.sessionId&&Co({type:"busy",sessionId:o.sessionId,busy:o.busy})}),n.addEventListener("chat.usage",a=>{const o=i(a);o!=null&&o.sessionId&&o.usage&&Co({type:"usage",sessionId:o.sessionId,usage:o.usage})}),n.addEventListener("chat.queued",a=>{const o=i(a);o!=null&&o.sessionId&&Co({type:"queued",sessionId:o.sessionId,items:o.items??[]})}),n.addEventListener("chat.branch",a=>{const o=i(a);o!=null&&o.sessionId&&Co({type:"branch",sessionId:o.sessionId,activeLeafId:o.activeLeafId??null})}),n.addEventListener("harness.auth",a=>{const o=i(a);o!=null&&o.harness&&o.authState&&h3(o)}),n.addEventListener("datadir.move.progress",a=>{const o=i(a);o&&hg({type:"progress",...o})}),n.addEventListener("datadir.move.done",a=>{const o=i(a);o&&hg({type:"done",path:o.path,oldPathLeft:o.oldPathLeft})}),n.addEventListener("datadir.move.error",a=>{const o=i(a);o&&hg({type:"error",error:o.error})}),n.addEventListener("update.status",a=>{const o=i(a);o&&rL(o)}),()=>n.close()},[])}const sL=` -`,nL='',rL=` +`,aL='',oL=` -`,d_={alphaxiv:"alphaXiv",openalex:"OpenAlex",biorxiv:"bioRxiv"},iL={alphaxiv:tL,openalex:rL,biorxiv:nL};function h_({source:e,size:t=16,decorative:n=!1,className:r=""}){return h.jsx("span",{className:`lit-logo flex-none inline-flex items-center justify-center p-[1.5px] box-border bg-white rounded-[3px] shadow-[0_0_0_1px_rgba(0,_0,_0,_0.08)] [&_svg]:w-full [&_svg]:h-full [&_svg]:block ${r}`,style:{width:t,height:t},...n?{"aria-hidden":!0}:{role:"img","aria-label":d_[e]},dangerouslySetInnerHTML:{__html:iL[e]}})}function u3(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function sL(e){const t=e.trim(),n=t.toLowerCase();if(n.includes("biorxiv.org"))return"biorxiv";if(n.includes("openalex.org"))return"openalex";const r=t.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const i=t.split("/").pop()??"";return/^W\d+$/i.test(i)?"openalex":"alphaxiv"}function aL(e){const n=e.trim().replace(/^https?:\/\/doi\.org\//i,"").replace(/^doi:/i,"").match(/10\.\d+\/[^\s?#]+/);return n?n[0].replace(/[.,)]+$/,"").replace(/v\d+(\.[a-z][a-z-]*)*$/i,""):null}function oL(e,t){const n=t.trim();if(e==="alphaxiv"){const a=(n.split(/[?#]/)[0].split("/").pop()||n).replace(/\.(pdf|md)$/i,"");return`https://www.alphaxiv.org/abs/${encodeURIComponent(a)}`}const r=aL(n);if(r)return`https://doi.org/${r}`;if(e==="openalex"){const i=n.split("/").pop()||n;return`https://openalex.org/${encodeURIComponent(i)}`}return`https://doi.org/${n}`}function lL(e){const t=[];let n="",r=!1,i=null;for(const a of e){if(i){a===i?i=null:n+=a,r=!0;continue}if(a==='"'||a==="'"){i=a,r=!0;continue}if(a===" "||a===" "||a===` -`){r&&(t.push(n),n="",r=!1);continue}if(a==="|"||a===";"||a===">"||a==="&")break;n+=a,r=!0}return r&&t.push(n),t}function cL(e){const t=e.match(/(?:^|[\s;&|(])orx\s+(lit|paper)\b/);if(!t)return null;const n=t[1],r=e.slice((t.index??0)+t[0].length),i=lL(r);let a,o;for(let l=0;l_&:first-child]:mr-3 [&.active]:text-primary","[&.active]:bg-surface"].join(" "),nr=[dh,"w-7 h-7"].join(" "),ui=["model-item [&.danger]:text-accent-red [&.danger:hover]:text-accent-red flex","items-center justify-between gap-2 w-full text-left py-1.5 px-2","text-md rounded-sm [&:hover]:bg-surface","[&_.model-id]:block [&_.model-id]:font-mono [&_.model-id]:text-2xs","[&_.model-id]:text-muted"].join(" "),pr=["settings-loading flex items-center gap-2 text-subtext text-md","py-1 px-0"].join(" "),Pt=["spinner w-[13px] h-[13px] border-2 border-border border-t-primary","rounded-full animate-[spin_0.8s_linear_infinite] shrink-0"].join(" "),rn="mono font-mono text-sm",ja="tab-body flex-1 min-h-0 relative flex flex-col",zc="code-tab-body flex-1 min-h-0 overflow-auto bg-background",ws=["code-tab-note py-2 px-4 text-sm text-muted","border-b border-b-border-variant shrink-0"].join(" "),Td=["title [.chat-header_&]:text-base [.chat-header_&]:font-semibold","[.chat-header_&]:text-text [.chat-header_&]:flex-1 [.chat-header_&]:min-w-0","[.chat-header_&]:overflow-hidden [.chat-header_&]:text-ellipsis","[.chat-header_&]:whitespace-nowrap"].join(" "),di=["btn inline-flex items-center justify-center gap-1.5 py-1.5 px-3.5","text-sm font-semibold border border-border","rounded-md bg-background text-text whitespace-nowrap","transition-[background,border-color,color] duration-120 ease-standard","[&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight","[&:disabled]:opacity-45 [&:disabled]:cursor-default [&.primary]:bg-primary","[&.primary]:border-primary [&.primary]:text-background","[&.primary:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))]","[&.primary:hover:not(:disabled)]:border-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))]","[&.primary:active:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_80%,_var(--text))]","[&.primary:active:not(:disabled)]:border-[color-mix(in_oklab,_var(--primary)_80%,_var(--text))]","[&.danger]:text-accent-red","[&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_8%,_transparent)]","[&.danger:active:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_14%,_transparent)]","[&.ghost]:border-transparent [&.ghost]:text-text","[&.ghost:hover:not(:disabled)]:text-text [&.ghost:hover:not(:disabled)]:bg-surface","[&.sm]:py-[3px] [&.sm]:px-[9px] [&.sm]:text-xs [&.sm]:rounded-sm"].join(" "),rr=`${di} sm`,Zr=`${di} primary`,dg=`${di} ghost`,uL=`${rr} primary`,hr=["badge inline-flex items-center font-sans text-xs","font-medium py-px px-[7px] border border-border","rounded-sm text-text [&.ok]:text-accent-green","[&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle","[&.err]:text-accent-red [&.err]:border-accent-red","[&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber","[&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle"].join(" "),Ii=`${hr} err`,Ns=`${hr} ok`,f_=`${hr} warn`,p_=["status-badge inline-flex items-center gap-1.5 text-sm","font-medium text-text whitespace-nowrap [&_.dot]:w-[7px]","[&_.dot]:h-[7px] [&_.dot]:rounded-full [&_.dot]:bg-current","[&_.dot]:shrink-0 [&.live_.dot]:animate-[or-pulse_1.2s_ease-in-out_infinite]","[&.st-done_.dot]:text-accent-green [&.st-done_>_svg]:text-accent-green","[&.st-failed_.dot]:text-accent-red [&.st-running_.dot]:text-accent-teal","[&.st-starting_.dot]:text-accent-amber [&.st-cancelling_.dot]:text-accent-orange","[&.st-cancelled_.dot]:text-accent-orange [&.st-editing_.dot]:text-accent-purple","[&.st-idle_.dot]:text-muted"].join(" "),m_=["settings-switch relative flex-none w-9.5 h-5.5 border border-border rounded-full","bg-surface transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:top-[3px] [&_span]:left-[3px] [&_span]:w-3.5 [&_span]:h-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background]","[&_span]:duration-120 [&_span]:ease-standard [&.on]:border-primary [&.on]:bg-primary","[&.on_span]:bg-background [&.on_span]:translate-x-4 [&:disabled]:opacity-45","[&:disabled]:cursor-default [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid","[&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2"].join(" "),dL=["alphaxiv","openalex","biorxiv"];let d3=null;function hL(){const[e,t]=R.useState(d3),[n,r]=R.useState(!1),i=o=>{d3=o,t(o)};R.useEffect(()=>{xD().then(i).catch(()=>{})},[]);const a=o=>{!e||n||(r(!0),yD({...e,[o]:!e[o]}).then(i).catch(()=>{}).finally(()=>r(!1)))};return e?h.jsx("div",{className:"flex flex-col",children:dL.map(o=>{const l=e[o];return h.jsxs("button",{type:"button",role:"switch","aria-checked":l,className:ui,disabled:n,onClick:()=>a(o),children:[h.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[h.jsx(h_,{source:o,size:16,decorative:!0}),d_[o]]}),h.jsx("span",{className:`${m_} ${l?"on":""}`,"aria-hidden":"true",children:h.jsx("span",{})})]},o)})}):h.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:"Loading…"})}function hg(e,t){if(!e)throw new Error("Assertion Error")}function ul(e,t){if(e==null)throw new Error(`Unexpected ${e}`);return e}function fL(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 pL(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` -`}]}function mL(e,t){const n=t.value?t.value+` -`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function gL(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bL(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Xr=Uo(/[A-Za-z]/),Lr=Uo(/[\dA-Za-z]/),vL=Uo(/[#-'*+\--9=?A-Z^-~]/);function Df(e){return e!==null&&(e<32||e===127)}const Lb=Uo(/\d/),_L=Uo(/[\dA-Fa-f]/),xL=Uo(/[!-/:-@[-`{-~]/);function st(e){return e!==null&&e<-2}function hn(e){return e!==null&&(e<0||e===32)}function Rt(e){return e===-2||e===-1||e===32}const dp=Uo(new RegExp("\\p{P}|\\p{S}","u")),jl=Uo(/\s/);function Uo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function au(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function yL(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=au(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,d),e.applyData(t,d)}function wL(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 SL(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function SS(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 i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function kL(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return SS(e,t);const i={src:au(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function CL(e,t){const n={src:au(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 EL(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 AL(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return SS(e,t);const i={href:au(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function TL(e,t){const n={href:au(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 NL(e,t,n){const r=e.all(t),i=n?jL(n):kS(t),a={},o=[];if(typeof t.checked=="boolean"){const m=r[0];let f;m&&m.type==="element"&&m.tagName==="p"?f=m:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l1}function ML(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0&&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 OL(e){const t=g_(e),n=CS(e);if(t&&n)return{start:t,end:n}}function IL(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=g_(t.children[1]),u=CS(t.children[t.children.length-1]);l&&u&&(o.position={start:l,end:u}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function zL(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let u=-1;const d=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(p3(t.slice(i),i>0,!1)),a.join("")}function p3(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===h3||a===f3;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===h3||a===f3;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function $L(e,t){const n={type:"text",value:HL(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function FL(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const PL={blockquote:fL,break:pL,code:mL,delete:gL,emphasis:bL,footnoteReference:yL,heading:wL,html:SL,imageReference:kL,image:CL,inlineCode:EL,linkReference:AL,link:TL,listItem:NL,list:ML,paragraph:RL,root:DL,strong:LL,table:IL,tableCell:BL,tableRow:zL,text:$L,thematicBreak:FL,toml:R0,yaml:R0,definition:R0,footnoteDefinition:R0};function R0(){}const AS=-1,hp=0,gd=1,Lf=2,b_=3,v_=4,__=5,x_=6,TS=7,NS=8,UL=typeof self=="object"?self:globalThis,m3=(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 UL[e](t)},qL=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case hp:case AS:return n(o,i);case gd:{const l=n([],i);for(const u of o)l.push(r(u));return l}case Lf:{const l=n({},i);for(const[u,d]of o)l[r(u)]=r(d);return l}case b_:return n(new Date(o),i);case v_:{const{source:l,flags:u}=o;return n(new RegExp(l,u),i)}case __:{const l=n(new Map,i);for(const[u,d]of o)l.set(r(u),r(d));return l}case x_:{const l=n(new Set,i);for(const u of o)l.add(r(u));return l}case TS:{const{name:l,message:u}=o;return n(m3(l,u),i)}case NS:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(m3(a,o),i)};return r},g3=e=>qL(new Map,e)(0),ml="",{toString:GL}={},{keys:VL}=Object,Ju=e=>{const t=typeof e;if(t!=="object"||!e)return[hp,t];const n=GL.call(e).slice(8,-1);switch(n){case"Array":return[gd,ml];case"Object":return[Lf,ml];case"Date":return[b_,ml];case"RegExp":return[v_,ml];case"Map":return[__,ml];case"Set":return[x_,ml];case"DataView":return[gd,n]}return n.includes("Array")?[gd,n]:n.includes("Error")?[TS,n]:[Lf,n]},D0=([e,t])=>e===hp&&(t==="function"||t==="symbol"),WL=(e,t,n,r)=>{const i=(o,l)=>{const u=r.push(o)-1;return n.set(l,u),u},a=o=>{if(n.has(o))return n.get(o);let[l,u]=Ju(o);switch(l){case hp:{let m=o;switch(u){case"bigint":l=NS,m=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);m=null;break;case"undefined":return i([AS],o)}return i([l,m],o)}case gd:{if(u){let g=o;return u==="DataView"?g=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(g=new Uint8Array(o)),i([u,[...g]],o)}const m=[],f=i([l,m],o);for(const g of o)m.push(a(g));return f}case Lf:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const m=[],f=i([l,m],o);for(const g of VL(o))(e||!D0(Ju(o[g])))&&m.push([a(g),a(o[g])]);return f}case b_:return i([l,isNaN(o.getTime())?ml:o.toISOString()],o);case v_:{const{source:m,flags:f}=o;return i([l,{source:m,flags:f}],o)}case __:{const m=[],f=i([l,m],o);for(const[g,b]of o)(e||!(D0(Ju(g))||D0(Ju(b))))&&m.push([a(g),a(b)]);return f}case x_:{const m=[],f=i([l,m],o);for(const g of o)(e||!D0(Ju(g)))&&m.push(a(g));return f}}const{message:d}=o;return i([l,{name:u,message:d}],o)};return a},b3=(e,{json:t,lossy:n}={})=>{const r=[];return WL(!(t||n),!!t,new Map,r)(e),r},Of=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?g3(b3(e,t)):structuredClone(e):(e,t)=>g3(b3(e,t));function YL(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 XL(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function KL(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||YL,r=e.options.footnoteBackLabel||XL,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u0&&k.push({type:"text",value:" "});let w=typeof n=="string"?n:n(u,b);typeof w=="string"&&(w={type:"text",value:w}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,b),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const x=m[m.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const w=x.children[x.children.length-1];w&&w.type==="text"?w.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...k)}else m.push(...k);const _={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(m,!0)};e.patch(d,_),l.push(_)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Of(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`,m_={alphaxiv:"alphaXiv",openalex:"OpenAlex",biorxiv:"bioRxiv"},lL={alphaxiv:sL,openalex:oL,biorxiv:aL};function g_({source:e,size:t=16,decorative:n=!1,className:r=""}){return h.jsx("span",{className:`lit-logo flex-none inline-flex items-center justify-center p-[1.5px] box-border bg-white rounded-[3px] shadow-[0_0_0_1px_rgba(0,_0,_0,_0.08)] [&_svg]:w-full [&_svg]:h-full [&_svg]:block ${r}`,style:{width:t,height:t},...n?{"aria-hidden":!0}:{role:"img","aria-label":m_[e]},dangerouslySetInnerHTML:{__html:lL[e]}})}function f3(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function cL(e){const t=e.trim(),n=t.toLowerCase();if(n.includes("biorxiv.org"))return"biorxiv";if(n.includes("openalex.org"))return"openalex";const r=t.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const i=t.split("/").pop()??"";return/^W\d+$/i.test(i)?"openalex":"alphaxiv"}function uL(e){const n=e.trim().replace(/^https?:\/\/doi\.org\//i,"").replace(/^doi:/i,"").match(/10\.\d+\/[^\s?#]+/);return n?n[0].replace(/[.,)]+$/,"").replace(/v\d+(\.[a-z][a-z-]*)*$/i,""):null}function dL(e,t){const n=t.trim();if(e==="alphaxiv"){const a=(n.split(/[?#]/)[0].split("/").pop()||n).replace(/\.(pdf|md)$/i,"");return`https://www.alphaxiv.org/abs/${encodeURIComponent(a)}`}const r=uL(n);if(r)return`https://doi.org/${r}`;if(e==="openalex"){const i=n.split("/").pop()||n;return`https://openalex.org/${encodeURIComponent(i)}`}return`https://doi.org/${n}`}function hL(e){const t=[];let n="",r=!1,i=null;for(const a of e){if(i){a===i?i=null:n+=a,r=!0;continue}if(a==='"'||a==="'"){i=a,r=!0;continue}if(a===" "||a===" "||a===` +`){r&&(t.push(n),n="",r=!1);continue}if(a==="|"||a===";"||a===">"||a==="&")break;n+=a,r=!0}return r&&t.push(n),t}function fL(e){const t=e.match(/(?:^|[\s;&|(])orx\s+(lit|paper)\b/);if(!t)return null;const n=t[1],r=e.slice((t.index??0)+t[0].length),i=hL(r);let a,o;for(let l=0;l_&:first-child]:mr-3 [&.active]:text-primary","[&.active]:bg-surface"].join(" "),nr=[hh,"w-7 h-7"].join(" "),li=["model-item [&.danger]:text-accent-red [&.danger:hover]:text-accent-red flex","items-center justify-between gap-2 w-full text-left py-1.5 px-2","text-md rounded-sm [&:hover]:bg-surface","[&_.model-id]:block [&_.model-id]:font-mono [&_.model-id]:text-2xs","[&_.model-id]:text-muted"].join(" "),fr=["settings-loading flex items-center gap-2 text-subtext text-md","py-1 px-0"].join(" "),Pt=["spinner w-[13px] h-[13px] border-2 border-border border-t-primary","rounded-full animate-[spin_0.8s_linear_infinite] shrink-0"].join(" "),nn="mono font-mono text-sm",ja="tab-body flex-1 min-h-0 relative flex flex-col",zc="code-tab-body flex-1 min-h-0 overflow-auto bg-background",vs=["code-tab-note py-2 px-4 text-sm text-muted","border-b border-b-border-variant shrink-0"].join(" "),Nd=["title [.chat-header_&]:text-base [.chat-header_&]:font-semibold","[.chat-header_&]:text-text [.chat-header_&]:flex-1 [.chat-header_&]:min-w-0","[.chat-header_&]:overflow-hidden [.chat-header_&]:text-ellipsis","[.chat-header_&]:whitespace-nowrap"].join(" "),ci=["btn inline-flex items-center justify-center gap-1.5 py-1.5 px-3.5","text-sm font-semibold border border-border","rounded-md bg-background text-text whitespace-nowrap","transition-[background,border-color,color] duration-120 ease-standard","[&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight","[&:disabled]:opacity-45 [&:disabled]:cursor-default [&.primary]:bg-primary","[&.primary]:border-primary [&.primary]:text-background","[&.primary:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))]","[&.primary:hover:not(:disabled)]:border-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))]","[&.primary:active:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_80%,_var(--text))]","[&.primary:active:not(:disabled)]:border-[color-mix(in_oklab,_var(--primary)_80%,_var(--text))]","[&.danger]:text-accent-red","[&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_8%,_transparent)]","[&.danger:active:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_14%,_transparent)]","[&.ghost]:border-transparent [&.ghost]:text-text","[&.ghost:hover:not(:disabled)]:text-text [&.ghost:hover:not(:disabled)]:bg-surface","[&.sm]:py-[3px] [&.sm]:px-[9px] [&.sm]:text-xs [&.sm]:rounded-sm"].join(" "),rr=`${ci} sm`,Xr=`${ci} primary`,fg=`${ci} ghost`,pL=`${rr} primary`,dr=["badge inline-flex items-center font-sans text-xs","font-medium py-px px-[7px] border border-border","rounded-sm text-text [&.ok]:text-accent-green","[&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle","[&.err]:text-accent-red [&.err]:border-accent-red","[&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber","[&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle"].join(" "),Li=`${dr} err`,Cs=`${dr} ok`,b_=`${dr} warn`,v_=["status-badge inline-flex items-center gap-1.5 text-sm","font-medium text-text whitespace-nowrap [&_.dot]:w-[7px]","[&_.dot]:h-[7px] [&_.dot]:rounded-full [&_.dot]:bg-current","[&_.dot]:shrink-0 [&.live_.dot]:animate-[or-pulse_1.2s_ease-in-out_infinite]","[&.st-done_.dot]:text-accent-green [&.st-done_>_svg]:text-accent-green","[&.st-failed_.dot]:text-accent-red [&.st-running_.dot]:text-accent-teal","[&.st-starting_.dot]:text-accent-amber [&.st-cancelling_.dot]:text-accent-orange","[&.st-cancelled_.dot]:text-accent-orange [&.st-editing_.dot]:text-accent-purple","[&.st-idle_.dot]:text-muted"].join(" "),__=["settings-switch relative flex-none w-9.5 h-5.5 border border-border rounded-full","bg-surface transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:top-[3px] [&_span]:left-[3px] [&_span]:w-3.5 [&_span]:h-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background]","[&_span]:duration-120 [&_span]:ease-standard [&.on]:border-primary [&.on]:bg-primary","[&.on_span]:bg-background [&.on_span]:translate-x-4 [&:disabled]:opacity-45","[&:disabled]:cursor-default [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid","[&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2"].join(" "),mL=["alphaxiv","openalex","biorxiv"];let p3=null;function gL(){const[e,t]=R.useState(p3),[n,r]=R.useState(!1),i=o=>{p3=o,t(o)};R.useEffect(()=>{kD().then(i).catch(()=>{})},[]);const a=o=>{!e||n||(r(!0),CD({...e,[o]:!e[o]}).then(i).catch(()=>{}).finally(()=>r(!1)))};return e?h.jsx("div",{className:"flex flex-col",children:mL.map(o=>{const l=e[o];return h.jsxs("button",{type:"button",role:"switch","aria-checked":l,className:li,disabled:n,onClick:()=>a(o),children:[h.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[h.jsx(g_,{source:o,size:16,decorative:!0}),m_[o]]}),h.jsx("span",{className:`${__} ${l?"on":""}`,"aria-hidden":"true",children:h.jsx("span",{})})]},o)})}):h.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:"Loading…"})}function pg(e,t){if(!e)throw new Error("Assertion Error")}function hl(e,t){if(e==null)throw new Error(`Unexpected ${e}`);return e}function bL(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 vL(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` +`}]}function _L(e,t){const n=t.value?t.value+` +`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function xL(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yL(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Wr=qo(/[A-Za-z]/),Dr=qo(/[\dA-Za-z]/),wL=qo(/[#-'*+\--9=?A-Z^-~]/);function Lf(e){return e!==null&&(e<32||e===127)}const zb=qo(/\d/),SL=qo(/[\dA-Fa-f]/),kL=qo(/[!-/:-@[-`{-~]/);function st(e){return e!==null&&e<-2}function dn(e){return e!==null&&(e<0||e===32)}function Mt(e){return e===-2||e===-1||e===32}const fp=qo(new RegExp("\\p{P}|\\p{S}","u")),Rl=qo(/\s/);function qo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function au(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function CL(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=au(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const d={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,d),e.applyData(t,d)}function EL(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 AL(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function SS(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 i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function TL(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return SS(e,t);const i={src:au(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function NL(e,t){const n={src:au(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 jL(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 ML(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return SS(e,t);const i={href:au(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function RL(e,t){const n={href:au(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 DL(e,t,n){const r=e.all(t),i=n?LL(n):kS(t),a={},o=[];if(typeof t.checked=="boolean"){const m=r[0];let f;m&&m.type==="element"&&m.tagName==="p"?f=m:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l1}function OL(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0&&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 HL(e){const t=x_(e),n=CS(e);if(t&&n)return{start:t,end:n}}function $L(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=x_(t.children[1]),c=CS(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function FL(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const d=[];for(;++c0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(b3(t.slice(i),i>0,!1)),a.join("")}function b3(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===m3||a===g3;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===m3||a===g3;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function qL(e,t){const n={type:"text",value:UL(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function GL(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const VL={blockquote:bL,break:vL,code:_L,delete:xL,emphasis:yL,footnoteReference:CL,heading:EL,html:AL,imageReference:TL,image:NL,inlineCode:jL,linkReference:ML,link:RL,listItem:DL,list:OL,paragraph:IL,root:zL,strong:BL,table:$L,tableCell:PL,tableRow:FL,text:qL,thematicBreak:GL,toml:D0,yaml:D0,definition:D0,footnoteDefinition:D0};function D0(){}const AS=-1,pp=0,bd=1,Of=2,y_=3,w_=4,S_=5,k_=6,TS=7,NS=8,WL=typeof self=="object"?self:globalThis,v3=(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 WL[e](t)},YL=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case pp:case AS:return n(o,i);case bd:{const l=n([],i);for(const c of o)l.push(r(c));return l}case Of:{const l=n({},i);for(const[c,d]of o)l[r(c)]=r(d);return l}case y_:return n(new Date(o),i);case w_:{const{source:l,flags:c}=o;return n(new RegExp(l,c),i)}case S_:{const l=n(new Map,i);for(const[c,d]of o)l.set(r(c),r(d));return l}case k_:{const l=n(new Set,i);for(const c of o)l.add(r(c));return l}case TS:{const{name:l,message:c}=o;return n(v3(l,c),i)}case NS:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(v3(a,o),i)};return r},_3=e=>YL(new Map,e)(0),bl="",{toString:XL}={},{keys:KL}=Object,ed=e=>{const t=typeof e;if(t!=="object"||!e)return[pp,t];const n=XL.call(e).slice(8,-1);switch(n){case"Array":return[bd,bl];case"Object":return[Of,bl];case"Date":return[y_,bl];case"RegExp":return[w_,bl];case"Map":return[S_,bl];case"Set":return[k_,bl];case"DataView":return[bd,n]}return n.includes("Array")?[bd,n]:n.includes("Error")?[TS,n]:[Of,n]},L0=([e,t])=>e===pp&&(t==="function"||t==="symbol"),ZL=(e,t,n,r)=>{const i=(o,l)=>{const c=r.push(o)-1;return n.set(l,c),c},a=o=>{if(n.has(o))return n.get(o);let[l,c]=ed(o);switch(l){case pp:{let m=o;switch(c){case"bigint":l=NS,m=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);m=null;break;case"undefined":return i([AS],o)}return i([l,m],o)}case bd:{if(c){let g=o;return c==="DataView"?g=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(g=new Uint8Array(o)),i([c,[...g]],o)}const m=[],f=i([l,m],o);for(const g of o)m.push(a(g));return f}case Of:{if(c)switch(c){case"BigInt":return i([c,o.toString()],o);case"Boolean":case"Number":case"String":return i([c,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const m=[],f=i([l,m],o);for(const g of KL(o))(e||!L0(ed(o[g])))&&m.push([a(g),a(o[g])]);return f}case y_:return i([l,isNaN(o.getTime())?bl:o.toISOString()],o);case w_:{const{source:m,flags:f}=o;return i([l,{source:m,flags:f}],o)}case S_:{const m=[],f=i([l,m],o);for(const[g,b]of o)(e||!(L0(ed(g))||L0(ed(b))))&&m.push([a(g),a(b)]);return f}case k_:{const m=[],f=i([l,m],o);for(const g of o)(e||!L0(ed(g)))&&m.push(a(g));return f}}const{message:d}=o;return i([l,{name:c,message:d}],o)};return a},x3=(e,{json:t,lossy:n}={})=>{const r=[];return ZL(!(t||n),!!t,new Map,r)(e),r},If=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?_3(x3(e,t)):structuredClone(e):(e,t)=>_3(x3(e,t));function QL(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 JL(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function eO(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||QL,r=e.options.footnoteBackLabel||JL,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&k.push({type:"text",value:" "});let w=typeof n=="string"?n:n(c,b);typeof w=="string"&&(w={type:"text",value:w}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,b),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const x=m[m.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const w=x.children[x.children.length-1];w&&w.type==="text"?w.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...k)}else m.push(...k);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(m,!0)};e.patch(d,v),l.push(v)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...If(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const hh=(function(e){if(e==null)return eO;if(typeof e=="function")return fp(e);if(typeof e=="object")return Array.isArray(e)?ZL(e):QL(e);if(typeof e=="string")return JL(e);throw new Error("Expected function, string, or object as test")});function ZL(e){const t=[];let n=-1;for(;++n":""))+")"})}return g;function g(){let b=jS,k,S,x;if((!t||a(u,d,m[m.length-1]||void 0))&&(b=rO(n(u,m)),b[0]===Ob))return b;if("children"in u&&u.children){const _=u;if(_.children&&b[0]!==MS)for(S=(r?_.children.length:-1)+o,x=m.concat(_);S>-1&&S<_.children.length;){const w=_.children[S];if(k=l(w,S,x)(),k[0]===Ob)return k;S=typeof k[1]=="number"?k[1]:S+o}}return b}}}function rO(e){return Array.isArray(e)?e:typeof e=="number"?[nO,e]:e==null?jS:[e]}function w_(e,t,n,r){let i,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,i=n):(a=t,o=n,i=r),y_(e,a,l,i);function l(u,d){const m=d[d.length-1],f=m?m.children.indexOf(u):void 0;return o(u,f,m)}}const Ib={}.hasOwnProperty,iO={};function sO(e,t){const n=t||iO,r=new Map,i=new Map,a=new Map,o={...PL,...n.handlers},l={all:d,applyData:oO,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:u,options:n,patch:aO,wrap:cO};return w_(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const f=m.type==="definition"?r:i,g=String(m.identifier).toUpperCase();f.has(g)||f.set(g,m)}}),l;function u(m,f){const g=m.type,b=l.handlers[g];if(Ib.call(l.handlers,g)&&b)return b(l,m,f);if(l.options.passThrough&&l.options.passThrough.includes(g)){if("children"in m){const{children:S,...x}=m,_=Of(x);return _.children=l.all(m),_}return Of(m)}return(l.options.unknownHandler||lO)(l,m,f)}function d(m){const f=[];if("children"in m){const g=m.children;let b=-1;for(;++b":""))+")"})}return g;function g(){let b=jS,k,S,x;if((!t||a(c,d,m[m.length-1]||void 0))&&(b=oO(n(c,m)),b[0]===Bb))return b;if("children"in c&&c.children){const v=c;if(v.children&&b[0]!==MS)for(S=(r?v.children.length:-1)+o,x=m.concat(v);S>-1&&S0&&n.push({type:"text",value:` -`}),n}function v3(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function _3(e,t){const n=sO(e,t),r=n.one(e,void 0),i=KL(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:` -`},i),a}function If(e,t){return e&&"run"in e?async function(n,r){const i=_3(n,{file:r,...t});await e.run(i,r)}:function(n,r){return _3(n,{file:r,...e||t})}}function x3(e){if(e)throw e}var fg,y3;function uO(){if(y3)return fg;y3=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},a=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),f=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!f)return!1;var g;for(g in d);return typeof g>"u"||e.call(d,g)},o=function(d,m){n&&m.name==="__proto__"?n(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},l=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(r)return r(d,m).value}else return;return d[m]};return fg=function u(){var d,m,f,g,b,k,S=arguments[0],x=1,_=arguments.length,w=!1;for(typeof S=="boolean"&&(w=S,S=arguments[1]||{},x=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});x<_;++x)if(d=arguments[x],d!=null)for(m in d)f=l(S,m),g=l(d,m),S!==g&&(w&&g&&(a(g)||(b=i(g)))?(b?(b=!1,k=f&&i(f)?f:[]):k=f&&a(f)?f:{},o(S,{name:m,newValue:u(w,k,g)})):typeof g<"u"&&o(S,{name:m,newValue:g}));return S},fg}var dO=uO();const pg=sp(dO);function zb(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 hO(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...i);function l(u,...d){const m=e[++a];let f=-1;if(u){o(u);return}for(;++fo.length;let u;l&&o.push(i);try{u=e.apply(this,o)}catch(d){const m=d;if(l&&n)throw m;return i(m)}l||(u&&u.then&&typeof u.then=="function"?u.then(a,i):u instanceof Error?i(u):a(u))}function i(o,...l){n||(n=!0,t(o,...l))}function a(o){i(null,o)}}function bd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?w3(e.position):"start"in e||"end"in e?w3(e):"line"in e||"column"in e?Bb(e):""}function Bb(e){return S3(e&&e.line)+":"+S3(e&&e.column)}function w3(e){return Bb(e&&e.start)+"-"+Bb(e&&e.end)}function S3(e){return e&&typeof e=="number"?e:1}class Ir extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?a.ruleId=r:(a.source=r.slice(0,u),a.ruleId=r.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=bd(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ir.prototype.file="";Ir.prototype.name="";Ir.prototype.reason="";Ir.prototype.message="";Ir.prototype.stack="";Ir.prototype.column=void 0;Ir.prototype.line=void 0;Ir.prototype.ancestors=void 0;Ir.prototype.cause=void 0;Ir.prototype.fatal=void 0;Ir.prototype.place=void 0;Ir.prototype.ruleId=void 0;Ir.prototype.source=void 0;const Vs={basename:pO,dirname:mO,extname:gO,join:bO,sep:"/"};function pO(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');fh(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function mO(e){if(fh(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 gO(e){fh(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function bO(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function _O(e,t){let n="",r=0,i=-1,a=0,o=-1,l,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function fh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xO={cwd:yO};function yO(){return"/"}function Hb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function wO(e){if(typeof e=="string")e=new URL(e);else if(!Hb(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 SO(e)}function SO(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(;++n0){let[b,...k]=m;const S=r[g][1];zb(S)&&zb(b)&&(b=pg(!0,S,b)),r[g]=[d,b,...k]}}}}const k_=new S_().freeze();function vg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function _g(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function xg(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 C3(e){if(!zb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function E3(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function L0(e){return AO(e)?e:new RS(e)}function AO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function TO(e){return typeof e=="string"||NO(e)}function NO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var A3=Object.prototype.hasOwnProperty;function T3(e,t,n){for(n of e.keys())if(vd(n,t))return n}function vd(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&vd(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i=="object"&&(i=T3(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i=="object"&&(i=T3(t,i),!i)||!vd(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(A3.call(e,n)&&++r&&!A3.call(t,n)||!(n in t)||!vd(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function N3(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const o=n.slice(i,r).trim();(o||!a)&&t.push(o),i=r+1,r=n.indexOf(",",i)}return t}function jO(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const MO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,RO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,DO={};function j3(e,t){return(DO.jsx?RO:MO).test(e)}const LO=/[ \t\n\f\r]/g;function OO(e){return typeof e=="object"?e.type==="text"?M3(e.value):!1:M3(e)}function M3(e){return e.replace(LO,"")===""}class ph{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ph.prototype.normal={};ph.prototype.property={};ph.prototype.space=void 0;function DS(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ph(n,r,t)}function Nd(e){return e.toLowerCase()}class fi{constructor(t,n){this.attribute=n,this.property=t}}fi.prototype.attribute="";fi.prototype.booleanish=!1;fi.prototype.boolean=!1;fi.prototype.commaOrSpaceSeparated=!1;fi.prototype.commaSeparated=!1;fi.prototype.defined=!1;fi.prototype.mustUseProperty=!1;fi.prototype.number=!1;fi.prototype.overloadedBoolean=!1;fi.prototype.property="";fi.prototype.spaceSeparated=!1;fi.prototype.space=void 0;let IO=0;const bt=Bl(),Jn=Bl(),$b=Bl(),ze=Bl(),dn=Bl(),El=Bl(),Mi=Bl();function Bl(){return 2**++IO}const Fb=Object.freeze(Object.defineProperty({__proto__:null,boolean:bt,booleanish:Jn,commaOrSpaceSeparated:Mi,commaSeparated:El,number:ze,overloadedBoolean:$b,spaceSeparated:dn},Symbol.toStringTag,{value:"Module"})),yg=Object.keys(Fb);class C_ extends fi{constructor(t,n,r,i){let a=-1;if(super(t,n),R3(this,"space",i),typeof r=="number")for(;++a4&&n.slice(0,4)==="data"&&FO.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(D3,UO);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!D3.test(a)){let o=a.replace($O,PO);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=C_}return new i(r,t)}function PO(e){return"-"+e.toLowerCase()}function UO(e){return e.charAt(1).toUpperCase()}const FS=DS([LS,zO,zS,BS,HS],"html"),pp=DS([LS,BO,zS,BS,HS],"svg");function L3(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function qO(e){return e.join(" ").trim()}var Sc={},wg,O3;function GO(){if(O3)return wg;O3=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,u=` -`,d="/",m="*",f="",g="comment",b="declaration";function k(x,_){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];_=_||{};var w=1,y=1;function C(V){var X=V.match(t);X&&(w+=X.length);var Y=V.lastIndexOf(u);y=~Y?V.length-Y:y+V.length}function T(){var V={line:w,column:y};return function(X){return X.position=new E(V),D(),X}}function E(V){this.start=V,this.end={line:w,column:y},this.source=_.source}E.prototype.content=x;function j(V){var X=new Error(_.source+":"+w+":"+y+": "+V);if(X.reason=V,X.filename=_.source,X.line=w,X.column=y,X.source=x,!_.silent)throw X}function N(V){var X=V.exec(x);if(X){var Y=X[0];return C(Y),x=x.slice(Y.length),X}}function D(){N(n)}function z(V){var X;for(V=V||[];X=$();)X!==!1&&V.push(X);return V}function $(){var V=T();if(!(d!=x.charAt(0)||m!=x.charAt(1))){for(var X=2;f!=x.charAt(X)&&(m!=x.charAt(X)||d!=x.charAt(X+1));)++X;if(X+=2,f===x.charAt(X-1))return j("End of comment missing");var Y=x.slice(2,X-2);return y+=2,C(Y),x=x.slice(X),y+=2,V({type:g,comment:Y})}}function F(){var V=T(),X=N(r);if(X){if($(),!N(i))return j("property missing ':'");var Y=N(a),Q=V({type:b,property:S(X[0].replace(e,f)),value:Y?S(Y[0].replace(e,f)):f});return N(o),Q}}function U(){var V=[];z(V);for(var X;X=F();)X!==!1&&(V.push(X),z(V));return V}return D(),U()}function S(x){return x?x.replace(l,f):f}return wg=k,wg}var I3;function VO(){if(I3)return Sc;I3=1;var e=Sc&&Sc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.default=n;const t=e(GO());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),l=typeof i=="function";return o.forEach(u=>{if(u.type!=="declaration")return;const{property:d,value:m}=u;l?i(d,m,u):m&&(a=a||{},a[d]=m)}),a}return Sc}var ed={},z3;function WO(){if(z3)return ed;z3=1,Object.defineProperty(ed,"__esModule",{value:!0}),ed.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(d){return!d||n.test(d)||e.test(d)},o=function(d,m){return m.toUpperCase()},l=function(d,m){return"".concat(m,"-")},u=function(d,m){return m===void 0&&(m={}),a(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(i,l):d=d.replace(r,l),d.replace(t,o))};return ed.camelCase=u,ed}var td,B3;function YO(){if(B3)return td;B3=1;var e=td&&td.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(VO()),n=WO();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(l,u){l&&u&&(o[(0,n.camelCase)(l,a)]=u)}),o}return r.default=r,td=r,td}var XO=YO();const KO=sp(XO),E_={}.hasOwnProperty,ZO=new Map,QO=/[A-Z]/g,JO=new Set(["table","tbody","thead","tfoot","tr"]),eI=new Set(["td","th"]),PS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function US(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=lI(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=oI(n,t.jsx,t.jsxs)}const i={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"?pp:FS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=qS(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function qS(e,t,n){if(t.type==="element")return tI(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return nI(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return iI(e,t,n);if(t.type==="mdxjsEsm")return rI(e,t);if(t.type==="root")return sI(e,t,n);if(t.type==="text")return aI(e,t)}function tI(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=pp,e.schema=i),e.ancestors.push(t);const a=VS(e,t.tagName,!1),o=cI(e,t);let l=T_(e,t);return JO.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!OO(u):!0})),GS(e,o,a,t),A_(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function nI(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)}jd(e,t.position)}function rI(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);jd(e,t.position)}function iI(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=pp,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:VS(e,t.name,!0),o=uI(e,t),l=T_(e,t);return GS(e,o,a,t),A_(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function sI(e,t,n){const r={};return A_(r,T_(e,t)),e.create(t,e.Fragment,r,n)}function aI(e,t){return t.value}function GS(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function A_(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function oI(e,t,n){return r;function r(i,a,o,l){const d=Array.isArray(o.children)?n:t;return l?d(a,o,l):d(a,o)}}function lI(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),u=g_(r);return t(i,a,o,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function cI(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&E_.call(t.properties,i)){const a=dI(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&eI.has(t.tagName)?r=l:n[o]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function uI(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else jd(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else jd(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function T_(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:ZO;for(;++ry.key).filter(y=>y!==void 0));let d=0;for(;d=e.children.length-m&&(E=i.length-(e.children.length-y)),E>=0&&(T=((_=i[E])==null?void 0:_.key)??T);T&&u.has(T)&&((w=i[E])==null?void 0:w.key)!==T;)T=`${T}+`;T&&u.add(T);const j=WS(C,i[E]??null,n,T);a.push(j),j.react!==void 0&&o.push(j.react)}const f=t!==null&&_I(e,t.node);if(t&&t.key===r&&f&&i.length===a.length&&a.every((y,C)=>y===i[C]))return t;const g=e.type==="element"&&gI.has(e.tagName)?o.filter(y=>typeof y!="string"||!bI.test(y)):o,b=g.length>0?g.length===1?g[0]:g:null;let k=f?t==null?void 0:t.shell:null;if(!k){const y=US({...e,children:[]},n);k={props:y.props,type:y.type}}return{children:a,key:r,node:e,react:h.jsx(k.type,{...k.props,children:b},r),shell:k}}function _I(e,t){if(e===t)return!0;const{children:n,position:r,...i}=e,{children:a,position:o,...l}=t;return vd(i,l)}function Bc(e,t){if(e===t)return!0;if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let o=0;oi?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(zi(e,e.length,0,t),e):t}const F3={}.hasOwnProperty;function XS(e){const t={};let n=-1;for(;++n13&&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 Es(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function Nt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(u){return Rt(u)?(e.enter(n),l(u)):t(u)}function l(u){return Rt(u)&&a++o))return;const j=t.events.length;let N=j,D,z;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(D){z=t.events[N][1].end;break}D=!0}for(_(r),E=j;Ey;){const T=n[C];t.containerState=T[1],T[0].exit.call(t,e)}n.length=y}function w(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function TI(e,t,n){return Nt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Yc(e){if(e===null||hn(e)||jl(e))return 1;if(dp(e))return 2}function mp(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},g={...e[n][1].start};U3(f,-u),U3(g,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},a={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=as(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=as(d,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),d=as(d,mp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=as(d,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,d=as(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,zi(e,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n0&&Rt(E)?Nt(e,w,"linePrefix",a+1)(E):w(E)}function w(E){return E===null||st(E)?e.check(q3,S,C)(E):(e.enter("codeFlowValue"),y(E))}function y(E){return E===null||st(E)?(e.exit("codeFlowValue"),w(E)):(e.consume(E),y)}function C(E){return e.exit("codeFenced"),t(E)}function T(E,j,N){let D=0;return z;function z(X){return E.enter("lineEnding"),E.consume(X),E.exit("lineEnding"),$}function $(X){return E.enter("codeFencedFence"),Rt(X)?Nt(E,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):F(X)}function F(X){return X===l?(E.enter("codeFencedFenceSequence"),U(X)):N(X)}function U(X){return X===l?(D++,E.consume(X),U):D>=o?(E.exit("codeFencedFenceSequence"),Rt(X)?Nt(E,V,"whitespace")(X):V(X)):N(X)}function V(X){return X===null||st(X)?(E.exit("codeFencedFence"),j(X)):N(X)}}}function $I(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Sg={name:"codeIndented",tokenize:PI},FI={partial:!0,tokenize:UI};function PI(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),Nt(e,a,"linePrefix",5)(d)}function a(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?o(d):n(d)}function o(d){return d===null?u(d):st(d)?e.attempt(FI,o,u)(d):(e.enter("codeFlowValue"),l(d))}function l(d){return d===null||st(d)?(e.exit("codeFlowValue"),o(d)):(e.consume(d),l)}function u(d){return e.exit("codeIndented"),t(d)}}function UI(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):st(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Nt(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):st(o)?i(o):n(o)}}const qI={name:"codeText",previous:VI,resolve:GI,tokenize:WI};function GI(e){let t=e.length-4,n=3,r,i;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=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 tthis.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 i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&nd(this.left,r),a.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),nd(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),nd(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=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function t9(e,t,n,r,i,a,o,l,u){const d=u||Number.POSITIVE_INFINITY;let m=0;return f;function f(_){return _===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(_),e.exit(a),g):_===null||_===32||_===41||Df(_)?n(_):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),S(_))}function g(_){return _===62?(e.enter(a),e.consume(_),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===62?(e.exit("chunkString"),e.exit(l),g(_)):_===null||_===60||st(_)?n(_):(e.consume(_),_===92?k:b)}function k(_){return _===60||_===62||_===92?(e.consume(_),b):b(_)}function S(_){return!m&&(_===null||_===41||hn(_))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(_)):m999||b===null||b===91||b===93&&!u||b===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(b):b===93?(e.exit(a),e.enter(i),e.consume(b),e.exit(i),e.exit(r),t):st(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===null||b===91||b===93||st(b)||l++>999?(e.exit("chunkString"),m(b)):(e.consume(b),u||(u=!Rt(b)),b===92?g:f)}function g(b){return b===91||b===92||b===93?(e.consume(b),l++,f):f(b)}}function r9(e,t,n,r,i,a){let o;return l;function l(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),o=g===40?41:g,u):n(g)}function u(g){return g===o?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(a),d(g))}function d(g){return g===o?(e.exit(a),u(o)):g===null?n(g):st(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Nt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===o||g===null||st(g)?(e.exit("chunkString"),d(g)):(e.consume(g),g===92?f:m)}function f(g){return g===o||g===92?(e.consume(g),m):m(g)}}function _d(e,t){let n;return r;function r(i){return st(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Rt(i)?Nt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const tz={name:"definition",tokenize:rz},nz={partial:!0,tokenize:iz};function rz(e,t,n){const r=this;let i;return a;function a(b){return e.enter("definition"),o(b)}function o(b){return n9.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function l(b){return i=Es(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),u):n(b)}function u(b){return hn(b)?_d(e,d)(b):d(b)}function d(b){return t9(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function m(b){return e.attempt(nz,f,f)(b)}function f(b){return Rt(b)?Nt(e,g,"whitespace")(b):g(b)}function g(b){return b===null||st(b)?(e.exit("definition"),r.parser.defined.push(i),t(b)):n(b)}}function iz(e,t,n){return r;function r(l){return hn(l)?_d(e,i)(l):n(l)}function i(l){return r9(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Rt(l)?Nt(e,o,"whitespace")(l):o(l)}function o(l){return l===null||st(l)?t(l):n(l)}}const sz={name:"hardBreakEscape",tokenize:az};function az(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return st(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const oz={name:"headingAtx",resolve:lz,tokenize:cz};function lz(e,t){let n=e.length-2,r=3,i,a;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&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},zi(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function cz(e,t,n){let r=0;return i;function i(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),o(m)}function o(m){return m===35&&r++<6?(e.consume(m),o):m===null||hn(m)?(e.exit("atxHeadingSequence"),l(m)):n(m)}function l(m){return m===35?(e.enter("atxHeadingSequence"),u(m)):m===null||st(m)?(e.exit("atxHeading"),t(m)):Rt(m)?Nt(e,l,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function u(m){return m===35?(e.consume(m),u):(e.exit("atxHeadingSequence"),l(m))}function d(m){return m===null||m===35||hn(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),d)}}const uz=["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"],V3=["pre","script","style","textarea"],dz={concrete:!0,name:"htmlFlow",resolveTo:pz,tokenize:mz},hz={partial:!0,tokenize:bz},fz={partial:!0,tokenize:gz};function pz(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 mz(e,t,n){const r=this;let i,a,o,l,u;return d;function d(W){return m(W)}function m(W){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(W),f}function f(W){return W===33?(e.consume(W),g):W===47?(e.consume(W),a=!0,S):W===63?(e.consume(W),i=3,r.interrupt?t:O):Xr(W)?(e.consume(W),o=String.fromCharCode(W),x):n(W)}function g(W){return W===45?(e.consume(W),i=2,b):W===91?(e.consume(W),i=5,l=0,k):Xr(W)?(e.consume(W),i=4,r.interrupt?t:O):n(W)}function b(W){return W===45?(e.consume(W),r.interrupt?t:O):n(W)}function k(W){const re="CDATA[";return W===re.charCodeAt(l++)?(e.consume(W),l===re.length?r.interrupt?t:F:k):n(W)}function S(W){return Xr(W)?(e.consume(W),o=String.fromCharCode(W),x):n(W)}function x(W){if(W===null||W===47||W===62||hn(W)){const re=W===47,ce=o.toLowerCase();return!re&&!a&&V3.includes(ce)?(i=1,r.interrupt?t(W):F(W)):uz.includes(o.toLowerCase())?(i=6,re?(e.consume(W),_):r.interrupt?t(W):F(W)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(W):a?w(W):y(W))}return W===45||Lr(W)?(e.consume(W),o+=String.fromCharCode(W),x):n(W)}function _(W){return W===62?(e.consume(W),r.interrupt?t:F):n(W)}function w(W){return Rt(W)?(e.consume(W),w):z(W)}function y(W){return W===47?(e.consume(W),z):W===58||W===95||Xr(W)?(e.consume(W),C):Rt(W)?(e.consume(W),y):z(W)}function C(W){return W===45||W===46||W===58||W===95||Lr(W)?(e.consume(W),C):T(W)}function T(W){return W===61?(e.consume(W),E):Rt(W)?(e.consume(W),T):y(W)}function E(W){return W===null||W===60||W===61||W===62||W===96?n(W):W===34||W===39?(e.consume(W),u=W,j):Rt(W)?(e.consume(W),E):N(W)}function j(W){return W===u?(e.consume(W),u=null,D):W===null||st(W)?n(W):(e.consume(W),j)}function N(W){return W===null||W===34||W===39||W===47||W===60||W===61||W===62||W===96||hn(W)?T(W):(e.consume(W),N)}function D(W){return W===47||W===62||Rt(W)?y(W):n(W)}function z(W){return W===62?(e.consume(W),$):n(W)}function $(W){return W===null||st(W)?F(W):Rt(W)?(e.consume(W),$):n(W)}function F(W){return W===45&&i===2?(e.consume(W),Y):W===60&&i===1?(e.consume(W),Q):W===62&&i===4?(e.consume(W),H):W===63&&i===3?(e.consume(W),O):W===93&&i===5?(e.consume(W),I):st(W)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(hz,G,U)(W)):W===null||st(W)?(e.exit("htmlFlowData"),U(W)):(e.consume(W),F)}function U(W){return e.check(fz,V,G)(W)}function V(W){return e.enter("lineEnding"),e.consume(W),e.exit("lineEnding"),X}function X(W){return W===null||st(W)?U(W):(e.enter("htmlFlowData"),F(W))}function Y(W){return W===45?(e.consume(W),O):F(W)}function Q(W){return W===47?(e.consume(W),o="",te):F(W)}function te(W){if(W===62){const re=o.toLowerCase();return V3.includes(re)?(e.consume(W),H):F(W)}return Xr(W)&&o.length<8?(e.consume(W),o+=String.fromCharCode(W),te):F(W)}function I(W){return W===93?(e.consume(W),O):F(W)}function O(W){return W===62?(e.consume(W),H):W===45&&i===2?(e.consume(W),O):F(W)}function H(W){return W===null||st(W)?(e.exit("htmlFlowData"),G(W)):(e.consume(W),H)}function G(W){return e.exit("htmlFlow"),t(W)}}function gz(e,t,n){const r=this;return i;function i(o){return st(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function bz(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(mh,t,n)}}const vz={name:"htmlText",tokenize:_z};function _z(e,t,n){const r=this;let i,a,o;return l;function l(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),u}function u(O){return O===33?(e.consume(O),d):O===47?(e.consume(O),T):O===63?(e.consume(O),y):Xr(O)?(e.consume(O),N):n(O)}function d(O){return O===45?(e.consume(O),m):O===91?(e.consume(O),a=0,k):Xr(O)?(e.consume(O),w):n(O)}function m(O){return O===45?(e.consume(O),b):n(O)}function f(O){return O===null?n(O):O===45?(e.consume(O),g):st(O)?(o=f,Q(O)):(e.consume(O),f)}function g(O){return O===45?(e.consume(O),b):f(O)}function b(O){return O===62?Y(O):O===45?g(O):f(O)}function k(O){const H="CDATA[";return O===H.charCodeAt(a++)?(e.consume(O),a===H.length?S:k):n(O)}function S(O){return O===null?n(O):O===93?(e.consume(O),x):st(O)?(o=S,Q(O)):(e.consume(O),S)}function x(O){return O===93?(e.consume(O),_):S(O)}function _(O){return O===62?Y(O):O===93?(e.consume(O),_):S(O)}function w(O){return O===null||O===62?Y(O):st(O)?(o=w,Q(O)):(e.consume(O),w)}function y(O){return O===null?n(O):O===63?(e.consume(O),C):st(O)?(o=y,Q(O)):(e.consume(O),y)}function C(O){return O===62?Y(O):y(O)}function T(O){return Xr(O)?(e.consume(O),E):n(O)}function E(O){return O===45||Lr(O)?(e.consume(O),E):j(O)}function j(O){return st(O)?(o=j,Q(O)):Rt(O)?(e.consume(O),j):Y(O)}function N(O){return O===45||Lr(O)?(e.consume(O),N):O===47||O===62||hn(O)?D(O):n(O)}function D(O){return O===47?(e.consume(O),Y):O===58||O===95||Xr(O)?(e.consume(O),z):st(O)?(o=D,Q(O)):Rt(O)?(e.consume(O),D):Y(O)}function z(O){return O===45||O===46||O===58||O===95||Lr(O)?(e.consume(O),z):$(O)}function $(O){return O===61?(e.consume(O),F):st(O)?(o=$,Q(O)):Rt(O)?(e.consume(O),$):D(O)}function F(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),i=O,U):st(O)?(o=F,Q(O)):Rt(O)?(e.consume(O),F):(e.consume(O),V)}function U(O){return O===i?(e.consume(O),i=void 0,X):O===null?n(O):st(O)?(o=U,Q(O)):(e.consume(O),U)}function V(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||hn(O)?D(O):(e.consume(O),V)}function X(O){return O===47||O===62||hn(O)?D(O):n(O)}function Y(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function Q(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),te}function te(O){return Rt(O)?Nt(e,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):I(O)}function I(O){return e.enter("htmlTextData"),o(O)}}const j_={name:"labelEnd",resolveAll:Sz,resolveTo:kz,tokenize:Cz},xz={tokenize:Ez},yz={tokenize:Az},wz={tokenize:Tz};function Sz(e){let t=-1;const n=[];for(;++t=3&&(d===null||st(d))?(e.exit("thematicBreak"),t(d)):n(d)}function u(d){return d===i?(e.consume(d),r++,u):(e.exit("thematicBreakSequence"),Rt(d)?Nt(e,l,"whitespace")(d):l(d))}}const oi={continuation:{tokenize:Bz},exit:$z,name:"list",tokenize:zz},Oz={partial:!0,tokenize:Fz},Iz={partial:!0,tokenize:Hz};function zz(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(b){const k=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:Lb(b)){if(r.containerState.type||(r.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(pf,n,d)(b):d(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(b)}return n(b)}function u(b){return Lb(b)&&++o<10?(e.consume(b),u):(!r.interrupt||o<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):n(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(mh,r.interrupt?n:m,e.attempt(Oz,g,f))}function m(b){return r.containerState.initialBlankLine=!0,a++,g(b)}function f(b){return Rt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),g):n(b)}function g(b){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function Bz(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(mh,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Nt(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!Rt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Iz,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Nt(e,e.attempt(oi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Hz(e,t,n){const r=this;return Nt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function $z(e){e.exit(this.containerState.type)}function Fz(e,t,n){const r=this;return Nt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!Rt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const W3={name:"setextUnderline",resolveTo:Pz,tokenize:Uz};function Pz(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Uz(e,t,n){const r=this;let i;return a;function a(d){let m=r.events.length,f;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){f=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=d,o(d)):n(d)}function o(d){return e.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===i?(e.consume(d),l):(e.exit("setextHeadingLineSequence"),Rt(d)?Nt(e,u,"lineSuffix")(d):u(d))}function u(d){return d===null||st(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const qz={tokenize:Gz};function Gz(e){const t=this,n=e.attempt(mh,r,e.attempt(this.parser.constructs.flowInitial,i,Nt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(KI,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Vz={resolveAll:s9()},Wz=i9("string"),Yz=i9("text");function i9(e){return{resolveAll:s9(e==="text"?Xz:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,l);return o;function o(m){return d(m)?a(m):l(m)}function l(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),u}function u(m){return d(m)?(n.exit("data"),a(m)):(n.consume(m),u)}function d(m){if(m===null)return!0;const f=i[m];let g=-1;if(f)for(;++g-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function lB(e,t){let n=-1;const r=[];let i;for(;++n"u"||e.call(d,g)},o=function(d,m){n&&m.name==="__proto__"?n(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},l=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(r)return r(d,m).value}else return;return d[m]};return mg=function c(){var d,m,f,g,b,k,S=arguments[0],x=1,v=arguments.length,w=!1;for(typeof S=="boolean"&&(w=S,S=arguments[1]||{},x=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});xo.length;let c;l&&o.push(i);try{c=e.apply(this,o)}catch(d){const m=d;if(l&&n)throw m;return i(m)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(o,...l){n||(n=!0,t(o,...l))}function a(o){i(null,o)}}function vd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?C3(e.position):"start"in e||"end"in e?C3(e):"line"in e||"column"in e?Fb(e):""}function Fb(e){return E3(e&&e.line)+":"+E3(e&&e.column)}function C3(e){return Fb(e&&e.start)+"-"+Fb(e&&e.end)}function E3(e){return e&&typeof e=="number"?e:1}class Or extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=vd(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Or.prototype.file="";Or.prototype.name="";Or.prototype.reason="";Or.prototype.message="";Or.prototype.stack="";Or.prototype.column=void 0;Or.prototype.line=void 0;Or.prototype.ancestors=void 0;Or.prototype.cause=void 0;Or.prototype.fatal=void 0;Or.prototype.place=void 0;Or.prototype.ruleId=void 0;Or.prototype.source=void 0;const qs={basename:vO,dirname:_O,extname:xO,join:yO,sep:"/"};function vO(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ph(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function _O(e){if(ph(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 xO(e){ph(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function yO(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function SO(e,t){let n="",r=0,i=-1,a=0,o=-1,l,c;for(;++o<=e.length;){if(o2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function ph(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const kO={cwd:CO};function CO(){return"/"}function Pb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function EO(e){if(typeof e=="string")e=new URL(e);else if(!Pb(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 AO(e)}function AO(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(;++n0){let[b,...k]=m;const S=r[g][1];$b(S)&&$b(b)&&(b=gg(!0,S,b)),r[g]=[d,b,...k]}}}}const T_=new A_().freeze();function xg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function yg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function wg(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 T3(e){if(!$b(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function N3(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function O0(e){return MO(e)?e:new RS(e)}function MO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function RO(e){return typeof e=="string"||DO(e)}function DO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var j3=Object.prototype.hasOwnProperty;function M3(e,t,n){for(n of e.keys())if(_d(n,t))return n}function _d(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&_d(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i=="object"&&(i=M3(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i=="object"&&(i=M3(t,i),!i)||!_d(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(j3.call(e,n)&&++r&&!j3.call(t,n)||!(n in t)||!_d(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function R3(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const o=n.slice(i,r).trim();(o||!a)&&t.push(o),i=r+1,r=n.indexOf(",",i)}return t}function LO(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const OO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,IO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zO={};function D3(e,t){return(zO.jsx?IO:OO).test(e)}const BO=/[ \t\n\f\r]/g;function HO(e){return typeof e=="object"?e.type==="text"?L3(e.value):!1:L3(e)}function L3(e){return e.replace(BO,"")===""}class mh{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}mh.prototype.normal={};mh.prototype.property={};mh.prototype.space=void 0;function DS(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new mh(n,r,t)}function jd(e){return e.toLowerCase()}class di{constructor(t,n){this.attribute=n,this.property=t}}di.prototype.attribute="";di.prototype.booleanish=!1;di.prototype.boolean=!1;di.prototype.commaOrSpaceSeparated=!1;di.prototype.commaSeparated=!1;di.prototype.defined=!1;di.prototype.mustUseProperty=!1;di.prototype.number=!1;di.prototype.overloadedBoolean=!1;di.prototype.property="";di.prototype.spaceSeparated=!1;di.prototype.space=void 0;let $O=0;const gt=Hl(),Jn=Hl(),Ub=Hl(),Ie=Hl(),un=Hl(),Tl=Hl(),Ni=Hl();function Hl(){return 2**++$O}const qb=Object.freeze(Object.defineProperty({__proto__:null,boolean:gt,booleanish:Jn,commaOrSpaceSeparated:Ni,commaSeparated:Tl,number:Ie,overloadedBoolean:Ub,spaceSeparated:un},Symbol.toStringTag,{value:"Module"})),Sg=Object.keys(qb);class N_ extends di{constructor(t,n,r,i){let a=-1;if(super(t,n),O3(this,"space",i),typeof r=="number")for(;++a4&&n.slice(0,4)==="data"&&GO.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(I3,WO);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!I3.test(a)){let o=a.replace(qO,VO);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=N_}return new i(r,t)}function VO(e){return"-"+e.toLowerCase()}function WO(e){return e.charAt(1).toUpperCase()}const FS=DS([LS,FO,zS,BS,HS],"html"),gp=DS([LS,PO,zS,BS,HS],"svg");function z3(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function YO(e){return e.join(" ").trim()}var Sc={},kg,B3;function XO(){if(B3)return kg;B3=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=` +`,d="/",m="*",f="",g="comment",b="declaration";function k(x,v){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];v=v||{};var w=1,y=1;function C(V){var X=V.match(t);X&&(w+=X.length);var Y=V.lastIndexOf(c);y=~Y?V.length-Y:y+V.length}function N(){var V={line:w,column:y};return function(X){return X.position=new E(V),D(),X}}function E(V){this.start=V,this.end={line:w,column:y},this.source=v.source}E.prototype.content=x;function M(V){var X=new Error(v.source+":"+w+":"+y+": "+V);if(X.reason=V,X.filename=v.source,X.line=w,X.column=y,X.source=x,!v.silent)throw X}function T(V){var X=V.exec(x);if(X){var Y=X[0];return C(Y),x=x.slice(Y.length),X}}function D(){T(n)}function z(V){var X;for(V=V||[];X=$();)X!==!1&&V.push(X);return V}function $(){var V=N();if(!(d!=x.charAt(0)||m!=x.charAt(1))){for(var X=2;f!=x.charAt(X)&&(m!=x.charAt(X)||d!=x.charAt(X+1));)++X;if(X+=2,f===x.charAt(X-1))return M("End of comment missing");var Y=x.slice(2,X-2);return y+=2,C(Y),x=x.slice(X),y+=2,V({type:g,comment:Y})}}function F(){var V=N(),X=T(r);if(X){if($(),!T(i))return M("property missing ':'");var Y=T(a),Q=V({type:b,property:S(X[0].replace(e,f)),value:Y?S(Y[0].replace(e,f)):f});return T(o),Q}}function U(){var V=[];z(V);for(var X;X=F();)X!==!1&&(V.push(X),z(V));return V}return D(),U()}function S(x){return x?x.replace(l,f):f}return kg=k,kg}var H3;function KO(){if(H3)return Sc;H3=1;var e=Sc&&Sc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.default=n;const t=e(XO());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),l=typeof i=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:d,value:m}=c;l?i(d,m,c):m&&(a=a||{},a[d]=m)}),a}return Sc}var td={},$3;function ZO(){if($3)return td;$3=1,Object.defineProperty(td,"__esModule",{value:!0}),td.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(d){return!d||n.test(d)||e.test(d)},o=function(d,m){return m.toUpperCase()},l=function(d,m){return"".concat(m,"-")},c=function(d,m){return m===void 0&&(m={}),a(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(i,l):d=d.replace(r,l),d.replace(t,o))};return td.camelCase=c,td}var nd,F3;function QO(){if(F3)return nd;F3=1;var e=nd&&nd.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(KO()),n=ZO();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(l,c){l&&c&&(o[(0,n.camelCase)(l,a)]=c)}),o}return r.default=r,nd=r,nd}var JO=QO();const eI=op(JO),j_={}.hasOwnProperty,tI=new Map,nI=/[A-Z]/g,rI=new Set(["table","tbody","thead","tfoot","tr"]),iI=new Set(["td","th"]),PS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function US(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=hI(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=dI(n,t.jsx,t.jsxs)}const i={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"?gp:FS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=qS(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function qS(e,t,n){if(t.type==="element")return sI(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return aI(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return lI(e,t,n);if(t.type==="mdxjsEsm")return oI(e,t);if(t.type==="root")return cI(e,t,n);if(t.type==="text")return uI(e,t)}function sI(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=gp,e.schema=i),e.ancestors.push(t);const a=VS(e,t.tagName,!1),o=fI(e,t);let l=R_(e,t);return rI.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!HO(c):!0})),GS(e,o,a,t),M_(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function aI(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)}Md(e,t.position)}function oI(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Md(e,t.position)}function lI(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=gp,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:VS(e,t.name,!0),o=pI(e,t),l=R_(e,t);return GS(e,o,a,t),M_(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function cI(e,t,n){const r={};return M_(r,R_(e,t)),e.create(t,e.Fragment,r,n)}function uI(e,t){return t.value}function GS(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function M_(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function dI(e,t,n){return r;function r(i,a,o,l){const d=Array.isArray(o.children)?n:t;return l?d(a,o,l):d(a,o)}}function hI(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),c=x_(r);return t(i,a,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function fI(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&j_.call(t.properties,i)){const a=mI(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&iI.has(t.tagName)?r=l:n[o]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function pI(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Md(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else Md(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function R_(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:tI;for(;++ry.key).filter(y=>y!==void 0));let d=0;for(;d=e.children.length-m&&(E=i.length-(e.children.length-y)),E>=0&&(N=((v=i[E])==null?void 0:v.key)??N);N&&c.has(N)&&((w=i[E])==null?void 0:w.key)!==N;)N=`${N}+`;N&&c.add(N);const M=WS(C,i[E]??null,n,N);a.push(M),M.react!==void 0&&o.push(M.react)}const f=t!==null&&SI(e,t.node);if(t&&t.key===r&&f&&i.length===a.length&&a.every((y,C)=>y===i[C]))return t;const g=e.type==="element"&&xI.has(e.tagName)?o.filter(y=>typeof y!="string"||!yI.test(y)):o,b=g.length>0?g.length===1?g[0]:g:null;let k=f?t==null?void 0:t.shell:null;if(!k){const y=US({...e,children:[]},n);k={props:y.props,type:y.type}}return{children:a,key:r,node:e,react:h.jsx(k.type,{...k.props,children:b},r),shell:k}}function SI(e,t){if(e===t)return!0;const{children:n,position:r,...i}=e,{children:a,position:o,...l}=t;return _d(i,l)}function Bc(e,t){if(e===t)return!0;if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let o=0;oi?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(Oi(e,e.length,0,t),e):t}const q3={}.hasOwnProperty;function XS(e){const t={};let n=-1;for(;++n13&&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 ws(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function Tt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return Mt(c)?(e.enter(n),l(c)):t(c)}function l(c){return Mt(c)&&a++o))return;const M=t.events.length;let T=M,D,z;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(D){z=t.events[T][1].end;break}D=!0}for(v(r),E=M;Ey;){const N=n[C];t.containerState=N[1],N[0].exit.call(t,e)}n.length=y}function w(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function RI(e,t,n){return Tt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Yc(e){if(e===null||dn(e)||Rl(e))return 1;if(fp(e))return 2}function bp(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},g={...e[n][1].start};V3(f,-c),V3(g,c),o={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=is(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=is(d,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),d=is(d,bp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=is(d,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,d=is(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,Oi(e,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n0&&Mt(E)?Tt(e,w,"linePrefix",a+1)(E):w(E)}function w(E){return E===null||st(E)?e.check(W3,S,C)(E):(e.enter("codeFlowValue"),y(E))}function y(E){return E===null||st(E)?(e.exit("codeFlowValue"),w(E)):(e.consume(E),y)}function C(E){return e.exit("codeFenced"),t(E)}function N(E,M,T){let D=0;return z;function z(X){return E.enter("lineEnding"),E.consume(X),E.exit("lineEnding"),$}function $(X){return E.enter("codeFencedFence"),Mt(X)?Tt(E,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):F(X)}function F(X){return X===l?(E.enter("codeFencedFenceSequence"),U(X)):T(X)}function U(X){return X===l?(D++,E.consume(X),U):D>=o?(E.exit("codeFencedFenceSequence"),Mt(X)?Tt(E,V,"whitespace")(X):V(X)):T(X)}function V(X){return X===null||st(X)?(E.exit("codeFencedFence"),M(X)):T(X)}}}function qI(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Cg={name:"codeIndented",tokenize:VI},GI={partial:!0,tokenize:WI};function VI(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),Tt(e,a,"linePrefix",5)(d)}function a(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?o(d):n(d)}function o(d){return d===null?c(d):st(d)?e.attempt(GI,o,c)(d):(e.enter("codeFlowValue"),l(d))}function l(d){return d===null||st(d)?(e.exit("codeFlowValue"),o(d)):(e.consume(d),l)}function c(d){return e.exit("codeIndented"),t(d)}}function WI(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):st(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Tt(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):st(o)?i(o):n(o)}}const YI={name:"codeText",previous:KI,resolve:XI,tokenize:ZI};function XI(e){let t=e.length-4,n=3,r,i;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=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 tthis.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 i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&rd(this.left,r),a.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),rd(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),rd(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=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function t9(e,t,n,r,i,a,o,l,c){const d=c||Number.POSITIVE_INFINITY;let m=0;return f;function f(v){return v===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(v),e.exit(a),g):v===null||v===32||v===41||Lf(v)?n(v):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),S(v))}function g(v){return v===62?(e.enter(a),e.consume(v),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),b(v))}function b(v){return v===62?(e.exit("chunkString"),e.exit(l),g(v)):v===null||v===60||st(v)?n(v):(e.consume(v),v===92?k:b)}function k(v){return v===60||v===62||v===92?(e.consume(v),b):b(v)}function S(v){return!m&&(v===null||v===41||dn(v))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(v)):m999||b===null||b===91||b===93&&!c||b===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(b):b===93?(e.exit(a),e.enter(i),e.consume(b),e.exit(i),e.exit(r),t):st(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===null||b===91||b===93||st(b)||l++>999?(e.exit("chunkString"),m(b)):(e.consume(b),c||(c=!Mt(b)),b===92?g:f)}function g(b){return b===91||b===92||b===93?(e.consume(b),l++,f):f(b)}}function r9(e,t,n,r,i,a){let o;return l;function l(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),o=g===40?41:g,c):n(g)}function c(g){return g===o?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(a),d(g))}function d(g){return g===o?(e.exit(a),c(o)):g===null?n(g):st(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Tt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===o||g===null||st(g)?(e.exit("chunkString"),d(g)):(e.consume(g),g===92?f:m)}function f(g){return g===o||g===92?(e.consume(g),m):m(g)}}function xd(e,t){let n;return r;function r(i){return st(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Mt(i)?Tt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const sz={name:"definition",tokenize:oz},az={partial:!0,tokenize:lz};function oz(e,t,n){const r=this;let i;return a;function a(b){return e.enter("definition"),o(b)}function o(b){return n9.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function l(b){return i=ws(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),c):n(b)}function c(b){return dn(b)?xd(e,d)(b):d(b)}function d(b){return t9(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function m(b){return e.attempt(az,f,f)(b)}function f(b){return Mt(b)?Tt(e,g,"whitespace")(b):g(b)}function g(b){return b===null||st(b)?(e.exit("definition"),r.parser.defined.push(i),t(b)):n(b)}}function lz(e,t,n){return r;function r(l){return dn(l)?xd(e,i)(l):n(l)}function i(l){return r9(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Mt(l)?Tt(e,o,"whitespace")(l):o(l)}function o(l){return l===null||st(l)?t(l):n(l)}}const cz={name:"hardBreakEscape",tokenize:uz};function uz(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return st(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const dz={name:"headingAtx",resolve:hz,tokenize:fz};function hz(e,t){let n=e.length-2,r=3,i,a;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&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Oi(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function fz(e,t,n){let r=0;return i;function i(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),o(m)}function o(m){return m===35&&r++<6?(e.consume(m),o):m===null||dn(m)?(e.exit("atxHeadingSequence"),l(m)):n(m)}function l(m){return m===35?(e.enter("atxHeadingSequence"),c(m)):m===null||st(m)?(e.exit("atxHeading"),t(m)):Mt(m)?Tt(e,l,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function c(m){return m===35?(e.consume(m),c):(e.exit("atxHeadingSequence"),l(m))}function d(m){return m===null||m===35||dn(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),d)}}const pz=["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"],X3=["pre","script","style","textarea"],mz={concrete:!0,name:"htmlFlow",resolveTo:vz,tokenize:_z},gz={partial:!0,tokenize:yz},bz={partial:!0,tokenize:xz};function vz(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 _z(e,t,n){const r=this;let i,a,o,l,c;return d;function d(W){return m(W)}function m(W){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(W),f}function f(W){return W===33?(e.consume(W),g):W===47?(e.consume(W),a=!0,S):W===63?(e.consume(W),i=3,r.interrupt?t:O):Wr(W)?(e.consume(W),o=String.fromCharCode(W),x):n(W)}function g(W){return W===45?(e.consume(W),i=2,b):W===91?(e.consume(W),i=5,l=0,k):Wr(W)?(e.consume(W),i=4,r.interrupt?t:O):n(W)}function b(W){return W===45?(e.consume(W),r.interrupt?t:O):n(W)}function k(W){const re="CDATA[";return W===re.charCodeAt(l++)?(e.consume(W),l===re.length?r.interrupt?t:F:k):n(W)}function S(W){return Wr(W)?(e.consume(W),o=String.fromCharCode(W),x):n(W)}function x(W){if(W===null||W===47||W===62||dn(W)){const re=W===47,ce=o.toLowerCase();return!re&&!a&&X3.includes(ce)?(i=1,r.interrupt?t(W):F(W)):pz.includes(o.toLowerCase())?(i=6,re?(e.consume(W),v):r.interrupt?t(W):F(W)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(W):a?w(W):y(W))}return W===45||Dr(W)?(e.consume(W),o+=String.fromCharCode(W),x):n(W)}function v(W){return W===62?(e.consume(W),r.interrupt?t:F):n(W)}function w(W){return Mt(W)?(e.consume(W),w):z(W)}function y(W){return W===47?(e.consume(W),z):W===58||W===95||Wr(W)?(e.consume(W),C):Mt(W)?(e.consume(W),y):z(W)}function C(W){return W===45||W===46||W===58||W===95||Dr(W)?(e.consume(W),C):N(W)}function N(W){return W===61?(e.consume(W),E):Mt(W)?(e.consume(W),N):y(W)}function E(W){return W===null||W===60||W===61||W===62||W===96?n(W):W===34||W===39?(e.consume(W),c=W,M):Mt(W)?(e.consume(W),E):T(W)}function M(W){return W===c?(e.consume(W),c=null,D):W===null||st(W)?n(W):(e.consume(W),M)}function T(W){return W===null||W===34||W===39||W===47||W===60||W===61||W===62||W===96||dn(W)?N(W):(e.consume(W),T)}function D(W){return W===47||W===62||Mt(W)?y(W):n(W)}function z(W){return W===62?(e.consume(W),$):n(W)}function $(W){return W===null||st(W)?F(W):Mt(W)?(e.consume(W),$):n(W)}function F(W){return W===45&&i===2?(e.consume(W),Y):W===60&&i===1?(e.consume(W),Q):W===62&&i===4?(e.consume(W),H):W===63&&i===3?(e.consume(W),O):W===93&&i===5?(e.consume(W),I):st(W)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(gz,G,U)(W)):W===null||st(W)?(e.exit("htmlFlowData"),U(W)):(e.consume(W),F)}function U(W){return e.check(bz,V,G)(W)}function V(W){return e.enter("lineEnding"),e.consume(W),e.exit("lineEnding"),X}function X(W){return W===null||st(W)?U(W):(e.enter("htmlFlowData"),F(W))}function Y(W){return W===45?(e.consume(W),O):F(W)}function Q(W){return W===47?(e.consume(W),o="",te):F(W)}function te(W){if(W===62){const re=o.toLowerCase();return X3.includes(re)?(e.consume(W),H):F(W)}return Wr(W)&&o.length<8?(e.consume(W),o+=String.fromCharCode(W),te):F(W)}function I(W){return W===93?(e.consume(W),O):F(W)}function O(W){return W===62?(e.consume(W),H):W===45&&i===2?(e.consume(W),O):F(W)}function H(W){return W===null||st(W)?(e.exit("htmlFlowData"),G(W)):(e.consume(W),H)}function G(W){return e.exit("htmlFlow"),t(W)}}function xz(e,t,n){const r=this;return i;function i(o){return st(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function yz(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(gh,t,n)}}const wz={name:"htmlText",tokenize:Sz};function Sz(e,t,n){const r=this;let i,a,o;return l;function l(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),c}function c(O){return O===33?(e.consume(O),d):O===47?(e.consume(O),N):O===63?(e.consume(O),y):Wr(O)?(e.consume(O),T):n(O)}function d(O){return O===45?(e.consume(O),m):O===91?(e.consume(O),a=0,k):Wr(O)?(e.consume(O),w):n(O)}function m(O){return O===45?(e.consume(O),b):n(O)}function f(O){return O===null?n(O):O===45?(e.consume(O),g):st(O)?(o=f,Q(O)):(e.consume(O),f)}function g(O){return O===45?(e.consume(O),b):f(O)}function b(O){return O===62?Y(O):O===45?g(O):f(O)}function k(O){const H="CDATA[";return O===H.charCodeAt(a++)?(e.consume(O),a===H.length?S:k):n(O)}function S(O){return O===null?n(O):O===93?(e.consume(O),x):st(O)?(o=S,Q(O)):(e.consume(O),S)}function x(O){return O===93?(e.consume(O),v):S(O)}function v(O){return O===62?Y(O):O===93?(e.consume(O),v):S(O)}function w(O){return O===null||O===62?Y(O):st(O)?(o=w,Q(O)):(e.consume(O),w)}function y(O){return O===null?n(O):O===63?(e.consume(O),C):st(O)?(o=y,Q(O)):(e.consume(O),y)}function C(O){return O===62?Y(O):y(O)}function N(O){return Wr(O)?(e.consume(O),E):n(O)}function E(O){return O===45||Dr(O)?(e.consume(O),E):M(O)}function M(O){return st(O)?(o=M,Q(O)):Mt(O)?(e.consume(O),M):Y(O)}function T(O){return O===45||Dr(O)?(e.consume(O),T):O===47||O===62||dn(O)?D(O):n(O)}function D(O){return O===47?(e.consume(O),Y):O===58||O===95||Wr(O)?(e.consume(O),z):st(O)?(o=D,Q(O)):Mt(O)?(e.consume(O),D):Y(O)}function z(O){return O===45||O===46||O===58||O===95||Dr(O)?(e.consume(O),z):$(O)}function $(O){return O===61?(e.consume(O),F):st(O)?(o=$,Q(O)):Mt(O)?(e.consume(O),$):D(O)}function F(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),i=O,U):st(O)?(o=F,Q(O)):Mt(O)?(e.consume(O),F):(e.consume(O),V)}function U(O){return O===i?(e.consume(O),i=void 0,X):O===null?n(O):st(O)?(o=U,Q(O)):(e.consume(O),U)}function V(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||dn(O)?D(O):(e.consume(O),V)}function X(O){return O===47||O===62||dn(O)?D(O):n(O)}function Y(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function Q(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),te}function te(O){return Mt(O)?Tt(e,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):I(O)}function I(O){return e.enter("htmlTextData"),o(O)}}const L_={name:"labelEnd",resolveAll:Az,resolveTo:Tz,tokenize:Nz},kz={tokenize:jz},Cz={tokenize:Mz},Ez={tokenize:Rz};function Az(e){let t=-1;const n=[];for(;++t=3&&(d===null||st(d))?(e.exit("thematicBreak"),t(d)):n(d)}function c(d){return d===i?(e.consume(d),r++,c):(e.exit("thematicBreakSequence"),Mt(d)?Tt(e,l,"whitespace")(d):l(d))}}const si={continuation:{tokenize:Pz},exit:qz,name:"list",tokenize:Fz},Hz={partial:!0,tokenize:Gz},$z={partial:!0,tokenize:Uz};function Fz(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(b){const k=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:zb(b)){if(r.containerState.type||(r.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(mf,n,d)(b):d(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(b)}return n(b)}function c(b){return zb(b)&&++o<10?(e.consume(b),c):(!r.interrupt||o<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):n(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(gh,r.interrupt?n:m,e.attempt(Hz,g,f))}function m(b){return r.containerState.initialBlankLine=!0,a++,g(b)}function f(b){return Mt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),g):n(b)}function g(b){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function Pz(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(gh,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Tt(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!Mt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt($z,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Tt(e,e.attempt(si,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Uz(e,t,n){const r=this;return Tt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function qz(e){e.exit(this.containerState.type)}function Gz(e,t,n){const r=this;return Tt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!Mt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const K3={name:"setextUnderline",resolveTo:Vz,tokenize:Wz};function Vz(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Wz(e,t,n){const r=this;let i;return a;function a(d){let m=r.events.length,f;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){f=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=d,o(d)):n(d)}function o(d){return e.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===i?(e.consume(d),l):(e.exit("setextHeadingLineSequence"),Mt(d)?Tt(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||st(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const Yz={tokenize:Xz};function Xz(e){const t=this,n=e.attempt(gh,r,e.attempt(this.parser.constructs.flowInitial,i,Tt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ez,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Kz={resolveAll:s9()},Zz=i9("string"),Qz=i9("text");function i9(e){return{resolveAll:s9(e==="text"?Jz:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,l);return o;function o(m){return d(m)?a(m):l(m)}function l(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),c}function c(m){return d(m)?(n.exit("data"),a(m)):(n.consume(m),c)}function d(m){if(m===null)return!0;const f=i[m];let g=-1;if(f)for(;++g-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function hB(e,t){let n=-1;const r=[];let i;for(;++n0){const tt=Ue.tokenStack[Ue.tokenStack.length-1];(tt[1]||X3).call(Ue,void 0,tt[0])}for(je.position={start:Eo(ve.length>0?ve[0][1].start:{line:1,column:1,offset:0}),end:Eo(ve.length>0?ve[ve.length-2][1].end:{line:1,column:1,offset:0})},De=-1;++De0&&(Tr(this,Do,En(this,Do)+n.slice(0,r.commitIndex)),n=n.slice(r.commitIndex),r=K3(n)),En(this,Do)+jB(n,r)}}Do=new WeakMap;const _B=new Set(["*","**","_","__"]);function K3(e){const t={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let n=0;n0){const et=Pe.tokenStack[Pe.tokenStack.length-1];(et[1]||Q3).call(Pe,void 0,et[0])}for(je.position={start:Eo(ve.length>0?ve[0][1].start:{line:1,column:1,offset:0}),end:Eo(ve.length>0?ve[ve.length-2][1].end:{line:1,column:1,offset:0})},De=-1;++De0&&(Ar(this,Do,Cn(this,Do)+n.slice(0,r.commitIndex)),n=n.slice(r.commitIndex),r=J3(n)),Cn(this,Do)+LB(n,r)}}Do=new WeakMap;const SB=new Set(["*","**","_","__"]);function J3(e){const t={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let n=0;nn){n=i-1;continue}if(t.exclusive)continue;if(NB(t)){Z3(t,n,r);continue}const a=kB(t,e,n);if(a>n){n=a-1;continue}const o=CB(t,e,n);if(o>n){n=o-1;continue}As(e,n)||Z3(t,n,r)}return t}function xB(e,t,n){const r=t[n];return r==="`"?yB(e,t,n):r==="$"?wB(e,t,n):r==="~"?SB(e,t,n):n}function yB(e,t,n){const r=R_(t,n),i="`".repeat(r),a=e.exclusive;return(a==null?void 0:a.kind)==="fence"?(a.token[0]==="`"&&zf(t,n)&&!As(t,n)&&r>=a.token.length&&(e.exclusive=null),n+r):(a==null?void 0:a.kind)==="code"?(!As(t,n)&&r>=a.token.length&&(e.exclusive=null),n+r):a||As(t,n)?n+r:r>=3&&zf(t,n)?(e.exclusive={kind:"fence",start:n,token:i},n+r):(e.exclusive={kind:"code",start:n,token:i},n+r)}function wB(e,t,n){const r=R_(t,n),i=e.exclusive;return(i==null?void 0:i.kind)==="math"?(!As(t,n)&&r>=i.token.length&&(e.exclusive=null),n+r):(i||As(t,n)||(e.exclusive={kind:"math",start:n,token:r>=2?"$$":"$"}),n+r)}function SB(e,t,n){const r=R_(t,n),i=e.exclusive;return(i==null?void 0:i.kind)==="fence"&&i.token[0]==="~"?(zf(t,n)&&!As(t,n)&&r>=i.token.length&&(e.exclusive=null),n+r):i||r<3||!zf(t,n)||As(t,n)?n:(e.exclusive={kind:"fence",start:n,token:"~".repeat(r)},n+r)}function kB(e,t,n){if(t[n]!=="<"||As(t,n))return n;const r=t[n+1];if(r!==void 0&&!u9(r))return n;e.pendingHtml=n;for(let i=n+1;i"||t[i]===` -`)return e.pendingHtml=null,i+1;return t.length}function CB(e,t,n){const r=EB(t,n);if(!r)return n;if(As(t,n))return n+r.length;const i=e.delims.findLastIndex(a=>a.token===r);return i!==-1?(e.delims.splice(i,1),n+r.length):n+r.length===t.length?(e.pendingDelim={start:n,token:r},n+r.length):(AB(t,n,r)&&e.delims.push({start:n,token:r}),n+r.length)}function EB(e,t){const n=e[t];if(n==="*")return e.startsWith("***",t)?"***":e.startsWith("**",t)?"**":"*";if(n==="_")return e.startsWith("__",t)?"__":"_";if(n==="~"&&e.startsWith("~~",t))return"~~"}function AB(e,t,n){const r=e[t+n.length];if(!r||/\s/.test(r))return!1;const i=e[t-1];return!e6(i)||!e6(r)}function Z3(e,t,n){const r=e.links.at(-1);if(n==="["){e.links.push({phase:"text",start:t});return}if(n==="]"&&(r==null?void 0:r.phase)==="text"){e.links[e.links.length-1]={phase:"url_wait",start:r.start,textEnd:t};return}if(n==="("&&(r==null?void 0:r.phase)==="url_wait"){e.links[e.links.length-1]={phase:"url",start:r.start,textEnd:r.textEnd,parenDepth:0};return}if(n==="("&&(r==null?void 0:r.phase)==="url"){r.parenDepth+=1;return}if(n===")"&&(r==null?void 0:r.phase)==="url"){if(r.parenDepth>0){r.parenDepth-=1;return}e.links.pop()}}function TB(e){var t,n;e.delims.length=0,e.links.length=0,((t=e.exclusive)==null?void 0:t.kind)!=="fence"&&(((n=e.exclusive)==null?void 0:n.kind)==="math"&&e.exclusive.token==="$$"||(e.exclusive=null))}function NB(e){var n;const t=(n=e.links.at(-1))==null?void 0:n.phase;return t==="url_wait"||t==="url"}function jB(e,t){t.pendingHtml!==null&&(e=e.slice(0,DB(e,t.pendingHtml)));const n=t.links.at(-1);if(n)return Gs(MB(e,n));const r=RB(t);if(r)return Gs(Dc(e,r));const i=IB(t);return i?i.kind==="delim"?Gs(Ub(e,i.start,i.token.length)?l9(e,i.token):e.slice(0,i.start)):Ub(e,i.start,i.token.length)?i.kind==="fence"?Gs(e):i.kind==="code"?Gs(Dc(e,i.token)):i.token==="$$"?Gs(Dc(e,(e.endsWith(` +`){RB(t),t.exclusive||(t.commitIndex=n+1);continue}const i=kB(t,e,n);if(i>n){n=i-1;continue}if(t.exclusive)continue;if(DB(t)){e6(t,n,r);continue}const a=TB(t,e,n);if(a>n){n=a-1;continue}const o=NB(t,e,n);if(o>n){n=o-1;continue}Ss(e,n)||e6(t,n,r)}return t}function kB(e,t,n){const r=t[n];return r==="`"?CB(e,t,n):r==="$"?EB(e,t,n):r==="~"?AB(e,t,n):n}function CB(e,t,n){const r=I_(t,n),i="`".repeat(r),a=e.exclusive;return(a==null?void 0:a.kind)==="fence"?(a.token[0]==="`"&&Bf(t,n)&&!Ss(t,n)&&r>=a.token.length&&(e.exclusive=null),n+r):(a==null?void 0:a.kind)==="code"?(!Ss(t,n)&&r>=a.token.length&&(e.exclusive=null),n+r):a||Ss(t,n)?n+r:r>=3&&Bf(t,n)?(e.exclusive={kind:"fence",start:n,token:i},n+r):(e.exclusive={kind:"code",start:n,token:i},n+r)}function EB(e,t,n){const r=I_(t,n),i=e.exclusive;return(i==null?void 0:i.kind)==="math"?(!Ss(t,n)&&r>=i.token.length&&(e.exclusive=null),n+r):(i||Ss(t,n)||(e.exclusive={kind:"math",start:n,token:r>=2?"$$":"$"}),n+r)}function AB(e,t,n){const r=I_(t,n),i=e.exclusive;return(i==null?void 0:i.kind)==="fence"&&i.token[0]==="~"?(Bf(t,n)&&!Ss(t,n)&&r>=i.token.length&&(e.exclusive=null),n+r):i||r<3||!Bf(t,n)||Ss(t,n)?n:(e.exclusive={kind:"fence",start:n,token:"~".repeat(r)},n+r)}function TB(e,t,n){if(t[n]!=="<"||Ss(t,n))return n;const r=t[n+1];if(r!==void 0&&!u9(r))return n;e.pendingHtml=n;for(let i=n+1;i"||t[i]===` +`)return e.pendingHtml=null,i+1;return t.length}function NB(e,t,n){const r=jB(t,n);if(!r)return n;if(Ss(t,n))return n+r.length;const i=e.delims.findLastIndex(a=>a.token===r);return i!==-1?(e.delims.splice(i,1),n+r.length):n+r.length===t.length?(e.pendingDelim={start:n,token:r},n+r.length):(MB(t,n,r)&&e.delims.push({start:n,token:r}),n+r.length)}function jB(e,t){const n=e[t];if(n==="*")return e.startsWith("***",t)?"***":e.startsWith("**",t)?"**":"*";if(n==="_")return e.startsWith("__",t)?"__":"_";if(n==="~"&&e.startsWith("~~",t))return"~~"}function MB(e,t,n){const r=e[t+n.length];if(!r||/\s/.test(r))return!1;const i=e[t-1];return!r6(i)||!r6(r)}function e6(e,t,n){const r=e.links.at(-1);if(n==="["){e.links.push({phase:"text",start:t});return}if(n==="]"&&(r==null?void 0:r.phase)==="text"){e.links[e.links.length-1]={phase:"url_wait",start:r.start,textEnd:t};return}if(n==="("&&(r==null?void 0:r.phase)==="url_wait"){e.links[e.links.length-1]={phase:"url",start:r.start,textEnd:r.textEnd,parenDepth:0};return}if(n==="("&&(r==null?void 0:r.phase)==="url"){r.parenDepth+=1;return}if(n===")"&&(r==null?void 0:r.phase)==="url"){if(r.parenDepth>0){r.parenDepth-=1;return}e.links.pop()}}function RB(e){var t,n;e.delims.length=0,e.links.length=0,((t=e.exclusive)==null?void 0:t.kind)!=="fence"&&(((n=e.exclusive)==null?void 0:n.kind)==="math"&&e.exclusive.token==="$$"||(e.exclusive=null))}function DB(e){var n;const t=(n=e.links.at(-1))==null?void 0:n.phase;return t==="url_wait"||t==="url"}function LB(e,t){t.pendingHtml!==null&&(e=e.slice(0,zB(e,t.pendingHtml)));const n=t.links.at(-1);if(n)return Ps(OB(e,n));const r=IB(t);if(r)return Ps(Dc(e,r));const i=$B(t);return i?i.kind==="delim"?Ps(Vb(e,i.start,i.token.length)?l9(e,i.token):e.slice(0,i.start)):Vb(e,i.start,i.token.length)?i.kind==="fence"?Ps(e):i.kind==="code"?Ps(Dc(e,i.token)):i.token==="$$"?Ps(Dc(e,(e.endsWith(` `)?"":` -`)+"$$")):/\s/.test(e[e.length-1]??"")?Gs(e):Gs(Dc(e,"$")):Gs(i.kind==="fence"?e:e.slice(0,i.start)):Gs(t.pendingDelim?e.slice(0,t.pendingDelim.start):e)}function MB(e,t){const n=e.slice(0,t.start);if(t.phase==="text")return Ub(e,t.start,1)?n+e.slice(t.start+1):n;const r=e.slice(t.start+1,t.textEnd);return t.phase==="url_wait"?n+r+e.slice(t.textEnd+1):n+r}function RB(e){const t=[];if(e.exclusive){if(e.exclusive.kind!=="code")return;t.push(e.exclusive.token)}for(let n=e.delims.length-1;n>=0;n--){const r=e.delims[n].token;if(!_B.has(r))return;t.push(r)}if(!(t.length<2))return t.join("")}function DB(e,t){let n=t,r=t;for(;r>0;){const i=e.lastIndexOf("<",r-1);if(i===-1||!LB(e,i,r))break;n=i,r=i}return n}function LB(e,t,n){if(e[n-1]!==">"||As(e,t))return!1;const r=e[t+1];if(r!==void 0&&!u9(r))return!1;for(let i=t+1;i"||a===` -`)return!1}return!0}function Gs(e){var x;const t=e.lastIndexOf(` +`)+"$$")):/\s/.test(e[e.length-1]??"")?Ps(e):Ps(Dc(e,"$")):Ps(i.kind==="fence"?e:e.slice(0,i.start)):Ps(t.pendingDelim?e.slice(0,t.pendingDelim.start):e)}function OB(e,t){const n=e.slice(0,t.start);if(t.phase==="text")return Vb(e,t.start,1)?n+e.slice(t.start+1):n;const r=e.slice(t.start+1,t.textEnd);return t.phase==="url_wait"?n+r+e.slice(t.textEnd+1):n+r}function IB(e){const t=[];if(e.exclusive){if(e.exclusive.kind!=="code")return;t.push(e.exclusive.token)}for(let n=e.delims.length-1;n>=0;n--){const r=e.delims[n].token;if(!SB.has(r))return;t.push(r)}if(!(t.length<2))return t.join("")}function zB(e,t){let n=t,r=t;for(;r>0;){const i=e.lastIndexOf("<",r-1);if(i===-1||!BB(e,i,r))break;n=i,r=i}return n}function BB(e,t,n){if(e[n-1]!==">"||Ss(e,t))return!1;const r=e[t+1];if(r!==void 0&&!u9(r))return!1;for(let i=t+1;i"||a===` +`)return!1}return!0}function Ps(e){var x;const t=e.lastIndexOf(` `),n=t===-1?0:t+2,r=e.slice(0,n),i=e.slice(n),a=i.indexOf(` -`),o=a===-1?i:i.slice(0,a),l=(x=o.match(/^( *)\|/))==null?void 0:x[1];if(l===void 0)return e;if(Q3(o)<2&&!zB(o,l))return r;const u=o.trimEnd().endsWith("|")?o:l9(o," |"),d=Q3(u),m=d<2?0:u.trimEnd().endsWith("|")?d-1:d;if(m===0)return e;const f=a===-1?"":i.slice(a+1),g=J3(l,Array.from({length:m},()=>"-"));if(f.length===0)return r+u+` +`),o=a===-1?i:i.slice(0,a),l=(x=o.match(/^( *)\|/))==null?void 0:x[1];if(l===void 0)return e;if(t6(o)<2&&!FB(o,l))return r;const c=o.trimEnd().endsWith("|")?o:l9(o," |"),d=t6(c),m=d<2?0:c.trimEnd().endsWith("|")?d-1:d;if(m===0)return e;const f=a===-1?"":i.slice(a+1),g=n6(l,Array.from({length:m},()=>"-"));if(f.length===0)return r+c+` `+g;const b=f.indexOf(` -`),k=b===-1?f:f.slice(0,b),S=b===-1?"":f.slice(b);if(BB(k,l,m))return e;if(k.startsWith(l+"|")&&/^[ |:\-\t]*$/.test(k.slice(l.length))){const _=c9(k,l).map(w=>{const y=w.trim();if(y.length===0)return"-";let C=0;for(let T=0;T1&&y.endsWith(":")?":":"")});for(;_.length{const y=w.trim();if(y.length===0)return"-";let C=0;for(let N=0;N1&&y.endsWith(":")?":":"")});for(;v.length0;n-=1)if(e.endsWith(t.slice(0,n)))return n;return 0}function IB(e){const t=e.delims.at(-1);return e.exclusive&&(!t||e.exclusive.start>t.start)?e.exclusive:t?{kind:"delim",start:t.start,token:t.token}:e.exclusive}function Q3(e){let t=0;for(let n=0;n0}function J3(e,t){return e+"|"+t.map(n=>` ${n} |`).join("")}function c9(e,t){const n=e.slice(t.length+1).split("|");return e.trimEnd().endsWith("|")&&n.pop(),n}function BB(e,t,n){if(!e.startsWith(t))return!1;const r=e.slice(t.length).trim();if(!r.startsWith("|")||!r.endsWith("|"))return!1;const i=c9(r,"").map(a=>a.trim());return i.length===n&&i.every(a=>/^:?-+:?$/.test(a))}function R_(e,t){let n=t+1;for(;nt+n}function zf(e,t){return t===0||e[t-1]===` -`}function As(e,t){let n=0;for(let r=t-1;r>=0&&e[r]==="\\";r--)n+=1;return n%2===1}function e6(e){return!!e&&/[A-Za-z0-9]/.test(e)}function u9(e){return!!e&&/[A-Za-z]/.test(e)}const d9=k_().use(M_);var eh,qc,Gc,Sl,Vc,th,nh,rh,kl,ih,Cl;class HB{constructor(){ji(this,eh,d9);ji(this,qc,null);ji(this,Gc,{});ji(this,Sl,null);ji(this,Vc,"");ji(this,th,[]);ji(this,nh,[]);ji(this,rh,[]);ji(this,kl,0);ji(this,ih,[]);ji(this,Cl,[])}reconfigure(t,n,r){En(this,qc)!==null&&En(this,eh)===t&&h9(En(this,Gc),r)&&!!En(this,Sl)===n||(Tr(this,eh,t),t.attachers.some(i=>i[0]===If)||(t=t(),t.use(If),t.freeze()),Tr(this,qc,t),Tr(this,Gc,r),Tr(this,Vc,""),Tr(this,th,[]),Tr(this,nh,[]),Tr(this,rh,[]),Tr(this,kl,0),Tr(this,ih,[]),Tr(this,Sl,n?new vB:null))}update(t){En(this,Sl)&&(t=En(this,Sl).update(t));let n=En(this,Vc);if(t===n)return En(this,Cl);const r=En(this,th),i=$B(t,n);let a=r.length-1;for(;a>=0&&!(i>=r[a]);a-=1);let o=r[a]??0;a===-1&&(a=0);const l=ul(En(this,qc)),u=En(this,nh),d=u.slice(a).some(E=>E.some(qb));let m=l.parse(t.slice(o)),f=m.children.map(E=>ul(ul(E.position).start.offset)+o);Tr(this,Vc,t),hg(r.length===u.length),r.splice(a,r.length-a,...f);{const E=Cg(m,f,o);hg(E.length===f.length),u.splice(a,u.length-a,...E)}if(d||qb(m)){a=0,o=0,m=l.parse(t),f=m.children.map(j=>ul(ul(j.position).start.offset)+o),r.splice(0,r.length,...f);const E=Cg(m,f,o);hg(E.length===f.length),u.splice(0,u.length,...E)}const g=Cg(l.runSync(m),f,o),b=En(this,rh),k=En(this,ih),S=En(this,Cl),x=k.length;let _=null,w=0;for(;wx&&(b.length=k.length=r.length);for(let E=r.length=C?D=x-(r.length-j):j=x){b[j]=String(En(this,kl)),Tr(this,kl,En(this,kl)+1),k[j]=null,_&&(_[j]=void 0);continue}b[j]=b[D]??String(q5(this,kl)._++),k[j]=k[D]??null,_&&(_[j]=S[D])}r.length[]);let i=0;for(const o of e.children){const l=(a=o.position)==null?void 0:a.start.offset;if(l!==void 0){for(;i+1i||n!==-1&&t>n||r!==-1&&t>r||WB.test(e.slice(0,t))?e:""}const i6=/[#.]/g;function JB(e,t){const n=e||"",r={};let i=0,a,o;for(;id&&(d=m):m&&(d!==void 0&&d>-1&&u.push(` -`.repeat(d)||" "),d=-1,u.push(m))}return u.join("")}function _9(e,t,n){return e.type==="element"?yH(e,t,n):e.type==="text"?n.whitespace==="normal"?x9(e,n):wH(e):[]}function yH(e,t,n){const r=y9(e,n),i=e.children||[];let a=-1,o=[];if(_H(e))return o;let l,u;for(Vb(e)||d6(e)&&o6(t,e,d6)?u=` -`:vH(e)?(l=2,u=2):v9(e)&&(l=1,u=1);++a15?d="…"+l.slice(i-15,i):d=l.slice(0,i);var m;a+15e.replace(AH,"-$1").toLowerCase(),NH={"&":"&",">":">","<":"<",'"':""","'":"'"},jH=/[&><"']/g,Or=e=>String(e).replace(jH,t=>NH[t]),mf=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?mf(e.body[0]):e:e.type==="font"?mf(e.body):e,MH=new Set(["mathord","textord","atom"]),Pa=e=>MH.has(mf(e).type),RH=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},Wb={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function DH(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function LH(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return DH(t)}function OH(e,t,n,r){var i=n[t];e[t]=i!==void 0?r.processor?r.processor(i):i:LH(r)}class L_{constructor(t){t===void 0&&(t={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n of Object.keys(Wb)){var r=Wb[n];r&&OH(this,n,t,r)}}reportNonstrict(t,n,r){var i=this.strict;if(typeof i=="function"&&(i=i(t,n,r)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Be("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),r);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,r){var i=this.strict;if(typeof i=="function")try{i=i(t,n,r)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=RH(t.url);if(n==null)return!1;t.protocol=n}var r=typeof this.trust=="function"?this.trust(t):this.trust;return!!r}}class Ao{constructor(t,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=r}sup(){return Ws[IH[this.id]]}sub(){return Ws[zH[this.id]]}fracNum(){return Ws[BH[this.id]]}fracDen(){return Ws[HH[this.id]]}cramp(){return Ws[$H[this.id]]}text(){return Ws[FH[this.id]]}isTight(){return this.size>=2}}var O_=0,Bf=1,Hc=2,Da=3,Rd=4,os=5,Xc=6,Kr=7,Ws=[new Ao(O_,0,!1),new Ao(Bf,0,!0),new Ao(Hc,1,!1),new Ao(Da,1,!0),new Ao(Rd,2,!1),new Ao(os,2,!0),new Ao(Xc,3,!1),new Ao(Kr,3,!0)],IH=[Rd,os,Rd,os,Xc,Kr,Xc,Kr],zH=[os,os,os,os,Kr,Kr,Kr,Kr],BH=[Hc,Da,Rd,os,Xc,Kr,Xc,Kr],HH=[Da,Da,os,os,Kr,Kr,Kr,Kr],$H=[Bf,Bf,Da,Da,os,os,Kr,Kr],FH=[O_,Bf,Hc,Da,Hc,Da,Hc,Da],vt={DISPLAY:Ws[O_],TEXT:Ws[Hc],SCRIPT:Ws[Rd],SCRIPTSCRIPT:Ws[Xc]},Yb=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function PH(e){for(var t=0;t=i[0]&&e<=i[1])return n.name}return null}var gf=[];Yb.forEach(e=>e.blocks.forEach(t=>gf.push(...t)));function w9(e){for(var t=0;t=gf[t]&&e<=gf[t+1])return!0;return!1}var dr=e=>e+" "+e,kc=80,UH=function(t,n){return"M95,"+(622+t+n)+` +`+f}function Dc(e,t){return e+t.slice(HB(e,t))}function l9(e,t){var i;const n=(i=e.match(/[^\S\n]+$/))==null?void 0:i[0];if(!n)return Dc(e,t);const r=e.slice(0,-n.length);return Dc(r,t)+n}function HB(e,t){for(let n=Math.min(e.length,t.length);n>0;n-=1)if(e.endsWith(t.slice(0,n)))return n;return 0}function $B(e){const t=e.delims.at(-1);return e.exclusive&&(!t||e.exclusive.start>t.start)?e.exclusive:t?{kind:"delim",start:t.start,token:t.token}:e.exclusive}function t6(e){let t=0;for(let n=0;n0}function n6(e,t){return e+"|"+t.map(n=>` ${n} |`).join("")}function c9(e,t){const n=e.slice(t.length+1).split("|");return e.trimEnd().endsWith("|")&&n.pop(),n}function PB(e,t,n){if(!e.startsWith(t))return!1;const r=e.slice(t.length).trim();if(!r.startsWith("|")||!r.endsWith("|"))return!1;const i=c9(r,"").map(a=>a.trim());return i.length===n&&i.every(a=>/^:?-+:?$/.test(a))}function I_(e,t){let n=t+1;for(;nt+n}function Bf(e,t){return t===0||e[t-1]===` +`}function Ss(e,t){let n=0;for(let r=t-1;r>=0&&e[r]==="\\";r--)n+=1;return n%2===1}function r6(e){return!!e&&/[A-Za-z0-9]/.test(e)}function u9(e){return!!e&&/[A-Za-z]/.test(e)}const d9=T_().use(O_);var th,qc,Gc,Cl,Vc,nh,rh,ih,El,sh,Al;class UB{constructor(){Ti(this,th,d9);Ti(this,qc,null);Ti(this,Gc,{});Ti(this,Cl,null);Ti(this,Vc,"");Ti(this,nh,[]);Ti(this,rh,[]);Ti(this,ih,[]);Ti(this,El,0);Ti(this,sh,[]);Ti(this,Al,[])}reconfigure(t,n,r){Cn(this,qc)!==null&&Cn(this,th)===t&&h9(Cn(this,Gc),r)&&!!Cn(this,Cl)===n||(Ar(this,th,t),t.attachers.some(i=>i[0]===zf)||(t=t(),t.use(zf),t.freeze()),Ar(this,qc,t),Ar(this,Gc,r),Ar(this,Vc,""),Ar(this,nh,[]),Ar(this,rh,[]),Ar(this,ih,[]),Ar(this,El,0),Ar(this,sh,[]),Ar(this,Cl,n?new wB:null))}update(t){Cn(this,Cl)&&(t=Cn(this,Cl).update(t));let n=Cn(this,Vc);if(t===n)return Cn(this,Al);const r=Cn(this,nh),i=qB(t,n);let a=r.length-1;for(;a>=0&&!(i>=r[a]);a-=1);let o=r[a]??0;a===-1&&(a=0);const l=hl(Cn(this,qc)),c=Cn(this,rh),d=c.slice(a).some(E=>E.some(Wb));let m=l.parse(t.slice(o)),f=m.children.map(E=>hl(hl(E.position).start.offset)+o);Ar(this,Vc,t),pg(r.length===c.length),r.splice(a,r.length-a,...f);{const E=Ag(m,f,o);pg(E.length===f.length),c.splice(a,c.length-a,...E)}if(d||Wb(m)){a=0,o=0,m=l.parse(t),f=m.children.map(M=>hl(hl(M.position).start.offset)+o),r.splice(0,r.length,...f);const E=Ag(m,f,o);pg(E.length===f.length),c.splice(0,c.length,...E)}const g=Ag(l.runSync(m),f,o),b=Cn(this,ih),k=Cn(this,sh),S=Cn(this,Al),x=k.length;let v=null,w=0;for(;wx&&(b.length=k.length=r.length);for(let E=r.length=C?D=x-(r.length-M):M=x){b[M]=String(Cn(this,El)),Ar(this,El,Cn(this,El)+1),k[M]=null,v&&(v[M]=void 0);continue}b[M]=b[D]??String(W5(this,El)._++),k[M]=k[D]??null,v&&(v[M]=S[D])}r.length[]);let i=0;for(const o of e.children){const l=(a=o.position)==null?void 0:a.start.offset;if(l!==void 0){for(;i+1i||n!==-1&&t>n||r!==-1&&t>r||ZB.test(e.slice(0,t))?e:""}const o6=/[#.]/g;function rH(e,t){const n=e||"",r={};let i=0,a,o;for(;id&&(d=m):m&&(d!==void 0&&d>-1&&c.push(` +`.repeat(d)||" "),d=-1,c.push(m))}return c.join("")}function _9(e,t,n){return e.type==="element"?CH(e,t,n):e.type==="text"?n.whitespace==="normal"?x9(e,n):EH(e):[]}function CH(e,t,n){const r=y9(e,n),i=e.children||[];let a=-1,o=[];if(SH(e))return o;let l,c;for(Xb(e)||p6(e)&&u6(t,e,p6)?c=` +`:wH(e)?(l=2,c=2):v9(e)&&(l=1,c=1);++a15?d="…"+l.slice(i-15,i):d=l.slice(0,i);var m;a+15e.replace(MH,"-$1").toLowerCase(),DH={"&":"&",">":">","<":"<",'"':""","'":"'"},LH=/[&><"']/g,Lr=e=>String(e).replace(LH,t=>DH[t]),gf=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?gf(e.body[0]):e:e.type==="font"?gf(e.body):e,OH=new Set(["mathord","textord","atom"]),Pa=e=>OH.has(gf(e).type),IH=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},Kb={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function zH(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function BH(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return zH(t)}function HH(e,t,n,r){var i=n[t];e[t]=i!==void 0?r.processor?r.processor(i):i:BH(r)}class B_{constructor(t){t===void 0&&(t={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n of Object.keys(Kb)){var r=Kb[n];r&&HH(this,n,t,r)}}reportNonstrict(t,n,r){var i=this.strict;if(typeof i=="function"&&(i=i(t,n,r)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new ze("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),r);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,r){var i=this.strict;if(typeof i=="function")try{i=i(t,n,r)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=IH(t.url);if(n==null)return!1;t.protocol=n}var r=typeof this.trust=="function"?this.trust(t):this.trust;return!!r}}class Ao{constructor(t,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=r}sup(){return Vs[$H[this.id]]}sub(){return Vs[FH[this.id]]}fracNum(){return Vs[PH[this.id]]}fracDen(){return Vs[UH[this.id]]}cramp(){return Vs[qH[this.id]]}text(){return Vs[GH[this.id]]}isTight(){return this.size>=2}}var H_=0,Hf=1,Hc=2,Da=3,Dd=4,ss=5,Xc=6,Yr=7,Vs=[new Ao(H_,0,!1),new Ao(Hf,0,!0),new Ao(Hc,1,!1),new Ao(Da,1,!0),new Ao(Dd,2,!1),new Ao(ss,2,!0),new Ao(Xc,3,!1),new Ao(Yr,3,!0)],$H=[Dd,ss,Dd,ss,Xc,Yr,Xc,Yr],FH=[ss,ss,ss,ss,Yr,Yr,Yr,Yr],PH=[Hc,Da,Dd,ss,Xc,Yr,Xc,Yr],UH=[Da,Da,ss,ss,Yr,Yr,Yr,Yr],qH=[Hf,Hf,Da,Da,ss,ss,Yr,Yr],GH=[H_,Hf,Hc,Da,Hc,Da,Hc,Da],bt={DISPLAY:Vs[H_],TEXT:Vs[Hc],SCRIPT:Vs[Dd],SCRIPTSCRIPT:Vs[Xc]},Zb=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function VH(e){for(var t=0;t=i[0]&&e<=i[1])return n.name}return null}var bf=[];Zb.forEach(e=>e.blocks.forEach(t=>bf.push(...t)));function w9(e){for(var t=0;t=bf[t]&&e<=bf[t+1])return!0;return!1}var ur=e=>e+" "+e,kc=80,WH=function(t,n){return"M95,"+(622+t+n)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 @@ -625,7 +620,7 @@ c5.3,-9.3,12,-14,20,-14 H400000v`+(40+t)+`H845.2724 s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},qH=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119 +M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},YH=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119 c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 c340,-704.7,510.7,-1060.3,512,-1067 l`+t/2.084+" -"+t+` @@ -635,7 +630,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5, c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},GH=function(t,n){return"M983 "+(10+t+n)+` +M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},XH=function(t,n){return"M983 "+(10+t+n)+` l`+t/3.13+" -"+t+` c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+` H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 @@ -644,7 +639,7 @@ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},VH=function(t,n){return"M424,"+(2398+t+n)+` +M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},KH=function(t,n){return"M424,"+(2398+t+n)+` c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 @@ -654,18 +649,18 @@ v`+(40+t)+`H1014.6 s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+` -h400000v`+(40+t)+"h-400000z"},WH=function(t,n){return"M473,"+(2713+t+n)+` +h400000v`+(40+t)+"h-400000z"},ZH=function(t,n){return"M473,"+(2713+t+n)+` c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+` c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7 s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, -606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},YH=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},XH=function(t,n,r){var i=r-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+` +606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},QH=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},JH=function(t,n,r){var i=r-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+` H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 -219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},KH=function(t,n,r){n=1e3*n;var i="";switch(t){case"sqrtMain":i=UH(n,kc);break;case"sqrtSize1":i=qH(n,kc);break;case"sqrtSize2":i=GH(n,kc);break;case"sqrtSize3":i=VH(n,kc);break;case"sqrtSize4":i=WH(n,kc);break;case"sqrtTall":i=XH(n,kc,r)}return i},ZH=function(t,n){switch(t){case"⎜":return dr("M291 0 H417 V"+n+" H291z");case"∣":return dr("M145 0 H188 V"+n+" H145z");case"∥":return dr("M145 0 H188 V"+n+" H145z")+dr("M367 0 H410 V"+n+" H367z");case"⎟":return dr("M457 0 H583 V"+n+" H457z");case"⎢":return dr("M319 0 H403 V"+n+" H319z");case"⎥":return dr("M263 0 H347 V"+n+" H263z");case"⎪":return dr("M384 0 H504 V"+n+" H384z");case"⏐":return dr("M312 0 H355 V"+n+" H312z");case"‖":return dr("M257 0 H300 V"+n+" H257z")+dr("M478 0 H521 V"+n+" H478z");default:return""}},h6={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},e$=function(t,n,r){n=1e3*n;var i="";switch(t){case"sqrtMain":i=WH(n,kc);break;case"sqrtSize1":i=YH(n,kc);break;case"sqrtSize2":i=XH(n,kc);break;case"sqrtSize3":i=KH(n,kc);break;case"sqrtSize4":i=ZH(n,kc);break;case"sqrtTall":i=JH(n,kc,r)}return i},t$=function(t,n){switch(t){case"⎜":return ur("M291 0 H417 V"+n+" H291z");case"∣":return ur("M145 0 H188 V"+n+" H145z");case"∥":return ur("M145 0 H188 V"+n+" H145z")+ur("M367 0 H410 V"+n+" H367z");case"⎟":return ur("M457 0 H583 V"+n+" H457z");case"⎢":return ur("M319 0 H403 V"+n+" H319z");case"⎥":return ur("M263 0 H347 V"+n+" H263z");case"⎪":return ur("M384 0 H504 V"+n+" H384z");case"⏐":return ur("M312 0 H355 V"+n+" H312z");case"‖":return ur("M257 0 H300 V"+n+" H257z")+ur("M478 0 H521 V"+n+" H478z");default:return""}},m6={doubleleftarrow:`M262 157 l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 @@ -711,10 +706,10 @@ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 - 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:dr("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:dr("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:dr("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:dr("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:ur("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:ur("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:ur("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:ur("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 - 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:dr("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:ur("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 @@ -763,7 +758,7 @@ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 - 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:dr("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:dr("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:dr("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 + 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:ur("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:ur("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:ur("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 @@ -836,7 +831,7 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z` c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},QH=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84 +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},n$=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84 H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 @@ -864,82 +859,84 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function JH(e){return"toText"in e}class lu{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n{if(JH(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var Xb={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},e$={ex:!0,em:!0,mu:!0},S9=function(t){return typeof t!="string"&&(t=t.unit),t in Xb||t in e$||t==="ex"},In=function(t,n){var r;if(t.unit in Xb)r=Xb[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var i;if(n.style.isTight()?i=n.havingStyle(n.style.text()):i=n,t.unit==="ex")r=i.fontMetrics().xHeight;else if(t.unit==="em")r=i.fontMetrics().quad;else throw new Be("Invalid unit: '"+t.unit+"'");i!==n&&(r*=i.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*r,n.maxSize)},$e=function(t){return+t.toFixed(4)+"em"},zo=function(t){return t.filter(n=>n).join(" ")},I_=function(t){var n="";for(var r of Object.keys(t)){var i=t[r];i!==void 0&&(n+=TH(r)+":"+i+";")}return n},k9=function(t,n,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var i=n.getColor();i&&(this.style.color=i)}},C9=function(t){var n=document.createElement(t);n.className=zo(this.classes),Object.assign(n.style,this.style);for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i/=\x00-\x1f]/,E9=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+Or(zo(this.classes))+'"');var r=I_(this.style);r&&(n+=' style="'+Or(r)+'"');for(var i of Object.keys(this.attributes)){if(t$.test(i))throw new Be("Invalid attribute name '"+i+"'");n+=" "+i+'="'+Or(this.attributes[i])+'"'}n+=">";for(var a=0;a",n};class cu{constructor(t,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,k9.call(this,t,r,i),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return C9.call(this,"span")}toMarkup(){return E9.call(this,"span")}}class gp{constructor(t,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,k9.call(this,n,i),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return C9.call(this,"a")}toMarkup(){return E9.call(this,"a")}}class n${constructor(t,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t=''+Or(this.alt)+'0&&(n=document.createElement("span"),n.style.marginRight=$e(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=zo(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="0&&(r+="margin-right:"+$e(this.italic)+";"),r+=I_(this.style),r&&(t=!0,n+=' style="'+Or(r)+'"');var i=Or(this.text);return t?(n+=">",n+=i,n+="",n):i}}class Ia{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i':''}}class Kb{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var t=" but got "+String(e)+".")}var a$=e=>e instanceof cu||e instanceof gp||e instanceof lu,Xs={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},O0={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},f6={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function o$(e,t){Xs[e]=t}function z_(e,t,n){if(!Xs[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=Xs[t][r];if(!i&&e[0]in f6&&(r=f6[e[0]].charCodeAt(0),i=Xs[t][r]),!i&&n==="text"&&w9(r)&&(i=Xs[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Tg={};function l$(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!Tg[t]){var n=Tg[t]={cssEmPerMu:O0.quad[t]/18};for(var r in O0)O0.hasOwnProperty(r)&&(n[r]=O0[r][t])}return Tg[t]}var Tn={math:{},text:{}};function L(e,t,n,r,i,a){Tn[e][i]={font:t,group:n,replace:r},a&&r&&(Tn[e][r]=Tn[e][i])}var P="math",Me="text",K="main",ae="ams",jn="accent-token",Ke="bin",Qr="close",uu="inner",ft="mathord",ir="op-token",Ui="open",gh="punct",ue="rel",Ua="spacing",fe="textord";L(P,K,ue,"≡","\\equiv",!0);L(P,K,ue,"≺","\\prec",!0);L(P,K,ue,"≻","\\succ",!0);L(P,K,ue,"∼","\\sim",!0);L(P,K,ue,"⊥","\\perp");L(P,K,ue,"⪯","\\preceq",!0);L(P,K,ue,"⪰","\\succeq",!0);L(P,K,ue,"≃","\\simeq",!0);L(P,K,ue,"∣","\\mid",!0);L(P,K,ue,"≪","\\ll",!0);L(P,K,ue,"≫","\\gg",!0);L(P,K,ue,"≍","\\asymp",!0);L(P,K,ue,"∥","\\parallel");L(P,K,ue,"⋈","\\bowtie",!0);L(P,K,ue,"⌣","\\smile",!0);L(P,K,ue,"⊑","\\sqsubseteq",!0);L(P,K,ue,"⊒","\\sqsupseteq",!0);L(P,K,ue,"≐","\\doteq",!0);L(P,K,ue,"⌢","\\frown",!0);L(P,K,ue,"∋","\\ni",!0);L(P,K,ue,"∝","\\propto",!0);L(P,K,ue,"⊢","\\vdash",!0);L(P,K,ue,"⊣","\\dashv",!0);L(P,K,ue,"∋","\\owns");L(P,K,gh,".","\\ldotp");L(P,K,gh,"⋅","\\cdotp");L(P,K,gh,"⋅","·");L(Me,K,fe,"⋅","·");L(P,K,fe,"#","\\#");L(Me,K,fe,"#","\\#");L(P,K,fe,"&","\\&");L(Me,K,fe,"&","\\&");L(P,K,fe,"ℵ","\\aleph",!0);L(P,K,fe,"∀","\\forall",!0);L(P,K,fe,"ℏ","\\hbar",!0);L(P,K,fe,"∃","\\exists",!0);L(P,K,fe,"∇","\\nabla",!0);L(P,K,fe,"♭","\\flat",!0);L(P,K,fe,"ℓ","\\ell",!0);L(P,K,fe,"♮","\\natural",!0);L(P,K,fe,"♣","\\clubsuit",!0);L(P,K,fe,"℘","\\wp",!0);L(P,K,fe,"♯","\\sharp",!0);L(P,K,fe,"♢","\\diamondsuit",!0);L(P,K,fe,"ℜ","\\Re",!0);L(P,K,fe,"♡","\\heartsuit",!0);L(P,K,fe,"ℑ","\\Im",!0);L(P,K,fe,"♠","\\spadesuit",!0);L(P,K,fe,"§","\\S",!0);L(Me,K,fe,"§","\\S");L(P,K,fe,"¶","\\P",!0);L(Me,K,fe,"¶","\\P");L(P,K,fe,"†","\\dag");L(Me,K,fe,"†","\\dag");L(Me,K,fe,"†","\\textdagger");L(P,K,fe,"‡","\\ddag");L(Me,K,fe,"‡","\\ddag");L(Me,K,fe,"‡","\\textdaggerdbl");L(P,K,Qr,"⎱","\\rmoustache",!0);L(P,K,Ui,"⎰","\\lmoustache",!0);L(P,K,Qr,"⟯","\\rgroup",!0);L(P,K,Ui,"⟮","\\lgroup",!0);L(P,K,Ke,"∓","\\mp",!0);L(P,K,Ke,"⊖","\\ominus",!0);L(P,K,Ke,"⊎","\\uplus",!0);L(P,K,Ke,"⊓","\\sqcap",!0);L(P,K,Ke,"∗","\\ast");L(P,K,Ke,"⊔","\\sqcup",!0);L(P,K,Ke,"◯","\\bigcirc",!0);L(P,K,Ke,"∙","\\bullet",!0);L(P,K,Ke,"‡","\\ddagger");L(P,K,Ke,"≀","\\wr",!0);L(P,K,Ke,"⨿","\\amalg");L(P,K,Ke,"&","\\And");L(P,K,ue,"⟵","\\longleftarrow",!0);L(P,K,ue,"⇐","\\Leftarrow",!0);L(P,K,ue,"⟸","\\Longleftarrow",!0);L(P,K,ue,"⟶","\\longrightarrow",!0);L(P,K,ue,"⇒","\\Rightarrow",!0);L(P,K,ue,"⟹","\\Longrightarrow",!0);L(P,K,ue,"↔","\\leftrightarrow",!0);L(P,K,ue,"⟷","\\longleftrightarrow",!0);L(P,K,ue,"⇔","\\Leftrightarrow",!0);L(P,K,ue,"⟺","\\Longleftrightarrow",!0);L(P,K,ue,"↦","\\mapsto",!0);L(P,K,ue,"⟼","\\longmapsto",!0);L(P,K,ue,"↗","\\nearrow",!0);L(P,K,ue,"↩","\\hookleftarrow",!0);L(P,K,ue,"↪","\\hookrightarrow",!0);L(P,K,ue,"↘","\\searrow",!0);L(P,K,ue,"↼","\\leftharpoonup",!0);L(P,K,ue,"⇀","\\rightharpoonup",!0);L(P,K,ue,"↙","\\swarrow",!0);L(P,K,ue,"↽","\\leftharpoondown",!0);L(P,K,ue,"⇁","\\rightharpoondown",!0);L(P,K,ue,"↖","\\nwarrow",!0);L(P,K,ue,"⇌","\\rightleftharpoons",!0);L(P,ae,ue,"≮","\\nless",!0);L(P,ae,ue,"","\\@nleqslant");L(P,ae,ue,"","\\@nleqq");L(P,ae,ue,"⪇","\\lneq",!0);L(P,ae,ue,"≨","\\lneqq",!0);L(P,ae,ue,"","\\@lvertneqq");L(P,ae,ue,"⋦","\\lnsim",!0);L(P,ae,ue,"⪉","\\lnapprox",!0);L(P,ae,ue,"⊀","\\nprec",!0);L(P,ae,ue,"⋠","\\npreceq",!0);L(P,ae,ue,"⋨","\\precnsim",!0);L(P,ae,ue,"⪹","\\precnapprox",!0);L(P,ae,ue,"≁","\\nsim",!0);L(P,ae,ue,"","\\@nshortmid");L(P,ae,ue,"∤","\\nmid",!0);L(P,ae,ue,"⊬","\\nvdash",!0);L(P,ae,ue,"⊭","\\nvDash",!0);L(P,ae,ue,"⋪","\\ntriangleleft");L(P,ae,ue,"⋬","\\ntrianglelefteq",!0);L(P,ae,ue,"⊊","\\subsetneq",!0);L(P,ae,ue,"","\\@varsubsetneq");L(P,ae,ue,"⫋","\\subsetneqq",!0);L(P,ae,ue,"","\\@varsubsetneqq");L(P,ae,ue,"≯","\\ngtr",!0);L(P,ae,ue,"","\\@ngeqslant");L(P,ae,ue,"","\\@ngeqq");L(P,ae,ue,"⪈","\\gneq",!0);L(P,ae,ue,"≩","\\gneqq",!0);L(P,ae,ue,"","\\@gvertneqq");L(P,ae,ue,"⋧","\\gnsim",!0);L(P,ae,ue,"⪊","\\gnapprox",!0);L(P,ae,ue,"⊁","\\nsucc",!0);L(P,ae,ue,"⋡","\\nsucceq",!0);L(P,ae,ue,"⋩","\\succnsim",!0);L(P,ae,ue,"⪺","\\succnapprox",!0);L(P,ae,ue,"≆","\\ncong",!0);L(P,ae,ue,"","\\@nshortparallel");L(P,ae,ue,"∦","\\nparallel",!0);L(P,ae,ue,"⊯","\\nVDash",!0);L(P,ae,ue,"⋫","\\ntriangleright");L(P,ae,ue,"⋭","\\ntrianglerighteq",!0);L(P,ae,ue,"","\\@nsupseteqq");L(P,ae,ue,"⊋","\\supsetneq",!0);L(P,ae,ue,"","\\@varsupsetneq");L(P,ae,ue,"⫌","\\supsetneqq",!0);L(P,ae,ue,"","\\@varsupsetneqq");L(P,ae,ue,"⊮","\\nVdash",!0);L(P,ae,ue,"⪵","\\precneqq",!0);L(P,ae,ue,"⪶","\\succneqq",!0);L(P,ae,ue,"","\\@nsubseteqq");L(P,ae,Ke,"⊴","\\unlhd");L(P,ae,Ke,"⊵","\\unrhd");L(P,ae,ue,"↚","\\nleftarrow",!0);L(P,ae,ue,"↛","\\nrightarrow",!0);L(P,ae,ue,"⇍","\\nLeftarrow",!0);L(P,ae,ue,"⇏","\\nRightarrow",!0);L(P,ae,ue,"↮","\\nleftrightarrow",!0);L(P,ae,ue,"⇎","\\nLeftrightarrow",!0);L(P,ae,ue,"△","\\vartriangle");L(P,ae,fe,"ℏ","\\hslash");L(P,ae,fe,"▽","\\triangledown");L(P,ae,fe,"◊","\\lozenge");L(P,ae,fe,"Ⓢ","\\circledS");L(P,ae,fe,"®","\\circledR");L(Me,ae,fe,"®","\\circledR");L(P,ae,fe,"∡","\\measuredangle",!0);L(P,ae,fe,"∄","\\nexists");L(P,ae,fe,"℧","\\mho");L(P,ae,fe,"Ⅎ","\\Finv",!0);L(P,ae,fe,"⅁","\\Game",!0);L(P,ae,fe,"‵","\\backprime");L(P,ae,fe,"▲","\\blacktriangle");L(P,ae,fe,"▼","\\blacktriangledown");L(P,ae,fe,"■","\\blacksquare");L(P,ae,fe,"⧫","\\blacklozenge");L(P,ae,fe,"★","\\bigstar");L(P,ae,fe,"∢","\\sphericalangle",!0);L(P,ae,fe,"∁","\\complement",!0);L(P,ae,fe,"ð","\\eth",!0);L(Me,K,fe,"ð","ð");L(P,ae,fe,"╱","\\diagup");L(P,ae,fe,"╲","\\diagdown");L(P,ae,fe,"□","\\square");L(P,ae,fe,"□","\\Box");L(P,ae,fe,"◊","\\Diamond");L(P,ae,fe,"¥","\\yen",!0);L(Me,ae,fe,"¥","\\yen",!0);L(P,ae,fe,"✓","\\checkmark",!0);L(Me,ae,fe,"✓","\\checkmark");L(P,ae,fe,"ℶ","\\beth",!0);L(P,ae,fe,"ℸ","\\daleth",!0);L(P,ae,fe,"ℷ","\\gimel",!0);L(P,ae,fe,"ϝ","\\digamma",!0);L(P,ae,fe,"ϰ","\\varkappa");L(P,ae,Ui,"┌","\\@ulcorner",!0);L(P,ae,Qr,"┐","\\@urcorner",!0);L(P,ae,Ui,"└","\\@llcorner",!0);L(P,ae,Qr,"┘","\\@lrcorner",!0);L(P,ae,ue,"≦","\\leqq",!0);L(P,ae,ue,"⩽","\\leqslant",!0);L(P,ae,ue,"⪕","\\eqslantless",!0);L(P,ae,ue,"≲","\\lesssim",!0);L(P,ae,ue,"⪅","\\lessapprox",!0);L(P,ae,ue,"≊","\\approxeq",!0);L(P,ae,Ke,"⋖","\\lessdot");L(P,ae,ue,"⋘","\\lll",!0);L(P,ae,ue,"≶","\\lessgtr",!0);L(P,ae,ue,"⋚","\\lesseqgtr",!0);L(P,ae,ue,"⪋","\\lesseqqgtr",!0);L(P,ae,ue,"≑","\\doteqdot");L(P,ae,ue,"≓","\\risingdotseq",!0);L(P,ae,ue,"≒","\\fallingdotseq",!0);L(P,ae,ue,"∽","\\backsim",!0);L(P,ae,ue,"⋍","\\backsimeq",!0);L(P,ae,ue,"⫅","\\subseteqq",!0);L(P,ae,ue,"⋐","\\Subset",!0);L(P,ae,ue,"⊏","\\sqsubset",!0);L(P,ae,ue,"≼","\\preccurlyeq",!0);L(P,ae,ue,"⋞","\\curlyeqprec",!0);L(P,ae,ue,"≾","\\precsim",!0);L(P,ae,ue,"⪷","\\precapprox",!0);L(P,ae,ue,"⊲","\\vartriangleleft");L(P,ae,ue,"⊴","\\trianglelefteq");L(P,ae,ue,"⊨","\\vDash",!0);L(P,ae,ue,"⊪","\\Vvdash",!0);L(P,ae,ue,"⌣","\\smallsmile");L(P,ae,ue,"⌢","\\smallfrown");L(P,ae,ue,"≏","\\bumpeq",!0);L(P,ae,ue,"≎","\\Bumpeq",!0);L(P,ae,ue,"≧","\\geqq",!0);L(P,ae,ue,"⩾","\\geqslant",!0);L(P,ae,ue,"⪖","\\eqslantgtr",!0);L(P,ae,ue,"≳","\\gtrsim",!0);L(P,ae,ue,"⪆","\\gtrapprox",!0);L(P,ae,Ke,"⋗","\\gtrdot");L(P,ae,ue,"⋙","\\ggg",!0);L(P,ae,ue,"≷","\\gtrless",!0);L(P,ae,ue,"⋛","\\gtreqless",!0);L(P,ae,ue,"⪌","\\gtreqqless",!0);L(P,ae,ue,"≖","\\eqcirc",!0);L(P,ae,ue,"≗","\\circeq",!0);L(P,ae,ue,"≜","\\triangleq",!0);L(P,ae,ue,"∼","\\thicksim");L(P,ae,ue,"≈","\\thickapprox");L(P,ae,ue,"⫆","\\supseteqq",!0);L(P,ae,ue,"⋑","\\Supset",!0);L(P,ae,ue,"⊐","\\sqsupset",!0);L(P,ae,ue,"≽","\\succcurlyeq",!0);L(P,ae,ue,"⋟","\\curlyeqsucc",!0);L(P,ae,ue,"≿","\\succsim",!0);L(P,ae,ue,"⪸","\\succapprox",!0);L(P,ae,ue,"⊳","\\vartriangleright");L(P,ae,ue,"⊵","\\trianglerighteq");L(P,ae,ue,"⊩","\\Vdash",!0);L(P,ae,ue,"∣","\\shortmid");L(P,ae,ue,"∥","\\shortparallel");L(P,ae,ue,"≬","\\between",!0);L(P,ae,ue,"⋔","\\pitchfork",!0);L(P,ae,ue,"∝","\\varpropto");L(P,ae,ue,"◀","\\blacktriangleleft");L(P,ae,ue,"∴","\\therefore",!0);L(P,ae,ue,"∍","\\backepsilon");L(P,ae,ue,"▶","\\blacktriangleright");L(P,ae,ue,"∵","\\because",!0);L(P,ae,ue,"⋘","\\llless");L(P,ae,ue,"⋙","\\gggtr");L(P,ae,Ke,"⊲","\\lhd");L(P,ae,Ke,"⊳","\\rhd");L(P,ae,ue,"≂","\\eqsim",!0);L(P,K,ue,"⋈","\\Join");L(P,ae,ue,"≑","\\Doteq",!0);L(P,ae,Ke,"∔","\\dotplus",!0);L(P,ae,Ke,"∖","\\smallsetminus");L(P,ae,Ke,"⋒","\\Cap",!0);L(P,ae,Ke,"⋓","\\Cup",!0);L(P,ae,Ke,"⩞","\\doublebarwedge",!0);L(P,ae,Ke,"⊟","\\boxminus",!0);L(P,ae,Ke,"⊞","\\boxplus",!0);L(P,ae,Ke,"⋇","\\divideontimes",!0);L(P,ae,Ke,"⋉","\\ltimes",!0);L(P,ae,Ke,"⋊","\\rtimes",!0);L(P,ae,Ke,"⋋","\\leftthreetimes",!0);L(P,ae,Ke,"⋌","\\rightthreetimes",!0);L(P,ae,Ke,"⋏","\\curlywedge",!0);L(P,ae,Ke,"⋎","\\curlyvee",!0);L(P,ae,Ke,"⊝","\\circleddash",!0);L(P,ae,Ke,"⊛","\\circledast",!0);L(P,ae,Ke,"⋅","\\centerdot");L(P,ae,Ke,"⊺","\\intercal",!0);L(P,ae,Ke,"⋒","\\doublecap");L(P,ae,Ke,"⋓","\\doublecup");L(P,ae,Ke,"⊠","\\boxtimes",!0);L(P,ae,ue,"⇢","\\dashrightarrow",!0);L(P,ae,ue,"⇠","\\dashleftarrow",!0);L(P,ae,ue,"⇇","\\leftleftarrows",!0);L(P,ae,ue,"⇆","\\leftrightarrows",!0);L(P,ae,ue,"⇚","\\Lleftarrow",!0);L(P,ae,ue,"↞","\\twoheadleftarrow",!0);L(P,ae,ue,"↢","\\leftarrowtail",!0);L(P,ae,ue,"↫","\\looparrowleft",!0);L(P,ae,ue,"⇋","\\leftrightharpoons",!0);L(P,ae,ue,"↶","\\curvearrowleft",!0);L(P,ae,ue,"↺","\\circlearrowleft",!0);L(P,ae,ue,"↰","\\Lsh",!0);L(P,ae,ue,"⇈","\\upuparrows",!0);L(P,ae,ue,"↿","\\upharpoonleft",!0);L(P,ae,ue,"⇃","\\downharpoonleft",!0);L(P,K,ue,"⊶","\\origof",!0);L(P,K,ue,"⊷","\\imageof",!0);L(P,ae,ue,"⊸","\\multimap",!0);L(P,ae,ue,"↭","\\leftrightsquigarrow",!0);L(P,ae,ue,"⇉","\\rightrightarrows",!0);L(P,ae,ue,"⇄","\\rightleftarrows",!0);L(P,ae,ue,"↠","\\twoheadrightarrow",!0);L(P,ae,ue,"↣","\\rightarrowtail",!0);L(P,ae,ue,"↬","\\looparrowright",!0);L(P,ae,ue,"↷","\\curvearrowright",!0);L(P,ae,ue,"↻","\\circlearrowright",!0);L(P,ae,ue,"↱","\\Rsh",!0);L(P,ae,ue,"⇊","\\downdownarrows",!0);L(P,ae,ue,"↾","\\upharpoonright",!0);L(P,ae,ue,"⇂","\\downharpoonright",!0);L(P,ae,ue,"⇝","\\rightsquigarrow",!0);L(P,ae,ue,"⇝","\\leadsto");L(P,ae,ue,"⇛","\\Rrightarrow",!0);L(P,ae,ue,"↾","\\restriction");L(P,K,fe,"‘","`");L(P,K,fe,"$","\\$");L(Me,K,fe,"$","\\$");L(Me,K,fe,"$","\\textdollar");L(P,K,fe,"%","\\%");L(Me,K,fe,"%","\\%");L(P,K,fe,"_","\\_");L(Me,K,fe,"_","\\_");L(Me,K,fe,"_","\\textunderscore");L(P,K,fe,"∠","\\angle",!0);L(P,K,fe,"∞","\\infty",!0);L(P,K,fe,"′","\\prime");L(P,K,fe,"△","\\triangle");L(P,K,fe,"Γ","\\Gamma",!0);L(P,K,fe,"Δ","\\Delta",!0);L(P,K,fe,"Θ","\\Theta",!0);L(P,K,fe,"Λ","\\Lambda",!0);L(P,K,fe,"Ξ","\\Xi",!0);L(P,K,fe,"Π","\\Pi",!0);L(P,K,fe,"Σ","\\Sigma",!0);L(P,K,fe,"Υ","\\Upsilon",!0);L(P,K,fe,"Φ","\\Phi",!0);L(P,K,fe,"Ψ","\\Psi",!0);L(P,K,fe,"Ω","\\Omega",!0);L(P,K,fe,"A","Α");L(P,K,fe,"B","Β");L(P,K,fe,"E","Ε");L(P,K,fe,"Z","Ζ");L(P,K,fe,"H","Η");L(P,K,fe,"I","Ι");L(P,K,fe,"K","Κ");L(P,K,fe,"M","Μ");L(P,K,fe,"N","Ν");L(P,K,fe,"O","Ο");L(P,K,fe,"P","Ρ");L(P,K,fe,"T","Τ");L(P,K,fe,"X","Χ");L(P,K,fe,"¬","\\neg",!0);L(P,K,fe,"¬","\\lnot");L(P,K,fe,"⊤","\\top");L(P,K,fe,"⊥","\\bot");L(P,K,fe,"∅","\\emptyset");L(P,ae,fe,"∅","\\varnothing");L(P,K,ft,"α","\\alpha",!0);L(P,K,ft,"β","\\beta",!0);L(P,K,ft,"γ","\\gamma",!0);L(P,K,ft,"δ","\\delta",!0);L(P,K,ft,"ϵ","\\epsilon",!0);L(P,K,ft,"ζ","\\zeta",!0);L(P,K,ft,"η","\\eta",!0);L(P,K,ft,"θ","\\theta",!0);L(P,K,ft,"ι","\\iota",!0);L(P,K,ft,"κ","\\kappa",!0);L(P,K,ft,"λ","\\lambda",!0);L(P,K,ft,"μ","\\mu",!0);L(P,K,ft,"ν","\\nu",!0);L(P,K,ft,"ξ","\\xi",!0);L(P,K,ft,"ο","\\omicron",!0);L(P,K,ft,"π","\\pi",!0);L(P,K,ft,"ρ","\\rho",!0);L(P,K,ft,"σ","\\sigma",!0);L(P,K,ft,"τ","\\tau",!0);L(P,K,ft,"υ","\\upsilon",!0);L(P,K,ft,"ϕ","\\phi",!0);L(P,K,ft,"χ","\\chi",!0);L(P,K,ft,"ψ","\\psi",!0);L(P,K,ft,"ω","\\omega",!0);L(P,K,ft,"ε","\\varepsilon",!0);L(P,K,ft,"ϑ","\\vartheta",!0);L(P,K,ft,"ϖ","\\varpi",!0);L(P,K,ft,"ϱ","\\varrho",!0);L(P,K,ft,"ς","\\varsigma",!0);L(P,K,ft,"φ","\\varphi",!0);L(P,K,Ke,"∗","*",!0);L(P,K,Ke,"+","+");L(P,K,Ke,"−","-",!0);L(P,K,Ke,"⋅","\\cdot",!0);L(P,K,Ke,"∘","\\circ",!0);L(P,K,Ke,"÷","\\div",!0);L(P,K,Ke,"±","\\pm",!0);L(P,K,Ke,"×","\\times",!0);L(P,K,Ke,"∩","\\cap",!0);L(P,K,Ke,"∪","\\cup",!0);L(P,K,Ke,"∖","\\setminus",!0);L(P,K,Ke,"∧","\\land");L(P,K,Ke,"∨","\\lor");L(P,K,Ke,"∧","\\wedge",!0);L(P,K,Ke,"∨","\\vee",!0);L(P,K,fe,"√","\\surd");L(P,K,Ui,"⟨","\\langle",!0);L(P,K,Ui,"∣","\\lvert");L(P,K,Ui,"∥","\\lVert");L(P,K,Qr,"?","?");L(P,K,Qr,"!","!");L(P,K,Qr,"⟩","\\rangle",!0);L(P,K,Qr,"∣","\\rvert");L(P,K,Qr,"∥","\\rVert");L(P,K,ue,"=","=");L(P,K,ue,":",":");L(P,K,ue,"≈","\\approx",!0);L(P,K,ue,"≅","\\cong",!0);L(P,K,ue,"≥","\\ge");L(P,K,ue,"≥","\\geq",!0);L(P,K,ue,"←","\\gets");L(P,K,ue,">","\\gt",!0);L(P,K,ue,"∈","\\in",!0);L(P,K,ue,"","\\@not");L(P,K,ue,"⊂","\\subset",!0);L(P,K,ue,"⊃","\\supset",!0);L(P,K,ue,"⊆","\\subseteq",!0);L(P,K,ue,"⊇","\\supseteq",!0);L(P,ae,ue,"⊈","\\nsubseteq",!0);L(P,ae,ue,"⊉","\\nsupseteq",!0);L(P,K,ue,"⊨","\\models");L(P,K,ue,"←","\\leftarrow",!0);L(P,K,ue,"≤","\\le");L(P,K,ue,"≤","\\leq",!0);L(P,K,ue,"<","\\lt",!0);L(P,K,ue,"→","\\rightarrow",!0);L(P,K,ue,"→","\\to");L(P,ae,ue,"≱","\\ngeq",!0);L(P,ae,ue,"≰","\\nleq",!0);L(P,K,Ua," ","\\ ");L(P,K,Ua," ","\\space");L(P,K,Ua," ","\\nobreakspace");L(Me,K,Ua," ","\\ ");L(Me,K,Ua," "," ");L(Me,K,Ua," ","\\space");L(Me,K,Ua," ","\\nobreakspace");L(P,K,Ua,"","\\nobreak");L(P,K,Ua,"","\\allowbreak");L(P,K,gh,",",",");L(P,K,gh,";",";");L(P,ae,Ke,"⊼","\\barwedge",!0);L(P,ae,Ke,"⊻","\\veebar",!0);L(P,K,Ke,"⊙","\\odot",!0);L(P,K,Ke,"⊕","\\oplus",!0);L(P,K,Ke,"⊗","\\otimes",!0);L(P,K,fe,"∂","\\partial",!0);L(P,K,Ke,"⊘","\\oslash",!0);L(P,ae,Ke,"⊚","\\circledcirc",!0);L(P,ae,Ke,"⊡","\\boxdot",!0);L(P,K,Ke,"△","\\bigtriangleup");L(P,K,Ke,"▽","\\bigtriangledown");L(P,K,Ke,"†","\\dagger");L(P,K,Ke,"⋄","\\diamond");L(P,K,Ke,"⋆","\\star");L(P,K,Ke,"◃","\\triangleleft");L(P,K,Ke,"▹","\\triangleright");L(P,K,Ui,"{","\\{");L(Me,K,fe,"{","\\{");L(Me,K,fe,"{","\\textbraceleft");L(P,K,Qr,"}","\\}");L(Me,K,fe,"}","\\}");L(Me,K,fe,"}","\\textbraceright");L(P,K,Ui,"{","\\lbrace");L(P,K,Qr,"}","\\rbrace");L(P,K,Ui,"[","\\lbrack",!0);L(Me,K,fe,"[","\\lbrack",!0);L(P,K,Qr,"]","\\rbrack",!0);L(Me,K,fe,"]","\\rbrack",!0);L(P,K,Ui,"(","\\lparen",!0);L(P,K,Qr,")","\\rparen",!0);L(Me,K,fe,"<","\\textless",!0);L(Me,K,fe,">","\\textgreater",!0);L(P,K,Ui,"⌊","\\lfloor",!0);L(P,K,Qr,"⌋","\\rfloor",!0);L(P,K,Ui,"⌈","\\lceil",!0);L(P,K,Qr,"⌉","\\rceil",!0);L(P,K,fe,"\\","\\backslash");L(P,K,fe,"∣","|");L(P,K,fe,"∣","\\vert");L(Me,K,fe,"|","\\textbar",!0);L(P,K,fe,"∥","\\|");L(P,K,fe,"∥","\\Vert");L(Me,K,fe,"∥","\\textbardbl");L(Me,K,fe,"~","\\textasciitilde");L(Me,K,fe,"\\","\\textbackslash");L(Me,K,fe,"^","\\textasciicircum");L(P,K,ue,"↑","\\uparrow",!0);L(P,K,ue,"⇑","\\Uparrow",!0);L(P,K,ue,"↓","\\downarrow",!0);L(P,K,ue,"⇓","\\Downarrow",!0);L(P,K,ue,"↕","\\updownarrow",!0);L(P,K,ue,"⇕","\\Updownarrow",!0);L(P,K,ir,"∐","\\coprod");L(P,K,ir,"⋁","\\bigvee");L(P,K,ir,"⋀","\\bigwedge");L(P,K,ir,"⨄","\\biguplus");L(P,K,ir,"⋂","\\bigcap");L(P,K,ir,"⋃","\\bigcup");L(P,K,ir,"∫","\\int");L(P,K,ir,"∫","\\intop");L(P,K,ir,"∬","\\iint");L(P,K,ir,"∭","\\iiint");L(P,K,ir,"∏","\\prod");L(P,K,ir,"∑","\\sum");L(P,K,ir,"⨂","\\bigotimes");L(P,K,ir,"⨁","\\bigoplus");L(P,K,ir,"⨀","\\bigodot");L(P,K,ir,"∮","\\oint");L(P,K,ir,"∯","\\oiint");L(P,K,ir,"∰","\\oiiint");L(P,K,ir,"⨆","\\bigsqcup");L(P,K,ir,"∫","\\smallint");L(Me,K,uu,"…","\\textellipsis");L(P,K,uu,"…","\\mathellipsis");L(Me,K,uu,"…","\\ldots",!0);L(P,K,uu,"…","\\ldots",!0);L(P,K,uu,"⋯","\\@cdots",!0);L(P,K,uu,"⋱","\\ddots",!0);L(P,K,fe,"⋮","\\varvdots");L(Me,K,fe,"⋮","\\varvdots");L(P,K,jn,"ˊ","\\acute");L(P,K,jn,"ˋ","\\grave");L(P,K,jn,"¨","\\ddot");L(P,K,jn,"~","\\tilde");L(P,K,jn,"ˉ","\\bar");L(P,K,jn,"˘","\\breve");L(P,K,jn,"ˇ","\\check");L(P,K,jn,"^","\\hat");L(P,K,jn,"⃗","\\vec");L(P,K,jn,"˙","\\dot");L(P,K,jn,"˚","\\mathring");L(P,K,ft,"","\\@imath");L(P,K,ft,"","\\@jmath");L(P,K,fe,"ı","ı");L(P,K,fe,"ȷ","ȷ");L(Me,K,fe,"ı","\\i",!0);L(Me,K,fe,"ȷ","\\j",!0);L(Me,K,fe,"ß","\\ss",!0);L(Me,K,fe,"æ","\\ae",!0);L(Me,K,fe,"œ","\\oe",!0);L(Me,K,fe,"ø","\\o",!0);L(Me,K,fe,"Æ","\\AE",!0);L(Me,K,fe,"Œ","\\OE",!0);L(Me,K,fe,"Ø","\\O",!0);L(Me,K,jn,"ˊ","\\'");L(Me,K,jn,"ˋ","\\`");L(Me,K,jn,"ˆ","\\^");L(Me,K,jn,"˜","\\~");L(Me,K,jn,"ˉ","\\=");L(Me,K,jn,"˘","\\u");L(Me,K,jn,"˙","\\.");L(Me,K,jn,"¸","\\c");L(Me,K,jn,"˚","\\r");L(Me,K,jn,"ˇ","\\v");L(Me,K,jn,"¨",'\\"');L(Me,K,jn,"˝","\\H");L(Me,K,jn,"◯","\\textcircled");var A9={"--":!0,"---":!0,"``":!0,"''":!0};L(Me,K,fe,"–","--",!0);L(Me,K,fe,"–","\\textendash");L(Me,K,fe,"—","---",!0);L(Me,K,fe,"—","\\textemdash");L(Me,K,fe,"‘","`",!0);L(Me,K,fe,"‘","\\textquoteleft");L(Me,K,fe,"’","'",!0);L(Me,K,fe,"’","\\textquoteright");L(Me,K,fe,"“","``",!0);L(Me,K,fe,"“","\\textquotedblleft");L(Me,K,fe,"”","''",!0);L(Me,K,fe,"”","\\textquotedblright");L(P,K,fe,"°","\\degree",!0);L(Me,K,fe,"°","\\degree");L(Me,K,fe,"°","\\textdegree",!0);L(P,K,fe,"£","\\pounds");L(P,K,fe,"£","\\mathsterling",!0);L(Me,K,fe,"£","\\pounds");L(Me,K,fe,"£","\\textsterling",!0);L(P,ae,fe,"✠","\\maltese");L(Me,ae,fe,"✠","\\maltese");var p6='0123456789/@."';for(var Ng=0;Ng{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484){var i=Math.floor((r-119808)/26);return k6[i]}else if(120782<=r&&r<=120831){var a=Math.floor((r-120782)/10);return u$[a]}else{if(r===120485||r===120486)return k6[0];if(120486{if(zo(e.classes)!==zo(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},T9=e=>{for(var t=0;tn&&(n=o.height),o.depth>r&&(r=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}t.height=n,t.depth=r,t.maxFontSize=i},Ie=function(t,n,r,i){var a=new cu(t,n,r,i);return H_(a),a},Ho=(e,t,n,r)=>new cu(e,t,n,r),Kc=function(t,n,r){var i=Ie([t],[],n);return i.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),i.style.borderBottomWidth=$e(i.height),i.maxFontSize=1,i},p$=function(t,n,r,i){var a=new gp(t,n,r,i);return H_(a),a},qa=function(t){var n=new lu(t);return H_(n),n},Zc=function(t,n){return t instanceof lu?Ie([],[t],n):t},m$=function(t){if(t.positionType==="individualShift"){for(var n=t.children,r=[n[0]],i=-n[0].shift-n[0].elem.depth,a=i,o=1;o{var n=Ie(["mspace"],[],t),r=In(e,t);return n.style.marginRight=$e(r),n},B0=(e,t,n)=>{var r,i;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return t==="textbf"&&n==="textit"?i="BoldItalic":t==="textbf"?i="Bold":n==="textit"?i="Italic":i="Regular",r+"-"+i},nv={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},j9={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},M9=function(t,n){var[r,i,a]=j9[t],o=new Bo(r),l=new Ia([o],{width:$e(i),height:$e(a),style:"width:"+$e(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),u=Ho(["overlay"],[l],n);return u.height=a,u.style.height=$e(a),u.style.width=$e(i),u},On={number:3,unit:"mu"},hl={number:4,unit:"mu"},Ea={number:5,unit:"mu"},g$={mord:{mop:On,mbin:hl,mrel:Ea,minner:On},mop:{mord:On,mop:On,mrel:Ea,minner:On},mbin:{mord:hl,mop:hl,mopen:hl,minner:hl},mrel:{mord:Ea,mop:Ea,mopen:Ea,minner:Ea},mopen:{},mclose:{mop:On,mbin:hl,mrel:Ea,minner:On},mpunct:{mord:On,mop:On,mrel:Ea,mopen:On,mclose:On,mpunct:On,minner:On},minner:{mord:On,mop:On,mbin:hl,mrel:Ea,mopen:On,mpunct:On,minner:On}},b$={mord:{mop:On},mop:{mord:On,mop:On},mbin:{},mrel:{},mopen:{},mclose:{mop:On},mpunct:{},minner:{mop:On}},R9={},$f={},Ff={};function Ye(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,l={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},u=0;u{var x=S.classes[0],_=k.classes[0];x==="mbin"&&_$.has(_)?S.classes[0]="mord":_==="mbin"&&v$.has(x)&&(k.classes[0]="mord")},{node:f},g,b),rv(a,(k,S)=>{var x,_,w=sv(S),y=sv(k),C=w&&y?k.hasClass("mtight")?(x=b$[w])==null?void 0:x[y]:(_=g$[w])==null?void 0:_[y]:null;if(C)return N9(C,d)},{node:f},g,b),a},rv=function(t,n,r,i,a){i&&t.push(i);for(var o=0;og=>{t.splice(f+1,0,g),o++})(o)}i&&t.pop()},D9=function(t){return t instanceof lu||t instanceof gp||t instanceof cu&&t.hasClass("enclosing")?t:null},iv=function(t,n){var r=D9(t);if(r){var i=r.children;if(i.length){if(n==="right")return iv(i[i.length-1],"right");if(n==="left")return iv(i[0],"left")}}return t},sv=function(t,n){if(!t)return null;n&&(t=iv(t,n));var r=t.classes[0];return y$[r]||null},Dd=function(t,n){var r=["nulldelimiter"].concat(t.baseSizingClasses());return Ie(n.concat(r))},Yt=function(t,n,r){if(!t)return Ie();if($f[t.type]){var i=$f[t.type](t,n);if(r&&n.size!==r.size){i=Ie(n.sizingClasses(r),[i],n);var a=n.sizeMultiplier/r.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Be("Got group of unknown type: '"+t.type+"'")};function H0(e,t){var n=Ie(["base"],e,t),r=Ie(["strut"]);return r.style.height=$e(n.height+n.depth),n.depth&&(r.style.verticalAlign=$e(-n.depth)),n.children.unshift(r),n}function av(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var r=fr(e,t,"root"),i;r.length===2&&r[1].hasClass("tag")&&(i=r.pop());for(var a=[],o=[],l=0;l0&&(a.push(H0(o,t)),o=[]),a.push(r[l]));o.length>0&&a.push(H0(o,t));var d;n?(d=H0(fr(n,t,!0),t),d.classes=["tag"],a.push(d)):i&&a.push(i);var m=Ie(["katex-html"],a);if(m.setAttribute("aria-hidden","true"),d){var f=d.children[0];f.style.height=$e(m.height+m.depth),m.depth&&(f.style.verticalAlign=$e(-m.depth))}return m}function L9(e){return new lu(e)}class He{constructor(t,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=zo(this.classes));for(var r=0;r0&&(t+=' class ="'+Or(zo(this.classes))+'"'),t+=">";for(var r=0;r",t}toText(){return this.children.map(t=>t.toText()).join("")}}class tr{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return Or(this.toText())}toText(){return this.text}}class O9{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character="  ":t>=-.05556&&t<=-.05555?this.character=" ⁣":t>=-.1667&&t<=-.1666?this.character=" ⁣":t>=-.2223&&t<=-.2222?this.character=" ⁣":t>=-.2778&&t<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",$e(this.width)),t}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var w$=new Set(["\\imath","\\jmath"]),S$=new Set(["mrow","mtable"]),cs=function(t,n,r){return Tn[n][t]&&Tn[n][t].replace&&t.charCodeAt(0)!==55349&&!(A9.hasOwnProperty(t)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(t=Tn[n][t].replace),new tr(t)},$_=function(t){return t.length===1?t[0]:new He("mrow",t)},k$={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},F_=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var r=e.mode,i=k$[n];if(i)return typeof i=="function"?i(e):i;var a=e.text;if(w$.has(a))return null;if(Tn[r][a]){var o=Tn[r][a].replace;o&&(a=o)}var l=nv[n].fontName;return z_(a,l,r)?nv[n].variant:null};function Dg(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof tr&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof tr&&n.text===","}else return!1}var qi=function(t,n,r){if(t.length===1){var i=fn(t[0],n);return r&&i instanceof He&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],o,l=0;l=1&&(o.type==="mn"||Dg(o))){var d=u.children[0];d instanceof He&&d.type==="mn"&&(d.children=[...o.children,...d.children],a.pop())}else if(o.type==="mi"&&o.children.length===1){var m=o.children[0];if(m instanceof tr&&m.text==="̸"&&(u.type==="mo"||u.type==="mi"||u.type==="mn")){var f=u.children[0];f instanceof tr&&f.text.length>0&&(f.text=f.text.slice(0,1)+"̸"+f.text.slice(1),a.pop())}}}a.push(u),o=u}return a},$o=function(t,n,r){return $_(qi(t,n,r))},fn=function(t,n){if(!t)return new He("mrow");if(Ff[t.type])return Ff[t.type](t,n);throw new Be("Got group of unknown type: '"+t.type+"'")};function C6(e,t,n,r,i){var a=qi(e,n),o;a.length===1&&a[0]instanceof He&&S$.has(a[0].type)?o=a[0]:o=new He("mrow",a);var l=new He("annotation",[new tr(t)]);l.setAttribute("encoding","application/x-tex");var u=new He("semantics",[o,l]),d=new He("math",[u]);d.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&d.setAttribute("display","block");var m=i?"katex":"katex-mathml";return Ie([m],[d])}var C$=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],E6=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],A6=function(t,n){return n.size<2?t:C$[t-1][n.size-1]};class Ma{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||Ma.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=E6[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new Ma(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:A6(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:E6[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=A6(Ma.BASESIZE,t);return this.size===n&&this.textSize===Ma.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Ma.BASESIZE?["sizing","reset-size"+this.size,"size"+Ma.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=l$(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Ma.BASESIZE=6;var I9=function(t){return new Ma({style:t.displayMode?vt.DISPLAY:vt.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},z9=function(t,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),t=Ie(r,[t])}return t},E$=function(t,n,r){var i=I9(r),a;if(r.output==="mathml")return C6(t,n,i,r.displayMode,!0);if(r.output==="html"){var o=av(t,i);a=Ie(["katex"],[o])}else{var l=C6(t,n,i,r.displayMode,!1),u=av(t,i);a=Ie(["katex"],[l,u])}return z9(a,r)},A$=function(t,n,r){var i=I9(r),a=av(t,i),o=Ie(["katex"],[a]);return z9(o,r)},T$={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},_p=function(t){var n=new He("mo",[new tr(T$[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},N$={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},j$=new Set(["widehat","widecheck","widetilde","utilde"]),xp=function(t,n){function r(){var l=4e5,u=t.label.slice(1);if(j$.has(u)&&"base"in t){var d=t.base.type==="ordgroup"?t.base.body.length:1,m,f,g;if(d>5)u==="widehat"||u==="widecheck"?(m=420,l=2364,g=.42,f=u+"4"):(m=312,l=2340,g=.34,f="tilde4");else{var b=[1,1,2,2,3,3][d];u==="widehat"||u==="widecheck"?(l=[0,1062,2364,2364,2364][b],m=[0,239,300,360,420][b],g=[0,.24,.3,.3,.36,.42][b],f=u+b):(l=[0,600,1033,2339,2340][b],m=[0,260,286,306,312][b],g=[0,.26,.286,.3,.306,.34][b],f="tilde"+b)}var k=new Bo(f),S=new Ia([k],{width:"100%",height:$e(g),viewBox:"0 0 "+l+" "+m,preserveAspectRatio:"none"});return{span:Ho([],[S],n),minWidth:0,height:g}}else{var x=[],_=N$[u];if(!_)throw new Error('No SVG data for "'+u+'".');var[w,y,C]=_,T=C/1e3,E=w.length,j,N;if(E===1){if(_.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+u+'".');j=["hide-tail"],N=[_[3]]}else if(E===2)j=["halfarrow-left","halfarrow-right"],N=["xMinYMin","xMaxYMin"];else if(E===3)j=["brace-left","brace-center","brace-right"],N=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+E+" children.");for(var D=0;D0&&(i.style.minWidth=$e(a)),i},M$=function(t,n,r,i,a){var o,l=t.height+t.depth+r+i;if(/fbox|color|angl/.test(n)){if(o=Ie(["stretchy",n],[],a),n==="fbox"){var u=a.color&&a.getColor();u&&(o.style.borderColor=u)}}else{var d=[];/^[bx]cancel$/.test(n)&&d.push(new Kb({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&d.push(new Kb({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var m=new Ia(d,{width:"100%",height:$e(l)});o=Ho([],[m],a)}return o.height=l,o.style.height=$e(l),o},R$={bin:1,close:1,inner:1,open:1,punct:1,rel:1},D$={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function L$(e){return e in R$}function Ct(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function yp(e){var t=wp(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function wp(e){return e&&(e.type==="atom"||D$.hasOwnProperty(e.type))?e:null}var B9=e=>{if(e instanceof $i)return e;if(a$(e)&&e.children.length===1)return B9(e.children[0])},P_=(e,t)=>{var n,r,i;e&&e.type==="supsub"?(r=Ct(e.base,"accent"),n=r.base,e.base=n,i=s$(Yt(e,t)),e.base=r):(r=Ct(e,"accent"),n=r.base);var a=Yt(n,t.havingCrampedStyle()),o=r.isShifty&&Pa(n),l=0;if(o){var u,d;l=(u=(d=B9(a))==null?void 0:d.skew)!=null?u:0}var m=r.label==="\\c",f=m?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),g;if(r.isStretchy)g=xp(r,t),g=Vt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:g,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+$e(2*l)+")",marginLeft:$e(2*l)}:void 0}]});else{var b,k;r.label==="\\vec"?(b=M9("vec",t),k=j9.vec[1]):(b=vp({mode:r.mode,text:r.label},t,"textord"),b=i$(b),b.italic=0,k=b.width,m&&(f+=b.depth)),g=Ie(["accent-body"],[b]);var S=r.label==="\\textcircled";S&&(g.classes.push("accent-full"),f=a.height);var x=l;S||(x-=k/2),g.style.left=$e(x),r.label==="\\textcircled"&&(g.style.top=".2em"),g=Vt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-f},{type:"elem",elem:g}]})}var _=Ie(["mord","accent"],[g],t);return i?(i.children[0]=_,i.height=Math.max(_.height,i.height),i.classes[0]="mord",i):_},H9=(e,t)=>{var n=e.isStretchy?_p(e.label):new He("mo",[cs(e.label,e.mode)]),r=new He("mover",[fn(e.base,t),n]);return r.setAttribute("accent","true"),r},O$=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Ye({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=Pf(t[0]),r=!O$.test(e.funcName),i=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:P_,mathmlBuilder:H9});Ye({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:P_,mathmlBuilder:H9});Ye({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=Yt(e.base,t),r=xp(e,t),i=e.label==="\\utilde"?.12:0,a=Vt({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]});return Ie(["mord","accentunder"],[a],t)},mathmlBuilder:(e,t)=>{var n=_p(e.label),r=new He("munder",[fn(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var $0=e=>{var t=new He("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Ye({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=Zc(Yt(e.body,r,t),t),a=e.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var o;e.below&&(r=t.havingStyle(n.sub()),o=Zc(Yt(e.below,r,t),t),o.classes.push(a+"-arrow-pad"));var l=xp(e,t),u=-t.fontMetrics().axisHeight+.5*l.height,d=-t.fontMetrics().axisHeight-.5*l.height-.111;(i.depth>.25||e.label==="\\xleftequilibrium")&&(d-=i.depth);var m;if(o){var f=-t.fontMetrics().axisHeight+o.height+.5*l.height+.111;m=Vt({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:u,wrapperClasses:["svg-align"]},{type:"elem",elem:o,shift:f}]})}else m=Vt({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:u,wrapperClasses:["svg-align"]}]});return Ie(["mrel","x-arrow"],[m],t)},mathmlBuilder(e,t){var n=_p(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var i=$0(fn(e.body,t));if(e.below){var a=$0(fn(e.below,t));r=new He("munderover",[n,a,i])}else r=new He("mover",[n,i])}else if(e.below){var o=$0(fn(e.below,t));r=new He("munder",[n,o])}else r=$0(),r=new He("mover",[n,r]);return r}});function $9(e,t){var n=fr(e.body,t,!0);return Ie([e.mclass],n,t)}function F9(e,t){var n,r=qi(e.body,t);return e.mclass==="minner"?n=new He("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(n=r[0],n.type="mi"):n=new He("mi",r):(e.isCharacterBox?(n=r[0],n.type="mo"):n=new He("mo",r),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Ye({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:er(i),isCharacterBox:Pa(i)}},htmlBuilder:$9,mathmlBuilder:F9});var Sp=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};Ye({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Sp(t[0]),body:er(t[1]),isCharacterBox:Pa(t[1])}}});Ye({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],o;r!=="\\stackrel"?o=Sp(i):o="mrel";var l={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:er(i)},u={type:"supsub",mode:a.mode,base:l,sup:r==="\\underset"?null:a,sub:r==="\\underset"?a:null};return{type:"mclass",mode:n.mode,mclass:o,body:[u],isCharacterBox:Pa(u)}},htmlBuilder:$9,mathmlBuilder:F9});Ye({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Sp(t[0]),body:er(t[0])}},htmlBuilder(e,t){var n=fr(e.body,t,!0),r=Ie([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=qi(e.body,t),r=new He("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var I$={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},T6=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),N6=e=>e.type==="textord"&&e.text==="@",z$=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function B$(e,t,n){var r=I$[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var i=n.callFunction("\\\\cdleft",[t[0]],[]),a={type:"atom",text:r,mode:"math",family:"rel"},o=n.callFunction("\\Big",[a],[]),l=n.callFunction("\\\\cdright",[t[1]],[]),u={type:"ordgroup",mode:"math",body:[i,o,l]};return n.callFunction("\\\\cdparent",[u],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var d={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[d],[])}default:return{type:"textord",text:" ",mode:"math"}}}function H$(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new Be("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],i=[r],a=0;aAV".includes(d))for(var f=0;f<2;f++){for(var g=!0,b=u+1;bAV=|." after @',o[u]);var k=B$(d,m,e),S={type:"styling",body:[k],mode:"math",style:"display",resetFont:!0};r.push(S),l=T6()}a%2===0?r.push(l):r.shift(),r=[],i.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var x=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:x,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Ye({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=Zc(Yt(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=$e(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new He("mrow",[fn(e.label,t)]);return n=new He("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new He("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Ye({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=Zc(Yt(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new He("mrow",[fn(e.fragment,t)])}});Ye({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=Ct(t[0],"ordgroup"),i=r.body,a="",o=0;o=1114111)throw new Be("\\@char with invalid code point "+a);return u<=65535?d=String.fromCharCode(u):(u-=65536,d=String.fromCharCode((u>>10)+55296,(u&1023)+56320)),{type:"textord",mode:n.mode,text:d}}});var P9=(e,t)=>{var n=fr(e.body,t.withColor(e.color),!1);return qa(n)},U9=(e,t)=>{var n=qi(e.body,t.withColor(e.color)),r=new He("mstyle",n);return r.setAttribute("mathcolor",e.color),r};Ye({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=Ct(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:er(i)}},htmlBuilder:P9,mathmlBuilder:U9});Ye({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=Ct(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var a=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:a}},htmlBuilder:P9,mathmlBuilder:U9});Ye({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:a,size:i&&Ct(i,"size").value}},htmlBuilder(e,t){var n=Ie(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=$e(In(e.size,t)))),n},mathmlBuilder(e,t){var n=new He("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",$e(In(e.size,t)))),n}});var ov={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},q9=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Be("Expected a control sequence",e);return t},$$=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},G9=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i==null&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};Ye({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(ov[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=ov[r.text]),Ct(t.parseFunction(),"internal");throw new Be("Invalid token after macro prefix",r)}});Ye({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Be("Expected a control sequence",r);for(var a=0,o,l=[[]];t.gullet.future().text!=="{";)if(r=t.gullet.popToken(),r.text==="#"){if(t.gullet.future().text==="{"){o=t.gullet.future(),l[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Be('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new Be('Argument number "'+r.text+'" out of order');a++,l.push([])}else{if(r.text==="EOF")throw new Be("Expected a macro definition");l[a].push(r.text)}var{tokens:u}=t.gullet.consumeArg();return o&&u.unshift(o),(n==="\\edef"||n==="\\xdef")&&(u=t.gullet.expandTokens(u),u.reverse()),t.gullet.macros.set(i,{tokens:u,numArgs:a,delimiters:l},n===ov[n]),{type:"internal",mode:t.mode}}});Ye({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=q9(t.gullet.popToken());t.gullet.consumeSpaces();var i=$$(t);return G9(t,r,i,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});Ye({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=q9(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return G9(t,r,a,n==="\\\\globalfuture"),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var ud=function(t,n,r){var i=Tn.math[t]&&Tn.math[t].replace,a=z_(i||t,n,r);if(!a)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return a},U_=function(t,n,r,i){var a=r.havingBaseStyle(n),o=Ie(i.concat(a.sizingClasses(r)),[t],r),l=a.sizeMultiplier/r.sizeMultiplier;return o.height*=l,o.depth*=l,o.maxFontSize=a.sizeMultiplier,o},V9=function(t,n,r){var i=n.havingBaseStyle(r),a=(1-n.sizeMultiplier/i.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=$e(a),t.height-=a,t.depth+=a},F$=function(t,n,r,i,a,o){var l=Wr(t,"Main-Regular",a,i),u=U_(l,n,i,o);return V9(u,i,n),u},P$=function(t,n,r,i){return Wr(t,"Size"+n+"-Regular",r,i)},W9=function(t,n,r,i,a,o){var l=P$(t,n,a,i),u=U_(Ie(["delimsizing","size"+n],[l],i),vt.TEXT,i,o);return r&&V9(u,i,vt.TEXT),u},Lg=function(t,n,r){var i;n==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Ie(["delimsizinginner",i],[Ie([],[Wr(t,n,r)])]);return{type:"elem",elem:a}},Og=function(t,n,r){var i=Xs["Size4-Regular"][t.charCodeAt(0)]?Xs["Size4-Regular"][t.charCodeAt(0)][4]:Xs["Size1-Regular"][t.charCodeAt(0)][4],a=new Bo("inner",ZH(t,Math.round(1e3*n))),o=new Ia([a],{width:$e(i),height:$e(n),style:"width:"+$e(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),l=Ho([],[o],r);return l.height=n,l.style.height=$e(n),l.style.width=$e(i),{type:"elem",elem:l}},lv=.008,F0={type:"kern",size:-1*lv},U$=new Set(["|","\\lvert","\\rvert","\\vert"]),q$=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),Y9=function(t,n,r,i,a,o){var l,u,d,m,f="",g=0;l=d=m=t,u=null;var b="Size1-Regular";t==="\\uparrow"?d=m="⏐":t==="\\Uparrow"?d=m="‖":t==="\\downarrow"?l=d="⏐":t==="\\Downarrow"?l=d="‖":t==="\\updownarrow"?(l="\\uparrow",d="⏐",m="\\downarrow"):t==="\\Updownarrow"?(l="\\Uparrow",d="‖",m="\\Downarrow"):U$.has(t)?(d="∣",f="vert",g=333):q$.has(t)?(d="∥",f="doublevert",g=556):t==="["||t==="\\lbrack"?(l="⎡",d="⎢",m="⎣",b="Size4-Regular",f="lbrack",g=667):t==="]"||t==="\\rbrack"?(l="⎤",d="⎥",m="⎦",b="Size4-Regular",f="rbrack",g=667):t==="\\lfloor"||t==="⌊"?(d=l="⎢",m="⎣",b="Size4-Regular",f="lfloor",g=667):t==="\\lceil"||t==="⌈"?(l="⎡",d=m="⎢",b="Size4-Regular",f="lceil",g=667):t==="\\rfloor"||t==="⌋"?(d=l="⎥",m="⎦",b="Size4-Regular",f="rfloor",g=667):t==="\\rceil"||t==="⌉"?(l="⎤",d=m="⎥",b="Size4-Regular",f="rceil",g=667):t==="("||t==="\\lparen"?(l="⎛",d="⎜",m="⎝",b="Size4-Regular",f="lparen",g=875):t===")"||t==="\\rparen"?(l="⎞",d="⎟",m="⎠",b="Size4-Regular",f="rparen",g=875):t==="\\{"||t==="\\lbrace"?(l="⎧",u="⎨",m="⎩",d="⎪",b="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(l="⎫",u="⎬",m="⎭",d="⎪",b="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(l="⎧",m="⎩",d="⎪",b="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(l="⎫",m="⎭",d="⎪",b="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(l="⎧",m="⎭",d="⎪",b="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(l="⎫",m="⎩",d="⎪",b="Size4-Regular");var k=ud(l,b,a),S=k.height+k.depth,x=ud(d,b,a),_=x.height+x.depth,w=ud(m,b,a),y=w.height+w.depth,C=0,T=1;if(u!==null){var E=ud(u,b,a);C=E.height+E.depth,T=2}var j=S+y+C,N=Math.max(0,Math.ceil((n-j)/(T*_))),D=j+N*T*_,z=i.fontMetrics().axisHeight;r&&(z*=i.sizeMultiplier);var $=D/2-z,F=[];if(f.length>0){var U=D-S-y,V=Math.round(D*1e3),X=QH(f,Math.round(U*1e3)),Y=new Bo(f,X),Q=$e(g/1e3),te=$e(V/1e3),I=new Ia([Y],{width:Q,height:te,viewBox:"0 0 "+g+" "+V}),O=Ho([],[I],i);O.height=V/1e3,O.style.width=Q,O.style.height=te,F.push({type:"elem",elem:O})}else{if(F.push(Lg(m,b,a)),F.push(F0),u===null){var H=D-S-y+2*lv;F.push(Og(d,H,i))}else{var G=(D-S-y-C)/2+2*lv;F.push(Og(d,G,i)),F.push(F0),F.push(Lg(u,b,a)),F.push(F0),F.push(Og(d,G,i))}F.push(F0),F.push(Lg(l,b,a))}var W=i.havingBaseStyle(vt.TEXT),re=Vt({positionType:"bottom",positionData:$,children:F});return U_(Ie(["delimsizing","mult"],[re],W),vt.TEXT,i,o)},Ig=80,zg=.08,Bg=function(t,n,r,i,a){var o=KH(t,i,r),l=new Bo(t,o),u=new Ia([l],{width:"400em",height:$e(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return Ho(["hide-tail"],[u],a)},G$=function(t,n){var r=n.havingBaseSizing(),i=J9("\\surd",t*r.sizeMultiplier,Q9,r),a=r.sizeMultiplier,o=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),l,u,d,m,f;return i.type==="small"?(m=1e3+1e3*o+Ig,t<1?a=1:t<1.4&&(a=.7),u=(1+o+zg)/a,d=(1+o)/a,l=Bg("sqrtMain",u,m,o,n),l.style.minWidth="0.853em",f=.833/a):i.type==="large"?(m=(1e3+Ig)*xd[i.size],d=(xd[i.size]+o)/a,u=(xd[i.size]+o+zg)/a,l=Bg("sqrtSize"+i.size,u,m,o,n),l.style.minWidth="1.02em",f=1/a):(u=t+o+zg,d=t+o,m=Math.floor(1e3*t+o)+Ig,l=Bg("sqrtTall",u,m,o,n),l.style.minWidth="0.742em",f=1.056),l.height=d,l.style.height=$e(u),{span:l,advanceWidth:f,ruleWidth:(n.fontMetrics().sqrtRuleThickness+o)*a}},X9=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),V$=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),K9=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),xd=[0,1.2,1.8,2.4,3],Z9=function(t,n,r,i,a){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),X9.has(t)||K9.has(t))return W9(t,n,!1,r,i,a);if(V$.has(t))return Y9(t,xd[n],!1,r,i,a);throw new Be("Illegal delimiter: '"+t+"'")},W$=[{type:"small",style:vt.SCRIPTSCRIPT},{type:"small",style:vt.SCRIPT},{type:"small",style:vt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Y$=[{type:"small",style:vt.SCRIPTSCRIPT},{type:"small",style:vt.SCRIPT},{type:"small",style:vt.TEXT},{type:"stack"}],Q9=[{type:"small",style:vt.SCRIPTSCRIPT},{type:"small",style:vt.SCRIPT},{type:"small",style:vt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],X$=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")},J9=function(t,n,r,i){for(var a=Math.min(2,3-i.style.size),o=a;on)return l}return r[r.length-1]},cv=function(t,n,r,i,a,o){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var l;K9.has(t)?l=W$:X9.has(t)?l=Q9:l=Y$;var u=J9(t,n,l,i);return u.type==="small"?F$(t,u.style,r,i,a,o):u.type==="large"?W9(t,u.size,r,i,a,o):Y9(t,n,r,i,a,o)},Hg=function(t,n,r,i,a,o){var l=i.fontMetrics().axisHeight*i.sizeMultiplier,u=901,d=5/i.fontMetrics().ptPerEm,m=Math.max(n-l,r+l),f=Math.max(m/500*u,2*m-d);return cv(t,f,!0,i,a,o)},j6={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},K$=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function M6(e){return"isMiddle"in e}function kp(e,t){var n=wp(e);if(n&&K$.has(n.text))return n;throw n?new Be("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new Be("Invalid delimiter type '"+e.type+"'",e)}Ye({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=kp(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:j6[e.funcName].size,mclass:j6[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?Ie([e.mclass]):Z9(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(cs(e.delim,e.mode));var n=new He("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=$e(xd[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function R6(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ye({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new Be("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:kp(t[0],e).text,color:n}}});Ye({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=kp(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var a=Ct(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{R6(e);for(var n=fr(e.body,t,!0,["mopen","mclose"]),r=0,i=0,a=!1,o=0;o{R6(e);var n=qi(e.body,t);if(e.left!=="."){var r=new He("mo",[cs(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(e.right!=="."){var i=new He("mo",[cs(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return $_(n)}});Ye({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=kp(t[0],e);if(!e.parser.leftrightDepth)throw new Be("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=Dd(t,[]):(n=Z9(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?cs("|","text"):cs(e.delim,e.mode),r=new He("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Cp=(e,t)=>{var n=Zc(Yt(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,l=Pa(e.body);if(r==="sout")a=Ie(["stretchy","sout"]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r==="phase"){var u=In({number:.6,unit:"pt"},t),d=In({number:.35,unit:"ex"},t),m=t.havingBaseSizing();i=i/m.sizeMultiplier;var f=n.height+n.depth+u+d;n.style.paddingLeft=$e(f/2+u);var g=Math.floor(1e3*f*i),b=YH(g),k=new Ia([new Bo("phase",b)],{width:"400em",height:$e(g/1e3),viewBox:"0 0 400000 "+g,preserveAspectRatio:"xMinYMin slice"});a=Ho(["hide-tail"],[k],t),a.style.height=$e(f),o=n.depth+u+d}else{/cancel/.test(r)?l||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var S,x,_=0;/box/.test(r)?(_=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),S=t.fontMetrics().fboxsep+(r==="colorbox"?0:_),x=S):r==="angl"?(_=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),S=4*_,x=Math.max(0,.25-n.depth)):(S=l?.2:0,x=S),a=M$(n,r,S,x,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle="solid",a.style.borderWidth=$e(_)):r==="angl"&&_!==.049&&(a.style.borderTopWidth=$e(_),a.style.borderRightWidth=$e(_)),o=n.depth+x,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=Vt({positionType:"individualShift",children:[{type:"elem",elem:a,shift:o},{type:"elem",elem:n,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];w=Vt({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:a,shift:o,wrapperClasses:y}]})}return/cancel/.test(r)&&(w.height=n.height,w.depth=n.depth),/cancel/.test(r)&&!l?Ie(["mord","cancel-lap"],[w],t):Ie(["mord"],[w],t)},Ep=(e,t)=>{var n,r=new He(e.label.includes("colorbox")?"mpadded":"menclose",[fn(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+$e(i)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};Ye({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Ct(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:Cp,mathmlBuilder:Ep});Ye({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Ct(t[0],"color-token").color,o=Ct(t[1],"color-token").color,l=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:l}},htmlBuilder:Cp,mathmlBuilder:Ep});Ye({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});Ye({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:Cp,mathmlBuilder:Ep});Ye({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:Cp,mathmlBuilder:Ep});Ye({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var ek={};function na(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,l={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},u=0;u{var t=e.parser.settings;if(!t.displayMode)throw new Be("{"+e.envName+"} can be used only in display mode.")},Z$=new Set(["gather","gather*"]);function q_(e){if(!e.includes("ed"))return!e.includes("*")}function qo(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:l,autoTag:u,singleRow:d,emptySingleRow:m,maxNumCols:f,leqno:g}=t;if(e.gullet.beginGroup(),d||e.gullet.macros.set("\\cr","\\\\\\relax"),!o){var b=e.gullet.expandMacroAsText("\\arraystretch");if(b==null)o=1;else if(o=parseFloat(b),!o||o<0)throw new Be("Invalid \\arraystretch: "+b)}e.gullet.beginGroup();var k=[],S=[k],x=[],_=[],w=u!=null?[]:void 0;function y(){u&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){w&&(e.gullet.macros.get("\\df@tag")?(w.push(e.subparse([new Ts("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!u&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),_.push(D6(e));;){var T=e.parseExpression(!1,d?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var E={type:"ordgroup",mode:e.mode,body:T};n&&(E={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[E]}),k.push(E);var j=e.fetch().text;if(j==="&"){if(f&&k.length===f){if(d||l)throw new Be("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(j==="\\end"){C(),k.length===1&&E.type==="styling"&&E.body.length===1&&E.body[0].type==="ordgroup"&&E.body[0].body.length===0&&(S.length>1||!m)&&S.pop(),_.length0&&(y+=.25),d.push({pos:y,isDashed:Ue[Je]})}for(C(o[0]),r=0;r0&&($+=w,j<$&&(j=$),$=0)),t.addJot&&rUe))for(r=0;r=l)){var se=void 0;if(i>0||t.hskipBeforeAndAfter){var oe,_e;se=(oe=(_e=W)==null?void 0:_e.pregap)!=null?oe:g,se!==0&&(X=Ie(["arraycolsep"],[]),X.style.width=$e(se),V.push(X))}var be=[];for(r=0;r0){for(var ut=Kc("hline",n,m),Zt=Kc("hdashline",n,m),Dt=[{type:"elem",elem:qe,shift:0}];d.length>0;){var Ge=d.pop(),rt=Ge.pos-F;Ge.isDashed?Dt.push({type:"elem",elem:Zt,shift:rt}):Dt.push({type:"elem",elem:ut,shift:rt})}qe=Vt({positionType:"individualShift",children:Dt})}if(Q.length===0)return Ie(["mord"],[qe],n);var ve=Vt({positionType:"individualShift",children:Q}),je=Ie(["tag"],[ve],n);return qa([qe,je])},Q$={c:"center ",l:"left ",r:"right "},ia=function(t,n){for(var r=[],i=new He("mtd",[],["mtr-glue"]),a=new He("mtd",[],["mml-eqn-num"]),o=0;o0){var k=t.cols,S="",x=!1,_=0,w=k.length;k[0].type==="separator"&&(g+="top ",_=1),k[k.length-1].type==="separator"&&(g+="bottom ",w-=1);for(var y=_;y0?"left ":"",g+=D[D.length-1].length>0?"right ":"";for(var z=1;z0&&b&&(x=1),r[k]={type:"align",align:S,pregap:x,postgap:0}}return o.colSeparationType=b?"align":"alignat",o};na({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=wp(t[0]),r=n?[t[0]]:Ct(t[0],"ordgroup").body,i=r.map(function(o){var l=yp(o),u=l.text;if("lcr".includes(u))return{type:"align",align:u};if(u==="|")return{type:"separator",separator:"|"};if(u===":")return{type:"separator",separator:":"};throw new Be("Unknown column alignment: "+u,o)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return qo(e.parser,a,G_(e.envName))},htmlBuilder:ra,mathmlBuilder:ia});na({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var i=e.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!"lcr".includes(n))throw new Be("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var a=qo(e.parser,r,G_(e.envName)),o=Math.max(0,...a.body.map(l=>l.length));return a.cols=new Array(o).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:ra,mathmlBuilder:ia});na({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=qo(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:ra,mathmlBuilder:ia});na({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=wp(t[0]),r=n?[t[0]]:Ct(t[0],"ordgroup").body,i=r.map(function(l){var u=yp(l),d=u.text;if("lc".includes(d))return{type:"align",align:d};throw new Be("Unknown column alignment: "+d,l)});if(i.length>1)throw new Be("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},o=qo(e.parser,a,"script");if(o.body.length>0&&o.body[0].length>1)throw new Be("{subarray} can contain only one column");return o},htmlBuilder:ra,mathmlBuilder:ia});na({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=qo(e.parser,t,G_(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:ra,mathmlBuilder:ia});na({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:rk,htmlBuilder:ra,mathmlBuilder:ia});na({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){Z$.has(e.envName)&&Ap(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:q_(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return qo(e.parser,t,"display")},htmlBuilder:ra,mathmlBuilder:ia});na({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:rk,htmlBuilder:ra,mathmlBuilder:ia});na({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Ap(e);var t={autoTag:q_(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return qo(e.parser,t,"display")},htmlBuilder:ra,mathmlBuilder:ia});na({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Ap(e),H$(e.parser)},htmlBuilder:ra,mathmlBuilder:ia});ee("\\nonumber","\\gdef\\@eqnsw{0}");ee("\\notag","\\nonumber");Ye({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Be(e.funcName+" valid only within array environment")}});var L6=ek;Ye({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!=="ordgroup")throw new Be("Invalid environment name",i);for(var a="",o=0;o{var n=e.font,r=t.withFont(n);return Yt(e.body,r)},sk=(e,t)=>{var n=e.font,r=t.withFont(n);return fn(e.body,r)},O6={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Ye({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=Pf(t[0]),a=r;return a in O6&&(a=O6[a]),{type:"font",mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:ik,mathmlBuilder:sk});Ye({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:Sp(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:Pa(r)}}});Ye({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,o=n.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:ik,mathmlBuilder:sk});var J$=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a;a=t.havingStyle(r);var o=Yt(e.numer,a,t);if(e.continued){var l=8.5/t.fontMetrics().ptPerEm,u=3.5/t.fontMetrics().ptPerEm;o.height=o.height0?k=3*g:k=7*g,S=t.fontMetrics().denom1):(f>0?(b=t.fontMetrics().num2,k=g):(b=t.fontMetrics().num3,k=3*g),S=t.fontMetrics().denom2);var x;if(m){var w=t.fontMetrics().axisHeight;b-o.depth-(w+.5*f){var n=new He("mfrac",[fn(e.numer,t),fn(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var r=In(e.barSize,t);n.setAttribute("linethickness",$e(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new He("mo",[new tr(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new He("mo",[new tr(e.rightDelim.replace("\\",""))]);o.setAttribute("fence","true"),i.push(o)}return $_(i)}return n},ak=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};Ye({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1],o,l=null,u=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,l="(",u=")";break;case"\\\\bracefrac":o=!1,l="\\{",u="\\}";break;case"\\\\brackfrac":o=!1,l="[",u="]";break;default:throw new Error("Unrecognized genfrac command")}var d=r==="\\cfrac",m=null;return d||r.startsWith("\\d")?m="display":r.startsWith("\\t")&&(m="text"),ak({type:"genfrac",mode:n.mode,numer:i,denom:a,continued:d,hasBarLine:o,leftDelim:l,rightDelim:u,barSize:null},m)},htmlBuilder:J$,mathmlBuilder:eF});Ye({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:i,token:r}}});var I6=["display","text","script","scriptscript"],z6=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};Ye({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=Pf(t[0]),o=a.type==="atom"&&a.family==="open"?z6(a.text):null,l=Pf(t[1]),u=l.type==="atom"&&l.family==="close"?z6(l.text):null,d=Ct(t[2],"size"),m,f=null;d.isBlank?m=!0:(f=d.value,m=f.number>0);var g=null,b=t[3];if(b.type==="ordgroup"){if(b.body.length>0){var k=Ct(b.body[0],"textord");g=I6[Number(k.text)]}}else b=Ct(b,"textord"),g=I6[Number(b.text)];return ak({type:"genfrac",mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:m,barSize:f,leftDelim:o,rightDelim:u},g)}});Ye({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Ct(t[0],"size").value,token:i}}});Ye({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=Ct(t[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var o=t[2],l=a.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:l,barSize:a,leftDelim:null,rightDelim:null}}});var ok=(e,t)=>{var n=t.style,r,i;e.type==="supsub"?(r=e.sup?Yt(e.sup,t.havingStyle(n.sup()),t):Yt(e.sub,t.havingStyle(n.sub()),t),i=Ct(e.base,"horizBrace")):i=Ct(e,"horizBrace");var a=Yt(i.base,t.havingBaseStyle(vt.DISPLAY)),o=xp(i,t),l;if(i.isOver?l=Vt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:o,wrapperClasses:["svg-align"]}]}):l=Vt({positionType:"bottom",positionData:a.depth+.1+o.height,children:[{type:"elem",elem:o,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),r){var u=Ie(["minner",i.isOver?"mover":"munder"],[l],t);i.isOver?l=Vt({positionType:"firstBaseline",children:[{type:"elem",elem:u},{type:"kern",size:.2},{type:"elem",elem:r}]}):l=Vt({positionType:"bottom",positionData:u.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:u}]})}return Ie(["minner",i.isOver?"mover":"munder"],[l],t)},tF=(e,t)=>{var n=_p(e.label);return new He(e.isOver?"mover":"munder",[fn(e.base,t),n])};Ye({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:t[0]}},htmlBuilder:ok,mathmlBuilder:tF});Ye({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=Ct(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:er(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=fr(e.body,t,!1);return p$(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=$o(e.body,t);return n instanceof He||(n=new He("mrow",[n])),n.setAttribute("href",e.href),n}});Ye({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=Ct(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:n,funcName:r,token:i}=e,a=Ct(t[0],"raw").string,o=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,u={};switch(r){case"\\htmlClass":u.class=a,l={command:"\\htmlClass",class:a};break;case"\\htmlId":u.id=a,l={command:"\\htmlId",id:a};break;case"\\htmlStyle":u.style=a,l={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var d=a.split(","),m=0;m{var n=fr(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=Ie(r,n,t);for(var a in e.attributes)a!=="class"&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>$o(e.body,t)});Ye({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:er(t[0]),mathml:er(t[1])}},htmlBuilder:(e,t)=>{var n=fr(e.html,t,!1);return qa(n)},mathmlBuilder:(e,t)=>$o(e.mathml,t)});var $g=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new Be("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!S9(r))throw new Be("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};Ye({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},a={number:.9,unit:"em"},o={number:0,unit:"em"},l="";if(n[0])for(var u=Ct(n[0],"raw").string,d=u.split(","),m=0;m{var n=In(e.height,t),r=0;e.totalheight.number>0&&(r=In(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=In(e.width,t));var a={height:$e(n+r)};i>0&&(a.width=$e(i)),r>0&&(a.verticalAlign=$e(-r));var o=new n$(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new He("mglyph",[]);n.setAttribute("alt",e.alt);var r=In(e.height,t),i=0;if(e.totalheight.number>0&&(i=In(e.totalheight,t)-r,n.setAttribute("valign",$e(-i))),n.setAttribute("height",$e(r+i)),e.width.number>0){var a=In(e.width,t);n.setAttribute("width",$e(a))}return n.setAttribute("src",e.src),n}});Ye({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=Ct(t[0],"size");if(n.settings.strict){var a=r[1]==="m",o=i.value.unit==="mu";a?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+i.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return N9(e.dimension,t)},mathmlBuilder(e,t){var n=In(e.dimension,t);return new O9(n)}});Ye({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=Ie([],[Yt(e.body,t)]),n=Ie(["inner"],[n],t)):n=Ie(["inner"],[Yt(e.body,t)]);var r=Ie(["fix"],[]),i=Ie([e.alignment],[n,r],t),a=Ie(["strut"]);return a.style.height=$e(i.height+i.depth),i.depth&&(a.style.verticalAlign=$e(-i.depth)),i.children.unshift(a),i=Ie(["thinbox"],[i],t),Ie(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new He("mpadded",[fn(e.body,t)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});Ye({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var a=n==="\\("?"\\)":"$",o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:o}}});Ye({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Be("Mismatched "+e.funcName)}});var B6=(e,t)=>{switch(t.style.size){case vt.DISPLAY.size:return e.display;case vt.TEXT.size:return e.text;case vt.SCRIPT.size:return e.script;case vt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Ye({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:er(t[0]),text:er(t[1]),script:er(t[2]),scriptscript:er(t[3])}},htmlBuilder:(e,t)=>{var n=B6(e,t),r=fr(n,t,!1);return qa(r)},mathmlBuilder:(e,t)=>{var n=B6(e,t);return $o(n,t)}});var lk=(e,t,n,r,i,a,o)=>{e=Ie([],[e]);var l=n&&Pa(n),u,d;if(t){var m=Yt(t,r.havingStyle(i.sup()),r);d={elem:m,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-m.depth)}}if(n){var f=Yt(n,r.havingStyle(i.sub()),r);u={elem:f,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-f.height)}}var g;if(d&&u){var b=r.fontMetrics().bigOpSpacing5+u.elem.height+u.elem.depth+u.kern+e.depth+o;g=Vt({positionType:"bottom",positionData:b,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:$e(-a)},{type:"kern",size:u.kern},{type:"elem",elem:e},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:$e(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(u){var k=e.height-o;g=Vt({positionType:"top",positionData:k,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:$e(-a)},{type:"kern",size:u.kern},{type:"elem",elem:e}]})}else if(d){var S=e.depth+o;g=Vt({positionType:"bottom",positionData:S,children:[{type:"elem",elem:e},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:$e(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var x=[g];if(u&&a!==0&&!l){var _=Ie(["mspace"],[],r);_.style.marginRight=$e(a),x.unshift(_)}return Ie(["mop","op-limits"],x,r)},ck=new Set(["\\smallint"]),du=(e,t)=>{var n,r,i=!1,a;e.type==="supsub"?(n=e.sup,r=e.sub,a=Ct(e.base,"op"),i=!0):a=Ct(e,"op");var o=t.style,l=!1;o.size===vt.DISPLAY.size&&a.symbol&&!ck.has(a.name)&&(l=!0);var u,d;if(a.symbol){var m=l?"Size2-Regular":"Size1-Regular",f="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(f=a.name.slice(1),a.name=f==="oiint"?"\\iint":"\\iiint"),u=Wr(a.name,m,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),d=u.italic,f.length>0){var g=M9(f+"Size"+(l?"2":"1"),t);u=Vt({positionType:"individualShift",children:[{type:"elem",elem:u,shift:0},{type:"elem",elem:g,shift:l?.08:0}]}),a.name="\\"+f,u.classes.unshift("mop"),u.italic=d}}else if(a.body){var b=fr(a.body,t,!0);b.length===1&&b[0]instanceof $i?(u=b[0],u.classes[0]="mop"):u=Ie(["mop"],b,t)}else{for(var k=[],S=1;S{var n;if(e.symbol)n=new He("mo",[cs(e.name,e.mode)]),ck.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new He("mo",qi(e.body,t));else{n=new He("mi",[new tr(e.name.slice(1))]);var r=new He("mo",[cs("⁡","text")]);e.parentIsSupSub?n=new He("mrow",[n,r]):n=L9([n,r])}return n},nF={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ye({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=nF[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:du,mathmlBuilder:bh});Ye({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:er(r)}},htmlBuilder:du,mathmlBuilder:bh});var rF={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ye({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:du,mathmlBuilder:bh});Ye({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:du,mathmlBuilder:bh});Ye({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=rF[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:du,mathmlBuilder:bh});var uk=(e,t)=>{var n,r,i=!1,a;e.type==="supsub"?(n=e.sup,r=e.sub,a=Ct(e.base,"operatorname"),i=!0):a=Ct(e,"operatorname");var o;if(a.body.length>0){for(var l=a.body.map(f=>{var g="text"in f?f.text:void 0;return typeof g=="string"?{type:"textord",mode:f.mode,text:g}:f}),u=fr(l,t.withFont("mathrm"),!0),d=0;d{for(var n=qi(e.body,t.withFont("mathrm")),r=!0,i=0;im.toText()).join("");n=[new tr(l)]}var u=new He("mi",n);u.setAttribute("mathvariant","normal");var d=new He("mo",[cs("⁡","text")]);return e.parentIsSupSub?new He("mrow",[u,d]):L9([u,d])};Ye({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:er(i),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:uk,mathmlBuilder:iF});ee("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");$l({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?qa(fr(e.body,t,!1)):Ie(["mord"],fr(e.body,t,!0),t)},mathmlBuilder(e,t){return $o(e.body,t,!0)}});Ye({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=Yt(e.body,t.havingCrampedStyle()),r=Kc("overline-line",t),i=t.fontMetrics().defaultRuleThickness,a=Vt({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]});return Ie(["mord","overline"],[a],t)},mathmlBuilder(e,t){var n=new He("mo",[new tr("‾")]);n.setAttribute("stretchy","true");var r=new He("mover",[fn(e.body,t),n]);return r.setAttribute("accent","true"),r}});Ye({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:er(r)}},htmlBuilder:(e,t)=>{var n=fr(e.body,t.withPhantom(),!1);return qa(n)},mathmlBuilder:(e,t)=>{var n=qi(e.body,t);return new He("mphantom",n)}});ee("\\hphantom","\\smash{\\phantom{#1}}");Ye({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Ie(["inner"],[Yt(e.body,t.withPhantom())]),r=Ie(["fix"],[]);return Ie(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=qi(er(e.body),t),r=new He("mphantom",n),i=new He("mpadded",[r]);return i.setAttribute("width","0px"),i}});Ye({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=Ct(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=Yt(e.body,t),r=In(e.dy,t);return Vt({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new He("mpadded",[fn(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}});Ye({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Ye({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,i=n[0],a=Ct(t[0],"size"),o=Ct(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&Ct(i,"size").value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=Ie(["mord","rule"],[],t),r=In(e.width,t),i=In(e.height,t),a=e.shift?In(e.shift,t):0;return n.style.borderRightWidth=$e(r),n.style.borderTopWidth=$e(i),n.style.bottom=$e(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=In(e.width,t),r=In(e.height,t),i=e.shift?In(e.shift,t):0,a=t.color&&t.getColor()||"black",o=new He("mspace");o.setAttribute("mathbackground",a),o.setAttribute("width",$e(n)),o.setAttribute("height",$e(r));var l=new He("mpadded",[o]);return i>=0?l.setAttribute("height",$e(i)):(l.setAttribute("height",$e(i)),l.setAttribute("depth",$e(-i))),l.setAttribute("voffset",$e(i)),l}});function dk(e,t,n){for(var r=fr(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a{var n=t.havingSize(e.size);return dk(e.body,n,t)};Ye({type:"sizing",names:H6,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:H6.indexOf(r)+1,body:a}},htmlBuilder:sF,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=qi(e.body,n),i=new He("mstyle",r);return i.setAttribute("mathsize",$e(n.sizeMultiplier)),i}});Ye({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,o=n[0]&&Ct(n[0],"ordgroup");if(o)for(var l,u=0;u{var n=Ie([],[Yt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return Ie(["mord","smash"],[n],t);if(n.children)for(var r=0;r{var n=new He("mpadded",[fn(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});Ye({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:"sqrt",mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=Yt(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=Zc(n,t);var r=t.fontMetrics(),i=r.defaultRuleThickness,a=i;t.style.idn.height+n.depth+o&&(o=(o+f-n.height-n.depth)/2);var g=u.height-n.height-o-d;n.style.paddingLeft=$e(m);var b=Vt({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+g)},{type:"elem",elem:u},{type:"kern",size:d}]});if(e.index){var k=t.havingStyle(vt.SCRIPTSCRIPT),S=Yt(e.index,k,t),x=.6*(b.height-b.depth),_=Vt({positionType:"shift",positionData:-x,children:[{type:"elem",elem:S}]}),w=Ie(["root"],[_]);return Ie(["mord","sqrt"],[w,b],t)}else return Ie(["mord","sqrt"],[b],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new He("mroot",[fn(n,t),fn(r,t)]):new He("msqrt",[fn(n,t)])}});var uv={display:vt.DISPLAY,text:vt.TEXT,script:vt.SCRIPT,scriptscript:vt.SCRIPTSCRIPT};function aF(e){return e in uv}Ye({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!aF(o))throw new Error("Unknown style: "+o);return{type:"styling",mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=uv[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont("")),dk(e.body,r,t)},mathmlBuilder(e,t){var n=uv[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(""));var i=qi(e.body,r),a=new He("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=o[e.style];return a.setAttribute("scriptlevel",l[0]),a.setAttribute("displaystyle",l[1]),a}});var oF=function(t,n){var r=t.base;if(r)if(r.type==="op"){var i=r.limits&&(n.style.size===vt.DISPLAY.size||r.alwaysHandleSupSub);return i?du:null}else if(r.type==="operatorname"){var a=r.alwaysHandleSupSub&&(n.style.size===vt.DISPLAY.size||r.limits);return a?uk:null}else{if(r.type==="accent")return Pa(r.base)?P_:null;if(r.type==="horizBrace"){var o=!t.sub;return o===r.isOver?ok:null}else return null}else return null};$l({type:"supsub",htmlBuilder(e,t){var n=oF(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,o=Yt(r,t),l,u,d=t.fontMetrics(),m=0,f=0,g=r&&Pa(r);if(i){var b=t.havingStyle(t.style.sup());l=Yt(i,b,t),g||(m=o.height-b.fontMetrics().supDrop*b.sizeMultiplier/t.sizeMultiplier)}if(a){var k=t.havingStyle(t.style.sub());u=Yt(a,k,t),g||(f=o.depth+k.fontMetrics().subDrop*k.sizeMultiplier/t.sizeMultiplier)}var S;t.style===vt.DISPLAY?S=d.sup1:t.style.cramped?S=d.sup3:S=d.sup2;var x=t.sizeMultiplier,_=$e(.5/d.ptPerEm/x),w=null;if(u){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(o instanceof $i||y){var C;w=$e(-((C=o.italic)!=null?C:0))}}var T;if(l&&u){m=Math.max(m,S,l.depth+.25*d.xHeight),f=Math.max(f,d.sub2);var E=d.defaultRuleThickness,j=4*E;if(m-l.depth-(u.height-f)0&&(m+=N,f-=N)}var D=[{type:"elem",elem:u,shift:f,marginRight:_,marginLeft:w},{type:"elem",elem:l,shift:-m,marginRight:_}];T=Vt({positionType:"individualShift",children:D})}else if(u){f=Math.max(f,d.sub1,u.height-.8*d.xHeight);var z=[{type:"elem",elem:u,marginLeft:w,marginRight:_}];T=Vt({positionType:"shift",positionData:f,children:z})}else if(l)m=Math.max(m,S,l.depth+.25*d.xHeight),T=Vt({positionType:"shift",positionData:-m,children:[{type:"elem",elem:l,marginRight:_}]});else throw new Error("supsub must have either sup or sub.");var $=sv(o,"right")||"mord";return Ie([$],[o,Ie(["msupsub"],[T])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type==="horizBrace"&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var a=[fn(e.base,t)];e.sub&&a.push(fn(e.sub,t)),e.sup&&a.push(fn(e.sup,t));var o;if(n)o=r?"mover":"munder";else if(e.sub)if(e.sup){var d=e.base;d&&d.type==="op"&&d.limits&&t.style===vt.DISPLAY||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(t.style===vt.DISPLAY||d.limits)?o="munderover":o="msubsup"}else{var u=e.base;u&&u.type==="op"&&u.limits&&(t.style===vt.DISPLAY||u.alwaysHandleSupSub)||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(u.limits||t.style===vt.DISPLAY)?o="munder":o="msub"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(t.style===vt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===vt.DISPLAY)?o="mover":o="msup"}return new He(o,a)}});$l({type:"atom",htmlBuilder(e,t){return B_(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new He("mo",[cs(e.text,e.mode)]);if(e.family==="bin"){var r=F_(e,t);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var hk={mi:"italic",mn:"normal",mtext:"normal"};$l({type:"mathord",htmlBuilder(e,t){return vp(e,t,"mathord")},mathmlBuilder(e,t){var n=new He("mi",[cs(e.text,e.mode,t)]),r=F_(e,t)||"italic";return r!==hk[n.type]&&n.setAttribute("mathvariant",r),n}});$l({type:"textord",htmlBuilder(e,t){return vp(e,t,"textord")},mathmlBuilder(e,t){var n=cs(e.text,e.mode,t),r=F_(e,t)||"normal",i;return e.mode==="text"?i=new He("mtext",[n]):/[0-9]/.test(e.text)?i=new He("mn",[n]):e.text==="\\prime"?i=new He("mo",[n]):i=new He("mi",[n]),r!==hk[i.type]&&i.setAttribute("mathvariant",r),i}});var Fg={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Pg={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};$l({type:"spacing",htmlBuilder(e,t){if(Pg.hasOwnProperty(e.text)){var n=Pg[e.text].className||"";if(e.mode==="text"){var r=vp(e,t,"textord");return r.classes.push(n),r}else return Ie(["mspace",n],[B_(e.text,e.mode,t)],t)}else{if(Fg.hasOwnProperty(e.text))return Ie(["mspace",Fg[e.text]],[],t);throw new Be('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(Pg.hasOwnProperty(e.text))n=new He("mtext",[new tr(" ")]);else{if(Fg.hasOwnProperty(e.text))return new He("mspace");throw new Be('Unknown type of space "'+e.text+'"')}return n}});var $6=()=>{var e=new He("mtd",[]);return e.setAttribute("width","50%"),e};$l({type:"tag",mathmlBuilder(e,t){var n=new He("mtable",[new He("mtr",[$6(),new He("mtd",[$o(e.body,t)]),$6(),new He("mtd",[$o(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var F6={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},P6={"\\textbf":"textbf","\\textmd":"textmd"},lF={"\\textit":"textit","\\textup":"textup"},U6=(e,t)=>{var n=e.font;if(n){if(F6[n])return t.withTextFontFamily(F6[n]);if(P6[n])return t.withTextFontWeight(P6[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(lF[n])};Ye({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"text",mode:n.mode,body:er(i),font:r}},htmlBuilder(e,t){var n=U6(e,t),r=fr(e.body,n,!0);return Ie(["mord","text"],r,n)},mathmlBuilder(e,t){var n=U6(e,t);return $o(e.body,n)}});Ye({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Yt(e.body,t),r=Kc("underline-line",t),i=t.fontMetrics().defaultRuleThickness,a=Vt({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]});return Ie(["mord","underline"],[a],t)},mathmlBuilder(e,t){var n=new He("mo",[new tr("‾")]);n.setAttribute("stretchy","true");var r=new He("munder",[fn(e.body,t),n]);return r.setAttribute("accentunder","true"),r}});Ye({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Yt(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return Vt({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new He("mpadded",[fn(e.body,t)],["vcenter"]);return new He("mrow",[n])}});Ye({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Be("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=q6(e),r=[],i=t.havingStyle(t.style.text()),a=0;ae.body.replace(/ /g,e.star?"␣":" "),Oo=R9,fk=`[ \r - ]`,cF="\\\\[a-zA-Z@]+",uF="\\\\[^\uD800-\uDFFF]",dF="("+cF+")"+fk+"*",hF=`\\\\( +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function r$(e){return"toText"in e}class lu{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n{if(r$(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var Qb={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},i$={ex:!0,em:!0,mu:!0},S9=function(t){return typeof t!="string"&&(t=t.unit),t in Qb||t in i$||t==="ex"},In=function(t,n){var r;if(t.unit in Qb)r=Qb[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var i;if(n.style.isTight()?i=n.havingStyle(n.style.text()):i=n,t.unit==="ex")r=i.fontMetrics().xHeight;else if(t.unit==="em")r=i.fontMetrics().quad;else throw new ze("Invalid unit: '"+t.unit+"'");i!==n&&(r*=i.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*r,n.maxSize)},He=function(t){return+t.toFixed(4)+"em"},zo=function(t){return t.filter(n=>n).join(" ")},$_=function(t){var n="";for(var r of Object.keys(t)){var i=t[r];i!==void 0&&(n+=RH(r)+":"+i+";")}return n},k9=function(t,n,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var i=n.getColor();i&&(this.style.color=i)}},C9=function(t){var n=document.createElement(t);n.className=zo(this.classes),Object.assign(n.style,this.style);for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i/=\x00-\x1f]/,E9=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+Lr(zo(this.classes))+'"');var r=$_(this.style);r&&(n+=' style="'+Lr(r)+'"');for(var i of Object.keys(this.attributes)){if(s$.test(i))throw new ze("Invalid attribute name '"+i+"'");n+=" "+i+'="'+Lr(this.attributes[i])+'"'}n+=">";for(var a=0;a",n};class cu{constructor(t,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,k9.call(this,t,r,i),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return C9.call(this,"span")}toMarkup(){return E9.call(this,"span")}}class vp{constructor(t,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,k9.call(this,n,i),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return C9.call(this,"a")}toMarkup(){return E9.call(this,"a")}}class a${constructor(t,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t=''+Lr(this.alt)+'0&&(n=document.createElement("span"),n.style.marginRight=He(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=zo(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="0&&(r+="margin-right:"+He(this.italic)+";"),r+=$_(this.style),r&&(t=!0,n+=' style="'+Lr(r)+'"');var i=Lr(this.text);return t?(n+=">",n+=i,n+="",n):i}}class Ia{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i':''}}class Jb{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var t=" but got "+String(e)+".")}var u$=e=>e instanceof cu||e instanceof vp||e instanceof lu,Ys={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},I0={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},g6={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function d$(e,t){Ys[e]=t}function F_(e,t,n){if(!Ys[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=Ys[t][r];if(!i&&e[0]in g6&&(r=g6[e[0]].charCodeAt(0),i=Ys[t][r]),!i&&n==="text"&&w9(r)&&(i=Ys[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var jg={};function h$(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!jg[t]){var n=jg[t]={cssEmPerMu:I0.quad[t]/18};for(var r in I0)I0.hasOwnProperty(r)&&(n[r]=I0[r][t])}return jg[t]}var An={math:{},text:{}};function L(e,t,n,r,i,a){An[e][i]={font:t,group:n,replace:r},a&&r&&(An[e][r]=An[e][i])}var P="math",Re="text",Z="main",oe="ams",Nn="accent-token",Xe="bin",Kr="close",uu="inner",ht="mathord",ir="op-token",Fi="open",bh="punct",ue="rel",Ua="spacing",pe="textord";L(P,Z,ue,"≡","\\equiv",!0);L(P,Z,ue,"≺","\\prec",!0);L(P,Z,ue,"≻","\\succ",!0);L(P,Z,ue,"∼","\\sim",!0);L(P,Z,ue,"⊥","\\perp");L(P,Z,ue,"⪯","\\preceq",!0);L(P,Z,ue,"⪰","\\succeq",!0);L(P,Z,ue,"≃","\\simeq",!0);L(P,Z,ue,"∣","\\mid",!0);L(P,Z,ue,"≪","\\ll",!0);L(P,Z,ue,"≫","\\gg",!0);L(P,Z,ue,"≍","\\asymp",!0);L(P,Z,ue,"∥","\\parallel");L(P,Z,ue,"⋈","\\bowtie",!0);L(P,Z,ue,"⌣","\\smile",!0);L(P,Z,ue,"⊑","\\sqsubseteq",!0);L(P,Z,ue,"⊒","\\sqsupseteq",!0);L(P,Z,ue,"≐","\\doteq",!0);L(P,Z,ue,"⌢","\\frown",!0);L(P,Z,ue,"∋","\\ni",!0);L(P,Z,ue,"∝","\\propto",!0);L(P,Z,ue,"⊢","\\vdash",!0);L(P,Z,ue,"⊣","\\dashv",!0);L(P,Z,ue,"∋","\\owns");L(P,Z,bh,".","\\ldotp");L(P,Z,bh,"⋅","\\cdotp");L(P,Z,bh,"⋅","·");L(Re,Z,pe,"⋅","·");L(P,Z,pe,"#","\\#");L(Re,Z,pe,"#","\\#");L(P,Z,pe,"&","\\&");L(Re,Z,pe,"&","\\&");L(P,Z,pe,"ℵ","\\aleph",!0);L(P,Z,pe,"∀","\\forall",!0);L(P,Z,pe,"ℏ","\\hbar",!0);L(P,Z,pe,"∃","\\exists",!0);L(P,Z,pe,"∇","\\nabla",!0);L(P,Z,pe,"♭","\\flat",!0);L(P,Z,pe,"ℓ","\\ell",!0);L(P,Z,pe,"♮","\\natural",!0);L(P,Z,pe,"♣","\\clubsuit",!0);L(P,Z,pe,"℘","\\wp",!0);L(P,Z,pe,"♯","\\sharp",!0);L(P,Z,pe,"♢","\\diamondsuit",!0);L(P,Z,pe,"ℜ","\\Re",!0);L(P,Z,pe,"♡","\\heartsuit",!0);L(P,Z,pe,"ℑ","\\Im",!0);L(P,Z,pe,"♠","\\spadesuit",!0);L(P,Z,pe,"§","\\S",!0);L(Re,Z,pe,"§","\\S");L(P,Z,pe,"¶","\\P",!0);L(Re,Z,pe,"¶","\\P");L(P,Z,pe,"†","\\dag");L(Re,Z,pe,"†","\\dag");L(Re,Z,pe,"†","\\textdagger");L(P,Z,pe,"‡","\\ddag");L(Re,Z,pe,"‡","\\ddag");L(Re,Z,pe,"‡","\\textdaggerdbl");L(P,Z,Kr,"⎱","\\rmoustache",!0);L(P,Z,Fi,"⎰","\\lmoustache",!0);L(P,Z,Kr,"⟯","\\rgroup",!0);L(P,Z,Fi,"⟮","\\lgroup",!0);L(P,Z,Xe,"∓","\\mp",!0);L(P,Z,Xe,"⊖","\\ominus",!0);L(P,Z,Xe,"⊎","\\uplus",!0);L(P,Z,Xe,"⊓","\\sqcap",!0);L(P,Z,Xe,"∗","\\ast");L(P,Z,Xe,"⊔","\\sqcup",!0);L(P,Z,Xe,"◯","\\bigcirc",!0);L(P,Z,Xe,"∙","\\bullet",!0);L(P,Z,Xe,"‡","\\ddagger");L(P,Z,Xe,"≀","\\wr",!0);L(P,Z,Xe,"⨿","\\amalg");L(P,Z,Xe,"&","\\And");L(P,Z,ue,"⟵","\\longleftarrow",!0);L(P,Z,ue,"⇐","\\Leftarrow",!0);L(P,Z,ue,"⟸","\\Longleftarrow",!0);L(P,Z,ue,"⟶","\\longrightarrow",!0);L(P,Z,ue,"⇒","\\Rightarrow",!0);L(P,Z,ue,"⟹","\\Longrightarrow",!0);L(P,Z,ue,"↔","\\leftrightarrow",!0);L(P,Z,ue,"⟷","\\longleftrightarrow",!0);L(P,Z,ue,"⇔","\\Leftrightarrow",!0);L(P,Z,ue,"⟺","\\Longleftrightarrow",!0);L(P,Z,ue,"↦","\\mapsto",!0);L(P,Z,ue,"⟼","\\longmapsto",!0);L(P,Z,ue,"↗","\\nearrow",!0);L(P,Z,ue,"↩","\\hookleftarrow",!0);L(P,Z,ue,"↪","\\hookrightarrow",!0);L(P,Z,ue,"↘","\\searrow",!0);L(P,Z,ue,"↼","\\leftharpoonup",!0);L(P,Z,ue,"⇀","\\rightharpoonup",!0);L(P,Z,ue,"↙","\\swarrow",!0);L(P,Z,ue,"↽","\\leftharpoondown",!0);L(P,Z,ue,"⇁","\\rightharpoondown",!0);L(P,Z,ue,"↖","\\nwarrow",!0);L(P,Z,ue,"⇌","\\rightleftharpoons",!0);L(P,oe,ue,"≮","\\nless",!0);L(P,oe,ue,"","\\@nleqslant");L(P,oe,ue,"","\\@nleqq");L(P,oe,ue,"⪇","\\lneq",!0);L(P,oe,ue,"≨","\\lneqq",!0);L(P,oe,ue,"","\\@lvertneqq");L(P,oe,ue,"⋦","\\lnsim",!0);L(P,oe,ue,"⪉","\\lnapprox",!0);L(P,oe,ue,"⊀","\\nprec",!0);L(P,oe,ue,"⋠","\\npreceq",!0);L(P,oe,ue,"⋨","\\precnsim",!0);L(P,oe,ue,"⪹","\\precnapprox",!0);L(P,oe,ue,"≁","\\nsim",!0);L(P,oe,ue,"","\\@nshortmid");L(P,oe,ue,"∤","\\nmid",!0);L(P,oe,ue,"⊬","\\nvdash",!0);L(P,oe,ue,"⊭","\\nvDash",!0);L(P,oe,ue,"⋪","\\ntriangleleft");L(P,oe,ue,"⋬","\\ntrianglelefteq",!0);L(P,oe,ue,"⊊","\\subsetneq",!0);L(P,oe,ue,"","\\@varsubsetneq");L(P,oe,ue,"⫋","\\subsetneqq",!0);L(P,oe,ue,"","\\@varsubsetneqq");L(P,oe,ue,"≯","\\ngtr",!0);L(P,oe,ue,"","\\@ngeqslant");L(P,oe,ue,"","\\@ngeqq");L(P,oe,ue,"⪈","\\gneq",!0);L(P,oe,ue,"≩","\\gneqq",!0);L(P,oe,ue,"","\\@gvertneqq");L(P,oe,ue,"⋧","\\gnsim",!0);L(P,oe,ue,"⪊","\\gnapprox",!0);L(P,oe,ue,"⊁","\\nsucc",!0);L(P,oe,ue,"⋡","\\nsucceq",!0);L(P,oe,ue,"⋩","\\succnsim",!0);L(P,oe,ue,"⪺","\\succnapprox",!0);L(P,oe,ue,"≆","\\ncong",!0);L(P,oe,ue,"","\\@nshortparallel");L(P,oe,ue,"∦","\\nparallel",!0);L(P,oe,ue,"⊯","\\nVDash",!0);L(P,oe,ue,"⋫","\\ntriangleright");L(P,oe,ue,"⋭","\\ntrianglerighteq",!0);L(P,oe,ue,"","\\@nsupseteqq");L(P,oe,ue,"⊋","\\supsetneq",!0);L(P,oe,ue,"","\\@varsupsetneq");L(P,oe,ue,"⫌","\\supsetneqq",!0);L(P,oe,ue,"","\\@varsupsetneqq");L(P,oe,ue,"⊮","\\nVdash",!0);L(P,oe,ue,"⪵","\\precneqq",!0);L(P,oe,ue,"⪶","\\succneqq",!0);L(P,oe,ue,"","\\@nsubseteqq");L(P,oe,Xe,"⊴","\\unlhd");L(P,oe,Xe,"⊵","\\unrhd");L(P,oe,ue,"↚","\\nleftarrow",!0);L(P,oe,ue,"↛","\\nrightarrow",!0);L(P,oe,ue,"⇍","\\nLeftarrow",!0);L(P,oe,ue,"⇏","\\nRightarrow",!0);L(P,oe,ue,"↮","\\nleftrightarrow",!0);L(P,oe,ue,"⇎","\\nLeftrightarrow",!0);L(P,oe,ue,"△","\\vartriangle");L(P,oe,pe,"ℏ","\\hslash");L(P,oe,pe,"▽","\\triangledown");L(P,oe,pe,"◊","\\lozenge");L(P,oe,pe,"Ⓢ","\\circledS");L(P,oe,pe,"®","\\circledR");L(Re,oe,pe,"®","\\circledR");L(P,oe,pe,"∡","\\measuredangle",!0);L(P,oe,pe,"∄","\\nexists");L(P,oe,pe,"℧","\\mho");L(P,oe,pe,"Ⅎ","\\Finv",!0);L(P,oe,pe,"⅁","\\Game",!0);L(P,oe,pe,"‵","\\backprime");L(P,oe,pe,"▲","\\blacktriangle");L(P,oe,pe,"▼","\\blacktriangledown");L(P,oe,pe,"■","\\blacksquare");L(P,oe,pe,"⧫","\\blacklozenge");L(P,oe,pe,"★","\\bigstar");L(P,oe,pe,"∢","\\sphericalangle",!0);L(P,oe,pe,"∁","\\complement",!0);L(P,oe,pe,"ð","\\eth",!0);L(Re,Z,pe,"ð","ð");L(P,oe,pe,"╱","\\diagup");L(P,oe,pe,"╲","\\diagdown");L(P,oe,pe,"□","\\square");L(P,oe,pe,"□","\\Box");L(P,oe,pe,"◊","\\Diamond");L(P,oe,pe,"¥","\\yen",!0);L(Re,oe,pe,"¥","\\yen",!0);L(P,oe,pe,"✓","\\checkmark",!0);L(Re,oe,pe,"✓","\\checkmark");L(P,oe,pe,"ℶ","\\beth",!0);L(P,oe,pe,"ℸ","\\daleth",!0);L(P,oe,pe,"ℷ","\\gimel",!0);L(P,oe,pe,"ϝ","\\digamma",!0);L(P,oe,pe,"ϰ","\\varkappa");L(P,oe,Fi,"┌","\\@ulcorner",!0);L(P,oe,Kr,"┐","\\@urcorner",!0);L(P,oe,Fi,"└","\\@llcorner",!0);L(P,oe,Kr,"┘","\\@lrcorner",!0);L(P,oe,ue,"≦","\\leqq",!0);L(P,oe,ue,"⩽","\\leqslant",!0);L(P,oe,ue,"⪕","\\eqslantless",!0);L(P,oe,ue,"≲","\\lesssim",!0);L(P,oe,ue,"⪅","\\lessapprox",!0);L(P,oe,ue,"≊","\\approxeq",!0);L(P,oe,Xe,"⋖","\\lessdot");L(P,oe,ue,"⋘","\\lll",!0);L(P,oe,ue,"≶","\\lessgtr",!0);L(P,oe,ue,"⋚","\\lesseqgtr",!0);L(P,oe,ue,"⪋","\\lesseqqgtr",!0);L(P,oe,ue,"≑","\\doteqdot");L(P,oe,ue,"≓","\\risingdotseq",!0);L(P,oe,ue,"≒","\\fallingdotseq",!0);L(P,oe,ue,"∽","\\backsim",!0);L(P,oe,ue,"⋍","\\backsimeq",!0);L(P,oe,ue,"⫅","\\subseteqq",!0);L(P,oe,ue,"⋐","\\Subset",!0);L(P,oe,ue,"⊏","\\sqsubset",!0);L(P,oe,ue,"≼","\\preccurlyeq",!0);L(P,oe,ue,"⋞","\\curlyeqprec",!0);L(P,oe,ue,"≾","\\precsim",!0);L(P,oe,ue,"⪷","\\precapprox",!0);L(P,oe,ue,"⊲","\\vartriangleleft");L(P,oe,ue,"⊴","\\trianglelefteq");L(P,oe,ue,"⊨","\\vDash",!0);L(P,oe,ue,"⊪","\\Vvdash",!0);L(P,oe,ue,"⌣","\\smallsmile");L(P,oe,ue,"⌢","\\smallfrown");L(P,oe,ue,"≏","\\bumpeq",!0);L(P,oe,ue,"≎","\\Bumpeq",!0);L(P,oe,ue,"≧","\\geqq",!0);L(P,oe,ue,"⩾","\\geqslant",!0);L(P,oe,ue,"⪖","\\eqslantgtr",!0);L(P,oe,ue,"≳","\\gtrsim",!0);L(P,oe,ue,"⪆","\\gtrapprox",!0);L(P,oe,Xe,"⋗","\\gtrdot");L(P,oe,ue,"⋙","\\ggg",!0);L(P,oe,ue,"≷","\\gtrless",!0);L(P,oe,ue,"⋛","\\gtreqless",!0);L(P,oe,ue,"⪌","\\gtreqqless",!0);L(P,oe,ue,"≖","\\eqcirc",!0);L(P,oe,ue,"≗","\\circeq",!0);L(P,oe,ue,"≜","\\triangleq",!0);L(P,oe,ue,"∼","\\thicksim");L(P,oe,ue,"≈","\\thickapprox");L(P,oe,ue,"⫆","\\supseteqq",!0);L(P,oe,ue,"⋑","\\Supset",!0);L(P,oe,ue,"⊐","\\sqsupset",!0);L(P,oe,ue,"≽","\\succcurlyeq",!0);L(P,oe,ue,"⋟","\\curlyeqsucc",!0);L(P,oe,ue,"≿","\\succsim",!0);L(P,oe,ue,"⪸","\\succapprox",!0);L(P,oe,ue,"⊳","\\vartriangleright");L(P,oe,ue,"⊵","\\trianglerighteq");L(P,oe,ue,"⊩","\\Vdash",!0);L(P,oe,ue,"∣","\\shortmid");L(P,oe,ue,"∥","\\shortparallel");L(P,oe,ue,"≬","\\between",!0);L(P,oe,ue,"⋔","\\pitchfork",!0);L(P,oe,ue,"∝","\\varpropto");L(P,oe,ue,"◀","\\blacktriangleleft");L(P,oe,ue,"∴","\\therefore",!0);L(P,oe,ue,"∍","\\backepsilon");L(P,oe,ue,"▶","\\blacktriangleright");L(P,oe,ue,"∵","\\because",!0);L(P,oe,ue,"⋘","\\llless");L(P,oe,ue,"⋙","\\gggtr");L(P,oe,Xe,"⊲","\\lhd");L(P,oe,Xe,"⊳","\\rhd");L(P,oe,ue,"≂","\\eqsim",!0);L(P,Z,ue,"⋈","\\Join");L(P,oe,ue,"≑","\\Doteq",!0);L(P,oe,Xe,"∔","\\dotplus",!0);L(P,oe,Xe,"∖","\\smallsetminus");L(P,oe,Xe,"⋒","\\Cap",!0);L(P,oe,Xe,"⋓","\\Cup",!0);L(P,oe,Xe,"⩞","\\doublebarwedge",!0);L(P,oe,Xe,"⊟","\\boxminus",!0);L(P,oe,Xe,"⊞","\\boxplus",!0);L(P,oe,Xe,"⋇","\\divideontimes",!0);L(P,oe,Xe,"⋉","\\ltimes",!0);L(P,oe,Xe,"⋊","\\rtimes",!0);L(P,oe,Xe,"⋋","\\leftthreetimes",!0);L(P,oe,Xe,"⋌","\\rightthreetimes",!0);L(P,oe,Xe,"⋏","\\curlywedge",!0);L(P,oe,Xe,"⋎","\\curlyvee",!0);L(P,oe,Xe,"⊝","\\circleddash",!0);L(P,oe,Xe,"⊛","\\circledast",!0);L(P,oe,Xe,"⋅","\\centerdot");L(P,oe,Xe,"⊺","\\intercal",!0);L(P,oe,Xe,"⋒","\\doublecap");L(P,oe,Xe,"⋓","\\doublecup");L(P,oe,Xe,"⊠","\\boxtimes",!0);L(P,oe,ue,"⇢","\\dashrightarrow",!0);L(P,oe,ue,"⇠","\\dashleftarrow",!0);L(P,oe,ue,"⇇","\\leftleftarrows",!0);L(P,oe,ue,"⇆","\\leftrightarrows",!0);L(P,oe,ue,"⇚","\\Lleftarrow",!0);L(P,oe,ue,"↞","\\twoheadleftarrow",!0);L(P,oe,ue,"↢","\\leftarrowtail",!0);L(P,oe,ue,"↫","\\looparrowleft",!0);L(P,oe,ue,"⇋","\\leftrightharpoons",!0);L(P,oe,ue,"↶","\\curvearrowleft",!0);L(P,oe,ue,"↺","\\circlearrowleft",!0);L(P,oe,ue,"↰","\\Lsh",!0);L(P,oe,ue,"⇈","\\upuparrows",!0);L(P,oe,ue,"↿","\\upharpoonleft",!0);L(P,oe,ue,"⇃","\\downharpoonleft",!0);L(P,Z,ue,"⊶","\\origof",!0);L(P,Z,ue,"⊷","\\imageof",!0);L(P,oe,ue,"⊸","\\multimap",!0);L(P,oe,ue,"↭","\\leftrightsquigarrow",!0);L(P,oe,ue,"⇉","\\rightrightarrows",!0);L(P,oe,ue,"⇄","\\rightleftarrows",!0);L(P,oe,ue,"↠","\\twoheadrightarrow",!0);L(P,oe,ue,"↣","\\rightarrowtail",!0);L(P,oe,ue,"↬","\\looparrowright",!0);L(P,oe,ue,"↷","\\curvearrowright",!0);L(P,oe,ue,"↻","\\circlearrowright",!0);L(P,oe,ue,"↱","\\Rsh",!0);L(P,oe,ue,"⇊","\\downdownarrows",!0);L(P,oe,ue,"↾","\\upharpoonright",!0);L(P,oe,ue,"⇂","\\downharpoonright",!0);L(P,oe,ue,"⇝","\\rightsquigarrow",!0);L(P,oe,ue,"⇝","\\leadsto");L(P,oe,ue,"⇛","\\Rrightarrow",!0);L(P,oe,ue,"↾","\\restriction");L(P,Z,pe,"‘","`");L(P,Z,pe,"$","\\$");L(Re,Z,pe,"$","\\$");L(Re,Z,pe,"$","\\textdollar");L(P,Z,pe,"%","\\%");L(Re,Z,pe,"%","\\%");L(P,Z,pe,"_","\\_");L(Re,Z,pe,"_","\\_");L(Re,Z,pe,"_","\\textunderscore");L(P,Z,pe,"∠","\\angle",!0);L(P,Z,pe,"∞","\\infty",!0);L(P,Z,pe,"′","\\prime");L(P,Z,pe,"△","\\triangle");L(P,Z,pe,"Γ","\\Gamma",!0);L(P,Z,pe,"Δ","\\Delta",!0);L(P,Z,pe,"Θ","\\Theta",!0);L(P,Z,pe,"Λ","\\Lambda",!0);L(P,Z,pe,"Ξ","\\Xi",!0);L(P,Z,pe,"Π","\\Pi",!0);L(P,Z,pe,"Σ","\\Sigma",!0);L(P,Z,pe,"Υ","\\Upsilon",!0);L(P,Z,pe,"Φ","\\Phi",!0);L(P,Z,pe,"Ψ","\\Psi",!0);L(P,Z,pe,"Ω","\\Omega",!0);L(P,Z,pe,"A","Α");L(P,Z,pe,"B","Β");L(P,Z,pe,"E","Ε");L(P,Z,pe,"Z","Ζ");L(P,Z,pe,"H","Η");L(P,Z,pe,"I","Ι");L(P,Z,pe,"K","Κ");L(P,Z,pe,"M","Μ");L(P,Z,pe,"N","Ν");L(P,Z,pe,"O","Ο");L(P,Z,pe,"P","Ρ");L(P,Z,pe,"T","Τ");L(P,Z,pe,"X","Χ");L(P,Z,pe,"¬","\\neg",!0);L(P,Z,pe,"¬","\\lnot");L(P,Z,pe,"⊤","\\top");L(P,Z,pe,"⊥","\\bot");L(P,Z,pe,"∅","\\emptyset");L(P,oe,pe,"∅","\\varnothing");L(P,Z,ht,"α","\\alpha",!0);L(P,Z,ht,"β","\\beta",!0);L(P,Z,ht,"γ","\\gamma",!0);L(P,Z,ht,"δ","\\delta",!0);L(P,Z,ht,"ϵ","\\epsilon",!0);L(P,Z,ht,"ζ","\\zeta",!0);L(P,Z,ht,"η","\\eta",!0);L(P,Z,ht,"θ","\\theta",!0);L(P,Z,ht,"ι","\\iota",!0);L(P,Z,ht,"κ","\\kappa",!0);L(P,Z,ht,"λ","\\lambda",!0);L(P,Z,ht,"μ","\\mu",!0);L(P,Z,ht,"ν","\\nu",!0);L(P,Z,ht,"ξ","\\xi",!0);L(P,Z,ht,"ο","\\omicron",!0);L(P,Z,ht,"π","\\pi",!0);L(P,Z,ht,"ρ","\\rho",!0);L(P,Z,ht,"σ","\\sigma",!0);L(P,Z,ht,"τ","\\tau",!0);L(P,Z,ht,"υ","\\upsilon",!0);L(P,Z,ht,"ϕ","\\phi",!0);L(P,Z,ht,"χ","\\chi",!0);L(P,Z,ht,"ψ","\\psi",!0);L(P,Z,ht,"ω","\\omega",!0);L(P,Z,ht,"ε","\\varepsilon",!0);L(P,Z,ht,"ϑ","\\vartheta",!0);L(P,Z,ht,"ϖ","\\varpi",!0);L(P,Z,ht,"ϱ","\\varrho",!0);L(P,Z,ht,"ς","\\varsigma",!0);L(P,Z,ht,"φ","\\varphi",!0);L(P,Z,Xe,"∗","*",!0);L(P,Z,Xe,"+","+");L(P,Z,Xe,"−","-",!0);L(P,Z,Xe,"⋅","\\cdot",!0);L(P,Z,Xe,"∘","\\circ",!0);L(P,Z,Xe,"÷","\\div",!0);L(P,Z,Xe,"±","\\pm",!0);L(P,Z,Xe,"×","\\times",!0);L(P,Z,Xe,"∩","\\cap",!0);L(P,Z,Xe,"∪","\\cup",!0);L(P,Z,Xe,"∖","\\setminus",!0);L(P,Z,Xe,"∧","\\land");L(P,Z,Xe,"∨","\\lor");L(P,Z,Xe,"∧","\\wedge",!0);L(P,Z,Xe,"∨","\\vee",!0);L(P,Z,pe,"√","\\surd");L(P,Z,Fi,"⟨","\\langle",!0);L(P,Z,Fi,"∣","\\lvert");L(P,Z,Fi,"∥","\\lVert");L(P,Z,Kr,"?","?");L(P,Z,Kr,"!","!");L(P,Z,Kr,"⟩","\\rangle",!0);L(P,Z,Kr,"∣","\\rvert");L(P,Z,Kr,"∥","\\rVert");L(P,Z,ue,"=","=");L(P,Z,ue,":",":");L(P,Z,ue,"≈","\\approx",!0);L(P,Z,ue,"≅","\\cong",!0);L(P,Z,ue,"≥","\\ge");L(P,Z,ue,"≥","\\geq",!0);L(P,Z,ue,"←","\\gets");L(P,Z,ue,">","\\gt",!0);L(P,Z,ue,"∈","\\in",!0);L(P,Z,ue,"","\\@not");L(P,Z,ue,"⊂","\\subset",!0);L(P,Z,ue,"⊃","\\supset",!0);L(P,Z,ue,"⊆","\\subseteq",!0);L(P,Z,ue,"⊇","\\supseteq",!0);L(P,oe,ue,"⊈","\\nsubseteq",!0);L(P,oe,ue,"⊉","\\nsupseteq",!0);L(P,Z,ue,"⊨","\\models");L(P,Z,ue,"←","\\leftarrow",!0);L(P,Z,ue,"≤","\\le");L(P,Z,ue,"≤","\\leq",!0);L(P,Z,ue,"<","\\lt",!0);L(P,Z,ue,"→","\\rightarrow",!0);L(P,Z,ue,"→","\\to");L(P,oe,ue,"≱","\\ngeq",!0);L(P,oe,ue,"≰","\\nleq",!0);L(P,Z,Ua," ","\\ ");L(P,Z,Ua," ","\\space");L(P,Z,Ua," ","\\nobreakspace");L(Re,Z,Ua," ","\\ ");L(Re,Z,Ua," "," ");L(Re,Z,Ua," ","\\space");L(Re,Z,Ua," ","\\nobreakspace");L(P,Z,Ua,"","\\nobreak");L(P,Z,Ua,"","\\allowbreak");L(P,Z,bh,",",",");L(P,Z,bh,";",";");L(P,oe,Xe,"⊼","\\barwedge",!0);L(P,oe,Xe,"⊻","\\veebar",!0);L(P,Z,Xe,"⊙","\\odot",!0);L(P,Z,Xe,"⊕","\\oplus",!0);L(P,Z,Xe,"⊗","\\otimes",!0);L(P,Z,pe,"∂","\\partial",!0);L(P,Z,Xe,"⊘","\\oslash",!0);L(P,oe,Xe,"⊚","\\circledcirc",!0);L(P,oe,Xe,"⊡","\\boxdot",!0);L(P,Z,Xe,"△","\\bigtriangleup");L(P,Z,Xe,"▽","\\bigtriangledown");L(P,Z,Xe,"†","\\dagger");L(P,Z,Xe,"⋄","\\diamond");L(P,Z,Xe,"⋆","\\star");L(P,Z,Xe,"◃","\\triangleleft");L(P,Z,Xe,"▹","\\triangleright");L(P,Z,Fi,"{","\\{");L(Re,Z,pe,"{","\\{");L(Re,Z,pe,"{","\\textbraceleft");L(P,Z,Kr,"}","\\}");L(Re,Z,pe,"}","\\}");L(Re,Z,pe,"}","\\textbraceright");L(P,Z,Fi,"{","\\lbrace");L(P,Z,Kr,"}","\\rbrace");L(P,Z,Fi,"[","\\lbrack",!0);L(Re,Z,pe,"[","\\lbrack",!0);L(P,Z,Kr,"]","\\rbrack",!0);L(Re,Z,pe,"]","\\rbrack",!0);L(P,Z,Fi,"(","\\lparen",!0);L(P,Z,Kr,")","\\rparen",!0);L(Re,Z,pe,"<","\\textless",!0);L(Re,Z,pe,">","\\textgreater",!0);L(P,Z,Fi,"⌊","\\lfloor",!0);L(P,Z,Kr,"⌋","\\rfloor",!0);L(P,Z,Fi,"⌈","\\lceil",!0);L(P,Z,Kr,"⌉","\\rceil",!0);L(P,Z,pe,"\\","\\backslash");L(P,Z,pe,"∣","|");L(P,Z,pe,"∣","\\vert");L(Re,Z,pe,"|","\\textbar",!0);L(P,Z,pe,"∥","\\|");L(P,Z,pe,"∥","\\Vert");L(Re,Z,pe,"∥","\\textbardbl");L(Re,Z,pe,"~","\\textasciitilde");L(Re,Z,pe,"\\","\\textbackslash");L(Re,Z,pe,"^","\\textasciicircum");L(P,Z,ue,"↑","\\uparrow",!0);L(P,Z,ue,"⇑","\\Uparrow",!0);L(P,Z,ue,"↓","\\downarrow",!0);L(P,Z,ue,"⇓","\\Downarrow",!0);L(P,Z,ue,"↕","\\updownarrow",!0);L(P,Z,ue,"⇕","\\Updownarrow",!0);L(P,Z,ir,"∐","\\coprod");L(P,Z,ir,"⋁","\\bigvee");L(P,Z,ir,"⋀","\\bigwedge");L(P,Z,ir,"⨄","\\biguplus");L(P,Z,ir,"⋂","\\bigcap");L(P,Z,ir,"⋃","\\bigcup");L(P,Z,ir,"∫","\\int");L(P,Z,ir,"∫","\\intop");L(P,Z,ir,"∬","\\iint");L(P,Z,ir,"∭","\\iiint");L(P,Z,ir,"∏","\\prod");L(P,Z,ir,"∑","\\sum");L(P,Z,ir,"⨂","\\bigotimes");L(P,Z,ir,"⨁","\\bigoplus");L(P,Z,ir,"⨀","\\bigodot");L(P,Z,ir,"∮","\\oint");L(P,Z,ir,"∯","\\oiint");L(P,Z,ir,"∰","\\oiiint");L(P,Z,ir,"⨆","\\bigsqcup");L(P,Z,ir,"∫","\\smallint");L(Re,Z,uu,"…","\\textellipsis");L(P,Z,uu,"…","\\mathellipsis");L(Re,Z,uu,"…","\\ldots",!0);L(P,Z,uu,"…","\\ldots",!0);L(P,Z,uu,"⋯","\\@cdots",!0);L(P,Z,uu,"⋱","\\ddots",!0);L(P,Z,pe,"⋮","\\varvdots");L(Re,Z,pe,"⋮","\\varvdots");L(P,Z,Nn,"ˊ","\\acute");L(P,Z,Nn,"ˋ","\\grave");L(P,Z,Nn,"¨","\\ddot");L(P,Z,Nn,"~","\\tilde");L(P,Z,Nn,"ˉ","\\bar");L(P,Z,Nn,"˘","\\breve");L(P,Z,Nn,"ˇ","\\check");L(P,Z,Nn,"^","\\hat");L(P,Z,Nn,"⃗","\\vec");L(P,Z,Nn,"˙","\\dot");L(P,Z,Nn,"˚","\\mathring");L(P,Z,ht,"","\\@imath");L(P,Z,ht,"","\\@jmath");L(P,Z,pe,"ı","ı");L(P,Z,pe,"ȷ","ȷ");L(Re,Z,pe,"ı","\\i",!0);L(Re,Z,pe,"ȷ","\\j",!0);L(Re,Z,pe,"ß","\\ss",!0);L(Re,Z,pe,"æ","\\ae",!0);L(Re,Z,pe,"œ","\\oe",!0);L(Re,Z,pe,"ø","\\o",!0);L(Re,Z,pe,"Æ","\\AE",!0);L(Re,Z,pe,"Œ","\\OE",!0);L(Re,Z,pe,"Ø","\\O",!0);L(Re,Z,Nn,"ˊ","\\'");L(Re,Z,Nn,"ˋ","\\`");L(Re,Z,Nn,"ˆ","\\^");L(Re,Z,Nn,"˜","\\~");L(Re,Z,Nn,"ˉ","\\=");L(Re,Z,Nn,"˘","\\u");L(Re,Z,Nn,"˙","\\.");L(Re,Z,Nn,"¸","\\c");L(Re,Z,Nn,"˚","\\r");L(Re,Z,Nn,"ˇ","\\v");L(Re,Z,Nn,"¨",'\\"');L(Re,Z,Nn,"˝","\\H");L(Re,Z,Nn,"◯","\\textcircled");var A9={"--":!0,"---":!0,"``":!0,"''":!0};L(Re,Z,pe,"–","--",!0);L(Re,Z,pe,"–","\\textendash");L(Re,Z,pe,"—","---",!0);L(Re,Z,pe,"—","\\textemdash");L(Re,Z,pe,"‘","`",!0);L(Re,Z,pe,"‘","\\textquoteleft");L(Re,Z,pe,"’","'",!0);L(Re,Z,pe,"’","\\textquoteright");L(Re,Z,pe,"“","``",!0);L(Re,Z,pe,"“","\\textquotedblleft");L(Re,Z,pe,"”","''",!0);L(Re,Z,pe,"”","\\textquotedblright");L(P,Z,pe,"°","\\degree",!0);L(Re,Z,pe,"°","\\degree");L(Re,Z,pe,"°","\\textdegree",!0);L(P,Z,pe,"£","\\pounds");L(P,Z,pe,"£","\\mathsterling",!0);L(Re,Z,pe,"£","\\pounds");L(Re,Z,pe,"£","\\textsterling",!0);L(P,oe,pe,"✠","\\maltese");L(Re,oe,pe,"✠","\\maltese");var b6='0123456789/@."';for(var Mg=0;Mg{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484){var i=Math.floor((r-119808)/26);return A6[i]}else if(120782<=r&&r<=120831){var a=Math.floor((r-120782)/10);return p$[a]}else{if(r===120485||r===120486)return A6[0];if(120486{if(zo(e.classes)!==zo(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},T9=e=>{for(var t=0;tn&&(n=o.height),o.depth>r&&(r=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}t.height=n,t.depth=r,t.maxFontSize=i},Oe=function(t,n,r,i){var a=new cu(t,n,r,i);return U_(a),a},Ho=(e,t,n,r)=>new cu(e,t,n,r),Kc=function(t,n,r){var i=Oe([t],[],n);return i.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),i.style.borderBottomWidth=He(i.height),i.maxFontSize=1,i},v$=function(t,n,r,i){var a=new vp(t,n,r,i);return U_(a),a},qa=function(t){var n=new lu(t);return U_(n),n},Zc=function(t,n){return t instanceof lu?Oe([],[t],n):t},_$=function(t){if(t.positionType==="individualShift"){for(var n=t.children,r=[n[0]],i=-n[0].shift-n[0].elem.depth,a=i,o=1;o{var n=Oe(["mspace"],[],t),r=In(e,t);return n.style.marginRight=He(r),n},H0=(e,t,n)=>{var r,i;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return t==="textbf"&&n==="textit"?i="BoldItalic":t==="textbf"?i="Bold":n==="textit"?i="Italic":i="Regular",r+"-"+i},sv={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},j9={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},M9=function(t,n){var[r,i,a]=j9[t],o=new Bo(r),l=new Ia([o],{width:He(i),height:He(a),style:"width:"+He(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),c=Ho(["overlay"],[l],n);return c.height=a,c.style.height=He(a),c.style.width=He(i),c},On={number:3,unit:"mu"},pl={number:4,unit:"mu"},Ta={number:5,unit:"mu"},x$={mord:{mop:On,mbin:pl,mrel:Ta,minner:On},mop:{mord:On,mop:On,mrel:Ta,minner:On},mbin:{mord:pl,mop:pl,mopen:pl,minner:pl},mrel:{mord:Ta,mop:Ta,mopen:Ta,minner:Ta},mopen:{},mclose:{mop:On,mbin:pl,mrel:Ta,minner:On},mpunct:{mord:On,mop:On,mrel:Ta,mopen:On,mclose:On,mpunct:On,minner:On},minner:{mord:On,mop:On,mbin:pl,mrel:Ta,mopen:On,mpunct:On,minner:On}},y$={mord:{mop:On},mop:{mord:On,mop:On},mbin:{},mrel:{},mopen:{},mclose:{mop:On},mpunct:{},minner:{mop:On}},R9={},Ff={},Pf={};function We(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,l={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},c=0;c{var x=S.classes[0],v=k.classes[0];x==="mbin"&&S$.has(v)?S.classes[0]="mord":v==="mbin"&&w$.has(x)&&(k.classes[0]="mord")},{node:f},g,b),av(a,(k,S)=>{var x,v,w=lv(S),y=lv(k),C=w&&y?k.hasClass("mtight")?(x=y$[w])==null?void 0:x[y]:(v=x$[w])==null?void 0:v[y]:null;if(C)return N9(C,d)},{node:f},g,b),a},av=function(t,n,r,i,a){i&&t.push(i);for(var o=0;og=>{t.splice(f+1,0,g),o++})(o)}i&&t.pop()},D9=function(t){return t instanceof lu||t instanceof vp||t instanceof cu&&t.hasClass("enclosing")?t:null},ov=function(t,n){var r=D9(t);if(r){var i=r.children;if(i.length){if(n==="right")return ov(i[i.length-1],"right");if(n==="left")return ov(i[0],"left")}}return t},lv=function(t,n){if(!t)return null;n&&(t=ov(t,n));var r=t.classes[0];return C$[r]||null},Ld=function(t,n){var r=["nulldelimiter"].concat(t.baseSizingClasses());return Oe(n.concat(r))},Yt=function(t,n,r){if(!t)return Oe();if(Ff[t.type]){var i=Ff[t.type](t,n);if(r&&n.size!==r.size){i=Oe(n.sizingClasses(r),[i],n);var a=n.sizeMultiplier/r.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new ze("Got group of unknown type: '"+t.type+"'")};function $0(e,t){var n=Oe(["base"],e,t),r=Oe(["strut"]);return r.style.height=He(n.height+n.depth),n.depth&&(r.style.verticalAlign=He(-n.depth)),n.children.unshift(r),n}function cv(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var r=hr(e,t,"root"),i;r.length===2&&r[1].hasClass("tag")&&(i=r.pop());for(var a=[],o=[],l=0;l0&&(a.push($0(o,t)),o=[]),a.push(r[l]));o.length>0&&a.push($0(o,t));var d;n?(d=$0(hr(n,t,!0),t),d.classes=["tag"],a.push(d)):i&&a.push(i);var m=Oe(["katex-html"],a);if(m.setAttribute("aria-hidden","true"),d){var f=d.children[0];f.style.height=He(m.height+m.depth),m.depth&&(f.style.verticalAlign=He(-m.depth))}return m}function L9(e){return new lu(e)}class Be{constructor(t,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=zo(this.classes));for(var r=0;r0&&(t+=' class ="'+Lr(zo(this.classes))+'"'),t+=">";for(var r=0;r",t}toText(){return this.children.map(t=>t.toText()).join("")}}class tr{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return Lr(this.toText())}toText(){return this.text}}class O9{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character="  ":t>=-.05556&&t<=-.05555?this.character=" ⁣":t>=-.1667&&t<=-.1666?this.character=" ⁣":t>=-.2223&&t<=-.2222?this.character=" ⁣":t>=-.2778&&t<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",He(this.width)),t}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var E$=new Set(["\\imath","\\jmath"]),A$=new Set(["mrow","mtable"]),os=function(t,n,r){return An[n][t]&&An[n][t].replace&&t.charCodeAt(0)!==55349&&!(A9.hasOwnProperty(t)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(t=An[n][t].replace),new tr(t)},q_=function(t){return t.length===1?t[0]:new Be("mrow",t)},T$={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},G_=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var r=e.mode,i=T$[n];if(i)return typeof i=="function"?i(e):i;var a=e.text;if(E$.has(a))return null;if(An[r][a]){var o=An[r][a].replace;o&&(a=o)}var l=sv[n].fontName;return F_(a,l,r)?sv[n].variant:null};function Og(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof tr&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof tr&&n.text===","}else return!1}var Pi=function(t,n,r){if(t.length===1){var i=hn(t[0],n);return r&&i instanceof Be&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],o,l=0;l=1&&(o.type==="mn"||Og(o))){var d=c.children[0];d instanceof Be&&d.type==="mn"&&(d.children=[...o.children,...d.children],a.pop())}else if(o.type==="mi"&&o.children.length===1){var m=o.children[0];if(m instanceof tr&&m.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var f=c.children[0];f instanceof tr&&f.text.length>0&&(f.text=f.text.slice(0,1)+"̸"+f.text.slice(1),a.pop())}}}a.push(c),o=c}return a},$o=function(t,n,r){return q_(Pi(t,n,r))},hn=function(t,n){if(!t)return new Be("mrow");if(Pf[t.type])return Pf[t.type](t,n);throw new ze("Got group of unknown type: '"+t.type+"'")};function T6(e,t,n,r,i){var a=Pi(e,n),o;a.length===1&&a[0]instanceof Be&&A$.has(a[0].type)?o=a[0]:o=new Be("mrow",a);var l=new Be("annotation",[new tr(t)]);l.setAttribute("encoding","application/x-tex");var c=new Be("semantics",[o,l]),d=new Be("math",[c]);d.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&d.setAttribute("display","block");var m=i?"katex":"katex-mathml";return Oe([m],[d])}var N$=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],N6=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],j6=function(t,n){return n.size<2?t:N$[t-1][n.size-1]};class Ma{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||Ma.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=N6[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new Ma(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:j6(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:N6[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=j6(Ma.BASESIZE,t);return this.size===n&&this.textSize===Ma.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Ma.BASESIZE?["sizing","reset-size"+this.size,"size"+Ma.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=h$(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Ma.BASESIZE=6;var I9=function(t){return new Ma({style:t.displayMode?bt.DISPLAY:bt.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},z9=function(t,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),t=Oe(r,[t])}return t},j$=function(t,n,r){var i=I9(r),a;if(r.output==="mathml")return T6(t,n,i,r.displayMode,!0);if(r.output==="html"){var o=cv(t,i);a=Oe(["katex"],[o])}else{var l=T6(t,n,i,r.displayMode,!1),c=cv(t,i);a=Oe(["katex"],[l,c])}return z9(a,r)},M$=function(t,n,r){var i=I9(r),a=cv(t,i),o=Oe(["katex"],[a]);return z9(o,r)},R$={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},yp=function(t){var n=new Be("mo",[new tr(R$[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},D$={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},L$=new Set(["widehat","widecheck","widetilde","utilde"]),wp=function(t,n){function r(){var l=4e5,c=t.label.slice(1);if(L$.has(c)&&"base"in t){var d=t.base.type==="ordgroup"?t.base.body.length:1,m,f,g;if(d>5)c==="widehat"||c==="widecheck"?(m=420,l=2364,g=.42,f=c+"4"):(m=312,l=2340,g=.34,f="tilde4");else{var b=[1,1,2,2,3,3][d];c==="widehat"||c==="widecheck"?(l=[0,1062,2364,2364,2364][b],m=[0,239,300,360,420][b],g=[0,.24,.3,.3,.36,.42][b],f=c+b):(l=[0,600,1033,2339,2340][b],m=[0,260,286,306,312][b],g=[0,.26,.286,.3,.306,.34][b],f="tilde"+b)}var k=new Bo(f),S=new Ia([k],{width:"100%",height:He(g),viewBox:"0 0 "+l+" "+m,preserveAspectRatio:"none"});return{span:Ho([],[S],n),minWidth:0,height:g}}else{var x=[],v=D$[c];if(!v)throw new Error('No SVG data for "'+c+'".');var[w,y,C]=v,N=C/1e3,E=w.length,M,T;if(E===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+c+'".');M=["hide-tail"],T=[v[3]]}else if(E===2)M=["halfarrow-left","halfarrow-right"],T=["xMinYMin","xMaxYMin"];else if(E===3)M=["brace-left","brace-center","brace-right"],T=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+E+" children.");for(var D=0;D0&&(i.style.minWidth=He(a)),i},O$=function(t,n,r,i,a){var o,l=t.height+t.depth+r+i;if(/fbox|color|angl/.test(n)){if(o=Oe(["stretchy",n],[],a),n==="fbox"){var c=a.color&&a.getColor();c&&(o.style.borderColor=c)}}else{var d=[];/^[bx]cancel$/.test(n)&&d.push(new Jb({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&d.push(new Jb({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var m=new Ia(d,{width:"100%",height:He(l)});o=Ho([],[m],a)}return o.height=l,o.style.height=He(l),o},I$={bin:1,close:1,inner:1,open:1,punct:1,rel:1},z$={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function B$(e){return e in I$}function Ct(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Sp(e){var t=kp(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function kp(e){return e&&(e.type==="atom"||z$.hasOwnProperty(e.type))?e:null}var B9=e=>{if(e instanceof Bi)return e;if(u$(e)&&e.children.length===1)return B9(e.children[0])},V_=(e,t)=>{var n,r,i;e&&e.type==="supsub"?(r=Ct(e.base,"accent"),n=r.base,e.base=n,i=c$(Yt(e,t)),e.base=r):(r=Ct(e,"accent"),n=r.base);var a=Yt(n,t.havingCrampedStyle()),o=r.isShifty&&Pa(n),l=0;if(o){var c,d;l=(c=(d=B9(a))==null?void 0:d.skew)!=null?c:0}var m=r.label==="\\c",f=m?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),g;if(r.isStretchy)g=wp(r,t),g=Vt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:g,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+He(2*l)+")",marginLeft:He(2*l)}:void 0}]});else{var b,k;r.label==="\\vec"?(b=M9("vec",t),k=j9.vec[1]):(b=xp({mode:r.mode,text:r.label},t,"textord"),b=l$(b),b.italic=0,k=b.width,m&&(f+=b.depth)),g=Oe(["accent-body"],[b]);var S=r.label==="\\textcircled";S&&(g.classes.push("accent-full"),f=a.height);var x=l;S||(x-=k/2),g.style.left=He(x),r.label==="\\textcircled"&&(g.style.top=".2em"),g=Vt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-f},{type:"elem",elem:g}]})}var v=Oe(["mord","accent"],[g],t);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},H9=(e,t)=>{var n=e.isStretchy?yp(e.label):new Be("mo",[os(e.label,e.mode)]),r=new Be("mover",[hn(e.base,t),n]);return r.setAttribute("accent","true"),r},H$=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));We({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=Uf(t[0]),r=!H$.test(e.funcName),i=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:V_,mathmlBuilder:H9});We({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:V_,mathmlBuilder:H9});We({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=Yt(e.base,t),r=wp(e,t),i=e.label==="\\utilde"?.12:0,a=Vt({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]});return Oe(["mord","accentunder"],[a],t)},mathmlBuilder:(e,t)=>{var n=yp(e.label),r=new Be("munder",[hn(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var F0=e=>{var t=new Be("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};We({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=Zc(Yt(e.body,r,t),t),a=e.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var o;e.below&&(r=t.havingStyle(n.sub()),o=Zc(Yt(e.below,r,t),t),o.classes.push(a+"-arrow-pad"));var l=wp(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,d=-t.fontMetrics().axisHeight-.5*l.height-.111;(i.depth>.25||e.label==="\\xleftequilibrium")&&(d-=i.depth);var m;if(o){var f=-t.fontMetrics().axisHeight+o.height+.5*l.height+.111;m=Vt({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:c,wrapperClasses:["svg-align"]},{type:"elem",elem:o,shift:f}]})}else m=Vt({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:c,wrapperClasses:["svg-align"]}]});return Oe(["mrel","x-arrow"],[m],t)},mathmlBuilder(e,t){var n=yp(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var i=F0(hn(e.body,t));if(e.below){var a=F0(hn(e.below,t));r=new Be("munderover",[n,a,i])}else r=new Be("mover",[n,i])}else if(e.below){var o=F0(hn(e.below,t));r=new Be("munder",[n,o])}else r=F0(),r=new Be("mover",[n,r]);return r}});function $9(e,t){var n=hr(e.body,t,!0);return Oe([e.mclass],n,t)}function F9(e,t){var n,r=Pi(e.body,t);return e.mclass==="minner"?n=new Be("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(n=r[0],n.type="mi"):n=new Be("mi",r):(e.isCharacterBox?(n=r[0],n.type="mo"):n=new Be("mo",r),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}We({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:er(i),isCharacterBox:Pa(i)}},htmlBuilder:$9,mathmlBuilder:F9});var Cp=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};We({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Cp(t[0]),body:er(t[1]),isCharacterBox:Pa(t[1])}}});We({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],o;r!=="\\stackrel"?o=Cp(i):o="mrel";var l={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:er(i)},c={type:"supsub",mode:a.mode,base:l,sup:r==="\\underset"?null:a,sub:r==="\\underset"?a:null};return{type:"mclass",mode:n.mode,mclass:o,body:[c],isCharacterBox:Pa(c)}},htmlBuilder:$9,mathmlBuilder:F9});We({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Cp(t[0]),body:er(t[0])}},htmlBuilder(e,t){var n=hr(e.body,t,!0),r=Oe([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=Pi(e.body,t),r=new Be("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var $$={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},M6=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),R6=e=>e.type==="textord"&&e.text==="@",F$=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function P$(e,t,n){var r=$$[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var i=n.callFunction("\\\\cdleft",[t[0]],[]),a={type:"atom",text:r,mode:"math",family:"rel"},o=n.callFunction("\\Big",[a],[]),l=n.callFunction("\\\\cdright",[t[1]],[]),c={type:"ordgroup",mode:"math",body:[i,o,l]};return n.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var d={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[d],[])}default:return{type:"textord",text:" ",mode:"math"}}}function U$(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new ze("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],i=[r],a=0;aAV".includes(d))for(var f=0;f<2;f++){for(var g=!0,b=c+1;bAV=|." after @',o[c]);var k=P$(d,m,e),S={type:"styling",body:[k],mode:"math",style:"display",resetFont:!0};r.push(S),l=M6()}a%2===0?r.push(l):r.shift(),r=[],i.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var x=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:x,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}We({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=Zc(Yt(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=He(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Be("mrow",[hn(e.label,t)]);return n=new Be("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Be("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});We({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=Zc(Yt(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new Be("mrow",[hn(e.fragment,t)])}});We({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=Ct(t[0],"ordgroup"),i=r.body,a="",o=0;o=1114111)throw new ze("\\@char with invalid code point "+a);return c<=65535?d=String.fromCharCode(c):(c-=65536,d=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:n.mode,text:d}}});var P9=(e,t)=>{var n=hr(e.body,t.withColor(e.color),!1);return qa(n)},U9=(e,t)=>{var n=Pi(e.body,t.withColor(e.color)),r=new Be("mstyle",n);return r.setAttribute("mathcolor",e.color),r};We({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=Ct(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:er(i)}},htmlBuilder:P9,mathmlBuilder:U9});We({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=Ct(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var a=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:a}},htmlBuilder:P9,mathmlBuilder:U9});We({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:a,size:i&&Ct(i,"size").value}},htmlBuilder(e,t){var n=Oe(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=He(In(e.size,t)))),n},mathmlBuilder(e,t){var n=new Be("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",He(In(e.size,t)))),n}});var uv={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},q9=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new ze("Expected a control sequence",e);return t},q$=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},G9=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i==null&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};We({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(uv[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=uv[r.text]),Ct(t.parseFunction(),"internal");throw new ze("Invalid token after macro prefix",r)}});We({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new ze("Expected a control sequence",r);for(var a=0,o,l=[[]];t.gullet.future().text!=="{";)if(r=t.gullet.popToken(),r.text==="#"){if(t.gullet.future().text==="{"){o=t.gullet.future(),l[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new ze('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new ze('Argument number "'+r.text+'" out of order');a++,l.push([])}else{if(r.text==="EOF")throw new ze("Expected a macro definition");l[a].push(r.text)}var{tokens:c}=t.gullet.consumeArg();return o&&c.unshift(o),(n==="\\edef"||n==="\\xdef")&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:l},n===uv[n]),{type:"internal",mode:t.mode}}});We({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=q9(t.gullet.popToken());t.gullet.consumeSpaces();var i=q$(t);return G9(t,r,i,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});We({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=q9(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return G9(t,r,a,n==="\\\\globalfuture"),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var dd=function(t,n,r){var i=An.math[t]&&An.math[t].replace,a=F_(i||t,n,r);if(!a)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return a},W_=function(t,n,r,i){var a=r.havingBaseStyle(n),o=Oe(i.concat(a.sizingClasses(r)),[t],r),l=a.sizeMultiplier/r.sizeMultiplier;return o.height*=l,o.depth*=l,o.maxFontSize=a.sizeMultiplier,o},V9=function(t,n,r){var i=n.havingBaseStyle(r),a=(1-n.sizeMultiplier/i.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=He(a),t.height-=a,t.depth+=a},G$=function(t,n,r,i,a,o){var l=Gr(t,"Main-Regular",a,i),c=W_(l,n,i,o);return V9(c,i,n),c},V$=function(t,n,r,i){return Gr(t,"Size"+n+"-Regular",r,i)},W9=function(t,n,r,i,a,o){var l=V$(t,n,a,i),c=W_(Oe(["delimsizing","size"+n],[l],i),bt.TEXT,i,o);return r&&V9(c,i,bt.TEXT),c},Ig=function(t,n,r){var i;n==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Oe(["delimsizinginner",i],[Oe([],[Gr(t,n,r)])]);return{type:"elem",elem:a}},zg=function(t,n,r){var i=Ys["Size4-Regular"][t.charCodeAt(0)]?Ys["Size4-Regular"][t.charCodeAt(0)][4]:Ys["Size1-Regular"][t.charCodeAt(0)][4],a=new Bo("inner",t$(t,Math.round(1e3*n))),o=new Ia([a],{width:He(i),height:He(n),style:"width:"+He(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),l=Ho([],[o],r);return l.height=n,l.style.height=He(n),l.style.width=He(i),{type:"elem",elem:l}},dv=.008,P0={type:"kern",size:-1*dv},W$=new Set(["|","\\lvert","\\rvert","\\vert"]),Y$=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),Y9=function(t,n,r,i,a,o){var l,c,d,m,f="",g=0;l=d=m=t,c=null;var b="Size1-Regular";t==="\\uparrow"?d=m="⏐":t==="\\Uparrow"?d=m="‖":t==="\\downarrow"?l=d="⏐":t==="\\Downarrow"?l=d="‖":t==="\\updownarrow"?(l="\\uparrow",d="⏐",m="\\downarrow"):t==="\\Updownarrow"?(l="\\Uparrow",d="‖",m="\\Downarrow"):W$.has(t)?(d="∣",f="vert",g=333):Y$.has(t)?(d="∥",f="doublevert",g=556):t==="["||t==="\\lbrack"?(l="⎡",d="⎢",m="⎣",b="Size4-Regular",f="lbrack",g=667):t==="]"||t==="\\rbrack"?(l="⎤",d="⎥",m="⎦",b="Size4-Regular",f="rbrack",g=667):t==="\\lfloor"||t==="⌊"?(d=l="⎢",m="⎣",b="Size4-Regular",f="lfloor",g=667):t==="\\lceil"||t==="⌈"?(l="⎡",d=m="⎢",b="Size4-Regular",f="lceil",g=667):t==="\\rfloor"||t==="⌋"?(d=l="⎥",m="⎦",b="Size4-Regular",f="rfloor",g=667):t==="\\rceil"||t==="⌉"?(l="⎤",d=m="⎥",b="Size4-Regular",f="rceil",g=667):t==="("||t==="\\lparen"?(l="⎛",d="⎜",m="⎝",b="Size4-Regular",f="lparen",g=875):t===")"||t==="\\rparen"?(l="⎞",d="⎟",m="⎠",b="Size4-Regular",f="rparen",g=875):t==="\\{"||t==="\\lbrace"?(l="⎧",c="⎨",m="⎩",d="⎪",b="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(l="⎫",c="⎬",m="⎭",d="⎪",b="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(l="⎧",m="⎩",d="⎪",b="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(l="⎫",m="⎭",d="⎪",b="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(l="⎧",m="⎭",d="⎪",b="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(l="⎫",m="⎩",d="⎪",b="Size4-Regular");var k=dd(l,b,a),S=k.height+k.depth,x=dd(d,b,a),v=x.height+x.depth,w=dd(m,b,a),y=w.height+w.depth,C=0,N=1;if(c!==null){var E=dd(c,b,a);C=E.height+E.depth,N=2}var M=S+y+C,T=Math.max(0,Math.ceil((n-M)/(N*v))),D=M+T*N*v,z=i.fontMetrics().axisHeight;r&&(z*=i.sizeMultiplier);var $=D/2-z,F=[];if(f.length>0){var U=D-S-y,V=Math.round(D*1e3),X=n$(f,Math.round(U*1e3)),Y=new Bo(f,X),Q=He(g/1e3),te=He(V/1e3),I=new Ia([Y],{width:Q,height:te,viewBox:"0 0 "+g+" "+V}),O=Ho([],[I],i);O.height=V/1e3,O.style.width=Q,O.style.height=te,F.push({type:"elem",elem:O})}else{if(F.push(Ig(m,b,a)),F.push(P0),c===null){var H=D-S-y+2*dv;F.push(zg(d,H,i))}else{var G=(D-S-y-C)/2+2*dv;F.push(zg(d,G,i)),F.push(P0),F.push(Ig(c,b,a)),F.push(P0),F.push(zg(d,G,i))}F.push(P0),F.push(Ig(l,b,a))}var W=i.havingBaseStyle(bt.TEXT),re=Vt({positionType:"bottom",positionData:$,children:F});return W_(Oe(["delimsizing","mult"],[re],W),bt.TEXT,i,o)},Bg=80,Hg=.08,$g=function(t,n,r,i,a){var o=e$(t,i,r),l=new Bo(t,o),c=new Ia([l],{width:"400em",height:He(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return Ho(["hide-tail"],[c],a)},X$=function(t,n){var r=n.havingBaseSizing(),i=J9("\\surd",t*r.sizeMultiplier,Q9,r),a=r.sizeMultiplier,o=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),l,c,d,m,f;return i.type==="small"?(m=1e3+1e3*o+Bg,t<1?a=1:t<1.4&&(a=.7),c=(1+o+Hg)/a,d=(1+o)/a,l=$g("sqrtMain",c,m,o,n),l.style.minWidth="0.853em",f=.833/a):i.type==="large"?(m=(1e3+Bg)*yd[i.size],d=(yd[i.size]+o)/a,c=(yd[i.size]+o+Hg)/a,l=$g("sqrtSize"+i.size,c,m,o,n),l.style.minWidth="1.02em",f=1/a):(c=t+o+Hg,d=t+o,m=Math.floor(1e3*t+o)+Bg,l=$g("sqrtTall",c,m,o,n),l.style.minWidth="0.742em",f=1.056),l.height=d,l.style.height=He(c),{span:l,advanceWidth:f,ruleWidth:(n.fontMetrics().sqrtRuleThickness+o)*a}},X9=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),K$=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),K9=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),yd=[0,1.2,1.8,2.4,3],Z9=function(t,n,r,i,a){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),X9.has(t)||K9.has(t))return W9(t,n,!1,r,i,a);if(K$.has(t))return Y9(t,yd[n],!1,r,i,a);throw new ze("Illegal delimiter: '"+t+"'")},Z$=[{type:"small",style:bt.SCRIPTSCRIPT},{type:"small",style:bt.SCRIPT},{type:"small",style:bt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Q$=[{type:"small",style:bt.SCRIPTSCRIPT},{type:"small",style:bt.SCRIPT},{type:"small",style:bt.TEXT},{type:"stack"}],Q9=[{type:"small",style:bt.SCRIPTSCRIPT},{type:"small",style:bt.SCRIPT},{type:"small",style:bt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],J$=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")},J9=function(t,n,r,i){for(var a=Math.min(2,3-i.style.size),o=a;on)return l}return r[r.length-1]},hv=function(t,n,r,i,a,o){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var l;K9.has(t)?l=Z$:X9.has(t)?l=Q9:l=Q$;var c=J9(t,n,l,i);return c.type==="small"?G$(t,c.style,r,i,a,o):c.type==="large"?W9(t,c.size,r,i,a,o):Y9(t,n,r,i,a,o)},Fg=function(t,n,r,i,a,o){var l=i.fontMetrics().axisHeight*i.sizeMultiplier,c=901,d=5/i.fontMetrics().ptPerEm,m=Math.max(n-l,r+l),f=Math.max(m/500*c,2*m-d);return hv(t,f,!0,i,a,o)},D6={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},eF=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function L6(e){return"isMiddle"in e}function Ep(e,t){var n=kp(e);if(n&&eF.has(n.text))return n;throw n?new ze("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new ze("Invalid delimiter type '"+e.type+"'",e)}We({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=Ep(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:D6[e.funcName].size,mclass:D6[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?Oe([e.mclass]):Z9(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(os(e.delim,e.mode));var n=new Be("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=He(yd[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function O6(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}We({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new ze("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Ep(t[0],e).text,color:n}}});We({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Ep(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var a=Ct(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{O6(e);for(var n=hr(e.body,t,!0,["mopen","mclose"]),r=0,i=0,a=!1,o=0;o{O6(e);var n=Pi(e.body,t);if(e.left!=="."){var r=new Be("mo",[os(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(e.right!=="."){var i=new Be("mo",[os(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return q_(n)}});We({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Ep(t[0],e);if(!e.parser.leftrightDepth)throw new ze("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=Ld(t,[]):(n=Z9(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?os("|","text"):os(e.delim,e.mode),r=new Be("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Ap=(e,t)=>{var n=Zc(Yt(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,l=Pa(e.body);if(r==="sout")a=Oe(["stretchy","sout"]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r==="phase"){var c=In({number:.6,unit:"pt"},t),d=In({number:.35,unit:"ex"},t),m=t.havingBaseSizing();i=i/m.sizeMultiplier;var f=n.height+n.depth+c+d;n.style.paddingLeft=He(f/2+c);var g=Math.floor(1e3*f*i),b=QH(g),k=new Ia([new Bo("phase",b)],{width:"400em",height:He(g/1e3),viewBox:"0 0 400000 "+g,preserveAspectRatio:"xMinYMin slice"});a=Ho(["hide-tail"],[k],t),a.style.height=He(f),o=n.depth+c+d}else{/cancel/.test(r)?l||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var S,x,v=0;/box/.test(r)?(v=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),S=t.fontMetrics().fboxsep+(r==="colorbox"?0:v),x=S):r==="angl"?(v=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),S=4*v,x=Math.max(0,.25-n.depth)):(S=l?.2:0,x=S),a=O$(n,r,S,x,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle="solid",a.style.borderWidth=He(v)):r==="angl"&&v!==.049&&(a.style.borderTopWidth=He(v),a.style.borderRightWidth=He(v)),o=n.depth+x,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=Vt({positionType:"individualShift",children:[{type:"elem",elem:a,shift:o},{type:"elem",elem:n,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];w=Vt({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:a,shift:o,wrapperClasses:y}]})}return/cancel/.test(r)&&(w.height=n.height,w.depth=n.depth),/cancel/.test(r)&&!l?Oe(["mord","cancel-lap"],[w],t):Oe(["mord"],[w],t)},Tp=(e,t)=>{var n,r=new Be(e.label.includes("colorbox")?"mpadded":"menclose",[hn(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+He(i)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};We({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Ct(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:Ap,mathmlBuilder:Tp});We({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Ct(t[0],"color-token").color,o=Ct(t[1],"color-token").color,l=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:l}},htmlBuilder:Ap,mathmlBuilder:Tp});We({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});We({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:Ap,mathmlBuilder:Tp});We({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:Ap,mathmlBuilder:Tp});We({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var ek={};function ta(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,l={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c{var t=e.parser.settings;if(!t.displayMode)throw new ze("{"+e.envName+"} can be used only in display mode.")},tF=new Set(["gather","gather*"]);function Y_(e){if(!e.includes("ed"))return!e.includes("*")}function Go(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:l,autoTag:c,singleRow:d,emptySingleRow:m,maxNumCols:f,leqno:g}=t;if(e.gullet.beginGroup(),d||e.gullet.macros.set("\\cr","\\\\\\relax"),!o){var b=e.gullet.expandMacroAsText("\\arraystretch");if(b==null)o=1;else if(o=parseFloat(b),!o||o<0)throw new ze("Invalid \\arraystretch: "+b)}e.gullet.beginGroup();var k=[],S=[k],x=[],v=[],w=c!=null?[]:void 0;function y(){c&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){w&&(e.gullet.macros.get("\\df@tag")?(w.push(e.subparse([new ks("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!c&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),v.push(I6(e));;){var N=e.parseExpression(!1,d?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var E={type:"ordgroup",mode:e.mode,body:N};n&&(E={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[E]}),k.push(E);var M=e.fetch().text;if(M==="&"){if(f&&k.length===f){if(d||l)throw new ze("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(M==="\\end"){C(),k.length===1&&E.type==="styling"&&E.body.length===1&&E.body[0].type==="ordgroup"&&E.body[0].body.length===0&&(S.length>1||!m)&&S.pop(),v.length0&&(y+=.25),d.push({pos:y,isDashed:Pe[Ze]})}for(C(o[0]),r=0;r0&&($+=w,M<$&&(M=$),$=0)),t.addJot&&rPe))for(r=0;r=l)){var se=void 0;if(i>0||t.hskipBeforeAndAfter){var le,_e;se=(le=(_e=W)==null?void 0:_e.pregap)!=null?le:g,se!==0&&(X=Oe(["arraycolsep"],[]),X.style.width=He(se),V.push(X))}var be=[];for(r=0;r0){for(var ct=Kc("hline",n,m),Kt=Kc("hdashline",n,m),Rt=[{type:"elem",elem:Ue,shift:0}];d.length>0;){var qe=d.pop(),nt=qe.pos-F;qe.isDashed?Rt.push({type:"elem",elem:Kt,shift:nt}):Rt.push({type:"elem",elem:ct,shift:nt})}Ue=Vt({positionType:"individualShift",children:Rt})}if(Q.length===0)return Oe(["mord"],[Ue],n);var ve=Vt({positionType:"individualShift",children:Q}),je=Oe(["tag"],[ve],n);return qa([Ue,je])},nF={c:"center ",l:"left ",r:"right "},ra=function(t,n){for(var r=[],i=new Be("mtd",[],["mtr-glue"]),a=new Be("mtd",[],["mml-eqn-num"]),o=0;o0){var k=t.cols,S="",x=!1,v=0,w=k.length;k[0].type==="separator"&&(g+="top ",v=1),k[k.length-1].type==="separator"&&(g+="bottom ",w-=1);for(var y=v;y0?"left ":"",g+=D[D.length-1].length>0?"right ":"";for(var z=1;z0&&b&&(x=1),r[k]={type:"align",align:S,pregap:x,postgap:0}}return o.colSeparationType=b?"align":"alignat",o};ta({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=kp(t[0]),r=n?[t[0]]:Ct(t[0],"ordgroup").body,i=r.map(function(o){var l=Sp(o),c=l.text;if("lcr".includes(c))return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new ze("Unknown column alignment: "+c,o)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Go(e.parser,a,X_(e.envName))},htmlBuilder:na,mathmlBuilder:ra});ta({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var i=e.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!"lcr".includes(n))throw new ze("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var a=Go(e.parser,r,X_(e.envName)),o=Math.max(0,...a.body.map(l=>l.length));return a.cols=new Array(o).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:na,mathmlBuilder:ra});ta({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=Go(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:na,mathmlBuilder:ra});ta({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=kp(t[0]),r=n?[t[0]]:Ct(t[0],"ordgroup").body,i=r.map(function(l){var c=Sp(l),d=c.text;if("lc".includes(d))return{type:"align",align:d};throw new ze("Unknown column alignment: "+d,l)});if(i.length>1)throw new ze("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},o=Go(e.parser,a,"script");if(o.body.length>0&&o.body[0].length>1)throw new ze("{subarray} can contain only one column");return o},htmlBuilder:na,mathmlBuilder:ra});ta({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=Go(e.parser,t,X_(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:na,mathmlBuilder:ra});ta({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:rk,htmlBuilder:na,mathmlBuilder:ra});ta({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){tF.has(e.envName)&&Np(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Y_(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Go(e.parser,t,"display")},htmlBuilder:na,mathmlBuilder:ra});ta({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:rk,htmlBuilder:na,mathmlBuilder:ra});ta({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Np(e);var t={autoTag:Y_(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Go(e.parser,t,"display")},htmlBuilder:na,mathmlBuilder:ra});ta({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Np(e),U$(e.parser)},htmlBuilder:na,mathmlBuilder:ra});ee("\\nonumber","\\gdef\\@eqnsw{0}");ee("\\notag","\\nonumber");We({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new ze(e.funcName+" valid only within array environment")}});var z6=ek;We({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!=="ordgroup")throw new ze("Invalid environment name",i);for(var a="",o=0;o{var n=e.font,r=t.withFont(n);return Yt(e.body,r)},sk=(e,t)=>{var n=e.font,r=t.withFont(n);return hn(e.body,r)},B6={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};We({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=Uf(t[0]),a=r;return a in B6&&(a=B6[a]),{type:"font",mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:ik,mathmlBuilder:sk});We({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:Cp(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:Pa(r)}}});We({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,o=n.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:ik,mathmlBuilder:sk});var rF=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a;a=t.havingStyle(r);var o=Yt(e.numer,a,t);if(e.continued){var l=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height0?k=3*g:k=7*g,S=t.fontMetrics().denom1):(f>0?(b=t.fontMetrics().num2,k=g):(b=t.fontMetrics().num3,k=3*g),S=t.fontMetrics().denom2);var x;if(m){var w=t.fontMetrics().axisHeight;b-o.depth-(w+.5*f){var n=new Be("mfrac",[hn(e.numer,t),hn(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var r=In(e.barSize,t);n.setAttribute("linethickness",He(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Be("mo",[new tr(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new Be("mo",[new tr(e.rightDelim.replace("\\",""))]);o.setAttribute("fence","true"),i.push(o)}return q_(i)}return n},ak=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};We({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1],o,l=null,c=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,l="(",c=")";break;case"\\\\bracefrac":o=!1,l="\\{",c="\\}";break;case"\\\\brackfrac":o=!1,l="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}var d=r==="\\cfrac",m=null;return d||r.startsWith("\\d")?m="display":r.startsWith("\\t")&&(m="text"),ak({type:"genfrac",mode:n.mode,numer:i,denom:a,continued:d,hasBarLine:o,leftDelim:l,rightDelim:c,barSize:null},m)},htmlBuilder:rF,mathmlBuilder:iF});We({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:i,token:r}}});var H6=["display","text","script","scriptscript"],$6=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};We({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=Uf(t[0]),o=a.type==="atom"&&a.family==="open"?$6(a.text):null,l=Uf(t[1]),c=l.type==="atom"&&l.family==="close"?$6(l.text):null,d=Ct(t[2],"size"),m,f=null;d.isBlank?m=!0:(f=d.value,m=f.number>0);var g=null,b=t[3];if(b.type==="ordgroup"){if(b.body.length>0){var k=Ct(b.body[0],"textord");g=H6[Number(k.text)]}}else b=Ct(b,"textord"),g=H6[Number(b.text)];return ak({type:"genfrac",mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:m,barSize:f,leftDelim:o,rightDelim:c},g)}});We({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Ct(t[0],"size").value,token:i}}});We({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=Ct(t[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var o=t[2],l=a.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:l,barSize:a,leftDelim:null,rightDelim:null}}});var ok=(e,t)=>{var n=t.style,r,i;e.type==="supsub"?(r=e.sup?Yt(e.sup,t.havingStyle(n.sup()),t):Yt(e.sub,t.havingStyle(n.sub()),t),i=Ct(e.base,"horizBrace")):i=Ct(e,"horizBrace");var a=Yt(i.base,t.havingBaseStyle(bt.DISPLAY)),o=wp(i,t),l;if(i.isOver?l=Vt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:o,wrapperClasses:["svg-align"]}]}):l=Vt({positionType:"bottom",positionData:a.depth+.1+o.height,children:[{type:"elem",elem:o,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),r){var c=Oe(["minner",i.isOver?"mover":"munder"],[l],t);i.isOver?l=Vt({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:r}]}):l=Vt({positionType:"bottom",positionData:c.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:c}]})}return Oe(["minner",i.isOver?"mover":"munder"],[l],t)},sF=(e,t)=>{var n=yp(e.label);return new Be(e.isOver?"mover":"munder",[hn(e.base,t),n])};We({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:t[0]}},htmlBuilder:ok,mathmlBuilder:sF});We({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=Ct(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:er(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=hr(e.body,t,!1);return v$(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=$o(e.body,t);return n instanceof Be||(n=new Be("mrow",[n])),n.setAttribute("href",e.href),n}});We({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=Ct(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:n,funcName:r,token:i}=e,a=Ct(t[0],"raw").string,o=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,c={};switch(r){case"\\htmlClass":c.class=a,l={command:"\\htmlClass",class:a};break;case"\\htmlId":c.id=a,l={command:"\\htmlId",id:a};break;case"\\htmlStyle":c.style=a,l={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var d=a.split(","),m=0;m{var n=hr(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=Oe(r,n,t);for(var a in e.attributes)a!=="class"&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>$o(e.body,t)});We({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:er(t[0]),mathml:er(t[1])}},htmlBuilder:(e,t)=>{var n=hr(e.html,t,!1);return qa(n)},mathmlBuilder:(e,t)=>$o(e.mathml,t)});var Pg=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new ze("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!S9(r))throw new ze("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};We({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},a={number:.9,unit:"em"},o={number:0,unit:"em"},l="";if(n[0])for(var c=Ct(n[0],"raw").string,d=c.split(","),m=0;m{var n=In(e.height,t),r=0;e.totalheight.number>0&&(r=In(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=In(e.width,t));var a={height:He(n+r)};i>0&&(a.width=He(i)),r>0&&(a.verticalAlign=He(-r));var o=new a$(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new Be("mglyph",[]);n.setAttribute("alt",e.alt);var r=In(e.height,t),i=0;if(e.totalheight.number>0&&(i=In(e.totalheight,t)-r,n.setAttribute("valign",He(-i))),n.setAttribute("height",He(r+i)),e.width.number>0){var a=In(e.width,t);n.setAttribute("width",He(a))}return n.setAttribute("src",e.src),n}});We({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=Ct(t[0],"size");if(n.settings.strict){var a=r[1]==="m",o=i.value.unit==="mu";a?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+i.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return N9(e.dimension,t)},mathmlBuilder(e,t){var n=In(e.dimension,t);return new O9(n)}});We({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=Oe([],[Yt(e.body,t)]),n=Oe(["inner"],[n],t)):n=Oe(["inner"],[Yt(e.body,t)]);var r=Oe(["fix"],[]),i=Oe([e.alignment],[n,r],t),a=Oe(["strut"]);return a.style.height=He(i.height+i.depth),i.depth&&(a.style.verticalAlign=He(-i.depth)),i.children.unshift(a),i=Oe(["thinbox"],[i],t),Oe(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new Be("mpadded",[hn(e.body,t)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});We({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var a=n==="\\("?"\\)":"$",o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:o}}});We({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new ze("Mismatched "+e.funcName)}});var F6=(e,t)=>{switch(t.style.size){case bt.DISPLAY.size:return e.display;case bt.TEXT.size:return e.text;case bt.SCRIPT.size:return e.script;case bt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};We({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:er(t[0]),text:er(t[1]),script:er(t[2]),scriptscript:er(t[3])}},htmlBuilder:(e,t)=>{var n=F6(e,t),r=hr(n,t,!1);return qa(r)},mathmlBuilder:(e,t)=>{var n=F6(e,t);return $o(n,t)}});var lk=(e,t,n,r,i,a,o)=>{e=Oe([],[e]);var l=n&&Pa(n),c,d;if(t){var m=Yt(t,r.havingStyle(i.sup()),r);d={elem:m,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-m.depth)}}if(n){var f=Yt(n,r.havingStyle(i.sub()),r);c={elem:f,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-f.height)}}var g;if(d&&c){var b=r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o;g=Vt({positionType:"bottom",positionData:b,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:He(-a)},{type:"kern",size:c.kern},{type:"elem",elem:e},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:He(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(c){var k=e.height-o;g=Vt({positionType:"top",positionData:k,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:He(-a)},{type:"kern",size:c.kern},{type:"elem",elem:e}]})}else if(d){var S=e.depth+o;g=Vt({positionType:"bottom",positionData:S,children:[{type:"elem",elem:e},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:He(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var x=[g];if(c&&a!==0&&!l){var v=Oe(["mspace"],[],r);v.style.marginRight=He(a),x.unshift(v)}return Oe(["mop","op-limits"],x,r)},ck=new Set(["\\smallint"]),du=(e,t)=>{var n,r,i=!1,a;e.type==="supsub"?(n=e.sup,r=e.sub,a=Ct(e.base,"op"),i=!0):a=Ct(e,"op");var o=t.style,l=!1;o.size===bt.DISPLAY.size&&a.symbol&&!ck.has(a.name)&&(l=!0);var c,d;if(a.symbol){var m=l?"Size2-Regular":"Size1-Regular",f="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(f=a.name.slice(1),a.name=f==="oiint"?"\\iint":"\\iiint"),c=Gr(a.name,m,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),d=c.italic,f.length>0){var g=M9(f+"Size"+(l?"2":"1"),t);c=Vt({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:g,shift:l?.08:0}]}),a.name="\\"+f,c.classes.unshift("mop"),c.italic=d}}else if(a.body){var b=hr(a.body,t,!0);b.length===1&&b[0]instanceof Bi?(c=b[0],c.classes[0]="mop"):c=Oe(["mop"],b,t)}else{for(var k=[],S=1;S{var n;if(e.symbol)n=new Be("mo",[os(e.name,e.mode)]),ck.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Be("mo",Pi(e.body,t));else{n=new Be("mi",[new tr(e.name.slice(1))]);var r=new Be("mo",[os("⁡","text")]);e.parentIsSupSub?n=new Be("mrow",[n,r]):n=L9([n,r])}return n},aF={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};We({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=aF[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:du,mathmlBuilder:vh});We({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:er(r)}},htmlBuilder:du,mathmlBuilder:vh});var oF={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};We({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:du,mathmlBuilder:vh});We({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:du,mathmlBuilder:vh});We({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=oF[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:du,mathmlBuilder:vh});var uk=(e,t)=>{var n,r,i=!1,a;e.type==="supsub"?(n=e.sup,r=e.sub,a=Ct(e.base,"operatorname"),i=!0):a=Ct(e,"operatorname");var o;if(a.body.length>0){for(var l=a.body.map(f=>{var g="text"in f?f.text:void 0;return typeof g=="string"?{type:"textord",mode:f.mode,text:g}:f}),c=hr(l,t.withFont("mathrm"),!0),d=0;d{for(var n=Pi(e.body,t.withFont("mathrm")),r=!0,i=0;im.toText()).join("");n=[new tr(l)]}var c=new Be("mi",n);c.setAttribute("mathvariant","normal");var d=new Be("mo",[os("⁡","text")]);return e.parentIsSupSub?new Be("mrow",[c,d]):L9([c,d])};We({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:er(i),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:uk,mathmlBuilder:lF});ee("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Fl({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?qa(hr(e.body,t,!1)):Oe(["mord"],hr(e.body,t,!0),t)},mathmlBuilder(e,t){return $o(e.body,t,!0)}});We({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=Yt(e.body,t.havingCrampedStyle()),r=Kc("overline-line",t),i=t.fontMetrics().defaultRuleThickness,a=Vt({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]});return Oe(["mord","overline"],[a],t)},mathmlBuilder(e,t){var n=new Be("mo",[new tr("‾")]);n.setAttribute("stretchy","true");var r=new Be("mover",[hn(e.body,t),n]);return r.setAttribute("accent","true"),r}});We({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:er(r)}},htmlBuilder:(e,t)=>{var n=hr(e.body,t.withPhantom(),!1);return qa(n)},mathmlBuilder:(e,t)=>{var n=Pi(e.body,t);return new Be("mphantom",n)}});ee("\\hphantom","\\smash{\\phantom{#1}}");We({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Oe(["inner"],[Yt(e.body,t.withPhantom())]),r=Oe(["fix"],[]);return Oe(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=Pi(er(e.body),t),r=new Be("mphantom",n),i=new Be("mpadded",[r]);return i.setAttribute("width","0px"),i}});We({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=Ct(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=Yt(e.body,t),r=In(e.dy,t);return Vt({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Be("mpadded",[hn(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}});We({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});We({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,i=n[0],a=Ct(t[0],"size"),o=Ct(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&Ct(i,"size").value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=Oe(["mord","rule"],[],t),r=In(e.width,t),i=In(e.height,t),a=e.shift?In(e.shift,t):0;return n.style.borderRightWidth=He(r),n.style.borderTopWidth=He(i),n.style.bottom=He(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=In(e.width,t),r=In(e.height,t),i=e.shift?In(e.shift,t):0,a=t.color&&t.getColor()||"black",o=new Be("mspace");o.setAttribute("mathbackground",a),o.setAttribute("width",He(n)),o.setAttribute("height",He(r));var l=new Be("mpadded",[o]);return i>=0?l.setAttribute("height",He(i)):(l.setAttribute("height",He(i)),l.setAttribute("depth",He(-i))),l.setAttribute("voffset",He(i)),l}});function dk(e,t,n){for(var r=hr(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a{var n=t.havingSize(e.size);return dk(e.body,n,t)};We({type:"sizing",names:P6,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:P6.indexOf(r)+1,body:a}},htmlBuilder:cF,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=Pi(e.body,n),i=new Be("mstyle",r);return i.setAttribute("mathsize",He(n.sizeMultiplier)),i}});We({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,o=n[0]&&Ct(n[0],"ordgroup");if(o)for(var l,c=0;c{var n=Oe([],[Yt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return Oe(["mord","smash"],[n],t);if(n.children)for(var r=0;r{var n=new Be("mpadded",[hn(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});We({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:"sqrt",mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=Yt(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=Zc(n,t);var r=t.fontMetrics(),i=r.defaultRuleThickness,a=i;t.style.idn.height+n.depth+o&&(o=(o+f-n.height-n.depth)/2);var g=c.height-n.height-o-d;n.style.paddingLeft=He(m);var b=Vt({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+g)},{type:"elem",elem:c},{type:"kern",size:d}]});if(e.index){var k=t.havingStyle(bt.SCRIPTSCRIPT),S=Yt(e.index,k,t),x=.6*(b.height-b.depth),v=Vt({positionType:"shift",positionData:-x,children:[{type:"elem",elem:S}]}),w=Oe(["root"],[v]);return Oe(["mord","sqrt"],[w,b],t)}else return Oe(["mord","sqrt"],[b],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Be("mroot",[hn(n,t),hn(r,t)]):new Be("msqrt",[hn(n,t)])}});var fv={display:bt.DISPLAY,text:bt.TEXT,script:bt.SCRIPT,scriptscript:bt.SCRIPTSCRIPT};function uF(e){return e in fv}We({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!uF(o))throw new Error("Unknown style: "+o);return{type:"styling",mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=fv[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont("")),dk(e.body,r,t)},mathmlBuilder(e,t){var n=fv[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(""));var i=Pi(e.body,r),a=new Be("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=o[e.style];return a.setAttribute("scriptlevel",l[0]),a.setAttribute("displaystyle",l[1]),a}});var dF=function(t,n){var r=t.base;if(r)if(r.type==="op"){var i=r.limits&&(n.style.size===bt.DISPLAY.size||r.alwaysHandleSupSub);return i?du:null}else if(r.type==="operatorname"){var a=r.alwaysHandleSupSub&&(n.style.size===bt.DISPLAY.size||r.limits);return a?uk:null}else{if(r.type==="accent")return Pa(r.base)?V_:null;if(r.type==="horizBrace"){var o=!t.sub;return o===r.isOver?ok:null}else return null}else return null};Fl({type:"supsub",htmlBuilder(e,t){var n=dF(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,o=Yt(r,t),l,c,d=t.fontMetrics(),m=0,f=0,g=r&&Pa(r);if(i){var b=t.havingStyle(t.style.sup());l=Yt(i,b,t),g||(m=o.height-b.fontMetrics().supDrop*b.sizeMultiplier/t.sizeMultiplier)}if(a){var k=t.havingStyle(t.style.sub());c=Yt(a,k,t),g||(f=o.depth+k.fontMetrics().subDrop*k.sizeMultiplier/t.sizeMultiplier)}var S;t.style===bt.DISPLAY?S=d.sup1:t.style.cramped?S=d.sup3:S=d.sup2;var x=t.sizeMultiplier,v=He(.5/d.ptPerEm/x),w=null;if(c){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(o instanceof Bi||y){var C;w=He(-((C=o.italic)!=null?C:0))}}var N;if(l&&c){m=Math.max(m,S,l.depth+.25*d.xHeight),f=Math.max(f,d.sub2);var E=d.defaultRuleThickness,M=4*E;if(m-l.depth-(c.height-f)0&&(m+=T,f-=T)}var D=[{type:"elem",elem:c,shift:f,marginRight:v,marginLeft:w},{type:"elem",elem:l,shift:-m,marginRight:v}];N=Vt({positionType:"individualShift",children:D})}else if(c){f=Math.max(f,d.sub1,c.height-.8*d.xHeight);var z=[{type:"elem",elem:c,marginLeft:w,marginRight:v}];N=Vt({positionType:"shift",positionData:f,children:z})}else if(l)m=Math.max(m,S,l.depth+.25*d.xHeight),N=Vt({positionType:"shift",positionData:-m,children:[{type:"elem",elem:l,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var $=lv(o,"right")||"mord";return Oe([$],[o,Oe(["msupsub"],[N])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type==="horizBrace"&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var a=[hn(e.base,t)];e.sub&&a.push(hn(e.sub,t)),e.sup&&a.push(hn(e.sup,t));var o;if(n)o=r?"mover":"munder";else if(e.sub)if(e.sup){var d=e.base;d&&d.type==="op"&&d.limits&&t.style===bt.DISPLAY||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(t.style===bt.DISPLAY||d.limits)?o="munderover":o="msubsup"}else{var c=e.base;c&&c.type==="op"&&c.limits&&(t.style===bt.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||t.style===bt.DISPLAY)?o="munder":o="msub"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(t.style===bt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===bt.DISPLAY)?o="mover":o="msup"}return new Be(o,a)}});Fl({type:"atom",htmlBuilder(e,t){return P_(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new Be("mo",[os(e.text,e.mode)]);if(e.family==="bin"){var r=G_(e,t);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var hk={mi:"italic",mn:"normal",mtext:"normal"};Fl({type:"mathord",htmlBuilder(e,t){return xp(e,t,"mathord")},mathmlBuilder(e,t){var n=new Be("mi",[os(e.text,e.mode,t)]),r=G_(e,t)||"italic";return r!==hk[n.type]&&n.setAttribute("mathvariant",r),n}});Fl({type:"textord",htmlBuilder(e,t){return xp(e,t,"textord")},mathmlBuilder(e,t){var n=os(e.text,e.mode,t),r=G_(e,t)||"normal",i;return e.mode==="text"?i=new Be("mtext",[n]):/[0-9]/.test(e.text)?i=new Be("mn",[n]):e.text==="\\prime"?i=new Be("mo",[n]):i=new Be("mi",[n]),r!==hk[i.type]&&i.setAttribute("mathvariant",r),i}});var Ug={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},qg={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Fl({type:"spacing",htmlBuilder(e,t){if(qg.hasOwnProperty(e.text)){var n=qg[e.text].className||"";if(e.mode==="text"){var r=xp(e,t,"textord");return r.classes.push(n),r}else return Oe(["mspace",n],[P_(e.text,e.mode,t)],t)}else{if(Ug.hasOwnProperty(e.text))return Oe(["mspace",Ug[e.text]],[],t);throw new ze('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(qg.hasOwnProperty(e.text))n=new Be("mtext",[new tr(" ")]);else{if(Ug.hasOwnProperty(e.text))return new Be("mspace");throw new ze('Unknown type of space "'+e.text+'"')}return n}});var U6=()=>{var e=new Be("mtd",[]);return e.setAttribute("width","50%"),e};Fl({type:"tag",mathmlBuilder(e,t){var n=new Be("mtable",[new Be("mtr",[U6(),new Be("mtd",[$o(e.body,t)]),U6(),new Be("mtd",[$o(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var q6={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},G6={"\\textbf":"textbf","\\textmd":"textmd"},hF={"\\textit":"textit","\\textup":"textup"},V6=(e,t)=>{var n=e.font;if(n){if(q6[n])return t.withTextFontFamily(q6[n]);if(G6[n])return t.withTextFontWeight(G6[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(hF[n])};We({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"text",mode:n.mode,body:er(i),font:r}},htmlBuilder(e,t){var n=V6(e,t),r=hr(e.body,n,!0);return Oe(["mord","text"],r,n)},mathmlBuilder(e,t){var n=V6(e,t);return $o(e.body,n)}});We({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Yt(e.body,t),r=Kc("underline-line",t),i=t.fontMetrics().defaultRuleThickness,a=Vt({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]});return Oe(["mord","underline"],[a],t)},mathmlBuilder(e,t){var n=new Be("mo",[new tr("‾")]);n.setAttribute("stretchy","true");var r=new Be("munder",[hn(e.body,t),n]);return r.setAttribute("accentunder","true"),r}});We({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Yt(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return Vt({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Be("mpadded",[hn(e.body,t)],["vcenter"]);return new Be("mrow",[n])}});We({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new ze("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=W6(e),r=[],i=t.havingStyle(t.style.text()),a=0;ae.body.replace(/ /g,e.star?"␣":" "),Oo=R9,fk=`[ \r + ]`,fF="\\\\[a-zA-Z@]+",pF="\\\\[^\uD800-\uDFFF]",mF="("+fF+")"+fk+"*",gF=`\\\\( |[ \r ]+ -?)[ \r ]*`,dv="[̀-ͯ]",fF=new RegExp(dv+"+$"),pF="("+fk+"+)|"+(hF+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(dv+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(dv+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+dF)+("|"+uF+")");class G6{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(pF,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new Ts("EOF",new ci(this,n,n));var r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new Be("Unexpected character: '"+t[n]+"'",new Ts(t[n],new ci(this,n,n+1)));var i=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=t.indexOf(` -`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new Ts(i,new ci(this,n,this.tokenRegex.lastIndex))}}class mF{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Be("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,r){if(r===void 0&&(r=!1),r){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(t)&&(a[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var gF=tk;ee("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});ee("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});ee("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});ee("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});ee("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});ee("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ee("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var V6={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ee("\\char",function(e){var t=e.popToken(),n,r=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new Be("\\char` missing argument");r=t.text.charCodeAt(0)}else n=10;if(n){if(r=V6[t.text],r==null||r>=n)throw new Be("Invalid base-"+n+" digit "+t.text);for(var i;(i=V6[e.future().text])!=null&&i{var i=e.consumeArg().tokens;if(i.length!==1)throw new Be("\\newcommand's first argument must be a macro name");var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new Be("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!o&&!n)throw new Be("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var l=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var u="",d=e.expandNextToken();d.text!=="]"&&d.text!=="EOF";)u+=d.text,d=e.expandNextToken();if(!u.match(/^\s*[0-9]+\s*$/))throw new Be("Invalid number of arguments: "+u);l=parseInt(u),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:l}),""};ee("\\newcommand",e=>V_(e,!1,!0,!1));ee("\\renewcommand",e=>V_(e,!0,!1,!1));ee("\\providecommand",e=>V_(e,!0,!0,!0));ee("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});ee("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});ee("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Oo[n],Tn.math[n],Tn.text[n]),""});ee("\\bgroup","{");ee("\\egroup","}");ee("~","\\nobreakspace");ee("\\lq","`");ee("\\rq","'");ee("\\aa","\\r a");ee("\\AA","\\r A");ee("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ee("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ee("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ee("ℬ","\\mathscr{B}");ee("ℰ","\\mathscr{E}");ee("ℱ","\\mathscr{F}");ee("ℋ","\\mathscr{H}");ee("ℐ","\\mathscr{I}");ee("ℒ","\\mathscr{L}");ee("ℳ","\\mathscr{M}");ee("ℛ","\\mathscr{R}");ee("ℭ","\\mathfrak{C}");ee("ℌ","\\mathfrak{H}");ee("ℨ","\\mathfrak{Z}");ee("\\Bbbk","\\Bbb{k}");ee("\\llap","\\mathllap{\\textrm{#1}}");ee("\\rlap","\\mathrlap{\\textrm{#1}}");ee("\\clap","\\mathclap{\\textrm{#1}}");ee("\\mathstrut","\\vphantom{(}");ee("\\underbar","\\underline{\\text{#1}}");ee("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ee("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ee("\\ne","\\neq");ee("≠","\\neq");ee("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ee("∉","\\notin");ee("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ee("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ee("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ee("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ee("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ee("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ee("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ee("⟂","\\perp");ee("‼","\\mathclose{!\\mkern-0.8mu!}");ee("∌","\\notni");ee("⌜","\\ulcorner");ee("⌝","\\urcorner");ee("⌞","\\llcorner");ee("⌟","\\lrcorner");ee("©","\\copyright");ee("®","\\textregistered");ee("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ee("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ee("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ee("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ee("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ee("⋮","\\vdots");ee("\\varGamma","\\mathit{\\Gamma}");ee("\\varDelta","\\mathit{\\Delta}");ee("\\varTheta","\\mathit{\\Theta}");ee("\\varLambda","\\mathit{\\Lambda}");ee("\\varXi","\\mathit{\\Xi}");ee("\\varPi","\\mathit{\\Pi}");ee("\\varSigma","\\mathit{\\Sigma}");ee("\\varUpsilon","\\mathit{\\Upsilon}");ee("\\varPhi","\\mathit{\\Phi}");ee("\\varPsi","\\mathit{\\Psi}");ee("\\varOmega","\\mathit{\\Omega}");ee("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ee("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ee("\\boxed","\\fbox{$\\displaystyle{#1}$}");ee("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ee("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ee("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ee("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ee("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var W6={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},bF=new Set(["bin","rel"]);ee("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in W6?t=W6[n]:(n.slice(0,4)==="\\not"||n in Tn.math&&bF.has(Tn.math[n].group))&&(t="\\dotsb"),t});var W_={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ee("\\dotso",function(e){var t=e.future().text;return t in W_?"\\ldots\\,":"\\ldots"});ee("\\dotsc",function(e){var t=e.future().text;return t in W_&&t!==","?"\\ldots\\,":"\\ldots"});ee("\\cdots",function(e){var t=e.future().text;return t in W_?"\\@cdots\\,":"\\@cdots"});ee("\\dotsb","\\cdots");ee("\\dotsm","\\cdots");ee("\\dotsi","\\!\\cdots");ee("\\dotsx","\\ldots\\,");ee("\\DOTSI","\\relax");ee("\\DOTSB","\\relax");ee("\\DOTSX","\\relax");ee("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ee("\\,","\\tmspace+{3mu}{.1667em}");ee("\\thinspace","\\,");ee("\\>","\\mskip{4mu}");ee("\\:","\\tmspace+{4mu}{.2222em}");ee("\\medspace","\\:");ee("\\;","\\tmspace+{5mu}{.2777em}");ee("\\thickspace","\\;");ee("\\!","\\tmspace-{3mu}{.1667em}");ee("\\negthinspace","\\!");ee("\\negmedspace","\\tmspace-{4mu}{.2222em}");ee("\\negthickspace","\\tmspace-{5mu}{.277em}");ee("\\enspace","\\kern.5em ");ee("\\enskip","\\hskip.5em\\relax");ee("\\quad","\\hskip1em\\relax");ee("\\qquad","\\hskip2em\\relax");ee("\\tag","\\@ifstar\\tag@literal\\tag@paren");ee("\\tag@paren","\\tag@literal{({#1})}");ee("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Be("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ee("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ee("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ee("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ee("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ee("\\newline","\\\\\\relax");ee("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var pk=$e(Xs["Main-Regular"][84][1]-.7*Xs["Main-Regular"][65][1]);ee("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+pk+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ee("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+pk+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ee("\\hspace","\\@ifstar\\@hspacer\\@hspace");ee("\\@hspace","\\hskip #1\\relax");ee("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ee("\\ordinarycolon",":");ee("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ee("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ee("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ee("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ee("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ee("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ee("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ee("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ee("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ee("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ee("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ee("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ee("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ee("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ee("∷","\\dblcolon");ee("∹","\\eqcolon");ee("≔","\\coloneqq");ee("≕","\\eqqcolon");ee("⩴","\\Coloneqq");ee("\\ratio","\\vcentcolon");ee("\\coloncolon","\\dblcolon");ee("\\colonequals","\\coloneqq");ee("\\coloncolonequals","\\Coloneqq");ee("\\equalscolon","\\eqqcolon");ee("\\equalscoloncolon","\\Eqqcolon");ee("\\colonminus","\\coloneq");ee("\\coloncolonminus","\\Coloneq");ee("\\minuscolon","\\eqcolon");ee("\\minuscoloncolon","\\Eqcolon");ee("\\coloncolonapprox","\\Colonapprox");ee("\\coloncolonsim","\\Colonsim");ee("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ee("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ee("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ee("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ee("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ee("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ee("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ee("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ee("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ee("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ee("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ee("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ee("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ee("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ee("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ee("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ee("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ee("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ee("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ee("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ee("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ee("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ee("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ee("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ee("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ee("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ee("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ee("\\imath","\\html@mathml{\\@imath}{ı}");ee("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ee("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ee("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ee("⟦","\\llbracket");ee("⟧","\\rrbracket");ee("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ee("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ee("⦃","\\lBrace");ee("⦄","\\rBrace");ee("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ee("⦵","\\minuso");ee("\\darr","\\downarrow");ee("\\dArr","\\Downarrow");ee("\\Darr","\\Downarrow");ee("\\lang","\\langle");ee("\\rang","\\rangle");ee("\\uarr","\\uparrow");ee("\\uArr","\\Uparrow");ee("\\Uarr","\\Uparrow");ee("\\N","\\mathbb{N}");ee("\\R","\\mathbb{R}");ee("\\Z","\\mathbb{Z}");ee("\\alef","\\aleph");ee("\\alefsym","\\aleph");ee("\\Alpha","\\mathrm{A}");ee("\\Beta","\\mathrm{B}");ee("\\bull","\\bullet");ee("\\Chi","\\mathrm{X}");ee("\\clubs","\\clubsuit");ee("\\cnums","\\mathbb{C}");ee("\\Complex","\\mathbb{C}");ee("\\Dagger","\\ddagger");ee("\\diamonds","\\diamondsuit");ee("\\empty","\\emptyset");ee("\\Epsilon","\\mathrm{E}");ee("\\Eta","\\mathrm{H}");ee("\\exist","\\exists");ee("\\harr","\\leftrightarrow");ee("\\hArr","\\Leftrightarrow");ee("\\Harr","\\Leftrightarrow");ee("\\hearts","\\heartsuit");ee("\\image","\\Im");ee("\\infin","\\infty");ee("\\Iota","\\mathrm{I}");ee("\\isin","\\in");ee("\\Kappa","\\mathrm{K}");ee("\\larr","\\leftarrow");ee("\\lArr","\\Leftarrow");ee("\\Larr","\\Leftarrow");ee("\\lrarr","\\leftrightarrow");ee("\\lrArr","\\Leftrightarrow");ee("\\Lrarr","\\Leftrightarrow");ee("\\Mu","\\mathrm{M}");ee("\\natnums","\\mathbb{N}");ee("\\Nu","\\mathrm{N}");ee("\\Omicron","\\mathrm{O}");ee("\\plusmn","\\pm");ee("\\rarr","\\rightarrow");ee("\\rArr","\\Rightarrow");ee("\\Rarr","\\Rightarrow");ee("\\real","\\Re");ee("\\reals","\\mathbb{R}");ee("\\Reals","\\mathbb{R}");ee("\\Rho","\\mathrm{P}");ee("\\sdot","\\cdot");ee("\\sect","\\S");ee("\\spades","\\spadesuit");ee("\\sub","\\subset");ee("\\sube","\\subseteq");ee("\\supe","\\supseteq");ee("\\Tau","\\mathrm{T}");ee("\\thetasym","\\vartheta");ee("\\weierp","\\wp");ee("\\Zeta","\\mathrm{Z}");ee("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ee("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ee("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ee("\\bra","\\mathinner{\\langle{#1}|}");ee("\\ket","\\mathinner{|{#1}\\rangle}");ee("\\braket","\\mathinner{\\langle{#1}\\rangle}");ee("\\Bra","\\left\\langle#1\\right|");ee("\\Ket","\\left|#1\\right\\rangle");var mk=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get("|"),l=t.macros.get("\\|");t.macros.beginGroup();var u=f=>g=>{e&&(g.macros.set("|",o),i.length&&g.macros.set("\\|",l));var b=f;if(!f&&i.length){var k=g.future();k.text==="|"&&(g.popToken(),b=!0)}return{tokens:b?i:r,numArgs:0}};t.macros.set("|",u(!1)),i.length&&t.macros.set("\\|",u(!0));var d=t.consumeArg().tokens,m=t.expandTokens([...a,...d,...n]);return t.macros.endGroup(),{tokens:m.reverse(),numArgs:0}};ee("\\bra@ket",mk(!1));ee("\\bra@set",mk(!0));ee("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ee("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ee("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ee("\\angln","{\\angl n}");ee("\\blue","\\textcolor{##6495ed}{#1}");ee("\\orange","\\textcolor{##ffa500}{#1}");ee("\\pink","\\textcolor{##ff00af}{#1}");ee("\\red","\\textcolor{##df0030}{#1}");ee("\\green","\\textcolor{##28ae7b}{#1}");ee("\\gray","\\textcolor{gray}{#1}");ee("\\purple","\\textcolor{##9d38bd}{#1}");ee("\\blueA","\\textcolor{##ccfaff}{#1}");ee("\\blueB","\\textcolor{##80f6ff}{#1}");ee("\\blueC","\\textcolor{##63d9ea}{#1}");ee("\\blueD","\\textcolor{##11accd}{#1}");ee("\\blueE","\\textcolor{##0c7f99}{#1}");ee("\\tealA","\\textcolor{##94fff5}{#1}");ee("\\tealB","\\textcolor{##26edd5}{#1}");ee("\\tealC","\\textcolor{##01d1c1}{#1}");ee("\\tealD","\\textcolor{##01a995}{#1}");ee("\\tealE","\\textcolor{##208170}{#1}");ee("\\greenA","\\textcolor{##b6ffb0}{#1}");ee("\\greenB","\\textcolor{##8af281}{#1}");ee("\\greenC","\\textcolor{##74cf70}{#1}");ee("\\greenD","\\textcolor{##1fab54}{#1}");ee("\\greenE","\\textcolor{##0d923f}{#1}");ee("\\goldA","\\textcolor{##ffd0a9}{#1}");ee("\\goldB","\\textcolor{##ffbb71}{#1}");ee("\\goldC","\\textcolor{##ff9c39}{#1}");ee("\\goldD","\\textcolor{##e07d10}{#1}");ee("\\goldE","\\textcolor{##a75a05}{#1}");ee("\\redA","\\textcolor{##fca9a9}{#1}");ee("\\redB","\\textcolor{##ff8482}{#1}");ee("\\redC","\\textcolor{##f9685d}{#1}");ee("\\redD","\\textcolor{##e84d39}{#1}");ee("\\redE","\\textcolor{##bc2612}{#1}");ee("\\maroonA","\\textcolor{##ffbde0}{#1}");ee("\\maroonB","\\textcolor{##ff92c6}{#1}");ee("\\maroonC","\\textcolor{##ed5fa6}{#1}");ee("\\maroonD","\\textcolor{##ca337c}{#1}");ee("\\maroonE","\\textcolor{##9e034e}{#1}");ee("\\purpleA","\\textcolor{##ddd7ff}{#1}");ee("\\purpleB","\\textcolor{##c6b9fc}{#1}");ee("\\purpleC","\\textcolor{##aa87ff}{#1}");ee("\\purpleD","\\textcolor{##7854ab}{#1}");ee("\\purpleE","\\textcolor{##543b78}{#1}");ee("\\mintA","\\textcolor{##f5f9e8}{#1}");ee("\\mintB","\\textcolor{##edf2df}{#1}");ee("\\mintC","\\textcolor{##e0e5cc}{#1}");ee("\\grayA","\\textcolor{##f6f7f7}{#1}");ee("\\grayB","\\textcolor{##f0f1f2}{#1}");ee("\\grayC","\\textcolor{##e3e5e6}{#1}");ee("\\grayD","\\textcolor{##d6d8da}{#1}");ee("\\grayE","\\textcolor{##babec2}{#1}");ee("\\grayF","\\textcolor{##888d93}{#1}");ee("\\grayG","\\textcolor{##626569}{#1}");ee("\\grayH","\\textcolor{##3b3e40}{#1}");ee("\\grayI","\\textcolor{##21242c}{#1}");ee("\\kaBlue","\\textcolor{##314453}{#1}");ee("\\kaGreen","\\textcolor{##71B307}{#1}");var gk={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class vF{constructor(t,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new mF(gF,n.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new G6(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,r,i;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:i,end:r}=this.consumeArg(["]"])}else({tokens:i,start:n,end:r}=this.consumeArg());return this.pushToken(new Ts("EOF",r.loc)),this.pushTokens(i),new Ts("",ci.range(n,r))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],r=t&&t.length>0;r||this.consumeSpaces();var i=this.future(),a,o=0,l=0;do{if(a=this.popToken(),n.push(a),a.text==="{")++o;else if(a.text==="}"){if(--o,o===-1)throw new Be("Extra }",a)}else if(a.text==="EOF")throw new Be("Unexpected end of input in a macro argument, expected '"+(t&&r?t[l]:"}")+"'",a);if(t&&r)if((o===0||o===1&&t[l]==="{")&&a.text===t[l]){if(++l,l===t.length){n.splice(-l,l);break}}else l=0}while(o!==0||r);return i.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:a}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new Be("The length of delimiters doesn't match the number of args!");for(var r=n[0],i=0;ithis.settings.maxExpand)throw new Be("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),r=n.text,i=n.noexpand?null:this._getExpansion(r);if(i==null||t&&i.unexpandable){if(t&&i==null&&r[0]==="\\"&&!this.isDefined(r))throw new Be("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var a=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var l=a.length-1;l>=0;--l){var u=a[l];if(u.text==="#"){if(l===0)throw new Be("Incomplete placeholder at end of macro body",u);if(u=a[--l],u.text==="#")a.splice(l+1,1);else if(/^[1-9]$/.test(u.text))a.splice(l,2,...o[+u.text-1]);else throw new Be("Not a valid argument number",u)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new Ts(t)]):void 0}expandTokens(t){var n=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),n.push(i)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(r=>r.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var r=this.lexer.catcodes[t];if(r!=null&&r!==13)return}var i=typeof n=="function"?n(this):n;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var o=i.replace(/##/g,"");o.includes("#"+(a+1));)++a;for(var l=new G6(i,this.settings),u=[],d=l.lex();d.text!=="EOF";)u.push(d),d=l.lex();u.reverse();var m={tokens:u,numArgs:a};return m}return i}isDefined(t){return this.macros.has(t)||Oo.hasOwnProperty(t)||Tn.math.hasOwnProperty(t)||Tn.text.hasOwnProperty(t)||gk.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Oo.hasOwnProperty(t)&&!Oo[t].primitive}}var Y6=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,P0=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Ug={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},X6={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Tp{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new vF(t,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new Be("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new Ts("}")),this.gullet.pushTokens(t);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(t,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(Tp.endOfExpression.has(i.text)||n&&i.text===n||t&&Oo[i.text]&&Oo[i.text].infix)break;var a=this.parseAtom(n);if(a){if(a.type==="internal")continue}else break;r.push(a)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(t){for(var n=-1,r,i=0;i=128)this.settings.strict&&(w9(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),o={type:"textord",mode:"text",loc:ci.range(t),text:n};else return null;if(this.consume(),a)for(var m=0;m0?{type:"text",value:E}:void 0),E===!1?g.lastIndex=C+1:(k!==C&&w.push({type:"text",value:d.value.slice(k,C)}),Array.isArray(E)?w.push(...E):E&&w.push(E),k=C+y[0].length,_=!0),!g.global)break;y=g.exec(d.value)}return _?(k?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Z6(e,"(");let a=Z6(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function xk(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||jl(n)||dp(n))&&(!t||n!==47)}yk.peek=ZF;function UF(){this.buffer()}function qF(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function GF(){this.buffer()}function VF(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function WF(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Es(this.sliceSerialize(e)).toLowerCase(),n.label=t}function YF(e){this.exit(e)}function XF(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Es(this.sliceSerialize(e)).toLowerCase(),n.label=t}function KF(e){this.exit(e)}function ZF(){return"["}function yk(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),l(),o(),a+=i.move("]"),a}function QF(){return{enter:{gfmFootnoteCallString:UF,gfmFootnoteCall:qF,gfmFootnoteDefinitionLabelString:GF,gfmFootnoteDefinition:VF},exit:{gfmFootnoteCallString:WF,gfmFootnoteCall:YF,gfmFootnoteDefinitionLabelString:XF,gfmFootnoteDefinition:KF}}}function JF(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:yk},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,o){const l=a.createTracker(o);let u=l.move("[^");const d=a.enter("footnoteDefinition"),m=a.enter("label");return u+=l.move(a.safe(a.associationId(r),{before:u,after:"]"})),m(),u+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),u+=l.move((t?` -`:" ")+a.indentLines(a.containerFlow(r,l.current()),t?wk:eP))),d(),u}}function eP(e,t,n){return t===0?e:wk(e,t,n)}function wk(e,t,n){return(n?"":" ")+e}const tP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Sk.peek=aP;function nP(){return{canContainEols:["delete"],enter:{strikethrough:iP},exit:{strikethrough:sP}}}function rP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:tP}],handlers:{delete:Sk}}}function iP(e){this.enter({type:"delete",children:[]},e)}function sP(e){this.exit(e)}function Sk(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function aP(){return"~"}function oP(e){return e.length}function lP(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||oP,a=[],o=[],l=[],u=[];let d=0,m=-1;for(;++md&&(d=e[m].length);++_u[_])&&(u[_]=y)}S.push(w)}o[m]=S,l[m]=x}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fu[f]&&(u[f]=w),b[f]=w),g[f]=y}o.splice(1,0,g),l.splice(1,0,b),m=-1;const k=[];for(;++m "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),dP);return i(),o}function dP(e,t,n){return">"+(n?"":" ")+e}function hP(e,t){return J6(e,t.inConstruct,!0)&&!J6(e,t.notInConstruct,!1)}function J6(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ro&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function fP(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 pP(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 mP(e,t,n,r){const i=pP(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(fP(e,n)){const f=n.enter("codeIndented"),g=n.indentLines(a,gP);return f(),g}const l=n.createTracker(r),u=i.repeat(Math.max(kk(a,i)+1,3)),d=n.enter("codeFenced");let m=l.move(u);if(e.lang){const f=n.enter(`codeFencedLang${o}`);m+=l.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);m+=l.move(" "),m+=l.move(n.safe(e.meta,{before:m,after:` +?)[ \r ]*`,pv="[̀-ͯ]",bF=new RegExp(pv+"+$"),vF="("+fk+"+)|"+(gF+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(pv+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(pv+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+mF)+("|"+pF+")");class Y6{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(vF,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new ks("EOF",new oi(this,n,n));var r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new ze("Unexpected character: '"+t[n]+"'",new ks(t[n],new oi(this,n,n+1)));var i=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=t.indexOf(` +`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new ks(i,new oi(this,n,this.tokenRegex.lastIndex))}}class _F{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new ze("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,r){if(r===void 0&&(r=!1),r){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(t)&&(a[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var xF=tk;ee("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});ee("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});ee("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});ee("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});ee("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});ee("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ee("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var X6={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ee("\\char",function(e){var t=e.popToken(),n,r=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new ze("\\char` missing argument");r=t.text.charCodeAt(0)}else n=10;if(n){if(r=X6[t.text],r==null||r>=n)throw new ze("Invalid base-"+n+" digit "+t.text);for(var i;(i=X6[e.future().text])!=null&&i{var i=e.consumeArg().tokens;if(i.length!==1)throw new ze("\\newcommand's first argument must be a macro name");var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new ze("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!o&&!n)throw new ze("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var l=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var c="",d=e.expandNextToken();d.text!=="]"&&d.text!=="EOF";)c+=d.text,d=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new ze("Invalid number of arguments: "+c);l=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:l}),""};ee("\\newcommand",e=>K_(e,!1,!0,!1));ee("\\renewcommand",e=>K_(e,!0,!1,!1));ee("\\providecommand",e=>K_(e,!0,!0,!0));ee("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});ee("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});ee("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Oo[n],An.math[n],An.text[n]),""});ee("\\bgroup","{");ee("\\egroup","}");ee("~","\\nobreakspace");ee("\\lq","`");ee("\\rq","'");ee("\\aa","\\r a");ee("\\AA","\\r A");ee("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ee("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ee("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ee("ℬ","\\mathscr{B}");ee("ℰ","\\mathscr{E}");ee("ℱ","\\mathscr{F}");ee("ℋ","\\mathscr{H}");ee("ℐ","\\mathscr{I}");ee("ℒ","\\mathscr{L}");ee("ℳ","\\mathscr{M}");ee("ℛ","\\mathscr{R}");ee("ℭ","\\mathfrak{C}");ee("ℌ","\\mathfrak{H}");ee("ℨ","\\mathfrak{Z}");ee("\\Bbbk","\\Bbb{k}");ee("\\llap","\\mathllap{\\textrm{#1}}");ee("\\rlap","\\mathrlap{\\textrm{#1}}");ee("\\clap","\\mathclap{\\textrm{#1}}");ee("\\mathstrut","\\vphantom{(}");ee("\\underbar","\\underline{\\text{#1}}");ee("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ee("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ee("\\ne","\\neq");ee("≠","\\neq");ee("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ee("∉","\\notin");ee("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ee("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ee("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ee("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ee("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ee("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ee("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ee("⟂","\\perp");ee("‼","\\mathclose{!\\mkern-0.8mu!}");ee("∌","\\notni");ee("⌜","\\ulcorner");ee("⌝","\\urcorner");ee("⌞","\\llcorner");ee("⌟","\\lrcorner");ee("©","\\copyright");ee("®","\\textregistered");ee("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ee("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ee("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ee("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ee("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ee("⋮","\\vdots");ee("\\varGamma","\\mathit{\\Gamma}");ee("\\varDelta","\\mathit{\\Delta}");ee("\\varTheta","\\mathit{\\Theta}");ee("\\varLambda","\\mathit{\\Lambda}");ee("\\varXi","\\mathit{\\Xi}");ee("\\varPi","\\mathit{\\Pi}");ee("\\varSigma","\\mathit{\\Sigma}");ee("\\varUpsilon","\\mathit{\\Upsilon}");ee("\\varPhi","\\mathit{\\Phi}");ee("\\varPsi","\\mathit{\\Psi}");ee("\\varOmega","\\mathit{\\Omega}");ee("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ee("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ee("\\boxed","\\fbox{$\\displaystyle{#1}$}");ee("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ee("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ee("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ee("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ee("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var K6={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},yF=new Set(["bin","rel"]);ee("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in K6?t=K6[n]:(n.slice(0,4)==="\\not"||n in An.math&&yF.has(An.math[n].group))&&(t="\\dotsb"),t});var Z_={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ee("\\dotso",function(e){var t=e.future().text;return t in Z_?"\\ldots\\,":"\\ldots"});ee("\\dotsc",function(e){var t=e.future().text;return t in Z_&&t!==","?"\\ldots\\,":"\\ldots"});ee("\\cdots",function(e){var t=e.future().text;return t in Z_?"\\@cdots\\,":"\\@cdots"});ee("\\dotsb","\\cdots");ee("\\dotsm","\\cdots");ee("\\dotsi","\\!\\cdots");ee("\\dotsx","\\ldots\\,");ee("\\DOTSI","\\relax");ee("\\DOTSB","\\relax");ee("\\DOTSX","\\relax");ee("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ee("\\,","\\tmspace+{3mu}{.1667em}");ee("\\thinspace","\\,");ee("\\>","\\mskip{4mu}");ee("\\:","\\tmspace+{4mu}{.2222em}");ee("\\medspace","\\:");ee("\\;","\\tmspace+{5mu}{.2777em}");ee("\\thickspace","\\;");ee("\\!","\\tmspace-{3mu}{.1667em}");ee("\\negthinspace","\\!");ee("\\negmedspace","\\tmspace-{4mu}{.2222em}");ee("\\negthickspace","\\tmspace-{5mu}{.277em}");ee("\\enspace","\\kern.5em ");ee("\\enskip","\\hskip.5em\\relax");ee("\\quad","\\hskip1em\\relax");ee("\\qquad","\\hskip2em\\relax");ee("\\tag","\\@ifstar\\tag@literal\\tag@paren");ee("\\tag@paren","\\tag@literal{({#1})}");ee("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new ze("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ee("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ee("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ee("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ee("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ee("\\newline","\\\\\\relax");ee("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var pk=He(Ys["Main-Regular"][84][1]-.7*Ys["Main-Regular"][65][1]);ee("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+pk+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ee("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+pk+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ee("\\hspace","\\@ifstar\\@hspacer\\@hspace");ee("\\@hspace","\\hskip #1\\relax");ee("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ee("\\ordinarycolon",":");ee("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ee("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ee("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ee("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ee("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ee("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ee("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ee("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ee("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ee("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ee("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ee("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ee("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ee("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ee("∷","\\dblcolon");ee("∹","\\eqcolon");ee("≔","\\coloneqq");ee("≕","\\eqqcolon");ee("⩴","\\Coloneqq");ee("\\ratio","\\vcentcolon");ee("\\coloncolon","\\dblcolon");ee("\\colonequals","\\coloneqq");ee("\\coloncolonequals","\\Coloneqq");ee("\\equalscolon","\\eqqcolon");ee("\\equalscoloncolon","\\Eqqcolon");ee("\\colonminus","\\coloneq");ee("\\coloncolonminus","\\Coloneq");ee("\\minuscolon","\\eqcolon");ee("\\minuscoloncolon","\\Eqcolon");ee("\\coloncolonapprox","\\Colonapprox");ee("\\coloncolonsim","\\Colonsim");ee("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ee("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ee("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ee("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ee("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ee("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ee("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ee("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ee("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ee("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ee("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ee("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ee("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ee("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ee("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ee("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ee("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ee("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ee("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ee("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ee("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ee("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ee("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ee("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ee("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ee("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ee("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ee("\\imath","\\html@mathml{\\@imath}{ı}");ee("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ee("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ee("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ee("⟦","\\llbracket");ee("⟧","\\rrbracket");ee("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ee("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ee("⦃","\\lBrace");ee("⦄","\\rBrace");ee("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ee("⦵","\\minuso");ee("\\darr","\\downarrow");ee("\\dArr","\\Downarrow");ee("\\Darr","\\Downarrow");ee("\\lang","\\langle");ee("\\rang","\\rangle");ee("\\uarr","\\uparrow");ee("\\uArr","\\Uparrow");ee("\\Uarr","\\Uparrow");ee("\\N","\\mathbb{N}");ee("\\R","\\mathbb{R}");ee("\\Z","\\mathbb{Z}");ee("\\alef","\\aleph");ee("\\alefsym","\\aleph");ee("\\Alpha","\\mathrm{A}");ee("\\Beta","\\mathrm{B}");ee("\\bull","\\bullet");ee("\\Chi","\\mathrm{X}");ee("\\clubs","\\clubsuit");ee("\\cnums","\\mathbb{C}");ee("\\Complex","\\mathbb{C}");ee("\\Dagger","\\ddagger");ee("\\diamonds","\\diamondsuit");ee("\\empty","\\emptyset");ee("\\Epsilon","\\mathrm{E}");ee("\\Eta","\\mathrm{H}");ee("\\exist","\\exists");ee("\\harr","\\leftrightarrow");ee("\\hArr","\\Leftrightarrow");ee("\\Harr","\\Leftrightarrow");ee("\\hearts","\\heartsuit");ee("\\image","\\Im");ee("\\infin","\\infty");ee("\\Iota","\\mathrm{I}");ee("\\isin","\\in");ee("\\Kappa","\\mathrm{K}");ee("\\larr","\\leftarrow");ee("\\lArr","\\Leftarrow");ee("\\Larr","\\Leftarrow");ee("\\lrarr","\\leftrightarrow");ee("\\lrArr","\\Leftrightarrow");ee("\\Lrarr","\\Leftrightarrow");ee("\\Mu","\\mathrm{M}");ee("\\natnums","\\mathbb{N}");ee("\\Nu","\\mathrm{N}");ee("\\Omicron","\\mathrm{O}");ee("\\plusmn","\\pm");ee("\\rarr","\\rightarrow");ee("\\rArr","\\Rightarrow");ee("\\Rarr","\\Rightarrow");ee("\\real","\\Re");ee("\\reals","\\mathbb{R}");ee("\\Reals","\\mathbb{R}");ee("\\Rho","\\mathrm{P}");ee("\\sdot","\\cdot");ee("\\sect","\\S");ee("\\spades","\\spadesuit");ee("\\sub","\\subset");ee("\\sube","\\subseteq");ee("\\supe","\\supseteq");ee("\\Tau","\\mathrm{T}");ee("\\thetasym","\\vartheta");ee("\\weierp","\\wp");ee("\\Zeta","\\mathrm{Z}");ee("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ee("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ee("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ee("\\bra","\\mathinner{\\langle{#1}|}");ee("\\ket","\\mathinner{|{#1}\\rangle}");ee("\\braket","\\mathinner{\\langle{#1}\\rangle}");ee("\\Bra","\\left\\langle#1\\right|");ee("\\Ket","\\left|#1\\right\\rangle");var mk=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get("|"),l=t.macros.get("\\|");t.macros.beginGroup();var c=f=>g=>{e&&(g.macros.set("|",o),i.length&&g.macros.set("\\|",l));var b=f;if(!f&&i.length){var k=g.future();k.text==="|"&&(g.popToken(),b=!0)}return{tokens:b?i:r,numArgs:0}};t.macros.set("|",c(!1)),i.length&&t.macros.set("\\|",c(!0));var d=t.consumeArg().tokens,m=t.expandTokens([...a,...d,...n]);return t.macros.endGroup(),{tokens:m.reverse(),numArgs:0}};ee("\\bra@ket",mk(!1));ee("\\bra@set",mk(!0));ee("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ee("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ee("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ee("\\angln","{\\angl n}");ee("\\blue","\\textcolor{##6495ed}{#1}");ee("\\orange","\\textcolor{##ffa500}{#1}");ee("\\pink","\\textcolor{##ff00af}{#1}");ee("\\red","\\textcolor{##df0030}{#1}");ee("\\green","\\textcolor{##28ae7b}{#1}");ee("\\gray","\\textcolor{gray}{#1}");ee("\\purple","\\textcolor{##9d38bd}{#1}");ee("\\blueA","\\textcolor{##ccfaff}{#1}");ee("\\blueB","\\textcolor{##80f6ff}{#1}");ee("\\blueC","\\textcolor{##63d9ea}{#1}");ee("\\blueD","\\textcolor{##11accd}{#1}");ee("\\blueE","\\textcolor{##0c7f99}{#1}");ee("\\tealA","\\textcolor{##94fff5}{#1}");ee("\\tealB","\\textcolor{##26edd5}{#1}");ee("\\tealC","\\textcolor{##01d1c1}{#1}");ee("\\tealD","\\textcolor{##01a995}{#1}");ee("\\tealE","\\textcolor{##208170}{#1}");ee("\\greenA","\\textcolor{##b6ffb0}{#1}");ee("\\greenB","\\textcolor{##8af281}{#1}");ee("\\greenC","\\textcolor{##74cf70}{#1}");ee("\\greenD","\\textcolor{##1fab54}{#1}");ee("\\greenE","\\textcolor{##0d923f}{#1}");ee("\\goldA","\\textcolor{##ffd0a9}{#1}");ee("\\goldB","\\textcolor{##ffbb71}{#1}");ee("\\goldC","\\textcolor{##ff9c39}{#1}");ee("\\goldD","\\textcolor{##e07d10}{#1}");ee("\\goldE","\\textcolor{##a75a05}{#1}");ee("\\redA","\\textcolor{##fca9a9}{#1}");ee("\\redB","\\textcolor{##ff8482}{#1}");ee("\\redC","\\textcolor{##f9685d}{#1}");ee("\\redD","\\textcolor{##e84d39}{#1}");ee("\\redE","\\textcolor{##bc2612}{#1}");ee("\\maroonA","\\textcolor{##ffbde0}{#1}");ee("\\maroonB","\\textcolor{##ff92c6}{#1}");ee("\\maroonC","\\textcolor{##ed5fa6}{#1}");ee("\\maroonD","\\textcolor{##ca337c}{#1}");ee("\\maroonE","\\textcolor{##9e034e}{#1}");ee("\\purpleA","\\textcolor{##ddd7ff}{#1}");ee("\\purpleB","\\textcolor{##c6b9fc}{#1}");ee("\\purpleC","\\textcolor{##aa87ff}{#1}");ee("\\purpleD","\\textcolor{##7854ab}{#1}");ee("\\purpleE","\\textcolor{##543b78}{#1}");ee("\\mintA","\\textcolor{##f5f9e8}{#1}");ee("\\mintB","\\textcolor{##edf2df}{#1}");ee("\\mintC","\\textcolor{##e0e5cc}{#1}");ee("\\grayA","\\textcolor{##f6f7f7}{#1}");ee("\\grayB","\\textcolor{##f0f1f2}{#1}");ee("\\grayC","\\textcolor{##e3e5e6}{#1}");ee("\\grayD","\\textcolor{##d6d8da}{#1}");ee("\\grayE","\\textcolor{##babec2}{#1}");ee("\\grayF","\\textcolor{##888d93}{#1}");ee("\\grayG","\\textcolor{##626569}{#1}");ee("\\grayH","\\textcolor{##3b3e40}{#1}");ee("\\grayI","\\textcolor{##21242c}{#1}");ee("\\kaBlue","\\textcolor{##314453}{#1}");ee("\\kaGreen","\\textcolor{##71B307}{#1}");var gk={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class wF{constructor(t,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new _F(xF,n.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new Y6(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,r,i;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:i,end:r}=this.consumeArg(["]"])}else({tokens:i,start:n,end:r}=this.consumeArg());return this.pushToken(new ks("EOF",r.loc)),this.pushTokens(i),new ks("",oi.range(n,r))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],r=t&&t.length>0;r||this.consumeSpaces();var i=this.future(),a,o=0,l=0;do{if(a=this.popToken(),n.push(a),a.text==="{")++o;else if(a.text==="}"){if(--o,o===-1)throw new ze("Extra }",a)}else if(a.text==="EOF")throw new ze("Unexpected end of input in a macro argument, expected '"+(t&&r?t[l]:"}")+"'",a);if(t&&r)if((o===0||o===1&&t[l]==="{")&&a.text===t[l]){if(++l,l===t.length){n.splice(-l,l);break}}else l=0}while(o!==0||r);return i.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:a}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new ze("The length of delimiters doesn't match the number of args!");for(var r=n[0],i=0;ithis.settings.maxExpand)throw new ze("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),r=n.text,i=n.noexpand?null:this._getExpansion(r);if(i==null||t&&i.unexpandable){if(t&&i==null&&r[0]==="\\"&&!this.isDefined(r))throw new ze("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var a=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var l=a.length-1;l>=0;--l){var c=a[l];if(c.text==="#"){if(l===0)throw new ze("Incomplete placeholder at end of macro body",c);if(c=a[--l],c.text==="#")a.splice(l+1,1);else if(/^[1-9]$/.test(c.text))a.splice(l,2,...o[+c.text-1]);else throw new ze("Not a valid argument number",c)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new ks(t)]):void 0}expandTokens(t){var n=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),n.push(i)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(r=>r.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var r=this.lexer.catcodes[t];if(r!=null&&r!==13)return}var i=typeof n=="function"?n(this):n;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var o=i.replace(/##/g,"");o.includes("#"+(a+1));)++a;for(var l=new Y6(i,this.settings),c=[],d=l.lex();d.text!=="EOF";)c.push(d),d=l.lex();c.reverse();var m={tokens:c,numArgs:a};return m}return i}isDefined(t){return this.macros.has(t)||Oo.hasOwnProperty(t)||An.math.hasOwnProperty(t)||An.text.hasOwnProperty(t)||gk.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Oo.hasOwnProperty(t)&&!Oo[t].primitive}}var Z6=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,U0=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Gg={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Q6={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class jp{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new wF(t,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new ze("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new ks("}")),this.gullet.pushTokens(t);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(t,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(jp.endOfExpression.has(i.text)||n&&i.text===n||t&&Oo[i.text]&&Oo[i.text].infix)break;var a=this.parseAtom(n);if(a){if(a.type==="internal")continue}else break;r.push(a)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(t){for(var n=-1,r,i=0;i=128)this.settings.strict&&(w9(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),o={type:"textord",mode:"text",loc:oi.range(t),text:n};else return null;if(this.consume(),a)for(var m=0;m0?{type:"text",value:E}:void 0),E===!1?g.lastIndex=C+1:(k!==C&&w.push({type:"text",value:d.value.slice(k,C)}),Array.isArray(E)?w.push(...E):E&&w.push(E),k=C+y[0].length,v=!0),!g.global)break;y=g.exec(d.value)}return v?(k?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=ew(e,"(");let a=ew(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function xk(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Rl(n)||fp(n))&&(!t||n!==47)}yk.peek=tP;function WF(){this.buffer()}function YF(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function XF(){this.buffer()}function KF(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ZF(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ws(this.sliceSerialize(e)).toLowerCase(),n.label=t}function QF(e){this.exit(e)}function JF(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ws(this.sliceSerialize(e)).toLowerCase(),n.label=t}function eP(e){this.exit(e)}function tP(){return"["}function yk(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),l(),o(),a+=i.move("]"),a}function nP(){return{enter:{gfmFootnoteCallString:WF,gfmFootnoteCall:YF,gfmFootnoteDefinitionLabelString:XF,gfmFootnoteDefinition:KF},exit:{gfmFootnoteCallString:ZF,gfmFootnoteCall:QF,gfmFootnoteDefinitionLabelString:JF,gfmFootnoteDefinition:eP}}}function rP(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:yk},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,o){const l=a.createTracker(o);let c=l.move("[^");const d=a.enter("footnoteDefinition"),m=a.enter("label");return c+=l.move(a.safe(a.associationId(r),{before:c,after:"]"})),m(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?` +`:" ")+a.indentLines(a.containerFlow(r,l.current()),t?wk:iP))),d(),c}}function iP(e,t,n){return t===0?e:wk(e,t,n)}function wk(e,t,n){return(n?"":" ")+e}const sP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Sk.peek=uP;function aP(){return{canContainEols:["delete"],enter:{strikethrough:lP},exit:{strikethrough:cP}}}function oP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:sP}],handlers:{delete:Sk}}}function lP(e){this.enter({type:"delete",children:[]},e)}function cP(e){this.exit(e)}function Sk(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function uP(){return"~"}function dP(e){return e.length}function hP(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||dP,a=[],o=[],l=[],c=[];let d=0,m=-1;for(;++md&&(d=e[m].length);++vc[v])&&(c[v]=y)}S.push(w)}o[m]=S,l[m]=x}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fc[f]&&(c[f]=w),b[f]=w),g[f]=y}o.splice(1,0,g),l.splice(1,0,b),m=-1;const k=[];for(;++m "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),mP);return i(),o}function mP(e,t,n){return">"+(n?"":" ")+e}function gP(e,t){return nw(e,t.inConstruct,!0)&&!nw(e,t.notInConstruct,!1)}function nw(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ro&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function bP(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 vP(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 _P(e,t,n,r){const i=vP(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(bP(e,n)){const f=n.enter("codeIndented"),g=n.indentLines(a,xP);return f(),g}const l=n.createTracker(r),c=i.repeat(Math.max(kk(a,i)+1,3)),d=n.enter("codeFenced");let m=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${o}`);m+=l.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);m+=l.move(" "),m+=l.move(n.safe(e.meta,{before:m,after:` `,encode:["`"],...l.current()})),f()}return m+=l.move(` `),a&&(m+=l.move(a+` -`)),m+=l.move(u),d(),m}function gP(e,t,n){return(n?"":" ")+e}function K_(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 bP(e,t,n,r){const i=K_(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("[");return d+=u.move(n.safe(n.associationId(e),{before:d,after:"]",...u.current()})),d+=u.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(l=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":` -`,...u.current()}))),l(),e.title&&(l=n.enter(`title${a}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),l()),o(),d}function vP(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 Ld(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Uf(e,t,n){const r=Yc(e),i=Yc(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ck.peek=_P;function Ck(e,t,n,r){const i=vP(n),a=n.enter("emphasis"),o=n.createTracker(r),l=o.move(i);let u=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const d=u.charCodeAt(0),m=Uf(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(u=Ld(d)+u.slice(1));const f=u.charCodeAt(u.length-1),g=Uf(r.after.charCodeAt(0),f,i);g.inside&&(u=u.slice(0,-1)+Ld(f));const b=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+u+b}function _P(e,t,n){return n.options.emphasis||"*"}function xP(e,t){let n=!1;return w_(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ob}),!!((!e.depth||e.depth<3)&&N_(e)&&(t.options.setext||n))}function yP(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(xP(e,n)){const m=n.enter("headingSetext"),f=n.enter("phrasing"),g=n.containerPhrasing(e,{...a.current(),before:` +`)),m+=l.move(c),d(),m}function xP(e,t,n){return(n?"":" ")+e}function e2(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 yP(e,t,n,r){const i=e2(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("[");return d+=c.move(n.safe(n.associationId(e),{before:d,after:"]",...c.current()})),d+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(e.url,{before:d,after:e.title?" ":` +`,...c.current()}))),l(),e.title&&(l=n.enter(`title${a}`),d+=c.move(" "+i),d+=c.move(n.safe(e.title,{before:d,after:i,...c.current()})),d+=c.move(i),l()),o(),d}function wP(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 Od(e){return"&#x"+e.toString(16).toUpperCase()+";"}function qf(e,t,n){const r=Yc(e),i=Yc(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ck.peek=SP;function Ck(e,t,n,r){const i=wP(n),a=n.enter("emphasis"),o=n.createTracker(r),l=o.move(i);let c=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const d=c.charCodeAt(0),m=qf(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(c=Od(d)+c.slice(1));const f=c.charCodeAt(c.length-1),g=qf(r.after.charCodeAt(0),f,i);g.inside&&(c=c.slice(0,-1)+Od(f));const b=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+c+b}function SP(e,t,n){return n.options.emphasis||"*"}function kP(e,t){let n=!1;return E_(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Bb}),!!((!e.depth||e.depth<3)&&D_(e)&&(t.options.setext||n))}function CP(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(kP(e,n)){const m=n.enter("headingSetext"),f=n.enter("phrasing"),g=n.containerPhrasing(e,{...a.current(),before:` `,after:` `});return f(),m(),g+` `+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(` -`))+1))}const o="#".repeat(i),l=n.enter("headingAtx"),u=n.enter("phrasing");a.move(o+" ");let d=n.containerPhrasing(e,{before:"# ",after:` -`,...a.current()});return/^[\t ]/.test(d)&&(d=Ld(d.charCodeAt(0))+d.slice(1)),d=d?o+" "+d:o,n.options.closeAtx&&(d+=" "+o),u(),l(),d}Ek.peek=wP;function Ek(e){return e.value||""}function wP(){return"<"}Ak.peek=SP;function Ak(e,t,n,r){const i=K_(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("![");return d+=u.move(n.safe(e.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(l=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),l(),e.title&&(l=n.enter(`title${a}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),l()),d+=u.move(")"),o(),d}function SP(){return"!"}Tk.peek=kP;function Tk(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");const d=n.safe(e.alt,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),o();const m=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return o(),n.stack=m,a(),i==="full"||!d||d!==f?u+=l.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function kP(){return"!"}Nk.peek=CP;function Nk(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a\u007F]/.test(e.url))}Mk.peek=EP;function Mk(e,t,n,r){const i=K_(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,u;if(jk(e,n)){const m=n.stack;n.stack=[],l=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),l(),n.stack=m,f}l=n.enter("link"),u=n.enter("label");let d=o.move("[");return d+=o.move(n.containerPhrasing(e,{before:d,after:"](",...o.current()})),d+=o.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=o.move("<"),d+=o.move(n.safe(e.url,{before:d,after:">",...o.current()})),d+=o.move(">")):(u=n.enter("destinationRaw"),d+=o.move(n.safe(e.url,{before:d,after:e.title?" ":")",...o.current()}))),u(),e.title&&(u=n.enter(`title${a}`),d+=o.move(" "+i),d+=o.move(n.safe(e.title,{before:d,after:i,...o.current()})),d+=o.move(i),u()),d+=o.move(")"),l(),d}function EP(e,t,n){return jk(e,n)?"<":"["}Rk.peek=AP;function Rk(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");const d=n.containerPhrasing(e,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),o();const m=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return o(),n.stack=m,a(),i==="full"||!d||d!==f?u+=l.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function AP(){return"["}function Z_(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 TP(e){const t=Z_(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 NP(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 Dk(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 jP(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?NP(n):Z_(n);const l=e.ordered?o==="."?")":".":TP(n);let u=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&m&&(!m.children||!m.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&&(u=!0),Dk(n)===o&&m){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(a+" ".repeat(o-a.length)),l.shift(o);const u=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,l.current()),m);return u(),d;function m(f,g,b){return g?(b?"":" ".repeat(o))+f:(b?a:a+" ".repeat(o-a.length))+f}}function DP(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const LP=hh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function OP(e,t,n,r){return(e.children.some(function(o){return LP(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function IP(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Lk.peek=zP;function Lk(e,t,n,r){const i=IP(n),a=n.enter("strong"),o=n.createTracker(r),l=o.move(i+i);let u=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const d=u.charCodeAt(0),m=Uf(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(u=Ld(d)+u.slice(1));const f=u.charCodeAt(u.length-1),g=Uf(r.after.charCodeAt(0),f,i);g.inside&&(u=u.slice(0,-1)+Ld(f));const b=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+u+b}function zP(e,t,n){return n.options.strong||"*"}function BP(e,t,n,r){return n.safe(e.value,r)}function HP(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 $P(e,t,n){const r=(Dk(n)+(n.options.ruleSpaces?" ":"")).repeat(HP(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Ok={blockquote:uP,break:ew,code:mP,definition:bP,emphasis:Ck,hardBreak:ew,heading:yP,html:Ek,image:Ak,imageReference:Tk,inlineCode:Nk,link:Mk,linkReference:Rk,list:jP,listItem:RP,paragraph:DP,root:OP,strong:Lk,text:BP,thematicBreak:$P};function FP(){return{enter:{table:PP,tableData:tw,tableHeader:tw,tableRow:qP},exit:{codeText:GP,table:UP,tableData:Wg,tableHeader:Wg,tableRow:Wg}}}function PP(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 UP(e){this.exit(e),this.data.inTable=void 0}function qP(e){this.enter({type:"tableRow",children:[]},e)}function Wg(e){this.exit(e)}function tw(e){this.enter({type:"tableCell",children:[]},e)}function GP(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,VP));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function VP(e,t){return t==="|"?t:e}function WP(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=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:g,table:o,tableCell:u,tableRow:l}};function o(b,k,S,x){return d(m(b,S,x),b.align)}function l(b,k,S,x){const _=f(b,S,x),w=d([_]);return w.slice(0,w.indexOf(` -`))}function u(b,k,S,x){const _=S.enter("tableCell"),w=S.enter("phrasing"),y=S.containerPhrasing(b,{...x,before:a,after:a});return w(),_(),y}function d(b,k){return lP(b,{align:k,alignDelimiters:r,padding:n,stringLength:i})}function m(b,k,S){const x=b.children;let _=-1;const w=[],y=k.enter("table");for(;++_0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const dU={tokenize:_U,partial:!0};function hU(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:gU,continuation:{tokenize:bU},exit:vU}},text:{91:{name:"gfmFootnoteCall",tokenize:mU},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:fU,resolveTo:pU}}}}function fU(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){o=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!o||!o._balanced)return n(u);const d=Es(r.sliceSerialize({start:o.end,end:r.now()}));return d.codePointAt(0)!==94||!a.includes(d.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function pU(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)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function mU(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,o;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(f){if(a>999||f===93&&!o||f===null||f===91||hn(f))return n(f);if(f===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return i.includes(Es(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return hn(f)||(o=!0),a++,e.consume(f),f===92?m:d}function m(f){return f===91||f===92||f===93?(e.consume(f),a++,d):d(f)}}function gU(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0,l;return u;function u(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(k)}function m(k){if(o>999||k===93&&!l||k===null||k===91||hn(k))return n(k);if(k===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return a=Es(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return hn(k)||(l=!0),o++,e.consume(k),k===92?f:m}function f(k){return k===91||k===92||k===93?(e.consume(k),o++,m):m(k)}function g(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),i.includes(a)||i.push(a),Nt(e,b,"gfmFootnoteDefinitionWhitespace")):n(k)}function b(k){return t(k)}}function bU(e,t,n){return e.check(mh,t,e.attempt(dU,t,n))}function vU(e){e.exit("gfmFootnoteDefinition")}function _U(e,t,n){const r=this;return Nt(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function xU(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,l){let u=-1;for(;++u1?u(k):(o.consume(k),f++,b);if(f<2&&!n)return u(k);const x=o.exit("strikethroughSequenceTemporary"),_=Yc(k);return x._open=!_||_===2&&!!S,x._close=!S||S===2&&!!_,l(k)}}}class yU{constructor(){this.map=[]}add(t,n,r){wU(this,t,n,r)}consume(t){if(this.map.sort(function(a,o){return a[0]-o[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 i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function wU(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const V=r.events[$][1].type;if(V==="lineEnding"||V==="linePrefix")$--;else break}const F=$>-1?r.events[$][1].type:null,U=F==="tableHead"||F==="tableRow"?E:u;return U===E&&r.parser.lazy[r.now().line]?n(z):U(z)}function u(z){return e.enter("tableHead"),e.enter("tableRow"),d(z)}function d(z){return z===124||(o=!0,a+=1),m(z)}function m(z){return z===null?n(z):st(z)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),b):n(z):Rt(z)?Nt(e,m,"whitespace")(z):(a+=1,o&&(o=!1,i+=1),z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),o=!0,m):(e.enter("data"),f(z)))}function f(z){return z===null||z===124||hn(z)?(e.exit("data"),m(z)):(e.consume(z),z===92?g:f)}function g(z){return z===92||z===124?(e.consume(z),f):f(z)}function b(z){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(z):(e.enter("tableDelimiterRow"),o=!1,Rt(z)?Nt(e,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):k(z))}function k(z){return z===45||z===58?x(z):z===124?(o=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),S):T(z)}function S(z){return Rt(z)?Nt(e,x,"whitespace")(z):x(z)}function x(z){return z===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),_):z===45?(a+=1,_(z)):z===null||st(z)?C(z):T(z)}function _(z){return z===45?(e.enter("tableDelimiterFiller"),w(z)):T(z)}function w(z){return z===45?(e.consume(z),w):z===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(z))}function y(z){return Rt(z)?Nt(e,C,"whitespace")(z):C(z)}function C(z){return z===124?k(z):z===null||st(z)?!o||i!==a?T(z):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(z)):T(z)}function T(z){return n(z)}function E(z){return e.enter("tableRow"),j(z)}function j(z){return z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),j):z===null||st(z)?(e.exit("tableRow"),t(z)):Rt(z)?Nt(e,j,"whitespace")(z):(e.enter("data"),N(z))}function N(z){return z===null||z===124||hn(z)?(e.exit("data"),j(z)):(e.consume(z),z===92?D:N)}function D(z){return z===92||z===124?(e.consume(z),N):N(z)}}function EU(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,u=0,d,m,f;const g=new yU;for(;++nn[2]+1){const k=n[2]+1,S=n[3]-n[2]-1;e.add(k,S,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(a.end=Object.assign({},Tc(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function rw(e,t,n,r,i){const a=[],o=Tc(t.events,n);i&&(i.end=Object.assign({},o),a.push(["exit",i,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function Tc(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const AU={name:"tasklistCheck",tokenize:NU};function TU(){return{text:{91:AU}}}function NU(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),a)}function a(u){return hn(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),o):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),o):n(u)}function o(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(u)}function l(u){return st(u)?t(u):Rt(u)?e.check({tokenize:jU},t,n)(u):n(u)}}function jU(e,t,n){return Nt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function MU(e){return XS([nU(),hU(),xU(e),kU(),TU()])}const RU={};function qk(e){const t=this,n=e||RU,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(MU(n)),a.push(QP()),o.push(JP(n))}function DU(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:o,mathTextData:l}};function e(u){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},u)}function t(){this.buffer()}function n(){const u=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=u}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(u){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),m=this.stack[this.stack.length-1];m.type,this.exit(u),m.value=d;const f=m.data.hChildren[0];f.type,f.tagName,f.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function a(u){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},u),this.buffer()}function o(u){const d=this.resume(),m=this.stack[this.stack.length-1];m.type,this.exit(u),m.value=d,m.data.hChildren.push({type:"text",value:d})}function l(u){this.config.enter.data.call(this,u),this.config.exit.data.call(this,u)}}function LU(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` -`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(a,o,l,u){const d=a.value||"",m=l.createTracker(u),f="$".repeat(Math.max(kk(d,"$")+1,2)),g=l.enter("mathFlow");let b=m.move(f);if(a.meta){const k=l.enter("mathFlowMeta");b+=m.move(l.safe(a.meta,{after:` +`))+1))}const o="#".repeat(i),l=n.enter("headingAtx"),c=n.enter("phrasing");a.move(o+" ");let d=n.containerPhrasing(e,{before:"# ",after:` +`,...a.current()});return/^[\t ]/.test(d)&&(d=Od(d.charCodeAt(0))+d.slice(1)),d=d?o+" "+d:o,n.options.closeAtx&&(d+=" "+o),c(),l(),d}Ek.peek=EP;function Ek(e){return e.value||""}function EP(){return"<"}Ak.peek=AP;function Ak(e,t,n,r){const i=e2(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("![");return d+=c.move(n.safe(e.alt,{before:d,after:"]",...c.current()})),d+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(e.url,{before:d,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${a}`),d+=c.move(" "+i),d+=c.move(n.safe(e.title,{before:d,after:i,...c.current()})),d+=c.move(i),l()),d+=c.move(")"),o(),d}function AP(){return"!"}Tk.peek=TP;function Tk(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const d=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),o();const m=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=m,a(),i==="full"||!d||d!==f?c+=l.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function TP(){return"!"}Nk.peek=NP;function Nk(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a\u007F]/.test(e.url))}Mk.peek=jP;function Mk(e,t,n,r){const i=e2(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(jk(e,n)){const m=n.stack;n.stack=[],l=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),l(),n.stack=m,f}l=n.enter("link"),c=n.enter("label");let d=o.move("[");return d+=o.move(n.containerPhrasing(e,{before:d,after:"](",...o.current()})),d+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=o.move("<"),d+=o.move(n.safe(e.url,{before:d,after:">",...o.current()})),d+=o.move(">")):(c=n.enter("destinationRaw"),d+=o.move(n.safe(e.url,{before:d,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),d+=o.move(" "+i),d+=o.move(n.safe(e.title,{before:d,after:i,...o.current()})),d+=o.move(i),c()),d+=o.move(")"),l(),d}function jP(e,t,n){return jk(e,n)?"<":"["}Rk.peek=MP;function Rk(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const d=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),o();const m=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=m,a(),i==="full"||!d||d!==f?c+=l.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function MP(){return"["}function t2(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 RP(e){const t=t2(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 DP(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 Dk(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 LP(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?DP(n):t2(n);const l=e.ordered?o==="."?")":".":RP(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&m&&(!m.children||!m.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),Dk(n)===o&&m){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(a+" ".repeat(o-a.length)),l.shift(o);const c=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,l.current()),m);return c(),d;function m(f,g,b){return g?(b?"":" ".repeat(o))+f:(b?a:a+" ".repeat(o-a.length))+f}}function zP(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const BP=fh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function HP(e,t,n,r){return(e.children.some(function(o){return BP(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function $P(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Lk.peek=FP;function Lk(e,t,n,r){const i=$P(n),a=n.enter("strong"),o=n.createTracker(r),l=o.move(i+i);let c=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const d=c.charCodeAt(0),m=qf(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(c=Od(d)+c.slice(1));const f=c.charCodeAt(c.length-1),g=qf(r.after.charCodeAt(0),f,i);g.inside&&(c=c.slice(0,-1)+Od(f));const b=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+c+b}function FP(e,t,n){return n.options.strong||"*"}function PP(e,t,n,r){return n.safe(e.value,r)}function UP(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 qP(e,t,n){const r=(Dk(n)+(n.options.ruleSpaces?" ":"")).repeat(UP(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Ok={blockquote:pP,break:rw,code:_P,definition:yP,emphasis:Ck,hardBreak:rw,heading:CP,html:Ek,image:Ak,imageReference:Tk,inlineCode:Nk,link:Mk,linkReference:Rk,list:LP,listItem:IP,paragraph:zP,root:HP,strong:Lk,text:PP,thematicBreak:qP};function GP(){return{enter:{table:VP,tableData:iw,tableHeader:iw,tableRow:YP},exit:{codeText:XP,table:WP,tableData:Xg,tableHeader:Xg,tableRow:Xg}}}function VP(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 WP(e){this.exit(e),this.data.inTable=void 0}function YP(e){this.enter({type:"tableRow",children:[]},e)}function Xg(e){this.exit(e)}function iw(e){this.enter({type:"tableCell",children:[]},e)}function XP(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,KP));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function KP(e,t){return t==="|"?t:e}function ZP(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=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:g,table:o,tableCell:c,tableRow:l}};function o(b,k,S,x){return d(m(b,S,x),b.align)}function l(b,k,S,x){const v=f(b,S,x),w=d([v]);return w.slice(0,w.indexOf(` +`))}function c(b,k,S,x){const v=S.enter("tableCell"),w=S.enter("phrasing"),y=S.containerPhrasing(b,{...x,before:a,after:a});return w(),v(),y}function d(b,k){return hP(b,{align:k,alignDelimiters:r,padding:n,stringLength:i})}function m(b,k,S){const x=b.children;let v=-1;const w=[],y=k.enter("table");for(;++v0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const mU={tokenize:SU,partial:!0};function gU(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:xU,continuation:{tokenize:yU},exit:wU}},text:{91:{name:"gfmFootnoteCall",tokenize:_U},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:bU,resolveTo:vU}}}}function bU(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const d=ws(r.sliceSerialize({start:o.end,end:r.now()}));return d.codePointAt(0)!==94||!a.includes(d.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function vU(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)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function _U(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,o;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(f){if(a>999||f===93&&!o||f===null||f===91||dn(f))return n(f);if(f===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return i.includes(ws(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return dn(f)||(o=!0),a++,e.consume(f),f===92?m:d}function m(f){return f===91||f===92||f===93?(e.consume(f),a++,d):d(f)}}function xU(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0,l;return c;function c(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(k)}function m(k){if(o>999||k===93&&!l||k===null||k===91||dn(k))return n(k);if(k===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return a=ws(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return dn(k)||(l=!0),o++,e.consume(k),k===92?f:m}function f(k){return k===91||k===92||k===93?(e.consume(k),o++,m):m(k)}function g(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),i.includes(a)||i.push(a),Tt(e,b,"gfmFootnoteDefinitionWhitespace")):n(k)}function b(k){return t(k)}}function yU(e,t,n){return e.check(gh,t,e.attempt(mU,t,n))}function wU(e){e.exit("gfmFootnoteDefinition")}function SU(e,t,n){const r=this;return Tt(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function kU(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,l){let c=-1;for(;++c1?c(k):(o.consume(k),f++,b);if(f<2&&!n)return c(k);const x=o.exit("strikethroughSequenceTemporary"),v=Yc(k);return x._open=!v||v===2&&!!S,x._close=!S||S===2&&!!v,l(k)}}}class CU{constructor(){this.map=[]}add(t,n,r){EU(this,t,n,r)}consume(t){if(this.map.sort(function(a,o){return a[0]-o[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 i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function EU(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const V=r.events[$][1].type;if(V==="lineEnding"||V==="linePrefix")$--;else break}const F=$>-1?r.events[$][1].type:null,U=F==="tableHead"||F==="tableRow"?E:c;return U===E&&r.parser.lazy[r.now().line]?n(z):U(z)}function c(z){return e.enter("tableHead"),e.enter("tableRow"),d(z)}function d(z){return z===124||(o=!0,a+=1),m(z)}function m(z){return z===null?n(z):st(z)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),b):n(z):Mt(z)?Tt(e,m,"whitespace")(z):(a+=1,o&&(o=!1,i+=1),z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),o=!0,m):(e.enter("data"),f(z)))}function f(z){return z===null||z===124||dn(z)?(e.exit("data"),m(z)):(e.consume(z),z===92?g:f)}function g(z){return z===92||z===124?(e.consume(z),f):f(z)}function b(z){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(z):(e.enter("tableDelimiterRow"),o=!1,Mt(z)?Tt(e,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):k(z))}function k(z){return z===45||z===58?x(z):z===124?(o=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),S):N(z)}function S(z){return Mt(z)?Tt(e,x,"whitespace")(z):x(z)}function x(z){return z===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),v):z===45?(a+=1,v(z)):z===null||st(z)?C(z):N(z)}function v(z){return z===45?(e.enter("tableDelimiterFiller"),w(z)):N(z)}function w(z){return z===45?(e.consume(z),w):z===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(z))}function y(z){return Mt(z)?Tt(e,C,"whitespace")(z):C(z)}function C(z){return z===124?k(z):z===null||st(z)?!o||i!==a?N(z):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(z)):N(z)}function N(z){return n(z)}function E(z){return e.enter("tableRow"),M(z)}function M(z){return z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),M):z===null||st(z)?(e.exit("tableRow"),t(z)):Mt(z)?Tt(e,M,"whitespace")(z):(e.enter("data"),T(z))}function T(z){return z===null||z===124||dn(z)?(e.exit("data"),M(z)):(e.consume(z),z===92?D:T)}function D(z){return z===92||z===124?(e.consume(z),T):T(z)}}function jU(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,d,m,f;const g=new CU;for(;++nn[2]+1){const k=n[2]+1,S=n[3]-n[2]-1;e.add(k,S,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(a.end=Object.assign({},Tc(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function aw(e,t,n,r,i){const a=[],o=Tc(t.events,n);i&&(i.end=Object.assign({},o),a.push(["exit",i,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function Tc(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const MU={name:"tasklistCheck",tokenize:DU};function RU(){return{text:{91:MU}}}function DU(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),a)}function a(c){return dn(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return st(c)?t(c):Mt(c)?e.check({tokenize:LU},t,n)(c):n(c)}}function LU(e,t,n){return Tt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function OU(e){return XS([aU(),gU(),kU(e),TU(),RU()])}const IU={};function qk(e){const t=this,n=e||IU,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(OU(n)),a.push(nU()),o.push(rU(n))}function zU(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:o,mathTextData:l}};function e(c){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},c)}function t(){this.buffer()}function n(){const c=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=c}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(c){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),m=this.stack[this.stack.length-1];m.type,this.exit(c),m.value=d;const f=m.data.hChildren[0];f.type,f.tagName,f.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function a(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function o(c){const d=this.resume(),m=this.stack[this.stack.length-1];m.type,this.exit(c),m.value=d,m.data.hChildren.push({type:"text",value:d})}function l(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function BU(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(a,o,l,c){const d=a.value||"",m=l.createTracker(c),f="$".repeat(Math.max(kk(d,"$")+1,2)),g=l.enter("mathFlow");let b=m.move(f);if(a.meta){const k=l.enter("mathFlowMeta");b+=m.move(l.safe(a.meta,{after:` `,before:b,encode:["$"],...m.current()})),k()}return b+=m.move(` `),d&&(b+=m.move(d+` -`)),b+=m.move(f),g(),b}function r(a,o,l){let u=a.value||"",d=1;for(t||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(u);)d++;const m="$".repeat(d);/[^ \r\n]/.test(u)&&(/^[ \r\n]/.test(u)&&/[ \r\n]$/.test(u)||/^\$|\$$/.test(u))&&(u=" "+u+" ");let f=-1;for(;++f]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}vh.displayName="c";vh.aliases=[];function vh(e){e.register(aa),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}Np.displayName="cpp";Np.aliases=[];function Np(e){e.register(vh),(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(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return n.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//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+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//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)}e2.displayName="arduino";e2.aliases=["ino"];function e2(e){e.register(Np),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}t2.displayName="bash";t2.aliases=["sh","shell"];function t2(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},i={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:i},{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:i},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:i.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:i.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 a=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=i.variable[1].inside,l=0;l>/g,function(G,W){return"(?:"+H[+W]+")"})}function r(O,H,G){return RegExp(n(O,H),"")}function i(O,H){for(var G=0;G>/g,function(){return"(?:"+O+")"});return O.replace(/<>/g,"[^\\s\\S]")}var a={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 o(O){return"\\b(?:"+O.trim().replace(/ /g,"|")+")\\b"}var l=o(a.typeDeclaration),u=RegExp(o(a.type+" "+a.typeDeclaration+" "+a.contextual+" "+a.other)),d=o(a.typeDeclaration+" "+a.contextual+" "+a.other),m=o(a.type+" "+a.typeDeclaration+" "+a.other),f=i(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),g=i(/\((?:[^()]|<>)*\)/.source,2),b=/@?\b[A-Za-z_]\w*\b/.source,k=n(/<<0>>(?:\s*<<1>>)?/.source,[b,f]),S=n(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,k]),x=/\[\s*(?:,\s*)*\]/.source,_=n(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[S,x]),w=n(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[f,g,x]),y=n(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=n(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,S,x]),T={keyword:u,punctuation:/[<>()?,.:[\]]/},E=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,j=/"(?:\\.|[^\\"\r\n])*"/.source,N=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;t.languages.csharp=t.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[N]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[j]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[S]),lookbehind:!0,inside:T},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[b,C]),lookbehind:!0,inside:T},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[b]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[l,k]),lookbehind:!0,inside:T},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[S]),lookbehind:!0,inside:T},{pattern:r(/(\bwhere\s+)<<0>>/.source,[b]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[_]),lookbehind:!0,inside:T},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,m,b]),inside:T}],keyword:u,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,[b]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[b]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[g]),lookbehind:!0,alias:"class-name",inside:T},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,S]),inside:T,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:T,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[b,f]),inside:{function:r(/^<<0>>/.source,[b]),generic:{pattern:RegExp(f),alias:"class-name",inside:T}}},"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,[l,k,b,C,u.source,g,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[k,g]),lookbehind:!0,greedy:!0,inside:t.languages.csharp},keyword:u,"class-name":{pattern:RegExp(C),greedy:!0,inside:T},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 D=j+"|"+E,z=n(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[D]),$=i(n(/[^"'/()]|<<0>>|\(<>*\)/.source,[z]),2),F=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,U=n(/<<0>>(?:\s*\(<<1>>*\))?/.source,[S,$]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[F,U]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[F]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[$]),inside:t.languages.csharp},"class-name":{pattern:RegExp(S),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var V=/:[^}\r\n]+/.source,X=i(n(/[^"'/()]|<<0>>|\(<>*\)/.source,[z]),2),Y=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,V]),Q=i(n(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[D]),2),te=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Q,V]);function I(O,H){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[O]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[H,V]),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,[Y]),lookbehind:!0,greedy:!0,inside:I(Y,X)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[te]),lookbehind:!0,greedy:!0,inside:I(te,Q)}],char:{pattern:RegExp(E),greedy:!0}}),t.languages.dotnet=t.languages.cs=t.languages.csharp})(e)}_h.displayName="markup";_h.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function _h(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\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://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 i={};i["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},i.cdata=/^$/i;var a={"included-cdata":{pattern://i,inside:i}};a["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var o={};o[n]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:a},e.languages.insertBefore("markup","cdata",o)}}),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}hu.displayName="css";hu.aliases=[];function hu(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)}r2.displayName="diff";r2.aliases=[];function r2(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 i=n[r],a=[];/^\w+$/.test(r)||a.push(/\w+/.exec(r)[0]),r==="diff"&&a.push("bold"),t.languages.diff[r]={pattern:RegExp("^(?:["+i+`].*(?:\r +`)),b+=m.move(f),g(),b}function r(a,o,l){let c=a.value||"",d=1;for(t||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(c);)d++;const m="$".repeat(d);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let f=-1;for(;++f]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}_h.displayName="c";_h.aliases=[];function _h(e){e.register(sa),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}Mp.displayName="cpp";Mp.aliases=[];function Mp(e){e.register(_h),(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(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return n.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//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+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//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)}i2.displayName="arduino";i2.aliases=["ino"];function i2(e){e.register(Mp),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}s2.displayName="bash";s2.aliases=["sh","shell"];function s2(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},i={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:i},{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:i},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:i.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:i.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 a=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=i.variable[1].inside,l=0;l>/g,function(G,W){return"(?:"+H[+W]+")"})}function r(O,H,G){return RegExp(n(O,H),"")}function i(O,H){for(var G=0;G>/g,function(){return"(?:"+O+")"});return O.replace(/<>/g,"[^\\s\\S]")}var a={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 o(O){return"\\b(?:"+O.trim().replace(/ /g,"|")+")\\b"}var l=o(a.typeDeclaration),c=RegExp(o(a.type+" "+a.typeDeclaration+" "+a.contextual+" "+a.other)),d=o(a.typeDeclaration+" "+a.contextual+" "+a.other),m=o(a.type+" "+a.typeDeclaration+" "+a.other),f=i(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),g=i(/\((?:[^()]|<>)*\)/.source,2),b=/@?\b[A-Za-z_]\w*\b/.source,k=n(/<<0>>(?:\s*<<1>>)?/.source,[b,f]),S=n(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,k]),x=/\[\s*(?:,\s*)*\]/.source,v=n(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[S,x]),w=n(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[f,g,x]),y=n(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=n(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,S,x]),N={keyword:c,punctuation:/[<>()?,.:[\]]/},E=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,M=/"(?:\\.|[^\\"\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,[M]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[S]),lookbehind:!0,inside:N},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[b,C]),lookbehind:!0,inside:N},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[b]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[l,k]),lookbehind:!0,inside:N},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[S]),lookbehind:!0,inside:N},{pattern:r(/(\bwhere\s+)<<0>>/.source,[b]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[v]),lookbehind:!0,inside:N},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,m,b]),inside:N}],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,[b]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[b]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[g]),lookbehind:!0,alias:"class-name",inside:N},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,S]),inside:N,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:N,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[b,f]),inside:{function:r(/^<<0>>/.source,[b]),generic:{pattern:RegExp(f),alias:"class-name",inside:N}}},"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,[l,k,b,C,c.source,g,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[k,g]),lookbehind:!0,greedy:!0,inside:t.languages.csharp},keyword:c,"class-name":{pattern:RegExp(C),greedy:!0,inside:N},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 D=M+"|"+E,z=n(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[D]),$=i(n(/[^"'/()]|<<0>>|\(<>*\)/.source,[z]),2),F=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,U=n(/<<0>>(?:\s*\(<<1>>*\))?/.source,[S,$]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[F,U]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[F]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[$]),inside:t.languages.csharp},"class-name":{pattern:RegExp(S),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var V=/:[^}\r\n]+/.source,X=i(n(/[^"'/()]|<<0>>|\(<>*\)/.source,[z]),2),Y=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,V]),Q=i(n(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[D]),2),te=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Q,V]);function I(O,H){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[O]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[H,V]),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,[Y]),lookbehind:!0,greedy:!0,inside:I(Y,X)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[te]),lookbehind:!0,greedy:!0,inside:I(te,Q)}],char:{pattern:RegExp(E),greedy:!0}}),t.languages.dotnet=t.languages.cs=t.languages.csharp})(e)}xh.displayName="markup";xh.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function xh(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\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://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 i={};i["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},i.cdata=/^$/i;var a={"included-cdata":{pattern://i,inside:i}};a["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var o={};o[n]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:a},e.languages.insertBefore("markup","cdata",o)}}),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}hu.displayName="css";hu.aliases=[];function hu(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)}o2.displayName="diff";o2.aliases=[];function o2(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 i=n[r],a=[];/^\w+$/.test(r)||a.push(/\w+/.exec(r)[0]),r==="diff"&&a.push("bold"),t.languages.diff[r]={pattern:RegExp("^(?:["+i+`].*(?:\r ?| -|(?![\\s\\S])))+`,"m"),alias:a,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)}i2.displayName="go";i2.aliases=[];function i2(e){e.register(aa),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"]}s2.displayName="ini";s2.aliases=[];function s2(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:/=/}}a2.displayName="java";a2.aliases=[];function a2(e){e.register(aa),(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,i={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":[i,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:i.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:i.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":i,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:i.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:i.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+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}o2.displayName="regex";o2.aliases=[];function o2(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]|.)/,i={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},o="(?:[^\\\\-]|"+r.source+")",l=RegExp(o+"-"+o),u={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:l,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":a,escape:r}},"special-escape":n,"char-set":i,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":u}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{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}l2.displayName="json";l2.aliases=["webmanifest"];function l2(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}c2.displayName="kotlin";c2.aliases=["kt","kts"];function c2(e){e.register(aa),(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)}u2.displayName="less";u2.aliases=[];function u2(e){e.register(hu),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"}})}d2.displayName="lua";d2.aliases=[];function d2(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:/[\[\](){},;]|\.+|:+/}}h2.displayName="makefile";h2.aliases=[];function h2(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:/[:;(){}]/}}f2.displayName="yaml";f2.aliases=["yml"];function f2(e){(function(t){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,i="(?:"+r.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+r.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function l(u,d){d=(d||"").replace(/m/g,"")+"m";var m=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return i}).replace(/<>/g,function(){return u});return RegExp(m,d)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return i})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return i}).replace(/<>/g,function(){return"(?:"+a+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:l(/\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:l(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:l(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:l(o),lookbehind:!0,greedy:!0},number:{pattern:l(/[+-]?(?: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)}p2.displayName="markdown";p2.aliases=["md"];function p2(e){e.register(_h),(function(t){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(l){return l=l.replace(//g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+l+")")}var i=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return i}),o=/\|?[ \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("^"+a+o+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+o+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(i),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(i),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__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\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(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.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(l){["url","bold","italic","strike","code-snippet"].forEach(function(u){l!==u&&(t.languages.markdown[l].inside.content.inside[u]=t.languages.markdown[u])})}),t.hooks.add("after-tokenize",function(l){if(l.language!=="markdown"&&l.language!=="md")return;function u(d){if(!(!d||typeof d=="string"))for(var m=0,f=d.length;m]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}g2.displayName="perl";g2.aliases=[];function g2(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)}Mp.displayName="markup-templating";Mp.aliases=[];function Mp(e){e.register(_h),(function(t){function n(r,i){return"___"+r.toUpperCase()+i+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,i,a,o){if(r.language===i){var l=r.tokenStack=[];r.code=r.code.replace(a,function(u){if(typeof o=="function"&&!o(u))return u;for(var d=l.length,m;r.code.indexOf(m=n(i,d))!==-1;)++d;return l[d]=u,m}),r.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(r,i){if(r.language!==i||!r.tokenStack)return;r.grammar=t.languages[i];var a=0,o=Object.keys(r.tokenStack);function l(u){for(var d=0;d=o.length);d++){var m=u[d];if(typeof m=="string"||m.content&&typeof m.content=="string"){var f=o[a],g=r.tokenStack[f],b=typeof m=="string"?m:m.content,k=n(i,f),S=b.indexOf(k);if(S>-1){++a;var x=b.substring(0,S),_=new t.Token(i,t.tokenize(g,r.grammar),"language-"+i,g),w=b.substring(S+k.length),y=[];x&&y.push.apply(y,l([x])),y.push(_),w&&y.push.apply(y,l([w])),typeof m=="string"?u.splice.apply(u,[d,1].concat(y)):m.content=y}}else m.content&&l(m.content)}return u}l(r.tokens)}}})})(e)}b2.displayName="php";b2.aliases=[];function b2(e){e.register(Mp),(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*\()/],i=/\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,a=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,o=/[{}\[\](),:;]/;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:i,operator:a,punctuation:o};var l={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php},u=[{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:l}},{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:l}}];t.languages.insertBefore("php","variable",{string:u,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:n,string:u,"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:i,operator:a,punctuation:o}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(d){if(/<\?/.test(d.code)){var m=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(d,"php",m)}}),t.hooks.add("after-tokenize",function(d){t.languages["markup-templating"].tokenizePlaceholders(d,"php")})})(e)}v2.displayName="python";v2.aliases=["py"];function v2(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}_2.displayName="r";_2.aliases=[];function _2(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:/[(){}\[\],;]/}}x2.displayName="ruby";x2.aliases=["rb"];function x2(e){e.register(aa),(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("|")+")",i=/(?:"(?:\\.|[^"\\\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+i),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+i+/(?=:(?!:))/.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)}y2.displayName="rust";y2.aliases=[];function y2(e){(function(t){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)n=n.replace(//g,function(){return n});n=n.replace(//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)}w2.displayName="sass";w2.aliases=[];function w2(e){e.register(hu),(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)}S2.displayName="scss";S2.aliases=[];function S2(e){e.register(hu),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}k2.displayName="sql";k2.aliases=[];function k2(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:/[;[\]()`,.]/}}C2.displayName="swift";C2.aliases=[];function C2(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})}E2.displayName="typescript";E2.aliases=["ts"];function E2(e){e.register(jp),(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)}Rp.displayName="basic";Rp.aliases=[];function Rp(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:/[,;:()]/}}A2.displayName="vbnet";A2.aliases=[];function A2(e){e.register(Rp),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 GU=["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"],sw={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 Vk(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}function VU(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function WU(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function aw(e){return WU(e)||Vk(e)}const YU=["","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 XU(e,t){const n={},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,i=[];let a=0,o=-1,l="",u,d;n.position&&("start"in n.position||"indent"in n.position?(d=n.position.indent,u=n.position.start):u=n.position);let m=(u?u.line:0)||1,f=(u?u.column:0)||1,g=k(),b;for(a--;++a<=e.length;)if(b===10&&(f=(d?d[o]:0)||1),b=e.charCodeAt(a),b===38){const _=e.charCodeAt(a+1);if(_===9||_===10||_===12||_===32||_===38||_===60||Number.isNaN(_)||r&&_===r){l+=String.fromCharCode(b),f++;continue}const w=a+1;let y=w,C=w,T;if(_===35){C=++y;const U=e.charCodeAt(C);U===88||U===120?(T="hexadecimal",C=++y):T="decimal"}else T="named";let E="",j="",N="";const D=T==="named"?aw:T==="decimal"?Vk:VU;for(C--;++C<=e.length;){const U=e.charCodeAt(C);if(!D(U))break;N+=String.fromCharCode(U),T==="named"&&GU.includes(N)&&(E=N,j=Md(N))}let z=e.charCodeAt(C)===59;if(z){C++;const U=T==="named"?Md(N):!1;U&&(E=N,j=U)}let $=1+C-w,F="";if(!(!z&&n.nonTerminated===!1))if(!N)T!=="named"&&S(4,$);else if(T==="named"){if(z&&!j)S(5,1);else if(E!==N&&(C=y+E.length,$=1+C-y,z=!1),!z){const U=E?1:3;if(n.attribute){const V=e.charCodeAt(C);V===61?(S(U,$),j=""):aw(V)?j="":S(U,$)}else S(U,$)}F=j}else{z||S(2,$);let U=Number.parseInt(N,T==="hexadecimal"?16:10);if(KU(U))S(7,$),F="�";else if(U in sw)S(6,$),F=sw[U];else{let V="";ZU(U)&&S(6,$),U>65535&&(U-=65536,V+=String.fromCharCode(U>>>10|55296),U=56320|U&1023),F=V+String.fromCharCode(U)}}if(F){x(),g=k(),a=C-1,f+=C-w+1,i.push(F);const U=k();U.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,F,{start:g,end:U},e.slice(w-1,C)),g=U}else N=e.slice(w-1,C),l+=N,f+=N.length,a=C-1}else b===10&&(m++,o++,f=0),Number.isNaN(b)?x():(l+=String.fromCharCode(b),f++);return i.join("");function k(){return{line:m,column:f,offset:a+((u?u.offset:0)||0)}}function S(_,w){let y;n.warning&&(y=k(),y.column+=w,y.offset+=w,n.warning.call(n.warningContext||void 0,YU[_],y,_))}function x(){l&&(i.push(l),n.text&&n.text.call(n.textContext||void 0,l,{start:g,end:k()}),l="")}}function KU(e){return e>=55296&&e<=57343||e>1114111}function ZU(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 QU=0,q0={},_r={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++QU}),e.__id},clone:function e(t,n){n=n||{};var r,i;switch(_r.util.type(t)){case"Object":if(i=_r.util.objId(t),n[i])return n[i];r={},n[i]=r;for(var a in t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case"Array":return i=_r.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(o,l){r[l]=e(o,n)}),r);default:return t}}},languages:{plain:q0,plaintext:q0,text:q0,txt:q0,extend:function(e,t){var n=_r.util.clone(_r.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||_r.languages;var i=r[e],a={};for(var o in i)if(i.hasOwnProperty(o)){if(o==t)for(var l in n)n.hasOwnProperty(l)&&(a[l]=n[l]);n.hasOwnProperty(o)||(a[o]=i[o])}var u=r[e];return r[e]=a,_r.languages.DFS(_r.languages,function(d,m){m===u&&d!=e&&(this[d]=a)}),a},DFS:function e(t,n,r,i){i=i||{};var a=_r.util.objId;for(var o in t)if(t.hasOwnProperty(o)){n.call(t,o,t[o],r||o);var l=t[o],u=_r.util.type(l);u==="Object"&&!i[a(l)]?(i[a(l)]=!0,e(l,n,null,i)):u==="Array"&&!i[a(l)]&&(i[a(l)]=!0,e(l,n,o,i))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(_r.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=_r.tokenize(r.code,r.grammar),_r.hooks.run("after-tokenize",r),yd.stringify(_r.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 i=new JU;return bf(i,i.head,e),Wk(e,i,t,i.head,0),tq(i)},hooks:{all:{},add:function(e,t){var n=_r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=_r.hooks.all[e];if(!(!n||!n.length))for(var r=0,i;i=n[r++];)i(t)}},Token:yd};function yd(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||"").length|0}function ow(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function Wk(e,t,n,r,i,a){for(var o in n)if(!(!n.hasOwnProperty(o)||!n[o])){var l=n[o];l=Array.isArray(l)?l:[l];for(var u=0;u=a.reach);_+=x.value.length,x=x.next){var w=x.value;if(t.length>e.length)return;if(!(w instanceof yd)){var y=1,C;if(g){if(C=ow(S,_,e,f),!C||C.index>=e.length)break;var N=C.index,T=C.index+C[0].length,E=_;for(E+=x.value.length;N>=E;)x=x.next,E+=x.value.length;if(E-=x.value.length,_=E,x.value instanceof yd)continue;for(var j=x;j!==t.tail&&(Ea.reach&&(a.reach=F);var U=x.prev;z&&(U=bf(t,U,z),_+=z.length),eq(t,U,y);var V=new yd(o,m?_r.tokenize(D,m):D,b,D);if(x=bf(t,U,V),$&&bf(t,x,$),y>1){var X={cause:o+","+u,reach:F};Wk(e,t,n,x.prev,_,X),a&&X.reach>a.reach&&(a.reach=X.reach)}}}}}}function JU(){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 bf(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function eq(e,t,n){for(var r=t.next,i=0;in)return e;try{return lt.highlight(e,t).children.map(Kk)}catch{return e}}const lw=/^\d+(?:,\d{3})*(?:\.\d+)?(?:\s*[–—-]\s*\$?\d+(?:,\d{3})*(?:\.\d+)?)?(?:\/[A-Za-z][A-Za-z0-9-]*)?/;function Qc(e,t,n){let r=t;for(;e[r]===n;)r+=1;return r-t}function Od(e,t){let n=0;for(let r=t-1;r>=0&&e[r]==="\\";r-=1)n+=1;return n%2===1}function mv(e){var o;let t=!1,n=0,r=0,i=0;for(;r[ \t]?/.exec(e.slice(r));if(l){r+=l[0].length,i+=1;continue}const u=/^ {0,3}(?:[-+*]|\d+[.)])[ \t]+/.exec(e.slice(r));if(!u)break;r+=u[0].length,n+=u[0].length,t=!0}const a=((o=/^[ \t]*/.exec(e.slice(r)))==null?void 0:o[0].length)??0;return{hasListMarker:t,indentation:a,listIndent:n,offset:r+a,quoteDepth:i}}function cq(e,t){const n=e[t];if(n!=="`"&&n!=="~"||Od(e,t)||Qc(e,t,n)<3)return!1;const r=e.lastIndexOf(` +|(?![\\s\\S])))+`,"m"),alias:a,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)}l2.displayName="go";l2.aliases=[];function l2(e){e.register(sa),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"]}c2.displayName="ini";c2.aliases=[];function c2(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:/=/}}u2.displayName="java";u2.aliases=[];function u2(e){e.register(sa),(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,i={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":[i,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:i.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:i.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":i,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:i.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:i.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+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}d2.displayName="regex";d2.aliases=[];function d2(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]|.)/,i={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},o="(?:[^\\\\-]|"+r.source+")",l=RegExp(o+"-"+o),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:l,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":a,escape:r}},"special-escape":n,"char-set":i,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:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{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}h2.displayName="json";h2.aliases=["webmanifest"];function h2(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}f2.displayName="kotlin";f2.aliases=["kt","kts"];function f2(e){e.register(sa),(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)}p2.displayName="less";p2.aliases=[];function p2(e){e.register(hu),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"}})}m2.displayName="lua";m2.aliases=[];function m2(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:/[\[\](){},;]|\.+|:+/}}g2.displayName="makefile";g2.aliases=[];function g2(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:/[:;(){}]/}}b2.displayName="yaml";b2.aliases=["yml"];function b2(e){(function(t){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,i="(?:"+r.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+r.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function l(c,d){d=(d||"").replace(/m/g,"")+"m";var m=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return i}).replace(/<>/g,function(){return c});return RegExp(m,d)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return i})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return i}).replace(/<>/g,function(){return"(?:"+a+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:l(/\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:l(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:l(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:l(o),lookbehind:!0,greedy:!0},number:{pattern:l(/[+-]?(?: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)}v2.displayName="markdown";v2.aliases=["md"];function v2(e){e.register(xh),(function(t){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(l){return l=l.replace(//g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+l+")")}var i=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return i}),o=/\|?[ \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("^"+a+o+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+o+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(i),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(i),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__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\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(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.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(l){["url","bold","italic","strike","code-snippet"].forEach(function(c){l!==c&&(t.languages.markdown[l].inside.content.inside[c]=t.languages.markdown[c])})}),t.hooks.add("after-tokenize",function(l){if(l.language!=="markdown"&&l.language!=="md")return;function c(d){if(!(!d||typeof d=="string"))for(var m=0,f=d.length;m]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}x2.displayName="perl";x2.aliases=[];function x2(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)}Dp.displayName="markup-templating";Dp.aliases=[];function Dp(e){e.register(xh),(function(t){function n(r,i){return"___"+r.toUpperCase()+i+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,i,a,o){if(r.language===i){var l=r.tokenStack=[];r.code=r.code.replace(a,function(c){if(typeof o=="function"&&!o(c))return c;for(var d=l.length,m;r.code.indexOf(m=n(i,d))!==-1;)++d;return l[d]=c,m}),r.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(r,i){if(r.language!==i||!r.tokenStack)return;r.grammar=t.languages[i];var a=0,o=Object.keys(r.tokenStack);function l(c){for(var d=0;d=o.length);d++){var m=c[d];if(typeof m=="string"||m.content&&typeof m.content=="string"){var f=o[a],g=r.tokenStack[f],b=typeof m=="string"?m:m.content,k=n(i,f),S=b.indexOf(k);if(S>-1){++a;var x=b.substring(0,S),v=new t.Token(i,t.tokenize(g,r.grammar),"language-"+i,g),w=b.substring(S+k.length),y=[];x&&y.push.apply(y,l([x])),y.push(v),w&&y.push.apply(y,l([w])),typeof m=="string"?c.splice.apply(c,[d,1].concat(y)):m.content=y}}else m.content&&l(m.content)}return c}l(r.tokens)}}})})(e)}y2.displayName="php";y2.aliases=[];function y2(e){e.register(Dp),(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*\()/],i=/\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,a=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,o=/[{}\[\](),:;]/;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:i,operator:a,punctuation:o};var l={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:l}},{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:l}}];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:i,operator:a,punctuation:o}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(d){if(/<\?/.test(d.code)){var m=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(d,"php",m)}}),t.hooks.add("after-tokenize",function(d){t.languages["markup-templating"].tokenizePlaceholders(d,"php")})})(e)}w2.displayName="python";w2.aliases=["py"];function w2(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}S2.displayName="r";S2.aliases=[];function S2(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:/[(){}\[\],;]/}}k2.displayName="ruby";k2.aliases=["rb"];function k2(e){e.register(sa),(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("|")+")",i=/(?:"(?:\\.|[^"\\\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+i),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+i+/(?=:(?!:))/.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)}C2.displayName="rust";C2.aliases=[];function C2(e){(function(t){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)n=n.replace(//g,function(){return n});n=n.replace(//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)}E2.displayName="sass";E2.aliases=[];function E2(e){e.register(hu),(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)}A2.displayName="scss";A2.aliases=[];function A2(e){e.register(hu),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}T2.displayName="sql";T2.aliases=[];function T2(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:/[;[\]()`,.]/}}N2.displayName="swift";N2.aliases=[];function N2(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})}j2.displayName="typescript";j2.aliases=["ts"];function j2(e){e.register(Rp),(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)}Lp.displayName="basic";Lp.aliases=[];function Lp(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:/[,;:()]/}}M2.displayName="vbnet";M2.aliases=[];function M2(e){e.register(Lp),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 XU=["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"],lw={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 Vk(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}function KU(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function ZU(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function cw(e){return ZU(e)||Vk(e)}const QU=["","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 JU(e,t){const n={},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,i=[];let a=0,o=-1,l="",c,d;n.position&&("start"in n.position||"indent"in n.position?(d=n.position.indent,c=n.position.start):c=n.position);let m=(c?c.line:0)||1,f=(c?c.column:0)||1,g=k(),b;for(a--;++a<=e.length;)if(b===10&&(f=(d?d[o]:0)||1),b=e.charCodeAt(a),b===38){const v=e.charCodeAt(a+1);if(v===9||v===10||v===12||v===32||v===38||v===60||Number.isNaN(v)||r&&v===r){l+=String.fromCharCode(b),f++;continue}const w=a+1;let y=w,C=w,N;if(v===35){C=++y;const U=e.charCodeAt(C);U===88||U===120?(N="hexadecimal",C=++y):N="decimal"}else N="named";let E="",M="",T="";const D=N==="named"?cw:N==="decimal"?Vk:KU;for(C--;++C<=e.length;){const U=e.charCodeAt(C);if(!D(U))break;T+=String.fromCharCode(U),N==="named"&&XU.includes(T)&&(E=T,M=Rd(T))}let z=e.charCodeAt(C)===59;if(z){C++;const U=N==="named"?Rd(T):!1;U&&(E=T,M=U)}let $=1+C-w,F="";if(!(!z&&n.nonTerminated===!1))if(!T)N!=="named"&&S(4,$);else if(N==="named"){if(z&&!M)S(5,1);else if(E!==T&&(C=y+E.length,$=1+C-y,z=!1),!z){const U=E?1:3;if(n.attribute){const V=e.charCodeAt(C);V===61?(S(U,$),M=""):cw(V)?M="":S(U,$)}else S(U,$)}F=M}else{z||S(2,$);let U=Number.parseInt(T,N==="hexadecimal"?16:10);if(eq(U))S(7,$),F="�";else if(U in lw)S(6,$),F=lw[U];else{let V="";tq(U)&&S(6,$),U>65535&&(U-=65536,V+=String.fromCharCode(U>>>10|55296),U=56320|U&1023),F=V+String.fromCharCode(U)}}if(F){x(),g=k(),a=C-1,f+=C-w+1,i.push(F);const U=k();U.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,F,{start:g,end:U},e.slice(w-1,C)),g=U}else T=e.slice(w-1,C),l+=T,f+=T.length,a=C-1}else b===10&&(m++,o++,f=0),Number.isNaN(b)?x():(l+=String.fromCharCode(b),f++);return i.join("");function k(){return{line:m,column:f,offset:a+((c?c.offset:0)||0)}}function S(v,w){let y;n.warning&&(y=k(),y.column+=w,y.offset+=w,n.warning.call(n.warningContext||void 0,QU[v],y,v))}function x(){l&&(i.push(l),n.text&&n.text.call(n.textContext||void 0,l,{start:g,end:k()}),l="")}}function eq(e){return e>=55296&&e<=57343||e>1114111}function tq(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 nq=0,G0={},vr={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++nq}),e.__id},clone:function e(t,n){n=n||{};var r,i;switch(vr.util.type(t)){case"Object":if(i=vr.util.objId(t),n[i])return n[i];r={},n[i]=r;for(var a in t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case"Array":return i=vr.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(o,l){r[l]=e(o,n)}),r);default:return t}}},languages:{plain:G0,plaintext:G0,text:G0,txt:G0,extend:function(e,t){var n=vr.util.clone(vr.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||vr.languages;var i=r[e],a={};for(var o in i)if(i.hasOwnProperty(o)){if(o==t)for(var l in n)n.hasOwnProperty(l)&&(a[l]=n[l]);n.hasOwnProperty(o)||(a[o]=i[o])}var c=r[e];return r[e]=a,vr.languages.DFS(vr.languages,function(d,m){m===c&&d!=e&&(this[d]=a)}),a},DFS:function e(t,n,r,i){i=i||{};var a=vr.util.objId;for(var o in t)if(t.hasOwnProperty(o)){n.call(t,o,t[o],r||o);var l=t[o],c=vr.util.type(l);c==="Object"&&!i[a(l)]?(i[a(l)]=!0,e(l,n,null,i)):c==="Array"&&!i[a(l)]&&(i[a(l)]=!0,e(l,n,o,i))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(vr.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=vr.tokenize(r.code,r.grammar),vr.hooks.run("after-tokenize",r),wd.stringify(vr.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 i=new rq;return vf(i,i.head,e),Wk(e,i,t,i.head,0),sq(i)},hooks:{all:{},add:function(e,t){var n=vr.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=vr.hooks.all[e];if(!(!n||!n.length))for(var r=0,i;i=n[r++];)i(t)}},Token:wd};function wd(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||"").length|0}function uw(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function Wk(e,t,n,r,i,a){for(var o in n)if(!(!n.hasOwnProperty(o)||!n[o])){var l=n[o];l=Array.isArray(l)?l:[l];for(var c=0;c=a.reach);v+=x.value.length,x=x.next){var w=x.value;if(t.length>e.length)return;if(!(w instanceof wd)){var y=1,C;if(g){if(C=uw(S,v,e,f),!C||C.index>=e.length)break;var T=C.index,N=C.index+C[0].length,E=v;for(E+=x.value.length;T>=E;)x=x.next,E+=x.value.length;if(E-=x.value.length,v=E,x.value instanceof wd)continue;for(var M=x;M!==t.tail&&(Ea.reach&&(a.reach=F);var U=x.prev;z&&(U=vf(t,U,z),v+=z.length),iq(t,U,y);var V=new wd(o,m?vr.tokenize(D,m):D,b,D);if(x=vf(t,U,V),$&&vf(t,x,$),y>1){var X={cause:o+","+c,reach:F};Wk(e,t,n,x.prev,v,X),a&&X.reach>a.reach&&(a.reach=X.reach)}}}}}}function rq(){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 vf(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function iq(e,t,n){for(var r=t.next,i=0;in)return null;try{return ot.highlight(e,t).children}catch{return null}}function Zk(e,t){var n;return e.type==="text"?e.value??"":e.type!=="element"?null:h.jsx("span",{className:(((n=e.properties)==null?void 0:n.className)??[]).join(" "),children:(e.children??[]).map(Zk)},t)}function fq(e,t,n=3e5){var r;return((r=Kk(e,t,n))==null?void 0:r.map(Zk))??e}function Qk(e,t,n=3e5){const r=Kk(e,t,n);if(!r)return e.split(` +`);const i=[];let a=[];const o=[];let l=0;const c=m=>{let f=m;for(let g=o.length-1;g>=0;g--)f=h.jsx("span",{className:o[g],children:f},l++);a.push(f)},d=m=>{var f;if(m.type==="text"){(m.value??"").split(` +`).forEach((g,b)=>{b>0&&(i.push(a),a=[]),g&&c(g)});return}m.type==="element"&&(o.push((((f=m.properties)==null?void 0:f.className)??[]).join(" ")),(m.children??[]).forEach(d),o.pop())};return r.forEach(d),i.push(a),i}function Jk(e){return Array.isArray(e)?e.length===0:e===""}const dw=/^\d+(?:,\d{3})*(?:\.\d+)?(?:\s*[–—-]\s*\$?\d+(?:,\d{3})*(?:\.\d+)?)?(?:\/[A-Za-z][A-Za-z0-9-]*)?/;function Qc(e,t,n){let r=t;for(;e[r]===n;)r+=1;return r-t}function Id(e,t){let n=0;for(let r=t-1;r>=0&&e[r]==="\\";r-=1)n+=1;return n%2===1}function vv(e){var o;let t=!1,n=0,r=0,i=0;for(;r[ \t]?/.exec(e.slice(r));if(l){r+=l[0].length,i+=1;continue}const c=/^ {0,3}(?:[-+*]|\d+[.)])[ \t]+/.exec(e.slice(r));if(!c)break;r+=c[0].length,n+=c[0].length,t=!0}const a=((o=/^[ \t]*/.exec(e.slice(r)))==null?void 0:o[0].length)??0;return{hasListMarker:t,indentation:a,listIndent:n,offset:r+a,quoteDepth:i}}function pq(e,t){const n=e[t];if(n!=="`"&&n!=="~"||Id(e,t)||Qc(e,t,n)<3)return!1;const r=e.lastIndexOf(` `,t-1)+1,i=e.indexOf(` -`,t),a=e.slice(r,i===-1?e.length:i),o=mv(a);return o.indentation<=3&&r+o.offset===t}function uq(e,t){const n=e[t],r=Qc(e,t,n),i=e.lastIndexOf(` +`,t),a=e.slice(r,i===-1?e.length:i),o=vv(a);return o.indentation<=3&&r+o.offset===t}function mq(e,t){const n=e[t],r=Qc(e,t,n),i=e.lastIndexOf(` `,t-1)+1,a=e.indexOf(` -`,t),o=mv(e.slice(i,a===-1?e.length:a));let l=e.indexOf(` -`,t+r);if(l===-1)return e.length;for(l+=1;l=o.listIndent&&f.indentation<=o.listIndent+3&&b>=r&&/^[ \t\r]*$/.test(e.slice(g+b,d)))return u===-1?e.length:u+1;if(u===-1)return e.length;l=u+1}return e.length}function dq(e,t,n){const r=Qc(e,t,"`");let i=t+r;for(;i")return i+1}return n?e.length:null}function fq(e){const t=[];for(let n=0;n|()[\]-]+$/.test(n)?/^[eE][+-]?\d+$/.test(n)||/[+*/=^_{}\\<>|()]/.test(n)?!0:/^[A-Za-z][A-Za-z0-9]*$/.test(n):!1:!0}function mq(e,{predictMath:t=!1}={}){const n=fq(e),r=new Set,i=new Set;for(let d=0;d=o.listIndent&&f.indentation<=o.listIndent+3&&b>=r&&/^[ \t\r]*$/.test(e.slice(g+b,d)))return c===-1?e.length:c+1;if(c===-1)return e.length;l=c+1}return e.length}function gq(e,t,n){const r=Qc(e,t,"`");let i=t+r;for(;i")return i+1}return n?e.length:null}function vq(e){const t=[];for(let n=0;n|()[\]-]+$/.test(n)?/^[eE][+-]?\d+$/.test(n)||/[+*/=^_{}\\<>|()]/.test(n)?!0:/^[A-Za-z][A-Za-z0-9]*$/.test(n):!1:!0}function xq(e,{predictMath:t=!1}={}){const n=vq(e),r=new Set,i=new Set;for(let d=0;d`$$${i}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,i)=>`$$${i}$$`);return t.predictMath&&(n=n.replace(/\\\[([\s\S]*)$/,(r,i)=>`$$${i}`).replace(/\\\(([\s\S]*)$/,(r,i)=>`$$${i}`)),mq(n,t)}function Zk(e,t={}){let n="",r=0,i=0;for(;i{var a;(a=navigator.clipboard)==null||a.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return h.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[h.jsx("button",{className:"md-code-copy absolute top-1.5 right-1.5 inline-flex items-center justify-center w-6.5 h-6.5 text-muted bg-background border border-border-variant rounded-sm opacity-0 transition-[opacity,color] duration-120 ease-standard [&:hover]:text-text [&:hover]:border-muted",title:"Copy","aria-label":"Copy code",onClick:i,children:n?h.jsx(Oi,{size:13}):h.jsx(n_,{size:13})}),h.jsx("pre",{children:h.jsx("code",{children:T2(e,t,gq)})})]})}function vq(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 uw(e,t,n){let r=t.line,i=t.column;for(let a=0;a]*?)\/?>/gi,r=[];let i=0,a=!1;for(const o of t.matchAll(n)){const l=(o[1]??"").toLowerCase(),u=vq(o[2]??"");if(!u[l==="run"?"id":"path"])continue;a=!0,o.index>i&&r.push({type:"text",value:t.slice(i,o.index),position:Yg(e,i,o.index)});const m=o.index+o[0].length;r.push({children:[],data:{hName:l==="run"?"run-mention":"file-mention",hProperties:u},position:Yg(e,o.index,m),type:l==="run"?"runMention":"fileMention"}),i=m}return a?(iQk(e)}function xq(){return e=>{const t=n=>{var r;for(const i of["href","src"])n.properties&&Object.hasOwn(n.properties,i)&&(n.properties[i]=f9(String(n.properties[i]||"")));(r=n.children)==null||r.forEach(t)};t(e)}}function hw({path:e,lines:t,exp:n,onOpenFile:r}){const i=e.split("/").pop()||e,a=t&&Number.parseInt(t,10)||void 0,o=a!=null?`${i}:${a}`:i;return h.jsxs("button",{className:"file-chip",title:`Open ${e}`,onClick:()=>r==null?void 0:r(e,a,n),disabled:!r,children:[h.jsx(tS,{size:12}),h.jsx("span",{className:"file-chip-label",children:o})]})}function yq({id:e,label:t,onOpenRun:n}){return h.jsxs("button",{className:"file-chip run-chip",title:`Open logs for run ${e}`,onClick:()=>n==null?void 0:n(e),disabled:!n,children:[h.jsx(s_,{size:12}),h.jsx("span",{className:"file-chip-label",children:t||"logs"})]})}const Jk={singleDollarTextMath:!0},wq=k_().use(M_).use(qk).use(Gk,Jk).use(_q).use(If).use(xq).use(_k);function Sq(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const eC={code:({node:e,className:t,children:n,...r})=>{const i=t??"",a=/language-(\w+)/.exec(i),o=String(n??"").replace(/\n$/,"");if(!(a!=null||o.includes(` -`)))return h.jsx("code",{className:i,...r,children:n});const u=a?fv(a[1]):null;return h.jsx(bq,{code:o,lang:u})},pre:({children:e})=>h.jsx(h.Fragment,{children:e})},za=R.memo(function({text:t,onOpenFile:n,onOpenRun:r,predict:i=!1}){const a=R.useMemo(()=>({"file-mention":o=>h.jsx(hw,{path:o.path,lines:o.lines,exp:o.exp,onOpenFile:n}),"run-mention":o=>h.jsx(yq,{id:o.id,label:o.label,onOpenRun:r}),a:({node:o,href:l,children:u,...d})=>l&&Sq(l)&&n?h.jsx(hw,{path:decodeURI(l),onOpenFile:n}):h.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",...d,children:u}),...eC}),[n,r]);return h.jsx("div",{"data-streaming":i||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-[color-mix(in_oklab,_var(--border)_50%,_transparent)] [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-[0.9em] [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-[1.05em] [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-[0.9em] [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-[1.05em] [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-[1.05em] [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-[1.05em] [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-[1.05em] [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:pl-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:pl-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-md [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-left [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-left [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pr-0 [&_blockquote]:pb-0.5 [&_blockquote]:pl-2.5 [&_blockquote]:border-l-[3px] [&_blockquote]:border-l-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text",children:h.jsx(PB,{content:Zk(t,{predictMath:i}),processor:wq,components:a,predict:i})})}),fw=["prompt-actions flex flex-wrap [&_.btn-primary]:inline-flex","[&_.btn-primary]:items-center [&_.btn-primary]:gap-1.5 [&_.btn-primary]:py-1.5 [&_.btn-primary]:px-[13px]","[&_.btn-primary]:font-[inherit] [&_.btn-primary]:text-sm","[&_.btn-primary]:font-semibold [&_.btn-primary]:rounded-sm","[&_.btn-primary]:cursor-pointer [&_.btn-primary]:transition-[background,border-color] [&_.btn-primary]:duration-80 [&_.btn-primary]:ease-standard","[&_.btn-ghost]:inline-flex [&_.btn-ghost]:items-center [&_.btn-ghost]:gap-1.5","[&_.btn-ghost]:py-1.5 [&_.btn-ghost]:px-[13px] [&_.btn-ghost]:font-[inherit] [&_.btn-ghost]:text-sm","[&_.btn-ghost]:font-semibold [&_.btn-ghost]:rounded-sm","[&_.btn-ghost]:cursor-pointer [&_.btn-ghost]:transition-[background,border-color] [&_.btn-ghost]:duration-80 [&_.btn-ghost]:ease-standard","[&_.btn-ghost]:border-border [&_button:disabled]:opacity-50","[&_button:disabled]:cursor-default plan-strip-actions gap-y-1.5 gap-x-2 justify-end","[&_.btn-primary]:bg-transparent [&_.btn-primary]:border [&_.btn-primary]:border-text","[&_.btn-primary]:text-text [&_.btn-ghost]:bg-transparent","[&_.btn-ghost]:border [&_.btn-ghost]:border-text [&_.btn-ghost]:text-text","[&_.btn-primary:hover:not(:disabled)]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]","[&_.btn-primary:hover:not(:disabled)]:border-text","[&_.btn-primary:hover:not(:disabled)]:text-text [&_.btn-primary:hover:not(:disabled)]:opacity-100","[&_.btn-ghost:hover:not(:disabled)]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]","[&_.btn-ghost:hover:not(:disabled)]:border-text","[&_.btn-ghost:hover:not(:disabled)]:text-text [&_.btn-ghost:hover:not(:disabled)]:opacity-100","[&_.plan-strip-primary]:bg-text [&_.plan-strip-primary]:border-text","[&_.plan-strip-primary]:text-background","[&_.plan-strip-primary:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--text)_85%,_var(--base))]","[&_.plan-strip-primary:hover:not(:disabled)]:border-text","[&_.plan-strip-primary:hover:not(:disabled)]:text-background","[&_.plan-strip-caret]:rounded-tl-none [&_.plan-strip-caret]:rounded-bl-none","[&_.plan-strip-caret]:py-0 [&_.plan-strip-caret]:px-1.5 [&_.plan-strip-caret]:flex","[&_.plan-strip-caret]:items-center","[&_.plan-strip-caret]:border-l [&_.plan-strip-caret]:border-l-[color-mix(in_oklab,_var(--base)_35%,_var(--text))]"].join(" ");function kq({synthesized:e,agentLabel:t,onView:n,onApprove:r,showResumeModes:i,onReject:a,onRevise:o}){const[l,u]=R.useState(!1),d=R.useRef(null),[m,f]=R.useState(!1),[g,b]=R.useState(""),k=R.useRef(null);R.useEffect(()=>{if(!l)return;const x=_=>{d.current&&!d.current.contains(_.target)&&u(!1)};return window.addEventListener("pointerdown",x),()=>window.removeEventListener("pointerdown",x)},[l]),R.useEffect(()=>{var x;m&&((x=k.current)==null||x.focus())},[m]);const S=()=>{o(g.trim()||"no specific feedback — use your judgment"),b(""),f(!1)};return h.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-l-[3px] border-l-accent-blue rounded-md bg-surface shadow-[0_2px_10px_rgb(0_0_0_/_6%)]",children:[h.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[h.jsx(s_,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),h.jsx("span",{className:"plan-strip-title text-md font-semibold whitespace-nowrap",children:e?`${t} is ready to proceed`:`${t} proposed a plan`}),h.jsx("button",{className:"plan-strip-open ml-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-md cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",onClick:n,children:"Open plan"})]}),m?h.jsxs(h.Fragment,{children:[h.jsx("textarea",{ref:k,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-md font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:"What should change? (optional)",rows:2,value:g,onChange:x=>b(x.target.value),onKeyDown:x=>{x.key==="Escape"?(x.preventDefault(),b(""),f(!1)):x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),S())}}),h.jsxs("div",{className:fw,children:[h.jsx("button",{className:"btn-ghost",onClick:()=>{b(""),f(!1)},children:"Back"}),h.jsx("span",{className:"plan-strip-spacer flex-1"}),h.jsxs("button",{className:"btn-primary plan-strip-primary",onClick:S,children:["Revise",h.jsx(J8,{size:13})]})]})]}):h.jsxs("div",{className:fw,children:[h.jsx("button",{className:"btn-ghost",onClick:a,children:"Reject"}),h.jsx("button",{className:"btn-ghost",onClick:()=>f(!0),children:"Revise…"}),h.jsx("span",{className:"plan-strip-spacer flex-1"}),i?h.jsxs("div",{className:"plan-strip-approve relative flex [&_.btn-primary:first-child]:rounded-tr-none [&_.btn-primary:first-child]:rounded-br-none",ref:d,children:[h.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>r("auto"),children:"Accept and auto mode"}),h.jsx("button",{className:"btn-primary plan-strip-primary plan-strip-caret","aria-label":"More approval options",onClick:()=>u(x=>!x),children:h.jsx(zl,{size:13})}),l&&h.jsx("div",{className:"plan-strip-menu absolute right-0 bottom-[calc(100%_+_4px)] flex flex-col min-w-47.5 p-1 border border-border rounded-md bg-surface shadow-[0_6px_20px_rgb(0_0_0_/_12%)] z-6 [&_button]:text-left [&_button]:py-[7px] [&_button]:px-[9px] [&_button]:border-0 [&_button]:rounded-sm [&_button]:bg-transparent [&_button]:text-text [&_button]:text-md [&_button]:cursor-pointer [&_button:hover]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]",children:h.jsx("button",{onClick:()=>{u(!1),r("bypassPermissions")},children:"Accept and bypass all"})})]}):h.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>r(),children:"Accept plan"})]})]})}function tC(){const[e,t]=R.useState(null),[n,r]=R.useState(null);return R.useEffect(()=>{let i=!1;const a=QD(o=>{i=!0,t(o)});return UR().then(o=>!i&&t(o)).catch(o=>r(o instanceof Error?o.message:String(o))),a},[]),{status:e,error:n,apply:t}}function Cq(){const{status:e}=tC(),[t,n]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null;return!r||t===r?null:h.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-xs text-text bg-surface border-b border-b-border",role:"status",children:[h.jsx(lh,{size:13,className:"shrink-0 text-subtext"}),h.jsxs("span",{className:"min-w-0",children:["Updated to ",h.jsx("strong",{className:"font-semibold",children:r}),". Restart to use it."]}),h.jsx("button",{type:"button",className:"ml-auto shrink-0 p-1 rounded-sm text-subtext hover:text-text hover:bg-highlight","aria-label":"Dismiss",onClick:()=>n(r),children:h.jsx(Yr,{size:13})})]})}const nC="orx:theme";function Eq(){try{const e=localStorage.getItem(nC);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let Id=Eq();const gv=new Set;function Aq(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function N2(){document.documentElement.dataset.theme=Aq(Id)}function Tq(e){Id=e;try{localStorage.setItem(nC,e)}catch{}N2();for(const t of gv)t()}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Id==="system"&&N2()});N2();function Nq(e){return gv.add(e),()=>gv.delete(e)}function jq(){return[R.useSyncExternalStore(Nq,()=>Id,()=>Id),Tq]}function rC({onSaved:e}){const[t,n]=R.useState(""),[r,i]=R.useState(!1),[a,o]=R.useState(null);async function l(u){if(u.preventDefault(),!(r||!t.trim())){i(!0),o(null);try{e(await vD(t.trim())),n("")}catch(d){o(d instanceof Error?d.message:String(d))}finally{i(!1)}}}return h.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:font-mono [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap",onSubmit:l,children:[h.jsx("input",{type:"password",value:t,onChange:u=>n(u.target.value),placeholder:"ghp_… personal access token",autoComplete:"off"}),h.jsx("button",{type:"submit",className:di,disabled:r||!t.trim(),children:r?"Checking…":"Save"}),h.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,workflow&description=orx",target:"_blank",rel:"noreferrer",children:"Create a token ↗"}),a&&h.jsx("div",{className:"error",children:a})]})}function Mq(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"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return"This machine";default:return e||"—"}}function Rq({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[h.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"}),h.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"}),h.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),h.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"}),h.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"}),h.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-0.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-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),h.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-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.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-0.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-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.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-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Dq({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[h.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"}),h.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)"}),h.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)"}),h.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"}),h.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"}),h.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)"}),h.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)"}),h.jsxs("defs",{children:[h.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#BFF9B4"}),h.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),h.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#80EE64"}),h.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),h.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),h.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),h.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),h.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),h.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),h.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#BFF9B4"}),h.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),h.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#80EE64"}),h.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),h.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),h.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),h.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),h.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),h.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function Lq({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:h.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-0.5-.623h-.804l-0.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-0.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-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.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-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.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-0.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-0.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-0.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 Oq({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:h.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function Iq({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[h.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),h.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function Dp({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:h.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-0.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-0.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 iC({kind:e,size:t=16}){switch(e){case"modal_job":return h.jsx(Dq,{size:t});case"hf_job":return h.jsx(Rq,{size:t});case"k8s_job":return h.jsx(Lq,{size:t});case"ssh_job":return h.jsx(r3,{size:t});case"slurm_job":return h.jsx(Rj,{size:t});case"ray_job":return h.jsx(Oq,{size:t});case"openresearch_job":return h.jsx(Iq,{size:t});case"local_job":return h.jsx(AM,{size:t});default:return h.jsx(r3,{size:t})}}function j2({backend:e}){const t=l_(e),n=GD(e);return t?h.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[h.jsx(iC,{kind:t}),h.jsx("span",{className:"backend-name",children:Mq(t)}),n&&h.jsx("span",{className:`backend-detail ${rn}`,children:n})]}):h.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function sC({value:e,max:t,label:n,caption:r,fillColor:i}){const a=t>0?Math.min(100,Math.round(e/t*100)):0;return h.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,children:[h.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:h.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${a}%`,background:i}})}),(n!==void 0||r!==void 0)&&h.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[h.jsx("span",{children:n??`${a}%`}),r]})]})}const pw={done:{className:"st-done",live:!1},failed:{className:"st-failed",live:!1},running:{className:"st-running",live:!0},starting:{className:"st-starting",live:!0},cancelling:{className:"st-cancelling",live:!0},cancelled:{className:"st-cancelled",live:!1},editing:{className:"st-editing",live:!0},idle:{className:"st-idle",live:!1}};function zq(e){return pw[e]??pw.idle}function Bq(e){return e.charAt(0).toUpperCase()+e.slice(1)}function La({status:e,label:t}){const n=zq(e);return h.jsxs("span",{className:`${p_} ${n.className}${n.live?" live":""}`,children:[h.jsx("span",{className:"dot"}),t??Bq(e)]})}const Ba=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Qs=["kv grid grid-cols-[auto_1fr] gap-y-[3px] gap-x-3.5 text-md","[&_.k]:text-subtext [&_.v]:font-mono [&_.v]:text-sm","[&_.v]:break-all"].join(" "),An=["settings-note mt-2.5 mx-0 mb-0 text-sm py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),xh=["form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-mono","[&_.repo-hint]:font-normal [&_.repo-hint]:text-xs","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-left","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-[0_2px_8px_rgb(0_0_0_/_5%)]","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-semibold [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-semibold","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pr-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:pl-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))]","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-left [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-md","[&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:font-mono [&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-md [&_.paper-pick_.title]:font-semibold","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-xs [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5 [&_.new-project-actions_.primary]:ml-auto","[&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),xl=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_p]:text-muted [&_p]:text-sm"].join(" "),mw=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-md [&_.kv_.v]:break-normal [&_.kv_.v.mono]:font-mono","[&_.kv_.v.mono]:text-sm [&_.kv_.v_.mono]:font-mono","[&_.kv_.v_.mono]:text-sm [&_.kv_.k.mono]:font-mono","[&_.kv_.k.mono]:text-sm [@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),Xg=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),rd=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function Kg(e){return e.agentReady?{cls:"ok",label:"Signed in"}:e.installed?e.authState==="unknown"?{cls:"warn",label:"Unable to verify"}:e.authState==="unsupported"?{cls:"warn",label:"Update required"}:{cls:"warn",label:"Not signed in"}:{cls:"warn",label:"Not installed"}}function Hq({h:e}){return e.authMethod?h.jsx(h.Fragment,{children:e.authMethod==="oauth"?"OAuth (subscription login)":"API key"}):h.jsx(h.Fragment,{children:"—"})}function $q(){const[e,t]=R.useState(null),[n,r]=R.useState("claude-code"),[i,a]=R.useState(!1),o=(u,d=!1)=>{a(!0),Mf(u,d).then(t).catch(()=>{}).finally(()=>a(!1))};R.useEffect(()=>o(!1),[]),R.useEffect(()=>u_(()=>o(!0)),[]);const l=e==null?void 0:e.find(u=>u.id===n);return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Harnesses"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",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."}),h.jsx("div",{className:"harness-tabs flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-md [&_button]:font-semibold [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(e??[]).map(u=>h.jsxs("button",{className:u.id===n?"active":"",onClick:()=>r(u.id),children:[u.name,h.jsx("span",{className:`harness-dot w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${Kg(u).cls}`})]},u.id))}),e?l?h.jsxs("div",{className:Ba,children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("span",{className:`${hr} ${Kg(l).cls}`,children:Kg(l).label}),h.jsx("div",{className:"spacer",style:{flex:1}}),h.jsxs("button",{className:rr,onClick:()=>o(!0,!0),disabled:i,children:[h.jsx(lh,{size:12,className:i?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," Refresh"]})]}),h.jsxs("div",{className:Qs,children:[h.jsx("span",{className:"k",children:"Binary"}),h.jsx("span",{className:"v",children:l.binPath??"not found on PATH"}),h.jsx("span",{className:"k",children:"Version"}),h.jsx("span",{className:"v",children:l.version??"—"}),h.jsx("span",{className:"k",children:"Auth"}),h.jsx("span",{className:"v",children:h.jsx(Hq,{h:l})}),l.account&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:l.id==="opencode"?"Providers":"Account"}),h.jsx("span",{className:"v",children:l.account})]}),l.org&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:"Org"}),h.jsx("span",{className:"v",children:l.org})]}),l.plan&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:"Plan"}),h.jsx("span",{className:"v",children:l.plan})]}),h.jsx("span",{className:"k",children:"Agent models"}),h.jsx("span",{className:"v",children:l.models.length>0?`${l.models.length} available — ${l.models.slice(0,4).map(u=>jf(u)).join(", ")}${l.models.length>4?", …":""}`:"none"})]}),!l.agentReady&&l.agentNote&&h.jsx("p",{className:An,children:l.agentNote})]}):null:h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Detecting harnesses…"]})]})}function Fq({s:e}){if(!e.configured)return h.jsx("span",{className:hr,children:"Not configured"});const t=e.preflight;return t.kubectlFound?t.reachable?t.canCreateJobs?h.jsx("span",{className:Ns,children:"Connected"}):h.jsx("span",{className:Ii,children:"No job-create permission"}):h.jsx("span",{className:Ii,children:"Cluster unreachable"}):h.jsx("span",{className:Ii,children:"kubectl not found"})}function Pq(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(""),[u,d]=R.useState(!1),[m,f]=R.useState(null),g=S=>{t(S),a(S.context??""),l(S.namespace)};R.useEffect(()=>{WR().then(g).catch(S=>r(S instanceof Error?S.message:String(S)))},[]);const b=e!==null&&i===(e.context??"")&&o.trim()===e.namespace;async function k(S){if(S.preventDefault(),!u){d(!0),f(null);try{g(await YR({context:i,namespace:o.trim()}))}catch(x){f(x instanceof Error?x.message:String(x))}finally{d(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on your own cluster with ",h.jsx("code",{children:"--backend k8s"}),". The run's resources (image, GPUs, topology) come from a manifest committed on the experiment branch (default ",h.jsx("code",{children:".orx/k8s.yaml"}),"); only the cluster context and namespace live here. Auth comes from your kubeconfig."]}),n?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Qs,children:[h.jsx("span",{className:"k",children:"Cluster"}),h.jsx("span",{className:"v",children:h.jsx(Fq,{s:e})})]}),e.preflight.error&&h.jsx("p",{className:An,children:e.preflight.error}),h.jsxs("form",{className:xh,onSubmit:k,children:[h.jsxs("div",{className:"row2",children:[h.jsxs("label",{children:["Context",h.jsxs("select",{value:i,onChange:S=>a(S.target.value),children:[h.jsxs("option",{value:"",children:["kubectl default",e.currentContext?` (${e.currentContext})`:""]}),e.contexts.map(S=>h.jsx("option",{value:S,children:S},S))]})]}),h.jsxs("label",{children:["Namespace",h.jsx("input",{className:rn,type:"text",value:o,onChange:S=>l(S.target.value),placeholder:"default",autoComplete:"off",spellCheck:!1})]})]}),m&&h.jsx("div",{className:"error",children:m}),h.jsx("div",{className:"actions",children:h.jsx("button",{type:"submit",className:Zr,disabled:u||b,children:u?"Saving…":"Save"})})]}),h.jsxs("div",{className:Ba,children:[h.jsx("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:h.jsx("h3",{children:"Run manifest"})}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Each run applies the manifest committed on its experiment branch — default"," ",h.jsx("code",{children:".orx/k8s.yaml"}),", or ",h.jsx("code",{children:"--manifest "}),". It declares whatever the run needs (image, GPU requests, an Indexed Job across nodes, extra Services, …); orx injects the run script as ",h.jsx("code",{children:"$ORX_SCRIPT"}),", the"," ",h.jsx("code",{children:"orx-env"})," Secret, run labels, and a default timeout, and requires exactly one Job (or one labelled ",h.jsx("code",{children:'orx-primary: "true"'}),") whose completion is the run's. Logs follow that Job's leader pod. Use"," ",h.jsx("code",{children:"{{ORX_RUN}}"})," in resource names to keep re-runs collision-free."]})]})]}):h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Checking kubectl…"]})]})}const Uq={env:"MODAL_TOKEN_ID env var",syncedEnv:"~/.openresearch/env",modalToml:"~/.modal.toml (modal token new)"};function qq({s:e}){return e.ready?h.jsx("span",{className:Ns,children:"Connected"}):!e.tokenConfigured&&!e.modalImportable?h.jsx("span",{className:hr,children:"Not set up"}):e.modalImportable?e.tokenConfigured?h.jsx("span",{className:hr,children:"Unknown"}):h.jsx("span",{className:Ii,children:"No token"}):h.jsx("span",{className:Ii,children:e.envProvisioned?"Env broken":"Env not built"})}function Gq(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(!1),[o,l]=R.useState(null);R.useEffect(()=>{XR().then(t).catch(d=>r(d instanceof Error?d.message:String(d)))},[]);async function u(){if(!i){a(!0),l(null);try{t(await KR())}catch(d){l(d instanceof Error?d.message:String(d))}finally{a(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Serverless GPUs on your own Modal account with"," ",h.jsx("code",{children:"--backend modal --flavor "})," (t4, a10g, a100-80gb, h100, …). orx manages a dedicated Python env with the Modal SDK; sandboxes scale to zero between runs."]}),n?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Qs,children:[h.jsx("span",{className:"k",children:"Status"}),h.jsx("span",{className:"v",children:h.jsx(qq,{s:e})}),h.jsx("span",{className:"k",children:"Environment"}),h.jsx("span",{className:"v",children:e.modalImportable?"Ready":e.envProvisioned?"Provisioned (modal import failing)":"Not built yet"}),h.jsx("span",{className:"k",children:"Token"}),h.jsx("span",{className:"v",children:e.tokenSource?Uq[e.tokenSource]:"Not configured"})]}),!e.tokenConfigured&&h.jsxs("p",{className:An,children:["No Modal token found. Run ",h.jsx("code",{children:"modal token new"}),", or add"," ",h.jsx("code",{children:"MODAL_TOKEN_ID"})," and ",h.jsx("code",{children:"MODAL_TOKEN_SECRET"})," in the Environment tab."]}),e.error&&e.envProvisioned&&!e.modalImportable&&h.jsx("p",{className:An,children:e.error}),o&&h.jsx("div",{className:"error",children:o}),!e.modalImportable&&h.jsx("div",{className:"actions",children:h.jsx("button",{className:Zr,onClick:()=>void u(),disabled:i,children:i?"Setting up… (~30–60s)":"Set up environment"})})]}):h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Checking Modal…"]})]})}function Vq({test:e}){if(e===void 0)return h.jsx("span",{className:"muted text-muted",children:"never tested"});if(e==="testing")return h.jsx("span",{className:Pt});const t=e.reachable?e.toolsFound?h.jsx("span",{className:Ns,children:"Ready"}):h.jsx("span",{className:Ii,children:"Missing bash/tar"}):h.jsx("span",{className:Ii,title:e.error??void 0,children:"Unreachable"});return h.jsxs(h.Fragment,{children:[t,h.jsx("span",{className:"ssh-tested-at block mt-0.5 text-muted text-xs",children:Zs(e.testedAt)})]})}function Wq(){const[e,t]=R.useState(null),[n,r]=R.useState({});R.useEffect(()=>{nD().then(t).catch(()=>t([]))},[]);async function i(a){r(o=>({...o,[a]:"testing"}));try{const o=await rD(a);r(l=>({...l,[a]:o}))}catch(o){r(l=>({...l,[a]:{reachable:!1,toolsFound:!1,error:o instanceof Error?o.message:String(o),testedAt:Date.now()}}))}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run experiments directly on your own boxes with"," ",h.jsx("code",{children:"--backend ssh --host "}),". Hosts come from"," ",h.jsx("code",{children:"~/.ssh/config"}),"; auth uses your keys/agent (orx never reads a key). The host just needs ",h.jsx("code",{children:"git"})," and ",h.jsx("code",{children:"bash"}),"."]}),e===null?h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Reading ~/.ssh/config…"]}):e.length===0?h.jsx("p",{className:"settings-empty text-muted text-md mt-1 mx-0 mb-0",children:"No hosts found in ~/.ssh/config."}):h.jsxs("table",{className:"flavor-table w-full border-collapse text-md [&_th]:pt-[5px] [&_th]:pr-2.5 [&_th]:pb-[5px] [&_th]:pl-0 [&_th]:border-b [&_th]:border-b-border [&_th]:text-left [&_th]:font-medium [&_th]:text-text [&_td]:pt-[5px] [&_td]:pr-2.5 [&_td]:pb-[5px] [&_td]:pl-0 [&_td]:border-b [&_td]:border-b-border-variant ssh-table table-fixed [&_th:nth-child(1)]:w-[20%] [&_th:nth-child(2)]:w-[26%] [&_th:nth-child(4)]:w-27 [&_th:nth-child(5)]:w-13 [&_td]:wrap-anywhere [&_td:last-child]:pr-0 [&_td:last-child]:text-right",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Host"}),h.jsx("th",{children:"Address"}),h.jsx("th",{children:"Identity"}),h.jsx("th",{children:"Status"}),h.jsx("th",{})]})}),h.jsx("tbody",{children:e.map(a=>h.jsxs("tr",{children:[h.jsx("td",{className:rn,children:a.host}),h.jsxs("td",{className:`${rn} muted text-muted`,children:[[a.user,a.hostname??"—"].filter(Boolean).join("@"),a.port?`:${a.port}`:""]}),h.jsx("td",{className:`${rn} muted text-muted`,children:a.identityFile??"—"}),h.jsx("td",{children:h.jsx(Vq,{test:n[a.host]??a.lastTest})}),h.jsx("td",{children:h.jsx("button",{className:rr,onClick:()=>void i(a.host),disabled:n[a.host]==="testing",children:"Test"})})]},a.host))})]})]})}function Yq({test:e}){return e===null?null:e==="testing"?h.jsx("span",{className:Pt}):e.reachable?e.slurmFound?e.toolsFound?h.jsx("span",{className:Ns,children:"Ready"}):h.jsx("span",{className:Ii,children:"Missing bash/tar"}):h.jsx("span",{className:Ii,children:"No Slurm CLI"}):h.jsx("span",{className:Ii,title:e.error??void 0,children:"Unreachable"})}function Xq(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(""),[u,d]=R.useState(""),[m,f]=R.useState(""),[g,b]=R.useState(!1),[k,S]=R.useState(null),[x,_]=R.useState(null),w=x!==null&&x!=="testing"?x:null,y=j=>{t(j),a(j.host??""),l(j.partition??""),d(j.account??""),f(j.timeLimit??"")};R.useEffect(()=>{iD().then(y).catch(j=>r(j instanceof Error?j.message:String(j)))},[]);const C=e!==null&&i===(e.host??"")&&o.trim()===(e.partition??"")&&u.trim()===(e.account??"")&&m.trim()===(e.timeLimit??"");async function T(j){if(j.preventDefault(),!g){b(!0),S(null);try{y(await sD({host:i,partition:o.trim(),account:u.trim(),timeLimit:m.trim()}))}catch(N){S(N instanceof Error?N.message:String(N))}finally{b(!1)}}}async function E(j){_("testing");try{_(await aD(j))}catch(N){_({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:N instanceof Error?N.message:String(N)})}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on your own cluster with ",h.jsx("code",{children:"--backend slurm [--flavor h100:2]"}),". orx submits via ",h.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?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[(w==null?void 0:w.error)&&h.jsx("p",{className:An,children:w.error}),w&&w.partitions.length>0&&h.jsxs("p",{className:An,children:["Partitions: ",h.jsx("code",{children:w.partitions.join(", ")})]}),h.jsxs("form",{className:xh,onSubmit:T,children:[h.jsxs("div",{className:"row2",children:[h.jsxs("label",{children:["Login node",h.jsxs("select",{value:i,onChange:j=>{a(j.target.value),_(null)},children:[h.jsx("option",{value:"",children:"not set (pass --host per launch)"}),i&&!e.hosts.some(j=>j.host===i)&&h.jsxs("option",{value:i,children:[i," (not in ~/.ssh/config)"]}),e.hosts.map(j=>h.jsx("option",{value:j.host,children:j.host},j.host))]})]}),h.jsxs("label",{children:["Partition",h.jsx("input",{className:rn,type:"text",list:"slurm-partitions",value:o,onChange:j=>l(j.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1}),h.jsx("datalist",{id:"slurm-partitions",children:w==null?void 0:w.partitions.map(j=>h.jsx("option",{value:j},j))})]})]}),h.jsxs("div",{className:"row2",children:[h.jsxs("label",{children:["Account",h.jsx("input",{className:rn,type:"text",value:u,onChange:j=>d(j.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1})]}),h.jsxs("label",{children:["Time limit",h.jsx("input",{className:rn,type:"text",value:m,onChange:j=>f(j.target.value),placeholder:"cluster default (e.g. 4h, 30m)",autoComplete:"off",spellCheck:!1})]})]}),k&&h.jsx("div",{className:"error",children:k}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"submit",className:Zr,disabled:g||C,children:g?"Saving…":"Save"}),h.jsx("button",{type:"button",className:di,onClick:()=>void E(i),disabled:!i||x==="testing",title:i?void 0:"Pick a login node first",children:"Test connection"}),h.jsx(Yq,{test:x})]})]})]}):h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Loading slurm settings…"]})]})}function Kq(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,d]=R.useState(null),[m,f]=R.useState(null),g=m!==null&&m!=="testing"?m:null,b=_=>{t(_),a(_.address??"")};R.useEffect(()=>{oD().then(b).catch(_=>r(_ instanceof Error?_.message:String(_)))},[]);const k=e!==null&&i===(e.address??"");async function S(_){if(_.preventDefault(),!o){l(!0),d(null);try{b(await lD({address:i}))}catch(w){d(w instanceof Error?w.message:String(w))}finally{l(!1)}}}async function x(){f("testing");try{f(await cD(i.trim()||void 0))}catch(_){f({reachable:!1,address:i.trim()||"(unknown)",rayVersion:null,error:_ instanceof Error?_.message:String(_)})}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on a Ray cluster with ",h.jsx("code",{children:"--backend ray [--flavor gpu:1]"}),". orx submits via the Ray Jobs API (Dashboard URL). Address resolution: this setting, then ",h.jsx("code",{children:"ASTROAI_RAY_JOBS_ADDRESS"})," /"," ",h.jsx("code",{children:"RAY_DASHBOARD_URL"}),", then ",h.jsx("code",{children:"http://127.0.0.1:8265"}),". Optional flavor maps to entrypoint CPUs/GPUs/memory (e.g."," ",h.jsx("code",{children:"cpu:2"}),", ",h.jsx("code",{children:"gpu:1,mem:8GiB"}),")."]}),n?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:An,children:["Effective: ",h.jsx("code",{children:e.resolvedAddress})," (",e.source,")"]}),(g==null?void 0:g.error)&&h.jsx("p",{className:An,children:g.error}),(g==null?void 0:g.reachable)&&g.rayVersion&&h.jsxs("p",{className:An,children:["Ray version: ",h.jsx("code",{children:g.rayVersion})]}),h.jsxs("form",{className:xh,onSubmit:S,children:[h.jsxs("label",{children:["Jobs / Dashboard URL",h.jsx("input",{className:rn,type:"text",value:i,onChange:_=>{a(_.target.value),f(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),u&&h.jsx("div",{className:"error",children:u}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"submit",className:Zr,disabled:o||k,children:o?"Saving…":"Save"}),h.jsx("button",{type:"button",className:di,onClick:()=>void x(),disabled:m==="testing",children:"Test connection"}),h.jsx(Zq,{test:m})]})]})]}):h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Loading Ray settings…"]})]})}function Zq({test:e}){return e===null?null:e==="testing"?h.jsx("span",{className:hr,children:"Testing…"}):e.reachable?h.jsx("span",{className:Ns,children:"Reachable"}):h.jsx("span",{className:f_,children:"Unreachable"})}function Qq(){const[e,t]=R.useState(null),[n,r]=R.useState(null);return R.useEffect(()=>{dD().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]),h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run experiments as detached, supervised processes on the machine running orx with"," ",h.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?h.jsx("div",{className:"error",children:n}):e?h.jsxs("div",{className:Qs,children:[h.jsx("span",{className:"k",children:"Hostname"}),h.jsx("span",{className:`v ${rn}`,children:e.hostname}),h.jsx("span",{className:"k",children:"System"}),h.jsxs("span",{className:"v",children:[e.os,"/",e.arch,e.chip?` — ${e.chip}`:""]}),h.jsx("span",{className:"k",children:"CPU"}),h.jsx("span",{className:"v",children:e.cpuCount>0?`${e.cpuCount} cores`:"—"}),h.jsx("span",{className:"k",children:"RAM"}),h.jsx("span",{className:"v",children:e.memBytes!==null?Lo(e.memBytes):"—"}),h.jsx("span",{className:"k",children:"GPUs"}),h.jsx("span",{className:"v",children:e.gpus.length===0?"none detected (nvidia-smi)":e.gpus.map(i=>`${i.name}${i.memMib!==null?` — ${Lo(i.memMib*1024*1024)}`:""}`).join(", ")})]}):h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Detecting hardware…"]})]})}function Jq(){const[e,t]=R.useState(null),[n,r]=R.useState(null);return R.useEffect(()=>{hD().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]),h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on an ephemeral OpenResearch box billed to your org with"," ",h.jsx("code",{children:"--backend openresearch --flavor "})," (h100_sxm, cpu5c, …; browse with ",h.jsx("code",{children:"orx compute"}),"). The box is provisioned for the run and deleted when it ends. Needs ",h.jsx("code",{children:"orx login"})," and a registered SSH key."]}),n?h.jsx("div",{className:"error",children:n}):e?e.loggedIn?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Qs,children:[h.jsx("span",{className:"k",children:"Status"}),h.jsx("span",{className:"v",children:h.jsx("span",{className:Ns,children:"Signed in"})}),h.jsx("span",{className:"k",children:"Orgs"}),h.jsx("span",{className:"v",children:e.orgs.length>0?e.orgs.join(", "):"—"}),h.jsx("span",{className:"k",children:"SSH key"}),h.jsx("span",{className:"v",children:e.sshKeyStatus==="matched"?h.jsx("span",{className:Ns,children:"On this computer"}):e.sshKeyStatus==="no_local_match"?h.jsx("span",{className:f_,children:"Not on this computer"}):e.sshKeyStatus==="none_registered"?h.jsx("span",{className:Ii,children:"None registered"}):h.jsx("span",{className:hr,children:"Unknown"})})]}),e.sshKeyStatus==="none_registered"&&(e.sshKeyPath?h.jsxs("p",{className:An,children:["Add one with ",h.jsxs("code",{children:["orx ssh-key add ",e.sshKeyPath]}),"."]}):h.jsxs("p",{className:An,children:["No key on this computer yet — create one with"," ",h.jsx("code",{children:"ssh-keygen -t ed25519"}),", then add it with"," ",h.jsx("code",{children:"orx ssh-key add"}),"."]})),e.sshKeyStatus==="no_local_match"&&(e.sshKeyPath?h.jsxs("p",{className:An,children:["Register this computer with ",h.jsxs("code",{children:["orx ssh-key add ",e.sshKeyPath]}),", or load a registered key with ",h.jsx("code",{children:"ssh-add"}),"."]}):h.jsxs("p",{className:An,children:["No key on this computer to register — load a registered key with"," ",h.jsx("code",{children:"ssh-add"}),", or create one with"," ",h.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),e.error&&h.jsx("p",{className:An,children:e.error})]}):h.jsxs("p",{className:An,children:["Not signed in. Run ",h.jsx("code",{children:"orx login"})," in a terminal to connect your OpenResearch account."]}):h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Checking credentials…"]})]})}const gw={local:"This machine",hf:"HF Jobs",modal:"Modal",k8s:"Kubernetes",ssh:"SSH",slurm:"Slurm",ray:"Ray",openresearch:"OpenResearch"},eG={local:"local_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},tG=["hf","modal","slurm","ray","openresearch"],bw=["hf","modal","openresearch"],vw={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"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]};function nG({t:e,isDefault:t}){return e.id==="local"?h.jsx("span",{className:Ns,children:"Ready"}):e.unverified?h.jsx("span",{className:hr,children:"Unknown"}):!e.configured&&t?h.jsx("span",{className:f_,children:"Not configured"}):e.configured?h.jsx("span",{className:Ns,children:"Configured"}):h.jsx("span",{className:hr,children:"Not set up"})}function rG({target:e,flavor:t,projectId:n,onSaved:r}){var g;const[i,a]=R.useState(t??""),[o,l]=R.useState(!1),[u,d]=R.useState(null);R.useEffect(()=>a(t??""),[t]);async function m(b){if(b.preventDefault(),!o){l(!0),d(null);try{r(await bS({backend:e,flavor:i.trim()||null,projectId:n}))}catch(k){d(k instanceof Error?k.message:String(k))}finally{l(!1)}}}const f=i.trim()===(t??"");return h.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-mono [&_.repo-hint]:font-normal [&_.repo-hint]:text-xs [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-left [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-[0_2px_8px_rgb(0_0_0_/_5%)] [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-semibold [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-semibold [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pr-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:pl-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))] [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-left [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-md [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:font-mono [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-md [&_.paper-pick_.title]:font-semibold flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-xs [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.new-project-actions_.primary]:ml-auto [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap settings-form mt-3.5 pt-3.5 border-t border-t-border compute-flavor-form mb-3.5 [&_label]:max-w-80",onSubmit:m,children:[h.jsxs("label",{children:["Default flavor",h.jsx("input",{className:rn,type:"text",list:`flavors-${e}`,value:i,onChange:b=>a(b.target.value),placeholder:bw.includes(e)?`e.g. ${((g=vw[e])==null?void 0:g[1])??""}`:"none (CPU-only)",autoComplete:"off",spellCheck:!1}),h.jsx("datalist",{id:`flavors-${e}`,children:(vw[e]??[]).map(b=>h.jsx("option",{value:b},b))})]}),u&&h.jsx("div",{className:"error",children:u}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"submit",className:rr,disabled:o||f,children:o?"Saving…":"Save flavor"}),bw.includes(e)&&!t&&h.jsxs("span",{className:"muted text-muted compute-flavor-hint text-sm",children:["This backend requires a flavor — without a default one, each launch must pass"," ",h.jsx("code",{children:"--flavor"}),"."]})]})]})}function iG({target:e,isDefault:t,isFallbackDefault:n,defaultFlavor:r,open:i,onToggle:a,onSettings:o,onError:l,projectId:u}){const[d,m]=R.useState(!1),[f,g]=R.useState(!1);i&&!d&&m(!0);async function b(k){if(!f){g(!0);try{o(await bS({backend:k,projectId:u}))}catch(S){l(S instanceof Error?S.message:String(S))}finally{g(!1)}}}return h.jsxs("div",{className:`compute-row bg-background border border-border rounded-lg [&.disabled]:opacity-52 [&.disabled_.compute-row-head]:cursor-default [&.open_.compute-row-head:hover]:rounded-[var(--radius-lg)_var(--radius-lg)_0_0] [&.open_.compute-chevron]:rotate-180${i?" open":""}${e.enabled?"":" disabled"}`,children:[h.jsxs("div",{className:"compute-row-head flex items-center gap-2.5 py-3 px-3.5 cursor-pointer select-none [&:hover]:bg-surface [&:hover]:rounded-lg [&_.badge]:flex-none",onClick:e.enabled?a:void 0,children:[h.jsx("span",{className:"compute-row-logo inline-flex items-center flex-none",children:h.jsx(iC,{kind:eG[e.id],size:18})}),h.jsx("span",{className:"compute-row-name text-md font-semibold text-text flex-none",children:gw[e.id]}),h.jsx("span",{className:"compute-row-summary flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-muted text-sm",children:e.summary}),h.jsx(nG,{t:e,isDefault:t}),t?h.jsx("span",{className:"badge inline-flex items-center font-sans text-xs font-medium py-px px-[7px] border border-border rounded-sm [&.ok]:text-accent-green [&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle [&.err]:text-accent-red [&.err]:border-accent-red [&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber [&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle compute-default-pill flex-none text-primary border-primary",children:n?"Local fallback":"Default"}):h.jsx("button",{type:"button",className:`${rr} compute-make-default flex-none`,onClick:k=>{k.stopPropagation(),b(e.id)},disabled:f||!e.enabled,children:"Make default"}),h.jsx("button",{type:"button",className:"compute-chevron-btn flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":i,"aria-label":`${i?"Collapse":"Expand"} ${gw[e.id]}`,disabled:!e.enabled,onClick:k=>{k.stopPropagation(),e.enabled&&a()},children:h.jsx(zl,{size:16,className:"compute-chevron text-muted transition-transform duration-120 ease-standard"})})]}),d&&e.enabled&&h.jsxs("div",{className:"compute-row-body border-t border-t-border p-3.5 [&_.settings-card]:mb-0 [&_.settings-card]:mt-3.5",hidden:!i,children:[t&&!n&&h.jsxs("p",{className:"settings-note mt-2.5 mx-0 mb-0 text-sm py-2 px-2.5 border border-accent-amber rounded-md bg-accent-amber-subtle text-accent-amber font-medium compute-default-note flex items-center gap-2.5 flex-wrap",children:["The agent launches runs here unless you tell it otherwise, and so does"," ",h.jsx("code",{children:"orx exp run"})," with no ",h.jsx("code",{children:"--backend"})," flag."," ",h.jsx("button",{type:"button",className:rr,onClick:()=>void b(null),disabled:f,children:"Clear default"})]}),t&&!e.configured&&h.jsx("p",{className:An,children:"This target is the default but isn't configured — launches will fail until it's set up below."}),t&&tG.includes(e.id)&&h.jsx(rG,{target:e.id,flavor:r,projectId:u,onSaved:o}),e.id==="local"&&h.jsx(Qq,{}),e.id==="hf"&&h.jsx(cG,{}),e.id==="modal"&&h.jsx(Gq,{}),e.id==="k8s"&&h.jsx(Pq,{}),e.id==="ssh"&&h.jsx(Wq,{}),e.id==="slurm"&&h.jsx(Xq,{}),e.id==="ray"&&h.jsx(Kq,{}),e.id==="openresearch"&&h.jsx(Jq,{})]})]})}function sG({project:e,onViewHistory:t}){const[n,r]=R.useState(null),[i,a]=R.useState(null),[o,l]=R.useState(null),[u,d]=R.useState(null),m=R.useRef(0);R.useEffect(()=>{m.current++,r(null),l(null),a(null),d(null)},[e==null?void 0:e.id]),R.useEffect(()=>{const S=++m.current;uD(e==null?void 0:e.id).then(x=>{S===m.current&&(r(x),a(null))}).catch(x=>{if(S!==m.current)return;const _=x instanceof Error?x.message:String(x);r(w=>(w===null?a(_):d(_),w))})},[o,e==null?void 0:e.id]);const f=S=>{m.current++,r(S),d(null)},g=n?n.targets:null,b=(n==null?void 0:n.defaultBackend)==="local"&&n.configuredDefaultBackend!==null&&n.configuredDefaultBackend!==void 0&&n.configuredDefaultBackend!=="local",k=S=>h.jsx(iG,{target:S,isDefault:(n==null?void 0:n.defaultBackend)===S.id,isFallbackDefault:!!(b&&S.id==="local"),defaultFlavor:(n==null?void 0:n.defaultFlavor)??null,open:S.enabled&&o===S.id,onToggle:()=>l(x=>x===S.id?null:S.id),onSettings:f,onError:d,projectId:e==null?void 0:e.id},`${(e==null?void 0:e.id)??"none"}:${S.id}`);return h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:"Compute"}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Where ",h.jsx("code",{children:"orx exp run"})," executes. Pick a default target; the agent uses it when a launch doesn't name a backend (",h.jsx("code",{children:"--backend "})," always wins)."]}),h.jsx(SG,{onViewHistory:t}),h.jsx("h2",{className:"compute-section-title mt-0 mx-0 mb-2.5 text-lg",children:"Targets"}),i?h.jsx("div",{className:"error",children:i}):g?h.jsxs(h.Fragment,{children:[u&&h.jsx("div",{className:"error",children:u}),h.jsxs("div",{className:"compute-list flex flex-col gap-2.5 mb-3.5",children:[g.filter(S=>S.id==="local").map(k),g.filter(S=>S.id!=="local").map(k)]}),b&&h.jsxs("p",{className:An,children:["Using this machine because the saved ",n==null?void 0:n.configuredDefaultBackend," default is not currently configured."]}),h.jsxs("p",{className:"compute-footnote flex items-start gap-1.5 mt-0.5 mx-0 mb-0 text-sm text-muted [&_svg]:flex-none [&_svg]:mt-px",children:[h.jsx(CM,{size:14,"aria-hidden":"true"}),h.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."})]})]}):h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Checking compute targets…"]})]})}const aG={env:"HF_TOKEN env var",openresearchEnv:"~/.openresearch/env",hfCache:"~/.cache/huggingface/token (hf auth login)"};function oG({settings:e}){return e.configured?e.valid?h.jsx("span",{className:Ns,children:"Connected"}):h.jsx("span",{className:Ii,children:"Invalid token"}):h.jsx("span",{className:hr,children:"Not configured"})}function lG({settings:e}){return!e.configured||!e.valid?null:e.jobsWrite===!0?h.jsx("span",{className:Ns,children:"Jobs: write OK"}):e.jobsWrite===!1?h.jsx("span",{className:Ii,children:"No job.write permission"}):h.jsx("span",{className:hr,children:"Jobs permission unknown"})}function cG(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,d]=R.useState(null),m=R.useRef(!1);R.useEffect(()=>{FR().then(g=>{m.current||t(g)}).catch(g=>{m.current||r(g instanceof Error?g.message:String(g))})},[]);async function f(g){if(g.preventDefault(),!(!i.trim()||o)){l(!0),d(null);try{const b=await PR(i.trim());m.current=!0,t(b),r(null),a("")}catch(b){d(b instanceof Error?b.message:String(b))}finally{l(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run experiments on your Hugging Face account with"," ",h.jsx("code",{children:"--backend hf --flavor "})," (t4-small, a10g-small, a100-large, …). Billed to HF per minute."]}),n?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Qs,children:[h.jsx("span",{className:"k",children:"Status"}),h.jsx("span",{className:"v",children:h.jsx(oG,{settings:e})}),h.jsx("span",{className:"k",children:"Account"}),h.jsx("span",{className:"v",children:e.username??"—"}),h.jsx("span",{className:"k",children:"Token"}),h.jsx("span",{className:"v",children:e.maskedToken??"—"}),h.jsx("span",{className:"k",children:"Source"}),h.jsx("span",{className:"v",children:e.source?aG[e.source]:"Not configured"}),h.jsx("span",{className:"k",children:"Jobs"}),h.jsxs("span",{className:"v",children:[h.jsx(lG,{settings:e}),(!e.configured||!e.valid)&&"—"]})]}),e.source==="env"&&h.jsx("p",{className:An,children:"HF_TOKEN is set in the environment and overrides any token saved here."}),e.valid&&e.jobsWrite===null&&h.jsxs("p",{className:An,children:["This token is valid but doesn't report whether it can launch Jobs — OAuth tokens from ",h.jsx("code",{children:"hf auth login"})," never do. Launches may still work; for a definitive check, save a write-scoped token from"," ",h.jsx("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",children:"huggingface.co/settings/tokens"}),"."]})]}):h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Loading status…"]}),h.jsxs("form",{className:xh,onSubmit:f,children:[h.jsxs("label",{children:[e!=null&&e.configured?"Replace token":"New token",h.jsx("input",{type:"password",value:i,onChange:g=>a(g.target.value),placeholder:"hf_…",autoComplete:"off"})]}),u&&h.jsx("div",{className:"error",children:u}),h.jsx("div",{className:"actions",children:h.jsx("button",{type:"submit",className:Zr,disabled:!i.trim()||o,children:o?"Validating…":"Save"})})]})]})}const aC=/^hf_[A-Za-z0-9]{10,}$/;function oC(){return h.jsx("tr",{children:h.jsx("td",{colSpan:3,children:h.jsxs("p",{className:An,children:["This value looks like a Hugging Face token — compute runs only read it from"," ",h.jsx("code",{children:"HF_TOKEN"}),". Save it under that key if it's meant for HF Jobs."]})})})}const _w=["HF_TOKEN","WANDB_API_KEY"];function uG({name:e,entry:t,onVars:n,onError:r}){const[i,a]=R.useState(""),[o,l]=R.useState(!1),u=f=>r(`${e}: ${f instanceof Error?f.message:String(f)}`);async function d(){if(!(!i.trim()||o)){l(!0);try{n(await gS(e,i.trim())),a("")}catch(f){u(f)}finally{l(!1)}}}async function m(){if(!o){l(!0);try{n(await QR(e))}catch(f){u(f)}finally{l(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("tr",{children:[h.jsx("td",{className:rn,children:e}),h.jsx("td",{className:`${rn} muted text-muted`,children:t?h.jsxs(h.Fragment,{children:[t.maskedValue,t.inProcessEnv&&h.jsx("span",{className:hr,children:"Overridden by env"})]}):h.jsx("input",{className:rn,type:"password",value:i,onChange:f=>a(f.target.value),onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),d()),f.key==="Escape"&&!o&&a("")},placeholder:"value","aria-label":`Value for ${e}`,autoComplete:"new-password",disabled:o})}),h.jsx("td",{children:t?h.jsx("button",{className:nr,title:`Delete ${e}`,"aria-label":`Delete ${e}`,onClick:()=>void m(),disabled:o,children:h.jsx(ch,{size:13})}):i.trim()&&h.jsx("button",{className:rr,onClick:()=>void d(),disabled:o,children:o?"Saving…":"Save"})})]}),!t&&e!=="HF_TOKEN"&&aC.test(i.trim())&&h.jsx(oC,{})]})}function dG({onVars:e,onError:t,onDone:n}){const[r,i]=R.useState(""),[a,o]=R.useState(""),[l,u]=R.useState(!1);async function d(){if(!(!r.trim()||!a.trim()||l)){u(!0);try{e(await gS(r.trim(),a.trim())),n()}catch(f){t(`${r.trim()}: ${f instanceof Error?f.message:String(f)}`)}finally{u(!1)}}}const m=f=>{f.key==="Enter"&&(f.preventDefault(),d()),f.key==="Escape"&&!l&&n()};return h.jsxs(h.Fragment,{children:[h.jsxs("tr",{children:[h.jsx("td",{children:h.jsx("input",{autoFocus:!0,className:rn,type:"text",value:r,onChange:f=>i(f.target.value),onKeyDown:m,placeholder:"MY_API_KEY","aria-label":"New variable key",autoComplete:"off",spellCheck:!1,disabled:l})}),h.jsx("td",{children:h.jsx("input",{className:rn,type:"password",value:a,onChange:f=>o(f.target.value),onKeyDown:m,placeholder:"value","aria-label":"New variable value",autoComplete:"new-password",disabled:l})}),h.jsxs("td",{children:[h.jsx("button",{className:rr,onClick:()=>void d(),disabled:l||!r.trim()||!a.trim(),children:l?"Saving…":"Save"}),h.jsx("button",{className:nr,title:"Cancel","aria-label":"Cancel new variable",onClick:n,disabled:l,children:h.jsx(Yr,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&aC.test(a.trim())&&h.jsx(oC,{})]})}function hG(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(!1),[o,l]=R.useState(null);R.useEffect(()=>{ZR().then(t).catch(f=>r(f instanceof Error?f.message:String(f)))},[]);const u=f=>{t(f),l(null)},d=e===null?[]:e.map(f=>f.key).filter(f=>!_w.includes(f)),m=[..._w,...d];return h.jsxs("div",{className:Ba,children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("h3",{children:"Environment variables"}),h.jsx("div",{className:"spacer",style:{flex:1}}),h.jsxs("button",{className:rr,onClick:()=>a(!0),disabled:i||e===null,children:[h.jsx(i_,{size:12})," Add variable"]})]}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Stored in ",h.jsx("code",{children:"~/.openresearch/env"})," and passed to runs and the research agent."," ",h.jsx("code",{children:"HF_TOKEN"})," and ",h.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?h.jsx("div",{className:"error",children:n}):e===null?h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Loading…"]}):h.jsx("table",{className:"env-table w-full border-collapse text-md table-fixed [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ml-2 [&_input]:w-full [&_input]:border-0 [&_input]:bg-transparent [&_input]:p-0 [&_input:focus]:shadow-[0_1px_0_0_var(--text)] [&_td]:h-9 [&_td]:pt-0 [&_td]:pr-2.5 [&_td]:pb-0 [&_td]:pl-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-right [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-left [&_.icon-btn]:ml-2 [&_.icon-btn]:align-middle [&_.icon-btn:hover]:text-accent-red",children:h.jsxs("tbody",{children:[m.map(f=>h.jsx(uG,{name:f,entry:e.find(g=>g.key===f),onVars:u,onError:l},f)),i&&h.jsx(dG,{onVars:u,onError:l,onDone:()=>a(!1)})]})}),o&&h.jsx("div",{className:"error",children:o})]})}const id=[{value:"system",label:"System",icon:zM},{value:"light",label:"Light",icon:uR},{value:"dark",label:"Dark",icon:HM}];function fG(){const[e,t]=jq(),n=r=>{var d;const i=r.key==="ArrowRight"||r.key==="ArrowDown"?1:r.key==="ArrowLeft"||r.key==="ArrowUp"?-1:0;if(!i)return;r.preventDefault();const a=[...r.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(m=>m===document.activeElement),u=((o===-1?id.findIndex(m=>m.value===e):o)+i+id.length)%id.length;t(id[u].value),(d=a[u])==null||d.focus()};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Appearance"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"How the interface looks on this device."}),h.jsx("div",{className:Ba,children:h.jsxs("div",{className:xl,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"Theme"}),h.jsx("p",{children:"System follows your operating system's light or dark setting."})]}),h.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":"Theme",onKeyDown:n,children:id.map(({value:r,label:i,icon:a})=>h.jsxs("button",{type:"button",role:"radio","aria-checked":e===r,tabIndex:e===r?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${e===r?"on":""}`,onClick:()=>t(r),children:[h.jsx(a,{size:14}),i]},r))})]})})]})}const pG={installer:"Installed with the orx installer","app-bundle":"macOS app",cargo:"Installed with cargo",homebrew:"Installed with Homebrew",nix:"Managed by Nix",unknown:"Unknown install"},mG={cargo:"Re-run your cargo install to update.",homebrew:"Run brew upgrade to update.",nix:"Update it through your Nix configuration."};function gG(){const{status:e,error:t,apply:n}=tC(),[r,i]=R.useState(null),[a,o]=R.useState(null);if(!e)return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Updates"}),t?h.jsx("div",{className:Ba,children:h.jsx("div",{className:"error",children:t})}):h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Loading…"]})]});const l=async(u,d)=>{i(u),o(null);try{await d()}catch(m){o(m instanceof Error?m.message:String(m))}finally{i(null)}};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Updates"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"Keeping this copy of orx on the latest release."}),h.jsxs("div",{className:Ba,children:[h.jsxs("div",{className:Qs,children:[h.jsx("div",{className:"k",children:"Version"}),h.jsx("div",{className:"v",children:e.current}),h.jsx("div",{className:"k",children:"Latest"}),h.jsx("div",{className:"v",children:e.latest??"—"}),h.jsx("div",{className:"k",children:"Install"}),h.jsx("div",{className:"v",children:pG[e.channel]})]}),e.restartRequired&&h.jsx("div",{className:xl,children:h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"Restart to finish updating"}),h.jsxs("p",{children:["Version ",e.installedVersion," is installed. This window is still running"," ",e.current,"."]})]})}),e.selfUpdates?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:xl,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"Install updates automatically"}),h.jsxs("p",{children:["New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",e.envDisabled&&" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect."]})]}),h.jsx("button",{type:"button",role:"switch","aria-checked":e.autoUpdate,"aria-label":"Install updates automatically",className:`${m_} ${e.autoUpdate?"on":""}`,disabled:r!==null,onClick:()=>void l("auto",()=>GR(!e.autoUpdate).then(n)),children:h.jsx("span",{})})]}),h.jsxs("div",{className:xl,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:e.updateAvailable?`Update to ${e.latest}`:"Check for updates"}),h.jsx("p",{children:e.updateAvailable?"Install the new release now instead of waiting for the background update.":"orx checks a few times a day on its own."})]}),h.jsx("button",{type:"button",className:rr,disabled:r!==null,onClick:()=>void l("apply",()=>qR().then(n)),children:r==="apply"?"Working…":e.updateAvailable?"Update now":"Check now"})]})]}):h.jsx("div",{className:xl,children:h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"orx can't update this install"}),h.jsx("p",{children:mG[e.channel]??"Reinstall with the orx installer to get automatic updates."})]})}),e.channel==="app-bundle"&&h.jsx(bG,{busy:r,run:l}),a&&h.jsx("div",{className:"error",children:a})]})]})}function bG({busy:e,run:t}){const[n,r]=R.useState(null),[i,a]=R.useState(!1),o=l=>void t("cli",()=>VR(l).then(u=>{r(u),a(!1)}).catch(u=>{throw a(!l&&String((u==null?void 0:u.message)??u).includes("--force")),u}));return h.jsxs("div",{className:xl,children:[h.jsxs("div",{children:[h.jsxs("div",{className:"project-default-title text-md font-semibold",children:["Install the ",h.jsx("code",{children:"orx"})," command"]}),n?h.jsxs("p",{children:[n.alreadyCurrent?"Already linked at ":"Linked ",h.jsx("code",{children:n.link}),".",!n.onPath&&` Add ${n.dir} to your PATH to use it.`]}):h.jsxs("p",{children:["Adds ",h.jsx("code",{children:"orx"})," to your terminal, pointing at this app — so the CLI and the app are always the same version."]})]}),h.jsx("button",{type:"button",className:rr,disabled:e!==null,onClick:()=>o(i),children:e==="cli"?"Working…":i?"Replace anyway":n?"Re-link":"Install"})]})}function vG(){const[e,t]=R.useState(null),[n,r]=R.useState(!1),[i,a]=R.useState(null),o=()=>{a(null),o_().then(t).catch(u=>a(u instanceof Error?u.message:String(u)))};R.useEffect(o,[]);const l=()=>{if(!e||n)return;const u=!e.githubForNewProjects;r(!0),a(null),xS(u,!0).then(t).catch(d=>a(d instanceof Error?d.message:String(d))).finally(()=>r(!1))};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"General"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"Defaults applied when you create a project."}),e?h.jsxs("div",{className:"settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md [&_>_.error]:whitespace-pre-wrap bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5 [&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0",children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("h3",{children:"GitHub publishing"}),h.jsx("span",{className:`${hr} ${e.githubAuthenticated?"ok":""}`,children:e.githubAuthenticated?`Connected via ${e.githubTokenSource}`:"Not connected"})]}),h.jsxs("div",{className:xl,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"Enable GitHub syncing for new projects"}),h.jsx("p",{children:"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots."})]}),h.jsx("button",{type:"button",role:"switch","aria-checked":e.githubForNewProjects,"aria-label":"Enable GitHub syncing for new projects",className:`${m_} ${e.githubForNewProjects?"on":""}`,disabled:n||!e.githubAuthenticated&&!e.githubForNewProjects,onClick:l,children:h.jsx("span",{})})]}),!e.githubAuthenticated&&h.jsxs("div",{className:"project-default-connect [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0 [&_p]:text-muted [&_p]:text-sm mt-3.5 pt-3.5 border-t border-t-border-variant [&_.onb-token-form]:mt-2.5",children:[h.jsx("p",{children:"Connect GitHub to make publishing the default for new projects."}),h.jsx(rC,{onSaved:o})]}),i&&h.jsx("div",{className:"error",children:i})]}):i?h.jsx("div",{className:"error",children:i}):h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Loading…"]})]})}function _G({project:e,publicationError:t,onProjectUpdate:n}){const[r,i]=R.useState(null),[a,o]=R.useState(!1),[l,u]=R.useState(null),[d,m]=R.useState(!1),[f,g]=R.useState(!1),[b,k]=R.useState(null),S=R.useRef(0),x=!!(r!=null&&r.github.owner&&r.github.repo),_=()=>{const T=++S.current;i(null),u(null),e&&wD(e.id).then(E=>{T===S.current&&i(E)}).catch(E=>{T===S.current&&u(E instanceof Error?E.message:String(E))})};R.useEffect(_,[e==null?void 0:e.id]);const w=T=>{const E=T instanceof Error?T.message:String(T);return E.toLowerCase().includes("archived")?"GitHub rejected the push because this repository is archived and read-only. The local project is still available. Unarchive the repository on GitHub, then enable syncing here.":E.includes("(fetch first)")||E.includes("non-fast-forward")?"GitHub contains changes that are not in this local project. Pull the latest GitHub changes and resolve any conflicts in Git, then try enabling syncing again.":E.includes("403")||E.toLowerCase().includes("permission denied")?"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.":E},y=()=>{e&&(o(!0),u(null),kD(e.id).then(T=>{i(T.git),n(T.project),o_().then(E=>{!E.githubForNewProjects&&!E.githubDefaultPromptSeen&&m(!0)}).catch(()=>{})}).catch(T=>u(w(T))).finally(()=>o(!1)))},C=T=>{g(!0),k(null),xS(T,!0).then(()=>m(!1)).catch(E=>k(E instanceof Error?E.message:String(E))).finally(()=>g(!1))};return h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:"Repository"}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Git and GitHub settings for ",h.jsx("strong",{children:(e==null?void 0:e.name)??"the current project"}),". Local Git powers experiments; publishing is optional."]}),e?l&&!r?h.jsx("div",{className:"error",children:l}):r?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:mw,children:[h.jsx("h3",{children:"Local repository"}),h.jsxs("div",{className:Qs,children:[h.jsx("span",{className:"k",children:"Path"}),h.jsx("span",{className:`v ${rn}`,children:r.path}),h.jsx("span",{className:"k",children:"Git"}),h.jsx("span",{className:"v",children:r.gitVersion??"not found"}),h.jsx("span",{className:"k",children:"State"}),h.jsx("span",{className:"v",children:r.initialized?`${r.currentBranch??"detached"} · ${r.clean?"clean":"has changes"}`:"not initialized"}),h.jsx("span",{className:"k",children:"Baseline"}),h.jsx("span",{className:`v ${rn}`,children:r.baselineBranch}),h.jsx("span",{className:"k",children:"Remotes"}),h.jsx("span",{className:"v",children:r.remotes.length?r.remotes.map(T=>`${T.name}: ${T.url}`).join(" · "):"none"})]}),!r.initialized&&h.jsx("div",{className:Xg,children:h.jsx("button",{className:Zr,onClick:()=>void SD(e.id).then(i).catch(T=>u(String(T))),children:"Initialize Git"})})]}),h.jsxs("div",{className:mw,children:[h.jsx("h3",{children:"GitHub"}),h.jsxs("div",{className:Qs,children:[h.jsx("span",{className:"k",children:"Authentication"}),h.jsxs("span",{className:"v",children:[h.jsx("span",{className:`${hr} ${r.github.authenticated?"ok":""}`,children:r.github.authenticated?"Connected":"Not connected"}),r.github.authenticated&&h.jsxs("span",{className:"git-detail-meta text-muted text-sm",children:["via ",r.github.tokenSource]})]}),h.jsx("span",{className:"k",children:"Project"}),h.jsx("span",{className:"v",children:x?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:rn,children:[r.github.owner,"/",r.github.repo]}),!r.github.enabled&&h.jsx("span",{className:"badge inline-flex items-center font-sans font-medium py-px px-[7px] border border-border rounded-sm [&.ok]:text-accent-green [&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle [&.err]:text-accent-red [&.err]:border-accent-red [&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber [&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle git-detail-meta text-muted text-sm",children:"Syncing off"})]}):h.jsx("span",{className:hr,children:"Local only"})}),r.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:"Sync"}),h.jsx("span",{className:"v",children:r.github.syncStatus})]})]}),!r.github.authenticated&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:"GitHub is optional. Connect only when you want a hosted copy for collaboration."}),h.jsx(rC,{onSaved:()=>_()})]}),r.github.authenticated&&!r.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:x?"Use this repository for automatic experiment-branch pushes when your connected account can write to it. Otherwise, OpenResearch creates a separate private repository for collaboration.":"Create a private repository and automatically push experiment branches for collaborator visibility."}),h.jsxs("div",{className:Xg,children:[x&&r.github.url&&h.jsxs("a",{className:di,href:r.github.url,target:"_blank",rel:"noreferrer",children:["Open on GitHub ",h.jsx(Cd,{size:12})]}),h.jsx("button",{className:Zr,disabled:a,onClick:y,children:a?"Enabling…":"Enable GitHub syncing"})]})]}),r.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed."}),h.jsxs("div",{className:Xg,children:[r.github.url&&h.jsxs("a",{className:di,href:r.github.url,target:"_blank",rel:"noreferrer",children:["Open on GitHub ",h.jsx(Cd,{size:12})]}),h.jsx("button",{className:di,disabled:a,onClick:()=>{o(!0),CD(e.id).then(T=>{i(T.git),n(T.project)}).catch(T=>u(T instanceof Error?T.message:String(T))).finally(()=>o(!1))},children:a?"Updating…":"Disable syncing"})]})]})]}),t&&h.jsx("div",{className:"error",children:w(t)}),l&&h.jsx("div",{className:"error",children:w(l)})]}):h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Loading…"]}):h.jsx("div",{className:Ba,children:h.jsx("p",{className:An,children:"Open a project to inspect its repository and GitHub publication state."})}),d&&h.jsx("div",{className:"modal-backdrop fixed inset-0 bg-[rgba(29,_27,_26,_0.4)] flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>C(!1),children:h.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)] p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-muted [&_>_p]:text-md [&_>_p]:leading-normal [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:T=>T.stopPropagation(),children:[h.jsx("h2",{id:"github-default-title",children:"Make GitHub syncing the default?"}),h.jsx("p",{children:"This is useful when collaborators follow project changes on GitHub. New projects will enable syncing automatically, creating a private repository when needed and pushing experiment branches for visibility."}),b&&h.jsx("div",{className:"error",children:b}),h.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[h.jsx("button",{className:di,disabled:f,onClick:()=>C(!1),children:"Not now"}),h.jsx("button",{className:Zr,disabled:f,onClick:()=>C(!0),children:f?"Saving…":"Make default"})]})]})})]})}const xG={env:"ORX_DATA_DIR environment variable",config:"your saved setting",xdg:"XDG_DATA_HOME",default:"default location"};function yG(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,d]=R.useState(null),[m,f]=R.useState({kind:"idle"}),[g,b]=R.useState(null),k=()=>JR().then(C=>{t(C),a(T=>T||C.current)}).catch(C=>r(C instanceof Error?C.message:String(C)));R.useEffect(()=>{k()},[]),R.useEffect(()=>ZD(C=>{C.type==="progress"?f(T=>{const E=T.kind==="moving"?T.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||E}}):C.type==="done"?(f({kind:"done",oldPathLeft:C.oldPathLeft}),d(null),a(""),k()):C.type==="error"&&f({kind:"error",message:C.error})}),[]);const S=(e==null?void 0:e.source)==="env",x=i.trim(),_=e!==null&&x===e.current;async function w(){if(!(o||!x)){l(!0),b(null),d(null);try{d(await eD(x))}catch(C){b(C instanceof Error?C.message:String(C))}finally{l(!1)}}}async function y(C){if(C.preventDefault(),!(m.kind==="moving"||!x||_)&&(b(null),!!window.confirm(`Move all orx data to: +`,d+3),g=f===-1?e.length:f;/^[ \t]*$/.test(e.slice(m,d))&&/^[ \t\r]*$/.test(e.slice(d+3,g))&&o.push(d)}for(let d=0;d+1`$$${i}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,i)=>`$$${i}$$`);return t.predictMath&&(n=n.replace(/\\\[([\s\S]*)$/,(r,i)=>`$$${i}`).replace(/\\\(([\s\S]*)$/,(r,i)=>`$$${i}`)),xq(n,t)}function eC(e,t={}){let n="",r=0,i=0;for(;i{var a;(a=navigator.clipboard)==null||a.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return h.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[h.jsx("button",{className:"md-code-copy absolute top-1.5 right-1.5 inline-flex items-center justify-center w-6.5 h-6.5 text-muted bg-background border border-border-variant rounded-sm opacity-0 transition-[opacity,color] duration-120 ease-standard [&:hover]:text-text [&:hover]:border-muted",title:"Copy","aria-label":"Copy code",onClick:i,children:n?h.jsx(Di,{size:13}):h.jsx(s_,{size:13})}),h.jsx("pre",{children:h.jsx("code",{children:fq(e,t,yq)})})]})}function Sq(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 fw(e,t,n){let r=t.line,i=t.column;for(let a=0;a]*?)\/?>/gi,r=[];let i=0,a=!1;for(const o of t.matchAll(n)){const l=(o[1]??"").toLowerCase(),c=Sq(o[2]??"");if(!c[l==="run"?"id":"path"])continue;a=!0,o.index>i&&r.push({type:"text",value:t.slice(i,o.index),position:Kg(e,i,o.index)});const m=o.index+o[0].length;r.push({children:[],data:{hName:l==="run"?"run-mention":"file-mention",hProperties:c},position:Kg(e,o.index,m),type:l==="run"?"runMention":"fileMention"}),i=m}return a?(itC(e)}function Cq(){return e=>{const t=n=>{var r;for(const i of["href","src"])n.properties&&Object.hasOwn(n.properties,i)&&(n.properties[i]=f9(String(n.properties[i]||"")));(r=n.children)==null||r.forEach(t)};t(e)}}function mw({path:e,lines:t,exp:n,onOpenFile:r}){const i=e.split("/").pop()||e,a=t&&Number.parseInt(t,10)||void 0,o=a!=null?`${i}:${a}`:i;return h.jsxs("button",{className:"file-chip",title:`Open ${e}`,onClick:()=>r==null?void 0:r(e,a,n),disabled:!r,children:[h.jsx(nS,{size:12}),h.jsx("span",{className:"file-chip-label",children:o})]})}function Eq({id:e,label:t,onOpenRun:n}){return h.jsxs("button",{className:"file-chip run-chip",title:`Open logs for run ${e}`,onClick:()=>n==null?void 0:n(e),disabled:!n,children:[h.jsx(l_,{size:12}),h.jsx("span",{className:"file-chip-label",children:t||"logs"})]})}const nC={singleDollarTextMath:!0},Aq=T_().use(O_).use(qk).use(Gk,nC).use(kq).use(zf).use(Cq).use(_k);function Tq(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const rC={code:({node:e,className:t,children:n,...r})=>{const i=t??"",a=/language-(\w+)/.exec(i),o=String(n??"").replace(/\n$/,"");if(!(a!=null||o.includes(` +`)))return h.jsx("code",{className:i,...r,children:n});const c=a?gv(a[1]):null;return h.jsx(wq,{code:o,lang:c})},pre:({children:e})=>h.jsx(h.Fragment,{children:e})},za=R.memo(function({text:t,onOpenFile:n,onOpenRun:r,predict:i=!1}){const a=R.useMemo(()=>({"file-mention":o=>h.jsx(mw,{path:o.path,lines:o.lines,exp:o.exp,onOpenFile:n}),"run-mention":o=>h.jsx(Eq,{id:o.id,label:o.label,onOpenRun:r}),a:({node:o,href:l,children:c,...d})=>l&&Tq(l)&&n?h.jsx(mw,{path:decodeURI(l),onOpenFile:n}):h.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",...d,children:c}),...rC}),[n,r]);return h.jsx("div",{"data-streaming":i||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-[color-mix(in_oklab,_var(--border)_50%,_transparent)] [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-[0.9em] [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-[1.05em] [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-[0.9em] [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-[1.05em] [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-[1.05em] [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-[1.05em] [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-[1.05em] [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:pl-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:pl-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-md [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-left [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-left [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pr-0 [&_blockquote]:pb-0.5 [&_blockquote]:pl-2.5 [&_blockquote]:border-l-[3px] [&_blockquote]:border-l-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text",children:h.jsx(VB,{content:eC(t,{predictMath:i}),processor:Aq,components:a,predict:i})})}),gw=["prompt-actions flex flex-wrap [&_.btn-primary]:inline-flex","[&_.btn-primary]:items-center [&_.btn-primary]:gap-1.5 [&_.btn-primary]:py-1.5 [&_.btn-primary]:px-[13px]","[&_.btn-primary]:font-[inherit] [&_.btn-primary]:text-sm","[&_.btn-primary]:font-semibold [&_.btn-primary]:rounded-sm","[&_.btn-primary]:cursor-pointer [&_.btn-primary]:transition-[background,border-color] [&_.btn-primary]:duration-80 [&_.btn-primary]:ease-standard","[&_.btn-ghost]:inline-flex [&_.btn-ghost]:items-center [&_.btn-ghost]:gap-1.5","[&_.btn-ghost]:py-1.5 [&_.btn-ghost]:px-[13px] [&_.btn-ghost]:font-[inherit] [&_.btn-ghost]:text-sm","[&_.btn-ghost]:font-semibold [&_.btn-ghost]:rounded-sm","[&_.btn-ghost]:cursor-pointer [&_.btn-ghost]:transition-[background,border-color] [&_.btn-ghost]:duration-80 [&_.btn-ghost]:ease-standard","[&_.btn-ghost]:border-border [&_button:disabled]:opacity-50","[&_button:disabled]:cursor-default plan-strip-actions gap-y-1.5 gap-x-2 justify-end","[&_.btn-primary]:bg-transparent [&_.btn-primary]:border [&_.btn-primary]:border-text","[&_.btn-primary]:text-text [&_.btn-ghost]:bg-transparent","[&_.btn-ghost]:border [&_.btn-ghost]:border-text [&_.btn-ghost]:text-text","[&_.btn-primary:hover:not(:disabled)]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]","[&_.btn-primary:hover:not(:disabled)]:border-text","[&_.btn-primary:hover:not(:disabled)]:text-text [&_.btn-primary:hover:not(:disabled)]:opacity-100","[&_.btn-ghost:hover:not(:disabled)]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]","[&_.btn-ghost:hover:not(:disabled)]:border-text","[&_.btn-ghost:hover:not(:disabled)]:text-text [&_.btn-ghost:hover:not(:disabled)]:opacity-100","[&_.plan-strip-primary]:bg-text [&_.plan-strip-primary]:border-text","[&_.plan-strip-primary]:text-background","[&_.plan-strip-primary:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--text)_85%,_var(--base))]","[&_.plan-strip-primary:hover:not(:disabled)]:border-text","[&_.plan-strip-primary:hover:not(:disabled)]:text-background","[&_.plan-strip-caret]:rounded-tl-none [&_.plan-strip-caret]:rounded-bl-none","[&_.plan-strip-caret]:py-0 [&_.plan-strip-caret]:px-1.5 [&_.plan-strip-caret]:flex","[&_.plan-strip-caret]:items-center","[&_.plan-strip-caret]:border-l [&_.plan-strip-caret]:border-l-[color-mix(in_oklab,_var(--base)_35%,_var(--text))]"].join(" ");function Nq({synthesized:e,agentLabel:t,onView:n,onApprove:r,showResumeModes:i,onReject:a,onRevise:o}){const[l,c]=R.useState(!1),d=R.useRef(null),[m,f]=R.useState(!1),[g,b]=R.useState(""),k=R.useRef(null);R.useEffect(()=>{if(!l)return;const x=v=>{d.current&&!d.current.contains(v.target)&&c(!1)};return window.addEventListener("pointerdown",x),()=>window.removeEventListener("pointerdown",x)},[l]),R.useEffect(()=>{var x;m&&((x=k.current)==null||x.focus())},[m]);const S=()=>{o(g.trim()||"no specific feedback — use your judgment"),b(""),f(!1)};return h.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-l-[3px] border-l-accent-blue rounded-md bg-surface shadow-[0_2px_10px_rgb(0_0_0_/_6%)]",children:[h.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[h.jsx(l_,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),h.jsx("span",{className:"plan-strip-title text-md font-semibold whitespace-nowrap",children:e?`${t} is ready to proceed`:`${t} proposed a plan`}),h.jsx("button",{className:"plan-strip-open ml-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-md cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",onClick:n,children:"Open plan"})]}),m?h.jsxs(h.Fragment,{children:[h.jsx("textarea",{ref:k,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-md font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:"What should change? (optional)",rows:2,value:g,onChange:x=>b(x.target.value),onKeyDown:x=>{x.key==="Escape"?(x.preventDefault(),b(""),f(!1)):x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),S())}}),h.jsxs("div",{className:gw,children:[h.jsx("button",{className:"btn-ghost",onClick:()=>{b(""),f(!1)},children:"Back"}),h.jsx("span",{className:"plan-strip-spacer flex-1"}),h.jsxs("button",{className:"btn-primary plan-strip-primary",onClick:S,children:["Revise",h.jsx(eS,{size:13})]})]})]}):h.jsxs("div",{className:gw,children:[h.jsx("button",{className:"btn-ghost",onClick:a,children:"Reject"}),h.jsx("button",{className:"btn-ghost",onClick:()=>f(!0),children:"Revise…"}),h.jsx("span",{className:"plan-strip-spacer flex-1"}),i?h.jsxs("div",{className:"plan-strip-approve relative flex [&_.btn-primary:first-child]:rounded-tr-none [&_.btn-primary:first-child]:rounded-br-none",ref:d,children:[h.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>r("auto"),children:"Accept and auto mode"}),h.jsx("button",{className:"btn-primary plan-strip-primary plan-strip-caret","aria-label":"More approval options",onClick:()=>c(x=>!x),children:h.jsx(Bl,{size:13})}),l&&h.jsx("div",{className:"plan-strip-menu absolute right-0 bottom-[calc(100%_+_4px)] flex flex-col min-w-47.5 p-1 border border-border rounded-md bg-surface shadow-[0_6px_20px_rgb(0_0_0_/_12%)] z-6 [&_button]:text-left [&_button]:py-[7px] [&_button]:px-[9px] [&_button]:border-0 [&_button]:rounded-sm [&_button]:bg-transparent [&_button]:text-text [&_button]:text-md [&_button]:cursor-pointer [&_button:hover]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]",children:h.jsx("button",{onClick:()=>{c(!1),r("bypassPermissions")},children:"Accept and bypass all"})})]}):h.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>r(),children:"Accept plan"})]})]})}function iC(){const[e,t]=R.useState(null),[n,r]=R.useState(null);return R.useEffect(()=>{let i=!1;const a=nL(o=>{i=!0,t(o)});return WR().then(o=>!i&&t(o)).catch(o=>r(o instanceof Error?o.message:String(o))),a},[]),{status:e,error:n,apply:t}}function jq(){const{status:e}=iC(),[t,n]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null;return!r||t===r?null:h.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-xs text-text bg-surface border-b border-b-border",role:"status",children:[h.jsx(ch,{size:13,className:"shrink-0 text-subtext"}),h.jsxs("span",{className:"min-w-0",children:["Updated to ",h.jsx("strong",{className:"font-semibold",children:r}),". Restart to use it."]}),h.jsx("button",{type:"button",className:"ml-auto shrink-0 p-1 rounded-sm text-subtext hover:text-text hover:bg-highlight","aria-label":"Dismiss",onClick:()=>n(r),children:h.jsx(Vr,{size:13})})]})}const sC="orx:theme";function Mq(){try{const e=localStorage.getItem(sC);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let zd=Mq();const _v=new Set;function Rq(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function R2(){document.documentElement.dataset.theme=Rq(zd)}function Dq(e){zd=e;try{localStorage.setItem(sC,e)}catch{}R2();for(const t of _v)t()}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{zd==="system"&&R2()});R2();function Lq(e){return _v.add(e),()=>_v.delete(e)}function Oq(){return[R.useSyncExternalStore(Lq,()=>zd,()=>zd),Dq]}function aC({onSaved:e}){const[t,n]=R.useState(""),[r,i]=R.useState(!1),[a,o]=R.useState(null);async function l(c){if(c.preventDefault(),!(r||!t.trim())){i(!0),o(null);try{e(await wD(t.trim())),n("")}catch(d){o(d instanceof Error?d.message:String(d))}finally{i(!1)}}}return h.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:font-mono [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap",onSubmit:l,children:[h.jsx("input",{type:"password",value:t,onChange:c=>n(c.target.value),placeholder:"ghp_… personal access token",autoComplete:"off"}),h.jsx("button",{type:"submit",className:ci,disabled:r||!t.trim(),children:r?"Checking…":"Save"}),h.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,workflow&description=orx",target:"_blank",rel:"noreferrer",children:"Create a token ↗"}),a&&h.jsx("div",{className:"error",children:a})]})}function Iq(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"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return"This machine";default:return e||"—"}}function zq({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[h.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"}),h.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"}),h.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),h.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"}),h.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"}),h.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-0.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-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),h.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-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.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-0.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-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.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-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Bq({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[h.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"}),h.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)"}),h.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)"}),h.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"}),h.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"}),h.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)"}),h.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)"}),h.jsxs("defs",{children:[h.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#BFF9B4"}),h.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),h.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#80EE64"}),h.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),h.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),h.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),h.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),h.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),h.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),h.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#BFF9B4"}),h.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),h.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#80EE64"}),h.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),h.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),h.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),h.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),h.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),h.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function Hq({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:h.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-0.5-.623h-.804l-0.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-0.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-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.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-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.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-0.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-0.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-0.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 $q({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:h.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function Fq({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[h.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),h.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function Op({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:h.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-0.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-0.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 oC({kind:e,size:t=16}){switch(e){case"modal_job":return h.jsx(Bq,{size:t});case"hf_job":return h.jsx(zq,{size:t});case"k8s_job":return h.jsx(Hq,{size:t});case"ssh_job":return h.jsx(a3,{size:t});case"slurm_job":return h.jsx(Bj,{size:t});case"ray_job":return h.jsx($q,{size:t});case"openresearch_job":return h.jsx(Fq,{size:t});case"local_job":return h.jsx(DM,{size:t});default:return h.jsx(a3,{size:t})}}function D2({backend:e}){const t=h_(e),n=XD(e);return t?h.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[h.jsx(oC,{kind:t}),h.jsx("span",{className:"backend-name",children:Iq(t)}),n&&h.jsx("span",{className:`backend-detail ${nn}`,children:n})]}):h.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function lC({value:e,max:t,label:n,caption:r,fillColor:i}){const a=t>0?Math.min(100,Math.round(e/t*100)):0;return h.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,children:[h.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:h.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${a}%`,background:i}})}),(n!==void 0||r!==void 0)&&h.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[h.jsx("span",{children:n??`${a}%`}),r]})]})}const bw={done:{className:"st-done",live:!1},failed:{className:"st-failed",live:!1},running:{className:"st-running",live:!0},starting:{className:"st-starting",live:!0},cancelling:{className:"st-cancelling",live:!0},cancelled:{className:"st-cancelled",live:!1},editing:{className:"st-editing",live:!0},idle:{className:"st-idle",live:!1}};function Pq(e){return bw[e]??bw.idle}function Uq(e){return e.charAt(0).toUpperCase()+e.slice(1)}function La({status:e,label:t}){const n=Pq(e);return h.jsxs("span",{className:`${v_} ${n.className}${n.live?" live":""}`,children:[h.jsx("span",{className:"dot"}),t??Uq(e)]})}const Ba=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Zs=["kv grid grid-cols-[auto_1fr] gap-y-[3px] gap-x-3.5 text-md","[&_.k]:text-subtext [&_.v]:font-mono [&_.v]:text-sm","[&_.v]:break-all"].join(" "),En=["settings-note mt-2.5 mx-0 mb-0 text-sm py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),yh=["form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-mono","[&_.repo-hint]:font-normal [&_.repo-hint]:text-xs","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-left","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-[0_2px_8px_rgb(0_0_0_/_5%)]","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-semibold [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-semibold","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pr-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:pl-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))]","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-left [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-md","[&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:font-mono [&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-md [&_.paper-pick_.title]:font-semibold","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-xs [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5 [&_.new-project-actions_.primary]:ml-auto","[&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),wl=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_p]:text-muted [&_p]:text-sm"].join(" "),vw=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-md [&_.kv_.v]:break-normal [&_.kv_.v.mono]:font-mono","[&_.kv_.v.mono]:text-sm [&_.kv_.v_.mono]:font-mono","[&_.kv_.v_.mono]:text-sm [&_.kv_.k.mono]:font-mono","[&_.kv_.k.mono]:text-sm [@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),Zg=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),id=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function Qg(e){return e.agentReady?{cls:"ok",label:"Signed in"}:e.installed?e.authState==="unknown"?{cls:"warn",label:"Unable to verify"}:e.authState==="unsupported"?{cls:"warn",label:"Update required"}:{cls:"warn",label:"Not signed in"}:{cls:"warn",label:"Not installed"}}function qq({h:e}){return e.authMethod?h.jsx(h.Fragment,{children:e.authMethod==="oauth"?"OAuth (subscription login)":"API key"}):h.jsx(h.Fragment,{children:"—"})}function Gq(){const[e,t]=R.useState(null),[n,r]=R.useState("claude-code"),[i,a]=R.useState(!1),o=(c,d=!1)=>{a(!0),Rf(c,d).then(t).catch(()=>{}).finally(()=>a(!1))};R.useEffect(()=>o(!1),[]),R.useEffect(()=>p_(()=>o(!0)),[]);const l=e==null?void 0:e.find(c=>c.id===n);return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Harnesses"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",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."}),h.jsx("div",{className:"harness-tabs flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-md [&_button]:font-semibold [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(e??[]).map(c=>h.jsxs("button",{className:c.id===n?"active":"",onClick:()=>r(c.id),children:[c.name,h.jsx("span",{className:`harness-dot w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${Qg(c).cls}`})]},c.id))}),e?l?h.jsxs("div",{className:Ba,children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("span",{className:`${dr} ${Qg(l).cls}`,children:Qg(l).label}),h.jsx("div",{className:"spacer",style:{flex:1}}),h.jsxs("button",{className:rr,onClick:()=>o(!0,!0),disabled:i,children:[h.jsx(ch,{size:12,className:i?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," Refresh"]})]}),h.jsxs("div",{className:Zs,children:[h.jsx("span",{className:"k",children:"Binary"}),h.jsx("span",{className:"v",children:l.binPath??"not found on PATH"}),h.jsx("span",{className:"k",children:"Version"}),h.jsx("span",{className:"v",children:l.version??"—"}),h.jsx("span",{className:"k",children:"Auth"}),h.jsx("span",{className:"v",children:h.jsx(qq,{h:l})}),l.account&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:l.id==="opencode"?"Providers":"Account"}),h.jsx("span",{className:"v",children:l.account})]}),l.org&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:"Org"}),h.jsx("span",{className:"v",children:l.org})]}),l.plan&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:"Plan"}),h.jsx("span",{className:"v",children:l.plan})]}),h.jsx("span",{className:"k",children:"Agent models"}),h.jsx("span",{className:"v",children:l.models.length>0?`${l.models.length} available — ${l.models.slice(0,4).map(c=>Mf(c)).join(", ")}${l.models.length>4?", …":""}`:"none"})]}),!l.agentReady&&l.agentNote&&h.jsx("p",{className:En,children:l.agentNote})]}):null:h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Detecting harnesses…"]})]})}function Vq({s:e}){if(!e.configured)return h.jsx("span",{className:dr,children:"Not configured"});const t=e.preflight;return t.kubectlFound?t.reachable?t.canCreateJobs?h.jsx("span",{className:Cs,children:"Connected"}):h.jsx("span",{className:Li,children:"No job-create permission"}):h.jsx("span",{className:Li,children:"Cluster unreachable"}):h.jsx("span",{className:Li,children:"kubectl not found"})}function Wq(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(""),[c,d]=R.useState(!1),[m,f]=R.useState(null),g=S=>{t(S),a(S.context??""),l(S.namespace)};R.useEffect(()=>{ZR().then(g).catch(S=>r(S instanceof Error?S.message:String(S)))},[]);const b=e!==null&&i===(e.context??"")&&o.trim()===e.namespace;async function k(S){if(S.preventDefault(),!c){d(!0),f(null);try{g(await QR({context:i,namespace:o.trim()}))}catch(x){f(x instanceof Error?x.message:String(x))}finally{d(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on your own cluster with ",h.jsx("code",{children:"--backend k8s"}),". The run's resources (image, GPUs, topology) come from a manifest committed on the experiment branch (default ",h.jsx("code",{children:".orx/k8s.yaml"}),"); only the cluster context and namespace live here. Auth comes from your kubeconfig."]}),n?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Zs,children:[h.jsx("span",{className:"k",children:"Cluster"}),h.jsx("span",{className:"v",children:h.jsx(Vq,{s:e})})]}),e.preflight.error&&h.jsx("p",{className:En,children:e.preflight.error}),h.jsxs("form",{className:yh,onSubmit:k,children:[h.jsxs("div",{className:"row2",children:[h.jsxs("label",{children:["Context",h.jsxs("select",{value:i,onChange:S=>a(S.target.value),children:[h.jsxs("option",{value:"",children:["kubectl default",e.currentContext?` (${e.currentContext})`:""]}),e.contexts.map(S=>h.jsx("option",{value:S,children:S},S))]})]}),h.jsxs("label",{children:["Namespace",h.jsx("input",{className:nn,type:"text",value:o,onChange:S=>l(S.target.value),placeholder:"default",autoComplete:"off",spellCheck:!1})]})]}),m&&h.jsx("div",{className:"error",children:m}),h.jsx("div",{className:"actions",children:h.jsx("button",{type:"submit",className:Xr,disabled:c||b,children:c?"Saving…":"Save"})})]}),h.jsxs("div",{className:Ba,children:[h.jsx("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:h.jsx("h3",{children:"Run manifest"})}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Each run applies the manifest committed on its experiment branch — default"," ",h.jsx("code",{children:".orx/k8s.yaml"}),", or ",h.jsx("code",{children:"--manifest "}),". It declares whatever the run needs (image, GPU requests, an Indexed Job across nodes, extra Services, …); orx injects the run script as ",h.jsx("code",{children:"$ORX_SCRIPT"}),", the"," ",h.jsx("code",{children:"orx-env"})," Secret, run labels, and a default timeout, and requires exactly one Job (or one labelled ",h.jsx("code",{children:'orx-primary: "true"'}),") whose completion is the run's. Logs follow that Job's leader pod. Use"," ",h.jsx("code",{children:"{{ORX_RUN}}"})," in resource names to keep re-runs collision-free."]})]})]}):h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Checking kubectl…"]})]})}const Yq={env:"MODAL_TOKEN_ID env var",syncedEnv:"~/.openresearch/env",modalToml:"~/.modal.toml (modal token new)"};function Xq({s:e}){return e.ready?h.jsx("span",{className:Cs,children:"Connected"}):!e.tokenConfigured&&!e.modalImportable?h.jsx("span",{className:dr,children:"Not set up"}):e.modalImportable?e.tokenConfigured?h.jsx("span",{className:dr,children:"Unknown"}):h.jsx("span",{className:Li,children:"No token"}):h.jsx("span",{className:Li,children:e.envProvisioned?"Env broken":"Env not built"})}function Kq(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(!1),[o,l]=R.useState(null);R.useEffect(()=>{JR().then(t).catch(d=>r(d instanceof Error?d.message:String(d)))},[]);async function c(){if(!i){a(!0),l(null);try{t(await eD())}catch(d){l(d instanceof Error?d.message:String(d))}finally{a(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Serverless GPUs on your own Modal account with"," ",h.jsx("code",{children:"--backend modal --flavor "})," (t4, a10g, a100-80gb, h100, …). orx manages a dedicated Python env with the Modal SDK; sandboxes scale to zero between runs."]}),n?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Zs,children:[h.jsx("span",{className:"k",children:"Status"}),h.jsx("span",{className:"v",children:h.jsx(Xq,{s:e})}),h.jsx("span",{className:"k",children:"Environment"}),h.jsx("span",{className:"v",children:e.modalImportable?"Ready":e.envProvisioned?"Provisioned (modal import failing)":"Not built yet"}),h.jsx("span",{className:"k",children:"Token"}),h.jsx("span",{className:"v",children:e.tokenSource?Yq[e.tokenSource]:"Not configured"})]}),!e.tokenConfigured&&h.jsxs("p",{className:En,children:["No Modal token found. Run ",h.jsx("code",{children:"modal token new"}),", or add"," ",h.jsx("code",{children:"MODAL_TOKEN_ID"})," and ",h.jsx("code",{children:"MODAL_TOKEN_SECRET"})," in the Environment tab."]}),e.error&&e.envProvisioned&&!e.modalImportable&&h.jsx("p",{className:En,children:e.error}),o&&h.jsx("div",{className:"error",children:o}),!e.modalImportable&&h.jsx("div",{className:"actions",children:h.jsx("button",{className:Xr,onClick:()=>void c(),disabled:i,children:i?"Setting up… (~30–60s)":"Set up environment"})})]}):h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Checking Modal…"]})]})}function Zq({test:e}){if(e===void 0)return h.jsx("span",{className:"muted text-muted",children:"never tested"});if(e==="testing")return h.jsx("span",{className:Pt});const t=e.reachable?e.toolsFound?h.jsx("span",{className:Cs,children:"Ready"}):h.jsx("span",{className:Li,children:"Missing bash/tar"}):h.jsx("span",{className:Li,title:e.error??void 0,children:"Unreachable"});return h.jsxs(h.Fragment,{children:[t,h.jsx("span",{className:"ssh-tested-at block mt-0.5 text-muted text-xs",children:Ks(e.testedAt)})]})}function Qq(){const[e,t]=R.useState(null),[n,r]=R.useState({});R.useEffect(()=>{aD().then(t).catch(()=>t([]))},[]);async function i(a){r(o=>({...o,[a]:"testing"}));try{const o=await oD(a);r(l=>({...l,[a]:o}))}catch(o){r(l=>({...l,[a]:{reachable:!1,toolsFound:!1,error:o instanceof Error?o.message:String(o),testedAt:Date.now()}}))}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run experiments directly on your own boxes with"," ",h.jsx("code",{children:"--backend ssh --host "}),". Hosts come from"," ",h.jsx("code",{children:"~/.ssh/config"}),"; auth uses your keys/agent (orx never reads a key). The host just needs ",h.jsx("code",{children:"git"})," and ",h.jsx("code",{children:"bash"}),"."]}),e===null?h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Reading ~/.ssh/config…"]}):e.length===0?h.jsx("p",{className:"settings-empty text-muted text-md mt-1 mx-0 mb-0",children:"No hosts found in ~/.ssh/config."}):h.jsxs("table",{className:"flavor-table w-full border-collapse text-md [&_th]:pt-[5px] [&_th]:pr-2.5 [&_th]:pb-[5px] [&_th]:pl-0 [&_th]:border-b [&_th]:border-b-border [&_th]:text-left [&_th]:font-medium [&_th]:text-text [&_td]:pt-[5px] [&_td]:pr-2.5 [&_td]:pb-[5px] [&_td]:pl-0 [&_td]:border-b [&_td]:border-b-border-variant ssh-table table-fixed [&_th:nth-child(1)]:w-[20%] [&_th:nth-child(2)]:w-[26%] [&_th:nth-child(4)]:w-27 [&_th:nth-child(5)]:w-13 [&_td]:wrap-anywhere [&_td:last-child]:pr-0 [&_td:last-child]:text-right",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Host"}),h.jsx("th",{children:"Address"}),h.jsx("th",{children:"Identity"}),h.jsx("th",{children:"Status"}),h.jsx("th",{})]})}),h.jsx("tbody",{children:e.map(a=>h.jsxs("tr",{children:[h.jsx("td",{className:nn,children:a.host}),h.jsxs("td",{className:`${nn} muted text-muted`,children:[[a.user,a.hostname??"—"].filter(Boolean).join("@"),a.port?`:${a.port}`:""]}),h.jsx("td",{className:`${nn} muted text-muted`,children:a.identityFile??"—"}),h.jsx("td",{children:h.jsx(Zq,{test:n[a.host]??a.lastTest})}),h.jsx("td",{children:h.jsx("button",{className:rr,onClick:()=>void i(a.host),disabled:n[a.host]==="testing",children:"Test"})})]},a.host))})]})]})}function Jq({test:e}){return e===null?null:e==="testing"?h.jsx("span",{className:Pt}):e.reachable?e.slurmFound?e.toolsFound?h.jsx("span",{className:Cs,children:"Ready"}):h.jsx("span",{className:Li,children:"Missing bash/tar"}):h.jsx("span",{className:Li,children:"No Slurm CLI"}):h.jsx("span",{className:Li,title:e.error??void 0,children:"Unreachable"})}function eG(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(""),[c,d]=R.useState(""),[m,f]=R.useState(""),[g,b]=R.useState(!1),[k,S]=R.useState(null),[x,v]=R.useState(null),w=x!==null&&x!=="testing"?x:null,y=M=>{t(M),a(M.host??""),l(M.partition??""),d(M.account??""),f(M.timeLimit??"")};R.useEffect(()=>{lD().then(y).catch(M=>r(M instanceof Error?M.message:String(M)))},[]);const C=e!==null&&i===(e.host??"")&&o.trim()===(e.partition??"")&&c.trim()===(e.account??"")&&m.trim()===(e.timeLimit??"");async function N(M){if(M.preventDefault(),!g){b(!0),S(null);try{y(await cD({host:i,partition:o.trim(),account:c.trim(),timeLimit:m.trim()}))}catch(T){S(T instanceof Error?T.message:String(T))}finally{b(!1)}}}async function E(M){v("testing");try{v(await uD(M))}catch(T){v({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:T instanceof Error?T.message:String(T)})}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on your own cluster with ",h.jsx("code",{children:"--backend slurm [--flavor h100:2]"}),". orx submits via ",h.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?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[(w==null?void 0:w.error)&&h.jsx("p",{className:En,children:w.error}),w&&w.partitions.length>0&&h.jsxs("p",{className:En,children:["Partitions: ",h.jsx("code",{children:w.partitions.join(", ")})]}),h.jsxs("form",{className:yh,onSubmit:N,children:[h.jsxs("div",{className:"row2",children:[h.jsxs("label",{children:["Login node",h.jsxs("select",{value:i,onChange:M=>{a(M.target.value),v(null)},children:[h.jsx("option",{value:"",children:"not set (pass --host per launch)"}),i&&!e.hosts.some(M=>M.host===i)&&h.jsxs("option",{value:i,children:[i," (not in ~/.ssh/config)"]}),e.hosts.map(M=>h.jsx("option",{value:M.host,children:M.host},M.host))]})]}),h.jsxs("label",{children:["Partition",h.jsx("input",{className:nn,type:"text",list:"slurm-partitions",value:o,onChange:M=>l(M.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1}),h.jsx("datalist",{id:"slurm-partitions",children:w==null?void 0:w.partitions.map(M=>h.jsx("option",{value:M},M))})]})]}),h.jsxs("div",{className:"row2",children:[h.jsxs("label",{children:["Account",h.jsx("input",{className:nn,type:"text",value:c,onChange:M=>d(M.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1})]}),h.jsxs("label",{children:["Time limit",h.jsx("input",{className:nn,type:"text",value:m,onChange:M=>f(M.target.value),placeholder:"cluster default (e.g. 4h, 30m)",autoComplete:"off",spellCheck:!1})]})]}),k&&h.jsx("div",{className:"error",children:k}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"submit",className:Xr,disabled:g||C,children:g?"Saving…":"Save"}),h.jsx("button",{type:"button",className:ci,onClick:()=>void E(i),disabled:!i||x==="testing",title:i?void 0:"Pick a login node first",children:"Test connection"}),h.jsx(Jq,{test:x})]})]})]}):h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Loading slurm settings…"]})]})}function tG(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(!1),[c,d]=R.useState(null),[m,f]=R.useState(null),g=m!==null&&m!=="testing"?m:null,b=v=>{t(v),a(v.address??"")};R.useEffect(()=>{dD().then(b).catch(v=>r(v instanceof Error?v.message:String(v)))},[]);const k=e!==null&&i===(e.address??"");async function S(v){if(v.preventDefault(),!o){l(!0),d(null);try{b(await hD({address:i}))}catch(w){d(w instanceof Error?w.message:String(w))}finally{l(!1)}}}async function x(){f("testing");try{f(await fD(i.trim()||void 0))}catch(v){f({reachable:!1,address:i.trim()||"(unknown)",rayVersion:null,error:v instanceof Error?v.message:String(v)})}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on a Ray cluster with ",h.jsx("code",{children:"--backend ray [--flavor gpu:1]"}),". orx submits via the Ray Jobs API (Dashboard URL). Address resolution: this setting, then ",h.jsx("code",{children:"ASTROAI_RAY_JOBS_ADDRESS"})," /"," ",h.jsx("code",{children:"RAY_DASHBOARD_URL"}),", then ",h.jsx("code",{children:"http://127.0.0.1:8265"}),". Optional flavor maps to entrypoint CPUs/GPUs/memory (e.g."," ",h.jsx("code",{children:"cpu:2"}),", ",h.jsx("code",{children:"gpu:1,mem:8GiB"}),")."]}),n?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:En,children:["Effective: ",h.jsx("code",{children:e.resolvedAddress})," (",e.source,")"]}),(g==null?void 0:g.error)&&h.jsx("p",{className:En,children:g.error}),(g==null?void 0:g.reachable)&&g.rayVersion&&h.jsxs("p",{className:En,children:["Ray version: ",h.jsx("code",{children:g.rayVersion})]}),h.jsxs("form",{className:yh,onSubmit:S,children:[h.jsxs("label",{children:["Jobs / Dashboard URL",h.jsx("input",{className:nn,type:"text",value:i,onChange:v=>{a(v.target.value),f(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),c&&h.jsx("div",{className:"error",children:c}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"submit",className:Xr,disabled:o||k,children:o?"Saving…":"Save"}),h.jsx("button",{type:"button",className:ci,onClick:()=>void x(),disabled:m==="testing",children:"Test connection"}),h.jsx(nG,{test:m})]})]})]}):h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Loading Ray settings…"]})]})}function nG({test:e}){return e===null?null:e==="testing"?h.jsx("span",{className:dr,children:"Testing…"}):e.reachable?h.jsx("span",{className:Cs,children:"Reachable"}):h.jsx("span",{className:b_,children:"Unreachable"})}function rG(){const[e,t]=R.useState(null),[n,r]=R.useState(null);return R.useEffect(()=>{mD().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]),h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run experiments as detached, supervised processes on the machine running orx with"," ",h.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?h.jsx("div",{className:"error",children:n}):e?h.jsxs("div",{className:Zs,children:[h.jsx("span",{className:"k",children:"Hostname"}),h.jsx("span",{className:`v ${nn}`,children:e.hostname}),h.jsx("span",{className:"k",children:"System"}),h.jsxs("span",{className:"v",children:[e.os,"/",e.arch,e.chip?` — ${e.chip}`:""]}),h.jsx("span",{className:"k",children:"CPU"}),h.jsx("span",{className:"v",children:e.cpuCount>0?`${e.cpuCount} cores`:"—"}),h.jsx("span",{className:"k",children:"RAM"}),h.jsx("span",{className:"v",children:e.memBytes!==null?Lo(e.memBytes):"—"}),h.jsx("span",{className:"k",children:"GPUs"}),h.jsx("span",{className:"v",children:e.gpus.length===0?"none detected (nvidia-smi)":e.gpus.map(i=>`${i.name}${i.memMib!==null?` — ${Lo(i.memMib*1024*1024)}`:""}`).join(", ")})]}):h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Detecting hardware…"]})]})}function iG(){const[e,t]=R.useState(null),[n,r]=R.useState(null);return R.useEffect(()=>{gD().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]),h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on an ephemeral OpenResearch box billed to your org with"," ",h.jsx("code",{children:"--backend openresearch --flavor "})," (h100_sxm, cpu5c, …; browse with ",h.jsx("code",{children:"orx compute"}),"). The box is provisioned for the run and deleted when it ends. Needs ",h.jsx("code",{children:"orx login"})," and a registered SSH key."]}),n?h.jsx("div",{className:"error",children:n}):e?e.loggedIn?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Zs,children:[h.jsx("span",{className:"k",children:"Status"}),h.jsx("span",{className:"v",children:h.jsx("span",{className:Cs,children:"Signed in"})}),h.jsx("span",{className:"k",children:"Orgs"}),h.jsx("span",{className:"v",children:e.orgs.length>0?e.orgs.join(", "):"—"}),h.jsx("span",{className:"k",children:"SSH key"}),h.jsx("span",{className:"v",children:e.sshKeyStatus==="matched"?h.jsx("span",{className:Cs,children:"On this computer"}):e.sshKeyStatus==="no_local_match"?h.jsx("span",{className:b_,children:"Not on this computer"}):e.sshKeyStatus==="none_registered"?h.jsx("span",{className:Li,children:"None registered"}):h.jsx("span",{className:dr,children:"Unknown"})})]}),e.sshKeyStatus==="none_registered"&&(e.sshKeyPath?h.jsxs("p",{className:En,children:["Add one with ",h.jsxs("code",{children:["orx ssh-key add ",e.sshKeyPath]}),"."]}):h.jsxs("p",{className:En,children:["No key on this computer yet — create one with"," ",h.jsx("code",{children:"ssh-keygen -t ed25519"}),", then add it with"," ",h.jsx("code",{children:"orx ssh-key add"}),"."]})),e.sshKeyStatus==="no_local_match"&&(e.sshKeyPath?h.jsxs("p",{className:En,children:["Register this computer with ",h.jsxs("code",{children:["orx ssh-key add ",e.sshKeyPath]}),", or load a registered key with ",h.jsx("code",{children:"ssh-add"}),"."]}):h.jsxs("p",{className:En,children:["No key on this computer to register — load a registered key with"," ",h.jsx("code",{children:"ssh-add"}),", or create one with"," ",h.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),e.error&&h.jsx("p",{className:En,children:e.error})]}):h.jsxs("p",{className:En,children:["Not signed in. Run ",h.jsx("code",{children:"orx login"})," in a terminal to connect your OpenResearch account."]}):h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Checking credentials…"]})]})}const _w={local:"This machine",hf:"HF Jobs",modal:"Modal",k8s:"Kubernetes",ssh:"SSH",slurm:"Slurm",ray:"Ray",openresearch:"OpenResearch"},sG={local:"local_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},aG=["hf","modal","slurm","ray","openresearch"],xw=["hf","modal","openresearch"],yw={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"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]};function oG({t:e,isDefault:t}){return e.id==="local"?h.jsx("span",{className:Cs,children:"Ready"}):e.unverified?h.jsx("span",{className:dr,children:"Unknown"}):!e.configured&&t?h.jsx("span",{className:b_,children:"Not configured"}):e.configured?h.jsx("span",{className:Cs,children:"Configured"}):h.jsx("span",{className:dr,children:"Not set up"})}function lG({target:e,flavor:t,projectId:n,onSaved:r}){var g;const[i,a]=R.useState(t??""),[o,l]=R.useState(!1),[c,d]=R.useState(null);R.useEffect(()=>a(t??""),[t]);async function m(b){if(b.preventDefault(),!o){l(!0),d(null);try{r(await bS({backend:e,flavor:i.trim()||null,projectId:n}))}catch(k){d(k instanceof Error?k.message:String(k))}finally{l(!1)}}}const f=i.trim()===(t??"");return h.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-mono [&_.repo-hint]:font-normal [&_.repo-hint]:text-xs [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-left [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-[0_2px_8px_rgb(0_0_0_/_5%)] [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-semibold [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-semibold [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pr-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:pl-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))] [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-left [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-md [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:font-mono [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-md [&_.paper-pick_.title]:font-semibold flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-xs [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.new-project-actions_.primary]:ml-auto [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap settings-form mt-3.5 pt-3.5 border-t border-t-border compute-flavor-form mb-3.5 [&_label]:max-w-80",onSubmit:m,children:[h.jsxs("label",{children:["Default flavor",h.jsx("input",{className:nn,type:"text",list:`flavors-${e}`,value:i,onChange:b=>a(b.target.value),placeholder:xw.includes(e)?`e.g. ${((g=yw[e])==null?void 0:g[1])??""}`:"none (CPU-only)",autoComplete:"off",spellCheck:!1}),h.jsx("datalist",{id:`flavors-${e}`,children:(yw[e]??[]).map(b=>h.jsx("option",{value:b},b))})]}),c&&h.jsx("div",{className:"error",children:c}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"submit",className:rr,disabled:o||f,children:o?"Saving…":"Save flavor"}),xw.includes(e)&&!t&&h.jsxs("span",{className:"muted text-muted compute-flavor-hint text-sm",children:["This backend requires a flavor — without a default one, each launch must pass"," ",h.jsx("code",{children:"--flavor"}),"."]})]})]})}function cG({target:e,isDefault:t,isFallbackDefault:n,defaultFlavor:r,open:i,onToggle:a,onSettings:o,onError:l,projectId:c}){const[d,m]=R.useState(!1),[f,g]=R.useState(!1);i&&!d&&m(!0);async function b(k){if(!f){g(!0);try{o(await bS({backend:k,projectId:c}))}catch(S){l(S instanceof Error?S.message:String(S))}finally{g(!1)}}}return h.jsxs("div",{className:`compute-row bg-background border border-border rounded-lg [&.disabled]:opacity-52 [&.disabled_.compute-row-head]:cursor-default [&.open_.compute-row-head:hover]:rounded-[var(--radius-lg)_var(--radius-lg)_0_0] [&.open_.compute-chevron]:rotate-180${i?" open":""}${e.enabled?"":" disabled"}`,children:[h.jsxs("div",{className:"compute-row-head flex items-center gap-2.5 py-3 px-3.5 cursor-pointer select-none [&:hover]:bg-surface [&:hover]:rounded-lg [&_.badge]:flex-none",onClick:e.enabled?a:void 0,children:[h.jsx("span",{className:"compute-row-logo inline-flex items-center flex-none",children:h.jsx(oC,{kind:sG[e.id],size:18})}),h.jsx("span",{className:"compute-row-name text-md font-semibold text-text flex-none",children:_w[e.id]}),h.jsx("span",{className:"compute-row-summary flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-muted text-sm",children:e.summary}),h.jsx(oG,{t:e,isDefault:t}),t?h.jsx("span",{className:"badge inline-flex items-center font-sans text-xs font-medium py-px px-[7px] border border-border rounded-sm [&.ok]:text-accent-green [&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle [&.err]:text-accent-red [&.err]:border-accent-red [&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber [&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle compute-default-pill flex-none text-primary border-primary",children:n?"Local fallback":"Default"}):h.jsx("button",{type:"button",className:`${rr} compute-make-default flex-none`,onClick:k=>{k.stopPropagation(),b(e.id)},disabled:f||!e.enabled,children:"Make default"}),h.jsx("button",{type:"button",className:"compute-chevron-btn flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":i,"aria-label":`${i?"Collapse":"Expand"} ${_w[e.id]}`,disabled:!e.enabled,onClick:k=>{k.stopPropagation(),e.enabled&&a()},children:h.jsx(Bl,{size:16,className:"compute-chevron text-muted transition-transform duration-120 ease-standard"})})]}),d&&e.enabled&&h.jsxs("div",{className:"compute-row-body border-t border-t-border p-3.5 [&_.settings-card]:mb-0 [&_.settings-card]:mt-3.5",hidden:!i,children:[t&&!n&&h.jsxs("p",{className:"settings-note mt-2.5 mx-0 mb-0 text-sm py-2 px-2.5 border border-accent-amber rounded-md bg-accent-amber-subtle text-accent-amber font-medium compute-default-note flex items-center gap-2.5 flex-wrap",children:["The agent launches runs here unless you tell it otherwise, and so does"," ",h.jsx("code",{children:"orx exp run"})," with no ",h.jsx("code",{children:"--backend"})," flag."," ",h.jsx("button",{type:"button",className:rr,onClick:()=>void b(null),disabled:f,children:"Clear default"})]}),t&&!e.configured&&h.jsx("p",{className:En,children:"This target is the default but isn't configured — launches will fail until it's set up below."}),t&&aG.includes(e.id)&&h.jsx(lG,{target:e.id,flavor:r,projectId:c,onSaved:o}),e.id==="local"&&h.jsx(rG,{}),e.id==="hf"&&h.jsx(pG,{}),e.id==="modal"&&h.jsx(Kq,{}),e.id==="k8s"&&h.jsx(Wq,{}),e.id==="ssh"&&h.jsx(Qq,{}),e.id==="slurm"&&h.jsx(eG,{}),e.id==="ray"&&h.jsx(tG,{}),e.id==="openresearch"&&h.jsx(iG,{})]})]})}function uG({project:e,onViewHistory:t}){const[n,r]=R.useState(null),[i,a]=R.useState(null),[o,l]=R.useState(null),[c,d]=R.useState(null),m=R.useRef(0);R.useEffect(()=>{m.current++,r(null),l(null),a(null),d(null)},[e==null?void 0:e.id]),R.useEffect(()=>{const S=++m.current;pD(e==null?void 0:e.id).then(x=>{S===m.current&&(r(x),a(null))}).catch(x=>{if(S!==m.current)return;const v=x instanceof Error?x.message:String(x);r(w=>(w===null?a(v):d(v),w))})},[o,e==null?void 0:e.id]);const f=S=>{m.current++,r(S),d(null)},g=n?n.targets:null,b=(n==null?void 0:n.defaultBackend)==="local"&&n.configuredDefaultBackend!==null&&n.configuredDefaultBackend!==void 0&&n.configuredDefaultBackend!=="local",k=S=>h.jsx(cG,{target:S,isDefault:(n==null?void 0:n.defaultBackend)===S.id,isFallbackDefault:!!(b&&S.id==="local"),defaultFlavor:(n==null?void 0:n.defaultFlavor)??null,open:S.enabled&&o===S.id,onToggle:()=>l(x=>x===S.id?null:S.id),onSettings:f,onError:d,projectId:e==null?void 0:e.id},`${(e==null?void 0:e.id)??"none"}:${S.id}`);return h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:"Compute"}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Where ",h.jsx("code",{children:"orx exp run"})," executes. Pick a default target; the agent uses it when a launch doesn't name a backend (",h.jsx("code",{children:"--backend "})," always wins)."]}),h.jsx(TG,{onViewHistory:t}),h.jsx("h2",{className:"compute-section-title mt-0 mx-0 mb-2.5 text-lg",children:"Targets"}),i?h.jsx("div",{className:"error",children:i}):g?h.jsxs(h.Fragment,{children:[c&&h.jsx("div",{className:"error",children:c}),h.jsxs("div",{className:"compute-list flex flex-col gap-2.5 mb-3.5",children:[g.filter(S=>S.id==="local").map(k),g.filter(S=>S.id!=="local").map(k)]}),b&&h.jsxs("p",{className:En,children:["Using this machine because the saved ",n==null?void 0:n.configuredDefaultBackend," default is not currently configured."]}),h.jsxs("p",{className:"compute-footnote flex items-start gap-1.5 mt-0.5 mx-0 mb-0 text-sm text-muted [&_svg]:flex-none [&_svg]:mt-px",children:[h.jsx(MM,{size:14,"aria-hidden":"true"}),h.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."})]})]}):h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Checking compute targets…"]})]})}const dG={env:"HF_TOKEN env var",openresearchEnv:"~/.openresearch/env",hfCache:"~/.cache/huggingface/token (hf auth login)"};function hG({settings:e}){return e.configured?e.valid?h.jsx("span",{className:Cs,children:"Connected"}):h.jsx("span",{className:Li,children:"Invalid token"}):h.jsx("span",{className:dr,children:"Not configured"})}function fG({settings:e}){return!e.configured||!e.valid?null:e.jobsWrite===!0?h.jsx("span",{className:Cs,children:"Jobs: write OK"}):e.jobsWrite===!1?h.jsx("span",{className:Li,children:"No job.write permission"}):h.jsx("span",{className:dr,children:"Jobs permission unknown"})}function pG(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(!1),[c,d]=R.useState(null),m=R.useRef(!1);R.useEffect(()=>{GR().then(g=>{m.current||t(g)}).catch(g=>{m.current||r(g instanceof Error?g.message:String(g))})},[]);async function f(g){if(g.preventDefault(),!(!i.trim()||o)){l(!0),d(null);try{const b=await VR(i.trim());m.current=!0,t(b),r(null),a("")}catch(b){d(b instanceof Error?b.message:String(b))}finally{l(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run experiments on your Hugging Face account with"," ",h.jsx("code",{children:"--backend hf --flavor "})," (t4-small, a10g-small, a100-large, …). Billed to HF per minute."]}),n?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Zs,children:[h.jsx("span",{className:"k",children:"Status"}),h.jsx("span",{className:"v",children:h.jsx(hG,{settings:e})}),h.jsx("span",{className:"k",children:"Account"}),h.jsx("span",{className:"v",children:e.username??"—"}),h.jsx("span",{className:"k",children:"Token"}),h.jsx("span",{className:"v",children:e.maskedToken??"—"}),h.jsx("span",{className:"k",children:"Source"}),h.jsx("span",{className:"v",children:e.source?dG[e.source]:"Not configured"}),h.jsx("span",{className:"k",children:"Jobs"}),h.jsxs("span",{className:"v",children:[h.jsx(fG,{settings:e}),(!e.configured||!e.valid)&&"—"]})]}),e.source==="env"&&h.jsx("p",{className:En,children:"HF_TOKEN is set in the environment and overrides any token saved here."}),e.valid&&e.jobsWrite===null&&h.jsxs("p",{className:En,children:["This token is valid but doesn't report whether it can launch Jobs — OAuth tokens from ",h.jsx("code",{children:"hf auth login"})," never do. Launches may still work; for a definitive check, save a write-scoped token from"," ",h.jsx("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",children:"huggingface.co/settings/tokens"}),"."]})]}):h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Loading status…"]}),h.jsxs("form",{className:yh,onSubmit:f,children:[h.jsxs("label",{children:[e!=null&&e.configured?"Replace token":"New token",h.jsx("input",{type:"password",value:i,onChange:g=>a(g.target.value),placeholder:"hf_…",autoComplete:"off"})]}),c&&h.jsx("div",{className:"error",children:c}),h.jsx("div",{className:"actions",children:h.jsx("button",{type:"submit",className:Xr,disabled:!i.trim()||o,children:o?"Validating…":"Save"})})]})]})}const cC=/^hf_[A-Za-z0-9]{10,}$/;function uC(){return h.jsx("tr",{children:h.jsx("td",{colSpan:3,children:h.jsxs("p",{className:En,children:["This value looks like a Hugging Face token — compute runs only read it from"," ",h.jsx("code",{children:"HF_TOKEN"}),". Save it under that key if it's meant for HF Jobs."]})})})}const ww=["HF_TOKEN","WANDB_API_KEY"];function mG({name:e,entry:t,onVars:n,onError:r}){const[i,a]=R.useState(""),[o,l]=R.useState(!1),c=f=>r(`${e}: ${f instanceof Error?f.message:String(f)}`);async function d(){if(!(!i.trim()||o)){l(!0);try{n(await gS(e,i.trim())),a("")}catch(f){c(f)}finally{l(!1)}}}async function m(){if(!o){l(!0);try{n(await nD(e))}catch(f){c(f)}finally{l(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("tr",{children:[h.jsx("td",{className:nn,children:e}),h.jsx("td",{className:`${nn} muted text-muted`,children:t?h.jsxs(h.Fragment,{children:[t.maskedValue,t.inProcessEnv&&h.jsx("span",{className:dr,children:"Overridden by env"})]}):h.jsx("input",{className:nn,type:"password",value:i,onChange:f=>a(f.target.value),onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),d()),f.key==="Escape"&&!o&&a("")},placeholder:"value","aria-label":`Value for ${e}`,autoComplete:"new-password",disabled:o})}),h.jsx("td",{children:t?h.jsx("button",{className:nr,title:`Delete ${e}`,"aria-label":`Delete ${e}`,onClick:()=>void m(),disabled:o,children:h.jsx(uh,{size:13})}):i.trim()&&h.jsx("button",{className:rr,onClick:()=>void d(),disabled:o,children:o?"Saving…":"Save"})})]}),!t&&e!=="HF_TOKEN"&&cC.test(i.trim())&&h.jsx(uC,{})]})}function gG({onVars:e,onError:t,onDone:n}){const[r,i]=R.useState(""),[a,o]=R.useState(""),[l,c]=R.useState(!1);async function d(){if(!(!r.trim()||!a.trim()||l)){c(!0);try{e(await gS(r.trim(),a.trim())),n()}catch(f){t(`${r.trim()}: ${f instanceof Error?f.message:String(f)}`)}finally{c(!1)}}}const m=f=>{f.key==="Enter"&&(f.preventDefault(),d()),f.key==="Escape"&&!l&&n()};return h.jsxs(h.Fragment,{children:[h.jsxs("tr",{children:[h.jsx("td",{children:h.jsx("input",{autoFocus:!0,className:nn,type:"text",value:r,onChange:f=>i(f.target.value),onKeyDown:m,placeholder:"MY_API_KEY","aria-label":"New variable key",autoComplete:"off",spellCheck:!1,disabled:l})}),h.jsx("td",{children:h.jsx("input",{className:nn,type:"password",value:a,onChange:f=>o(f.target.value),onKeyDown:m,placeholder:"value","aria-label":"New variable value",autoComplete:"new-password",disabled:l})}),h.jsxs("td",{children:[h.jsx("button",{className:rr,onClick:()=>void d(),disabled:l||!r.trim()||!a.trim(),children:l?"Saving…":"Save"}),h.jsx("button",{className:nr,title:"Cancel","aria-label":"Cancel new variable",onClick:n,disabled:l,children:h.jsx(Vr,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&cC.test(a.trim())&&h.jsx(uC,{})]})}function bG(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(!1),[o,l]=R.useState(null);R.useEffect(()=>{tD().then(t).catch(f=>r(f instanceof Error?f.message:String(f)))},[]);const c=f=>{t(f),l(null)},d=e===null?[]:e.map(f=>f.key).filter(f=>!ww.includes(f)),m=[...ww,...d];return h.jsxs("div",{className:Ba,children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("h3",{children:"Environment variables"}),h.jsx("div",{className:"spacer",style:{flex:1}}),h.jsxs("button",{className:rr,onClick:()=>a(!0),disabled:i||e===null,children:[h.jsx(o_,{size:12})," Add variable"]})]}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Stored in ",h.jsx("code",{children:"~/.openresearch/env"})," and passed to runs and the research agent."," ",h.jsx("code",{children:"HF_TOKEN"})," and ",h.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?h.jsx("div",{className:"error",children:n}):e===null?h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Loading…"]}):h.jsx("table",{className:"env-table w-full border-collapse text-md table-fixed [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ml-2 [&_input]:w-full [&_input]:border-0 [&_input]:bg-transparent [&_input]:p-0 [&_input:focus]:shadow-[0_1px_0_0_var(--text)] [&_td]:h-9 [&_td]:pt-0 [&_td]:pr-2.5 [&_td]:pb-0 [&_td]:pl-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-right [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-left [&_.icon-btn]:ml-2 [&_.icon-btn]:align-middle [&_.icon-btn:hover]:text-accent-red",children:h.jsxs("tbody",{children:[m.map(f=>h.jsx(mG,{name:f,entry:e.find(g=>g.key===f),onVars:c,onError:l},f)),i&&h.jsx(gG,{onVars:c,onError:l,onDone:()=>a(!1)})]})}),o&&h.jsx("div",{className:"error",children:o})]})}const sd=[{value:"system",label:"System",icon:UM},{value:"light",label:"Light",icon:pR},{value:"dark",label:"Dark",icon:GM}];function vG(){const[e,t]=Oq(),n=r=>{var d;const i=r.key==="ArrowRight"||r.key==="ArrowDown"?1:r.key==="ArrowLeft"||r.key==="ArrowUp"?-1:0;if(!i)return;r.preventDefault();const a=[...r.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(m=>m===document.activeElement),c=((o===-1?sd.findIndex(m=>m.value===e):o)+i+sd.length)%sd.length;t(sd[c].value),(d=a[c])==null||d.focus()};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Appearance"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"How the interface looks on this device."}),h.jsx("div",{className:Ba,children:h.jsxs("div",{className:wl,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"Theme"}),h.jsx("p",{children:"System follows your operating system's light or dark setting."})]}),h.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":"Theme",onKeyDown:n,children:sd.map(({value:r,label:i,icon:a})=>h.jsxs("button",{type:"button",role:"radio","aria-checked":e===r,tabIndex:e===r?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${e===r?"on":""}`,onClick:()=>t(r),children:[h.jsx(a,{size:14}),i]},r))})]})})]})}const _G={installer:"Installed with the orx installer","app-bundle":"macOS app",cargo:"Installed with cargo",homebrew:"Installed with Homebrew",nix:"Managed by Nix",unknown:"Unknown install"},xG={cargo:"Re-run your cargo install to update.",homebrew:"Run brew upgrade to update.",nix:"Update it through your Nix configuration."};function yG(){const{status:e,error:t,apply:n}=iC(),[r,i]=R.useState(null),[a,o]=R.useState(null);if(!e)return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Updates"}),t?h.jsx("div",{className:Ba,children:h.jsx("div",{className:"error",children:t})}):h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Loading…"]})]});const l=async(c,d)=>{i(c),o(null);try{await d()}catch(m){o(m instanceof Error?m.message:String(m))}finally{i(null)}};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Updates"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"Keeping this copy of orx on the latest release."}),h.jsxs("div",{className:Ba,children:[h.jsxs("div",{className:Zs,children:[h.jsx("div",{className:"k",children:"Version"}),h.jsx("div",{className:"v",children:e.current}),h.jsx("div",{className:"k",children:"Latest"}),h.jsx("div",{className:"v",children:e.latest??"—"}),h.jsx("div",{className:"k",children:"Install"}),h.jsx("div",{className:"v",children:_G[e.channel]})]}),e.restartRequired&&h.jsx("div",{className:wl,children:h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"Restart to finish updating"}),h.jsxs("p",{children:["Version ",e.installedVersion," is installed. This window is still running"," ",e.current,"."]})]})}),e.selfUpdates?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:wl,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"Install updates automatically"}),h.jsxs("p",{children:["New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",e.envDisabled&&" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect."]})]}),h.jsx("button",{type:"button",role:"switch","aria-checked":e.autoUpdate,"aria-label":"Install updates automatically",className:`${__} ${e.autoUpdate?"on":""}`,disabled:r!==null,onClick:()=>void l("auto",()=>XR(!e.autoUpdate).then(n)),children:h.jsx("span",{})})]}),h.jsxs("div",{className:wl,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:e.updateAvailable?`Update to ${e.latest}`:"Check for updates"}),h.jsx("p",{children:e.updateAvailable?"Install the new release now instead of waiting for the background update.":"orx checks a few times a day on its own."})]}),h.jsx("button",{type:"button",className:rr,disabled:r!==null,onClick:()=>void l("apply",()=>YR().then(n)),children:r==="apply"?"Working…":e.updateAvailable?"Update now":"Check now"})]})]}):h.jsx("div",{className:wl,children:h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"orx can't update this install"}),h.jsx("p",{children:xG[e.channel]??"Reinstall with the orx installer to get automatic updates."})]})}),e.channel==="app-bundle"&&h.jsx(wG,{busy:r,run:l}),a&&h.jsx("div",{className:"error",children:a})]})]})}function wG({busy:e,run:t}){const[n,r]=R.useState(null),[i,a]=R.useState(!1),o=l=>void t("cli",()=>KR(l).then(c=>{r(c),a(!1)}).catch(c=>{throw a(!l&&String((c==null?void 0:c.message)??c).includes("--force")),c}));return h.jsxs("div",{className:wl,children:[h.jsxs("div",{children:[h.jsxs("div",{className:"project-default-title text-md font-semibold",children:["Install the ",h.jsx("code",{children:"orx"})," command"]}),n?h.jsxs("p",{children:[n.alreadyCurrent?"Already linked at ":"Linked ",h.jsx("code",{children:n.link}),".",!n.onPath&&` Add ${n.dir} to your PATH to use it.`]}):h.jsxs("p",{children:["Adds ",h.jsx("code",{children:"orx"})," to your terminal, pointing at this app — so the CLI and the app are always the same version."]})]}),h.jsx("button",{type:"button",className:rr,disabled:e!==null,onClick:()=>o(i),children:e==="cli"?"Working…":i?"Replace anyway":n?"Re-link":"Install"})]})}function SG(){const[e,t]=R.useState(null),[n,r]=R.useState(!1),[i,a]=R.useState(null),o=()=>{a(null),d_().then(t).catch(c=>a(c instanceof Error?c.message:String(c)))};R.useEffect(o,[]);const l=()=>{if(!e||n)return;const c=!e.githubForNewProjects;r(!0),a(null),xS(c,!0).then(t).catch(d=>a(d instanceof Error?d.message:String(d))).finally(()=>r(!1))};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"General"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"Defaults applied when you create a project."}),e?h.jsxs("div",{className:"settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md [&_>_.error]:whitespace-pre-wrap bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5 [&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0",children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("h3",{children:"GitHub publishing"}),h.jsx("span",{className:`${dr} ${e.githubAuthenticated?"ok":""}`,children:e.githubAuthenticated?`Connected via ${e.githubTokenSource}`:"Not connected"})]}),h.jsxs("div",{className:wl,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"Enable GitHub syncing for new projects"}),h.jsx("p",{children:"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots."})]}),h.jsx("button",{type:"button",role:"switch","aria-checked":e.githubForNewProjects,"aria-label":"Enable GitHub syncing for new projects",className:`${__} ${e.githubForNewProjects?"on":""}`,disabled:n||!e.githubAuthenticated&&!e.githubForNewProjects,onClick:l,children:h.jsx("span",{})})]}),!e.githubAuthenticated&&h.jsxs("div",{className:"project-default-connect [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0 [&_p]:text-muted [&_p]:text-sm mt-3.5 pt-3.5 border-t border-t-border-variant [&_.onb-token-form]:mt-2.5",children:[h.jsx("p",{children:"Connect GitHub to make publishing the default for new projects."}),h.jsx(aC,{onSaved:o})]}),i&&h.jsx("div",{className:"error",children:i})]}):i?h.jsx("div",{className:"error",children:i}):h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Loading…"]})]})}function kG({project:e,publicationError:t,onProjectUpdate:n}){const[r,i]=R.useState(null),[a,o]=R.useState(!1),[l,c]=R.useState(null),[d,m]=R.useState(!1),[f,g]=R.useState(!1),[b,k]=R.useState(null),S=R.useRef(0),x=!!(r!=null&&r.github.owner&&r.github.repo),v=()=>{const N=++S.current;i(null),c(null),e&&ED(e.id).then(E=>{N===S.current&&i(E)}).catch(E=>{N===S.current&&c(E instanceof Error?E.message:String(E))})};R.useEffect(v,[e==null?void 0:e.id]);const w=N=>{const E=N instanceof Error?N.message:String(N);return E.toLowerCase().includes("archived")?"GitHub rejected the push because this repository is archived and read-only. The local project is still available. Unarchive the repository on GitHub, then enable syncing here.":E.includes("(fetch first)")||E.includes("non-fast-forward")?"GitHub contains changes that are not in this local project. Pull the latest GitHub changes and resolve any conflicts in Git, then try enabling syncing again.":E.includes("403")||E.toLowerCase().includes("permission denied")?"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.":E},y=()=>{e&&(o(!0),c(null),TD(e.id).then(N=>{i(N.git),n(N.project),d_().then(E=>{!E.githubForNewProjects&&!E.githubDefaultPromptSeen&&m(!0)}).catch(()=>{})}).catch(N=>c(w(N))).finally(()=>o(!1)))},C=N=>{g(!0),k(null),xS(N,!0).then(()=>m(!1)).catch(E=>k(E instanceof Error?E.message:String(E))).finally(()=>g(!1))};return h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:"Repository"}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Git and GitHub settings for ",h.jsx("strong",{children:(e==null?void 0:e.name)??"the current project"}),". Local Git powers experiments; publishing is optional."]}),e?l&&!r?h.jsx("div",{className:"error",children:l}):r?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:vw,children:[h.jsx("h3",{children:"Local repository"}),h.jsxs("div",{className:Zs,children:[h.jsx("span",{className:"k",children:"Path"}),h.jsx("span",{className:`v ${nn}`,children:r.path}),h.jsx("span",{className:"k",children:"Git"}),h.jsx("span",{className:"v",children:r.gitVersion??"not found"}),h.jsx("span",{className:"k",children:"State"}),h.jsx("span",{className:"v",children:r.initialized?`${r.currentBranch??"detached"} · ${r.clean?"clean":"has changes"}`:"not initialized"}),h.jsx("span",{className:"k",children:"Baseline"}),h.jsx("span",{className:`v ${nn}`,children:r.baselineBranch}),h.jsx("span",{className:"k",children:"Remotes"}),h.jsx("span",{className:"v",children:r.remotes.length?r.remotes.map(N=>`${N.name}: ${N.url}`).join(" · "):"none"})]}),!r.initialized&&h.jsx("div",{className:Zg,children:h.jsx("button",{className:Xr,onClick:()=>void AD(e.id).then(i).catch(N=>c(String(N))),children:"Initialize Git"})})]}),h.jsxs("div",{className:vw,children:[h.jsx("h3",{children:"GitHub"}),h.jsxs("div",{className:Zs,children:[h.jsx("span",{className:"k",children:"Authentication"}),h.jsxs("span",{className:"v",children:[h.jsx("span",{className:`${dr} ${r.github.authenticated?"ok":""}`,children:r.github.authenticated?"Connected":"Not connected"}),r.github.authenticated&&h.jsxs("span",{className:"git-detail-meta text-muted text-sm",children:["via ",r.github.tokenSource]})]}),h.jsx("span",{className:"k",children:"Project"}),h.jsx("span",{className:"v",children:x?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:nn,children:[r.github.owner,"/",r.github.repo]}),!r.github.enabled&&h.jsx("span",{className:"badge inline-flex items-center font-sans font-medium py-px px-[7px] border border-border rounded-sm [&.ok]:text-accent-green [&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle [&.err]:text-accent-red [&.err]:border-accent-red [&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber [&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle git-detail-meta text-muted text-sm",children:"Syncing off"})]}):h.jsx("span",{className:dr,children:"Local only"})}),r.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:"Sync"}),h.jsx("span",{className:"v",children:r.github.syncStatus})]})]}),!r.github.authenticated&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:"GitHub is optional. Connect only when you want a hosted copy for collaboration."}),h.jsx(aC,{onSaved:()=>v()})]}),r.github.authenticated&&!r.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:x?"Use this repository for automatic experiment-branch pushes when your connected account can write to it. Otherwise, OpenResearch creates a separate private repository for collaboration.":"Create a private repository and automatically push experiment branches for collaborator visibility."}),h.jsxs("div",{className:Zg,children:[x&&r.github.url&&h.jsxs("a",{className:ci,href:r.github.url,target:"_blank",rel:"noreferrer",children:["Open on GitHub ",h.jsx(Ed,{size:12})]}),h.jsx("button",{className:Xr,disabled:a,onClick:y,children:a?"Enabling…":"Enable GitHub syncing"})]})]}),r.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed."}),h.jsxs("div",{className:Zg,children:[r.github.url&&h.jsxs("a",{className:ci,href:r.github.url,target:"_blank",rel:"noreferrer",children:["Open on GitHub ",h.jsx(Ed,{size:12})]}),h.jsx("button",{className:ci,disabled:a,onClick:()=>{o(!0),ND(e.id).then(N=>{i(N.git),n(N.project)}).catch(N=>c(N instanceof Error?N.message:String(N))).finally(()=>o(!1))},children:a?"Updating…":"Disable syncing"})]})]})]}),t&&h.jsx("div",{className:"error",children:w(t)}),l&&h.jsx("div",{className:"error",children:w(l)})]}):h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Loading…"]}):h.jsx("div",{className:Ba,children:h.jsx("p",{className:En,children:"Open a project to inspect its repository and GitHub publication state."})}),d&&h.jsx("div",{className:"modal-backdrop fixed inset-0 bg-[rgba(29,_27,_26,_0.4)] flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>C(!1),children:h.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)] p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-muted [&_>_p]:text-md [&_>_p]:leading-normal [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:N=>N.stopPropagation(),children:[h.jsx("h2",{id:"github-default-title",children:"Make GitHub syncing the default?"}),h.jsx("p",{children:"This is useful when collaborators follow project changes on GitHub. New projects will enable syncing automatically, creating a private repository when needed and pushing experiment branches for visibility."}),b&&h.jsx("div",{className:"error",children:b}),h.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[h.jsx("button",{className:ci,disabled:f,onClick:()=>C(!1),children:"Not now"}),h.jsx("button",{className:Xr,disabled:f,onClick:()=>C(!0),children:f?"Saving…":"Make default"})]})]})})]})}const CG={env:"ORX_DATA_DIR environment variable",config:"your saved setting",xdg:"XDG_DATA_HOME",default:"default location"};function EG(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(!1),[c,d]=R.useState(null),[m,f]=R.useState({kind:"idle"}),[g,b]=R.useState(null),k=()=>rD().then(C=>{t(C),a(N=>N||C.current)}).catch(C=>r(C instanceof Error?C.message:String(C)));R.useEffect(()=>{k()},[]),R.useEffect(()=>tL(C=>{C.type==="progress"?f(N=>{const E=N.kind==="moving"?N.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||E}}):C.type==="done"?(f({kind:"done",oldPathLeft:C.oldPathLeft}),d(null),a(""),k()):C.type==="error"&&f({kind:"error",message:C.error})}),[]);const S=(e==null?void 0:e.source)==="env",x=i.trim(),v=e!==null&&x===e.current;async function w(){if(!(o||!x)){l(!0),b(null),d(null);try{d(await iD(x))}catch(C){b(C instanceof Error?C.message:String(C))}finally{l(!1)}}}async function y(C){if(C.preventDefault(),!(m.kind==="moving"||!x||v)&&(b(null),!!window.confirm(`Move all orx data to: ${x} -The store is copied to the new location and activated there. Active runs or chats will block the move.`))){f({kind:"moving",phase:"preparing",copied:0,total:(u==null?void 0:u.treeBytes)??0});try{await tD(x)}catch(T){f({kind:"idle"}),b(T instanceof Error?T.message:String(T))}}}return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Storage"}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Where orx keeps everything on this machine — the local database, run logs, artifacts, and chat attachments for ",h.jsx("strong",{children:"all"})," projects. Moving it copies the whole store to the new location and activates it there."]}),n?h.jsx("div",{className:Ba,children:h.jsx("div",{className:"error",children:n})}):e?h.jsxs("div",{className:Ba,children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("h3",{children:"Data directory"}),h.jsx("div",{className:"spacer",style:{flex:1}}),h.jsx("span",{className:hr,children:e.isDefault?"Default":"Custom"})]}),h.jsxs("div",{className:Qs,children:[h.jsx("span",{className:"k",children:"Current"}),h.jsx("span",{className:`v ${rn}`,children:e.current}),h.jsx("span",{className:"k",children:"Source"}),h.jsx("span",{className:"v",children:xG[e.source]}),!e.isDefault&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:"Default"}),h.jsx("span",{className:`v ${rn}`,children:e.defaultPath})]})]}),S?h.jsxs("p",{className:An,children:["The data directory is pinned by the ",h.jsx("code",{children:"ORX_DATA_DIR"})," environment variable, which overrides this setting. Unset it to choose a location here."]}):h.jsxs("form",{className:xh,onSubmit:y,children:[h.jsxs("label",{children:["New location",h.jsx("input",{className:rn,type:"text",value:i,onChange:C=>{a(C.target.value),d(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:m.kind==="moving"})]}),u&&!u.error&&u.ok&&h.jsxs("p",{className:An,children:["Ready to move ",Lo(u.treeBytes??0),u.freeBytes!=null&&` — ${Lo(u.freeBytes)} free at target`,u.sameFilesystem?" (same disk, instant)":"","."]}),u&&u.ok===!1&&u.error&&h.jsx("div",{className:"error",children:u.error}),g&&h.jsx("div",{className:"error",children:g}),m.kind==="moving"&&h.jsx(sC,{value:m.copied,max:m.total,label:`${m.phase.charAt(0).toUpperCase()}${m.phase.slice(1)}…`,caption:m.total>0?h.jsxs("span",{className:rn,children:[Lo(m.copied)," / ",Lo(m.total)]}):void 0}),m.kind==="done"&&h.jsxs("p",{className:An,children:["Moved. orx is now using the new location.",m.oldPathLeft&&h.jsxs(h.Fragment,{children:[" ","The old copy was left at ",h.jsx("code",{children:m.oldPathLeft})," (different disk) — you can delete it once you've confirmed everything works."]})]}),m.kind==="error"&&h.jsxs("div",{className:"error",children:["Move failed: ",m.message]}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"button",className:di,onClick:w,disabled:o||!x||_||m.kind==="moving",children:o?"Checking…":"Check"}),h.jsx("button",{type:"submit",className:Zr,disabled:!x||_||m.kind==="moving",children:m.kind==="moving"?"Moving…":"Move data here"})]})]})]}):h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Loading…"]})]})}const bv=e=>e==="running"||e==="starting";function wG(e){return bv(e.status)?Rf(Date.now()-e.createdAt):e.endedAt?Rf(e.endedAt-e.createdAt):"—"}function lC({instances:e,emptyLabel:t}){return e.length===0?h.jsx("p",{className:"instances-empty m-0 py-3.5 px-4 border border-border rounded-lg bg-background text-subtext text-md",children:t}):h.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:h.jsxs("table",{className:"runs-table w-full border-collapse text-md bg-background [&_th]:text-left [&_th]:text-text [&_th]:text-xs [&_th]:font-semibold [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-[color-mix(in_oklab,_var(--text)_6%,_transparent)] [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Backend"}),h.jsx("th",{children:"Project"}),h.jsx("th",{children:"Status"}),h.jsx("th",{children:"Started"}),h.jsx("th",{children:"Runtime"})]})}),h.jsx("tbody",{children:e.map(n=>{var i;const r=typeof((i=n.backend)==null?void 0:i.url)=="string"?n.backend.url:void 0;return h.jsxs("tr",{children:[h.jsx("td",{children:h.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5 [&_.icon-btn]:w-5.5 [&_.icon-btn]:h-5.5",children:[h.jsx(j2,{backend:n.backend}),r&&h.jsx("a",{className:nr,href:r,target:"_blank",rel:"noreferrer",title:"Open job page","aria-label":"Open job page",onClick:a=>a.stopPropagation(),children:h.jsx(Cd,{size:12})})]})}),h.jsx("td",{children:n.projectName??qD(n.projectId)}),h.jsx("td",{children:h.jsx(La,{status:ls(n)})}),h.jsx("td",{children:Zs(n.createdAt)}),h.jsx("td",{children:wG(n)})]},n.id)})})]})})}function SG({onViewHistory:e}){const[t,n]=R.useState(null),[r,i]=R.useState(null),[a,o]=R.useState(!1),[,l]=R.useState(0);R.useEffect(()=>{const g=setInterval(()=>l(b=>b+1),3e4);return()=>clearInterval(g)},[]);const u=()=>{o(!0),fS().then(g=>{n(g),i(null)}).catch(g=>{i(g instanceof Error?g.message:String(g)),n(b=>b??[])}).finally(()=>o(!1))};R.useEffect(()=>u(),[]);const d=(g,b)=>b.createdAt-g.createdAt,m=t==null?void 0:t.filter(g=>bv(g.status)).sort(d),f=t==null?void 0:t.filter(g=>!bv(g.status)).sort(d);return h.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-6.5",children:[h.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0 [&_p]:text-muted [&_p]:text-sm [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[h.jsxs("div",{children:[h.jsxs("h2",{children:["Running instances",m&&m.length>0&&h.jsx("span",{className:"count-badge",children:m.length})]}),h.jsx("p",{children:"Compute currently active across all projects."})]}),h.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[h.jsxs("button",{className:rr,onClick:u,disabled:a,children:[h.jsx(lh,{size:12,className:a?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," Refresh"]}),h.jsx("button",{className:rr,onClick:e,children:`View history${f!=null&&f.length?` (${f.length})`:""}`})]})]}),r&&h.jsx("div",{className:"error",children:r}),!m||!f?h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Loading…"]}):h.jsx(lC,{instances:m,emptyLabel:"Nothing running right now."})]})}function kG({onBack:e}){const[t,n]=R.useState(null),[r,i]=R.useState(null),[a,o]=R.useState(!1),[,l]=R.useState(0);R.useEffect(()=>{const d=setInterval(()=>l(m=>m+1),3e4);return()=>clearInterval(d)},[]);const u=()=>{o(!0),fS().then(d=>{n(d.sort((m,f)=>f.createdAt-m.createdAt)),i(null)}).catch(d=>{i(d instanceof Error?d.message:String(d)),n(m=>m??[])}).finally(()=>o(!1))};return R.useEffect(u,[]),h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:e,children:[h.jsx(Tf,{size:14})," Back to Compute"]}),h.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[h.jsx("h1",{children:"Instance history"}),h.jsxs("button",{className:rr,onClick:u,disabled:a,children:[h.jsx(lh,{size:12,className:a?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," Refresh"]})]}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"Every compute instance spun up across your projects."}),r&&h.jsx("div",{className:"error",children:r}),t?h.jsx(lC,{instances:t,emptyLabel:"No instances yet."}):h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Loading…"]})]})}const cC=["projects","harnesses","storage"],CG=[{id:"compute",label:"Compute",icon:h.jsx(eM,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:"Environment",icon:h.jsx(aS,{size:15}),activeTabs:["environment"]},{id:"settings",label:"Settings",icon:h.jsx(sR,{size:15}),activeTabs:["settings",...cC]}];function EG(e){return cC.includes(e)}function AG({tab:e,project:t,githubPublicationError:n,onProjectUpdate:r,onSelectTab:i}){const a=e==="settings"||EG(e);return h.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-md [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[a&&h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:"Settings"}),h.jsxs("div",{className:"settings-stack mt-4.5",children:[h.jsx("section",{className:rd,children:h.jsx(fG,{})}),h.jsx("section",{className:rd,children:h.jsx(vG,{})}),h.jsx("section",{className:rd,children:h.jsx($q,{})}),h.jsx("section",{className:rd,children:h.jsx(yG,{})}),h.jsx("section",{className:rd,children:h.jsx(gG,{})})]})]}),e==="compute"&&h.jsx(sG,{project:t,onViewHistory:()=>i("instances")}),e==="instances"&&h.jsx(kG,{onBack:()=>i("compute")}),e==="environment"&&h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:"Environment"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"Variables available to runs and the research agent (API keys, tokens)."}),h.jsx(hG,{})]}),e==="git"&&h.jsx(_G,{project:t,publicationError:n,onProjectUpdate:r})]})}function TG({skills:e,activeIndex:t,onPick:n,onHover:r}){return h.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] left-0 min-w-85 max-w-full p-1.5 bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden",children:e.map((i,a)=>h.jsxs("button",{type:"button",className:`skill-item flex flex-col gap-0.5 w-full text-left py-[7px] px-2 rounded-sm [&.active]:bg-surface [&_.skill-name]:text-md [&_.skill-hint]:text-muted [&_.skill-desc]:text-sm [&_.skill-desc]:text-subtext ${a===t?"active":""}`,onMouseDown:o=>{o.preventDefault(),n(i)},onMouseEnter:()=>r(a),children:[h.jsxs("span",{className:"skill-name",children:["/",i.name," ",h.jsx("span",{className:"skill-hint",children:i.argHint})]}),h.jsx("span",{className:"skill-desc",children:i.description})]},i.name))})}function NG({cmd:e}){const[t,n]=R.useState(!1);return h.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[h.jsx("code",{className:rn,children:e}),h.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)}).catch(()=>{})},"aria-label":t?"Copied":`Copy ${e}`,title:t?"Copied":"Copy",children:t?h.jsx(Oi,{size:11,strokeWidth:3}):h.jsx(n_,{size:11})})]})}function M2(e){return e?e.split(/`([^`]+)`/).map((t,n)=>n%2===1?h.jsx(NG,{cmd:t},n):t):null}function vv({harness:e,size:t=16}){const n=`block shrink-0${e==="claude-code"?" text-[#d97757]":""}`;return e==="claude-code"?h.jsx("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?h.jsx("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):h.jsx("svg",{className:n,width:t,height:t,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const jG=["model-group flex items-center justify-between gap-2","text-md font-semibold text-text pt-2.5 px-2 pb-1.5"].join(" "),xw=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-xs text-muted"].join(" "),dd={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"};function MG(e){var r,i;const t=e.find(a=>a.agentReady);if(!t)return null;const n=((r=t.models[0])==null?void 0:r.id)??null;return{harness:t.id,model:n,permissionMode:((i=t.options)==null?void 0:i.defaultPermissionMode)??null,reasoningLevel:up(t,n).defaultId}}function Go(e){const[t,n]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!t)return;const i=o=>{var l;(l=r.current)!=null&&l.contains(o.target)||n(!1)},a=o=>{var l;o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),n(!1),(l=e==null?void 0:e.current)==null||l.focus())};return document.addEventListener("mousedown",i,!0),document.addEventListener("keydown",a,!0),()=>{document.removeEventListener("mousedown",i,!0),document.removeEventListener("keydown",a,!0)}},[t,e]),{open:t,setOpen:n,ref:r}}function RG({value:e,onSelect:t,permissionChoices:n=[],defaultPermissionId:r,onSelectPermission:i,reasoningChoices:a=[],defaultReasoningId:o,onSelectReasoning:l,onHarnesses:u,lockHarness:d=!1}){var O,H,G,W,re;const[m,f]=R.useState([]),g=R.useRef(null),b=R.useRef(null),{open:k,setOpen:S,ref:x}=Go(g),[_,w]=R.useState(""),[y,C]=R.useState("root"),T=()=>{S(!1),C("root"),w("")};R.useEffect(()=>{var ce;k&&(y==="reasoning"||y==="permissions")&&((ce=b.current)==null||ce.focus())},[k,y]),R.useEffect(()=>{let ce=!0;const pe=(B=!1)=>Mf(B).then(se=>{ce&&(f(se),u==null||u(se))}).catch(()=>{});pe();const ne=u_(()=>void pe(!0));return()=>{ce=!1,ne()}},[]);const E=R.useMemo(()=>{const ce=_.trim().toLowerCase();return(d&&e?m.filter(ne=>ne.id===e.harness):m).map(ne=>{let B=ne.models;return ce?B=B.filter(se=>se.id.toLowerCase().includes(ce)):ne.id==="opencode"&&(B=B.slice(0,6)),{harness:ne,models:B,hidden:ce?0:ne.models.length-B.length}})},[m,_,d,e]),j=(ce,pe)=>{var B;const ne=(e==null?void 0:e.harness)===ce.id;t({harness:ce.id,model:pe,permissionMode:ne?e.permissionMode:((B=ce.options)==null?void 0:B.defaultPermissionMode)??null,reasoningLevel:yS(ce,pe,ne?e.reasoningLevel:null)}),T()},N=(e==null?void 0:e.model)!=null?(O=m.find(ce=>ce.id===e.harness))==null?void 0:O.models.find(ce=>ce.id===e.model):void 0,D=e?e.model?N?jf(N):wS(e.model):"Default model":"Model",z=(e==null?void 0:e.reasoningLevel)??o??((H=a[0])==null?void 0:H.id),$=(G=a.find(ce=>ce.id===z))==null?void 0:G.label,F=(e==null?void 0:e.permissionMode)??r??((W=n[0])==null?void 0:W.id),U=(re=n.find(ce=>ce.id===F))==null?void 0:re.label,V=(e==null?void 0:e.harness)==="opencode"?"Variant":"Effort",X=ce=>{l==null||l(ce),T()},Y=ce=>{i==null||i(ce),T()},Q=(ce,pe,ne)=>h.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-md text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>C(ne),children:[h.jsx("span",{className:"flex-1",children:ce}),pe&&h.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:pe}),h.jsx(ta,{size:14,className:"shrink-0 text-muted"})]}),te=ce=>h.jsxs("button",{ref:b,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-left text-sm font-medium text-text hover:bg-surface",onClick:()=>{C("root"),w("")},children:[h.jsx(X8,{size:15}),ce]}),I=(ce,pe,ne,B)=>h.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:ce.map(se=>h.jsxs("button",{className:ui,onClick:()=>B(se.id),children:[h.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[h.jsxs("span",{children:[se.label,se.id===ne&&h.jsx("span",{className:"font-normal text-muted",children:" · Default"})]}),se.description&&h.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:se.description})]}),se.id===pe&&h.jsx(Oi,{size:13})]},se.id))});return h.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:x,children:[h.jsxs("button",{ref:g,type:"button",className:"composer-pill inline-flex min-w-0 max-w-full items-center gap-[5px] text-md text-text py-[5px] px-2 rounded-sm whitespace-nowrap transition-[background] duration-150 ease-standard [&:hover]:bg-surface",title:`Harness + model for this chat: ${D}${$?` · ${$}`:""}`,"aria-haspopup":"menu","aria-expanded":k,onClick:()=>{k?T():(C("root"),S(!0))},children:[(e==null?void 0:e.harness)&&h.jsx(vv,{harness:e.harness,size:14}),h.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[D,$&&h.jsx("span",{className:"model-picker-reasoning ml-1 text-muted",children:$})]}),h.jsx(zl,{size:14,className:"shrink-0 text-muted"})]}),k&&h.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-[0_10px_26px_rgba(0,_0,_0,_0.16)] z-50 overflow-hidden w-72 [&.align-right]:left-auto [&.align-right]:right-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[y==="root"&&h.jsxs("div",{className:"model-root-menu p-1",children:[Q("Model",D,"models"),a.length>0&&Q(V,$,"reasoning"),n.length>0&&Q("Mode",U,"permissions")]}),y==="models"&&h.jsxs(h.Fragment,{children:[te("Model"),h.jsx("input",{autoFocus:!0,type:"text",placeholder:"Search models…",value:_,onChange:ce=>w(ce.target.value)}),h.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[E.map(({harness:ce,models:pe,hidden:ne})=>h.jsxs("div",{className:"[&_.model-item]:pl-6",children:[h.jsxs("div",{className:jG,children:[h.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[h.jsx(vv,{harness:ce.id,size:14}),ce.name]}),!ce.agentReady&&h.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[h.jsx(n3,{size:10})," Unavailable"]})]}),ce.agentReady?h.jsxs(h.Fragment,{children:[ce.models.length===0&&h.jsxs("button",{className:ui,onClick:()=>j(ce,null),children:[h.jsxs("span",{children:["Default model",h.jsx("span",{className:"model-id",children:"CLI configuration"})]}),(e==null?void 0:e.harness)===ce.id&&(e==null?void 0:e.model)===null&&h.jsx(Oi,{size:13})]}),pe.map(B=>h.jsxs("button",{className:ui,title:B.id,onClick:()=>j(ce,B.id),children:[h.jsx("span",{children:jf(B)}),(e==null?void 0:e.harness)===ce.id&&(e==null?void 0:e.model)===B.id&&h.jsx(Oi,{size:13})]},B.id)),ne>0&&h.jsxs("div",{className:xw,children:[ne," more — search to find"]}),_.trim().length>0&&!ce.models.some(B=>B.id===_.trim())&&h.jsx("button",{className:ui,onClick:()=>j(ce,_.trim()),children:h.jsxs("span",{children:["Use “",_.trim(),"”",h.jsx("span",{className:"model-id",children:"pass as the model id"})]})})]}):h.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-xs text-muted model-unavailable leading-normal border-b border-b-border-variant",children:ce.agentNote?M2(ce.agentNote):"Not available"})]},ce.id)),m.length===0&&h.jsx("div",{className:xw,children:"Detecting harnesses…"})]}),d&&e&&m.length>1&&h.jsxs("div",{className:"model-locked-note flex items-center gap-1.5 py-[7px] px-3 text-xs text-muted border-t border-t-border-variant [&_svg]:shrink-0",children:[h.jsx(n3,{size:11}),"Sessions keep their harness — new chat to switch"]})]}),y==="reasoning"&&h.jsxs(h.Fragment,{children:[te(V),I(a,z,o,X)]}),y==="permissions"&&h.jsxs(h.Fragment,{children:[te("Mode"),I(n,F,r,Y)]})]})]})}function DG(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const _v=6.5,yw=2*Math.PI*_v;function LG({usage:e}){return!e||e.usedTokens<=0?null:h.jsx(OG,{usage:e})}function OG({usage:e}){const{open:t,setOpen:n,ref:r}=Go(),{usedTokens:i,contextWindow:a}=e,o=a&&a>0?Math.min(100,Math.round(i/a*100)):null,l=o===null?"var(--accent)":DG(o);return h.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[h.jsx("button",{type:"button",className:"composer-bare inline-flex items-center gap-[3px] text-md text-text py-[5px] px-1 rounded-sm transition-[background] duration-150 ease-standard [&:hover]:bg-surface [&.context-ring]:inline-flex [&.context-ring]:items-center [&.context-ring]:mr-2 context-ring",title:"Context window used",onClick:()=>n(u=>!u),children:o===null?M0(i):h.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[h.jsx("circle",{cx:"8",cy:"8",r:_v,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),h.jsx("circle",{cx:"8",cy:"8",r:_v,fill:"none",stroke:l,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${yw*Math.max(o,2)/100} ${yw}`,transform:"rotate(-90 8 8)"})]})}),t&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 align-right context-meter-menu w-70 pt-2.5 px-3 pb-3 [&_.progress]:mt-2 [&_.progress]:mx-0 [&_.progress]:mb-0 [&_.progress-track]:h-[5px] [&_.progress-track]:border-0 [&_.progress-track]:bg-border",children:[h.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[h.jsx("span",{children:"Context window"}),h.jsx("span",{className:"context-meter-value text-text tabular-nums",children:o===null?`${M0(i)} tokens`:`${M0(i)} / ${M0(a)} (${o}%)`})]}),o!==null&&h.jsx(sC,{value:i,max:a,fillColor:l})]})]})}const xv={name:"plan",description:"Toggle Plan mode for this chat",argHint:"",source:"command"},IG=new Set([xv.name]);function ww(e,t){if(t<0||t>e.length)return null;let n=t;for(;n>0&&!/\s/.test(e[n-1]);)n-=1;if(e[n]!=="/")return null;let r=t;for(;r0}}function zG(e,t){return t?e.filter(n=>n.source==="command"&&IG.has(n.name.toLowerCase())):e}function BG(e,t){let n=e.slice(0,t.start),r=e.slice(t.end);return n?r?/\s$/.test(n)&&/^\s/.test(r)&&(r=r.slice(1)):n=n.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:n+r,cursor:n.length}}function HG(e,t){const n=e.filter(r=>r.name.toLowerCase()!==xv.name);return t?[xv,...n]:n}function $G(e,t){if(!t)return null;const n=/(^|\s)\/plan(?=\s|$)/gi;return n.test(e)?{prompt:e.replace(n,"").trim()}:null}function FG(e,t,n){if(e==="command")return t!==void 0?t:n??void 0}const R2="orx:demo-read-sessions";function uC(){try{const e=JSON.parse(sessionStorage.getItem(R2)??"[]");return new Set(Array.isArray(e)?e.filter(t=>typeof t=="string"):[])}catch{return new Set}}function PG(e){try{const t=uC();t.add(e),sessionStorage.setItem(R2,JSON.stringify([...t]))}catch{}}function UG(){try{sessionStorage.removeItem(R2)}catch{}}function qG(e){return e.replace(/([\\`*_[\]<>$~])/g,"\\$1").replace(/(^|\n)(\s*)(#{1,6}|>|[-+]|\d+\.)\s/g,"$1$2\\$3 ").replace(/(^|\n)(\s*)(=+|-{1,2})(?=\s*(?:\n|$))/g,"$1$2\\$3").replace(/(^|\n)(\s*)(-{3,})(?=\s*(?:\n|$))/g,"$1$2\\$3")}function GG(e){const t=Math.max(0,...Array.from(e.matchAll(/`+/g),i=>i[0].length)),n="`".repeat(t+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${n}${r}${n}`}function VG(e){const t=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),n="`".repeat(Math.max(3,t+1));return` +The store is copied to the new location and activated there. Active runs or chats will block the move.`))){f({kind:"moving",phase:"preparing",copied:0,total:(c==null?void 0:c.treeBytes)??0});try{await sD(x)}catch(N){f({kind:"idle"}),b(N instanceof Error?N.message:String(N))}}}return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Storage"}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Where orx keeps everything on this machine — the local database, run logs, artifacts, and chat attachments for ",h.jsx("strong",{children:"all"})," projects. Moving it copies the whole store to the new location and activates it there."]}),n?h.jsx("div",{className:Ba,children:h.jsx("div",{className:"error",children:n})}):e?h.jsxs("div",{className:Ba,children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("h3",{children:"Data directory"}),h.jsx("div",{className:"spacer",style:{flex:1}}),h.jsx("span",{className:dr,children:e.isDefault?"Default":"Custom"})]}),h.jsxs("div",{className:Zs,children:[h.jsx("span",{className:"k",children:"Current"}),h.jsx("span",{className:`v ${nn}`,children:e.current}),h.jsx("span",{className:"k",children:"Source"}),h.jsx("span",{className:"v",children:CG[e.source]}),!e.isDefault&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:"Default"}),h.jsx("span",{className:`v ${nn}`,children:e.defaultPath})]})]}),S?h.jsxs("p",{className:En,children:["The data directory is pinned by the ",h.jsx("code",{children:"ORX_DATA_DIR"})," environment variable, which overrides this setting. Unset it to choose a location here."]}):h.jsxs("form",{className:yh,onSubmit:y,children:[h.jsxs("label",{children:["New location",h.jsx("input",{className:nn,type:"text",value:i,onChange:C=>{a(C.target.value),d(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:m.kind==="moving"})]}),c&&!c.error&&c.ok&&h.jsxs("p",{className:En,children:["Ready to move ",Lo(c.treeBytes??0),c.freeBytes!=null&&` — ${Lo(c.freeBytes)} free at target`,c.sameFilesystem?" (same disk, instant)":"","."]}),c&&c.ok===!1&&c.error&&h.jsx("div",{className:"error",children:c.error}),g&&h.jsx("div",{className:"error",children:g}),m.kind==="moving"&&h.jsx(lC,{value:m.copied,max:m.total,label:`${m.phase.charAt(0).toUpperCase()}${m.phase.slice(1)}…`,caption:m.total>0?h.jsxs("span",{className:nn,children:[Lo(m.copied)," / ",Lo(m.total)]}):void 0}),m.kind==="done"&&h.jsxs("p",{className:En,children:["Moved. orx is now using the new location.",m.oldPathLeft&&h.jsxs(h.Fragment,{children:[" ","The old copy was left at ",h.jsx("code",{children:m.oldPathLeft})," (different disk) — you can delete it once you've confirmed everything works."]})]}),m.kind==="error"&&h.jsxs("div",{className:"error",children:["Move failed: ",m.message]}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"button",className:ci,onClick:w,disabled:o||!x||v||m.kind==="moving",children:o?"Checking…":"Check"}),h.jsx("button",{type:"submit",className:Xr,disabled:!x||v||m.kind==="moving",children:m.kind==="moving"?"Moving…":"Move data here"})]})]})]}):h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Loading…"]})]})}const xv=e=>e==="running"||e==="starting";function AG(e){return xv(e.status)?Df(Date.now()-e.createdAt):e.endedAt?Df(e.endedAt-e.createdAt):"—"}function dC({instances:e,emptyLabel:t}){return e.length===0?h.jsx("p",{className:"instances-empty m-0 py-3.5 px-4 border border-border rounded-lg bg-background text-subtext text-md",children:t}):h.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:h.jsxs("table",{className:"runs-table w-full border-collapse text-md bg-background [&_th]:text-left [&_th]:text-text [&_th]:text-xs [&_th]:font-semibold [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-[color-mix(in_oklab,_var(--text)_6%,_transparent)] [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Backend"}),h.jsx("th",{children:"Project"}),h.jsx("th",{children:"Status"}),h.jsx("th",{children:"Started"}),h.jsx("th",{children:"Runtime"})]})}),h.jsx("tbody",{children:e.map(n=>{var i;const r=typeof((i=n.backend)==null?void 0:i.url)=="string"?n.backend.url:void 0;return h.jsxs("tr",{children:[h.jsx("td",{children:h.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5 [&_.icon-btn]:w-5.5 [&_.icon-btn]:h-5.5",children:[h.jsx(D2,{backend:n.backend}),r&&h.jsx("a",{className:nr,href:r,target:"_blank",rel:"noreferrer",title:"Open job page","aria-label":"Open job page",onClick:a=>a.stopPropagation(),children:h.jsx(Ed,{size:12})})]})}),h.jsx("td",{children:n.projectName??YD(n.projectId)}),h.jsx("td",{children:h.jsx(La,{status:as(n)})}),h.jsx("td",{children:Ks(n.createdAt)}),h.jsx("td",{children:AG(n)})]},n.id)})})]})})}function TG({onViewHistory:e}){const[t,n]=R.useState(null),[r,i]=R.useState(null),[a,o]=R.useState(!1),[,l]=R.useState(0);R.useEffect(()=>{const g=setInterval(()=>l(b=>b+1),3e4);return()=>clearInterval(g)},[]);const c=()=>{o(!0),fS().then(g=>{n(g),i(null)}).catch(g=>{i(g instanceof Error?g.message:String(g)),n(b=>b??[])}).finally(()=>o(!1))};R.useEffect(()=>c(),[]);const d=(g,b)=>b.createdAt-g.createdAt,m=t==null?void 0:t.filter(g=>xv(g.status)).sort(d),f=t==null?void 0:t.filter(g=>!xv(g.status)).sort(d);return h.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-6.5",children:[h.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0 [&_p]:text-muted [&_p]:text-sm [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[h.jsxs("div",{children:[h.jsxs("h2",{children:["Running instances",m&&m.length>0&&h.jsx("span",{className:"count-badge",children:m.length})]}),h.jsx("p",{children:"Compute currently active across all projects."})]}),h.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[h.jsxs("button",{className:rr,onClick:c,disabled:a,children:[h.jsx(ch,{size:12,className:a?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," Refresh"]}),h.jsx("button",{className:rr,onClick:e,children:`View history${f!=null&&f.length?` (${f.length})`:""}`})]})]}),r&&h.jsx("div",{className:"error",children:r}),!m||!f?h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Loading…"]}):h.jsx(dC,{instances:m,emptyLabel:"Nothing running right now."})]})}function NG({onBack:e}){const[t,n]=R.useState(null),[r,i]=R.useState(null),[a,o]=R.useState(!1),[,l]=R.useState(0);R.useEffect(()=>{const d=setInterval(()=>l(m=>m+1),3e4);return()=>clearInterval(d)},[]);const c=()=>{o(!0),fS().then(d=>{n(d.sort((m,f)=>f.createdAt-m.createdAt)),i(null)}).catch(d=>{i(d instanceof Error?d.message:String(d)),n(m=>m??[])}).finally(()=>o(!1))};return R.useEffect(c,[]),h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:e,children:[h.jsx(Nf,{size:14})," Back to Compute"]}),h.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[h.jsx("h1",{children:"Instance history"}),h.jsxs("button",{className:rr,onClick:c,disabled:a,children:[h.jsx(ch,{size:12,className:a?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," Refresh"]})]}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"Every compute instance spun up across your projects."}),r&&h.jsx("div",{className:"error",children:r}),t?h.jsx(dC,{instances:t,emptyLabel:"No instances yet."}):h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Loading…"]})]})}const hC=["projects","harnesses","storage"],jG=[{id:"compute",label:"Compute",icon:h.jsx(aM,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:"Environment",icon:h.jsx(oS,{size:15}),activeTabs:["environment"]},{id:"settings",label:"Settings",icon:h.jsx(cR,{size:15}),activeTabs:["settings",...hC]}];function MG(e){return hC.includes(e)}function RG({tab:e,project:t,githubPublicationError:n,onProjectUpdate:r,onSelectTab:i}){const a=e==="settings"||MG(e);return h.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-md [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[a&&h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:"Settings"}),h.jsxs("div",{className:"settings-stack mt-4.5",children:[h.jsx("section",{className:id,children:h.jsx(vG,{})}),h.jsx("section",{className:id,children:h.jsx(SG,{})}),h.jsx("section",{className:id,children:h.jsx(Gq,{})}),h.jsx("section",{className:id,children:h.jsx(EG,{})}),h.jsx("section",{className:id,children:h.jsx(yG,{})})]})]}),e==="compute"&&h.jsx(uG,{project:t,onViewHistory:()=>i("instances")}),e==="instances"&&h.jsx(NG,{onBack:()=>i("compute")}),e==="environment"&&h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:"Environment"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"Variables available to runs and the research agent (API keys, tokens)."}),h.jsx(bG,{})]}),e==="git"&&h.jsx(kG,{project:t,publicationError:n,onProjectUpdate:r})]})}function DG({skills:e,activeIndex:t,onPick:n,onHover:r}){return h.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] left-0 min-w-85 max-w-full p-1.5 bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden",children:e.map((i,a)=>h.jsxs("button",{type:"button",className:`skill-item flex flex-col gap-0.5 w-full text-left py-[7px] px-2 rounded-sm [&.active]:bg-surface [&_.skill-name]:text-md [&_.skill-hint]:text-muted [&_.skill-desc]:text-sm [&_.skill-desc]:text-subtext ${a===t?"active":""}`,onMouseDown:o=>{o.preventDefault(),n(i)},onMouseEnter:()=>r(a),children:[h.jsxs("span",{className:"skill-name",children:["/",i.name," ",h.jsx("span",{className:"skill-hint",children:i.argHint})]}),h.jsx("span",{className:"skill-desc",children:i.description})]},i.name))})}function LG({cmd:e}){const[t,n]=R.useState(!1);return h.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[h.jsx("code",{className:nn,children:e}),h.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)}).catch(()=>{})},"aria-label":t?"Copied":`Copy ${e}`,title:t?"Copied":"Copy",children:t?h.jsx(Di,{size:11,strokeWidth:3}):h.jsx(s_,{size:11})})]})}function L2(e){return e?e.split(/`([^`]+)`/).map((t,n)=>n%2===1?h.jsx(LG,{cmd:t},n):t):null}function yv({harness:e,size:t=16}){const n=`block shrink-0${e==="claude-code"?" text-[#d97757]":""}`;return e==="claude-code"?h.jsx("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?h.jsx("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):h.jsx("svg",{className:n,width:t,height:t,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const OG=["model-group flex items-center justify-between gap-2","text-md font-semibold text-text pt-2.5 px-2 pb-1.5"].join(" "),Sw=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-xs text-muted"].join(" "),hd={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"};function IG(e){var r,i;const t=e.find(a=>a.agentReady);if(!t)return null;const n=((r=t.models[0])==null?void 0:r.id)??null;return{harness:t.id,model:n,permissionMode:((i=t.options)==null?void 0:i.defaultPermissionMode)??null,reasoningLevel:hp(t,n).defaultId}}function Vo(e){const[t,n]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!t)return;const i=o=>{var l;(l=r.current)!=null&&l.contains(o.target)||n(!1)},a=o=>{var l;o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),n(!1),(l=e==null?void 0:e.current)==null||l.focus())};return document.addEventListener("mousedown",i,!0),document.addEventListener("keydown",a,!0),()=>{document.removeEventListener("mousedown",i,!0),document.removeEventListener("keydown",a,!0)}},[t,e]),{open:t,setOpen:n,ref:r}}function zG({value:e,onSelect:t,permissionChoices:n=[],defaultPermissionId:r,onSelectPermission:i,reasoningChoices:a=[],defaultReasoningId:o,onSelectReasoning:l,onHarnesses:c,lockHarness:d=!1}){var O,H,G,W,re;const[m,f]=R.useState([]),g=R.useRef(null),b=R.useRef(null),{open:k,setOpen:S,ref:x}=Vo(g),[v,w]=R.useState(""),[y,C]=R.useState("root"),N=()=>{S(!1),C("root"),w("")};R.useEffect(()=>{var ce;k&&(y==="reasoning"||y==="permissions")&&((ce=b.current)==null||ce.focus())},[k,y]),R.useEffect(()=>{let ce=!0;const me=(B=!1)=>Rf(B).then(se=>{ce&&(f(se),c==null||c(se))}).catch(()=>{});me();const ne=p_(()=>void me(!0));return()=>{ce=!1,ne()}},[]);const E=R.useMemo(()=>{const ce=v.trim().toLowerCase();return(d&&e?m.filter(ne=>ne.id===e.harness):m).map(ne=>{let B=ne.models;return ce?B=B.filter(se=>se.id.toLowerCase().includes(ce)):ne.id==="opencode"&&(B=B.slice(0,6)),{harness:ne,models:B,hidden:ce?0:ne.models.length-B.length}})},[m,v,d,e]),M=(ce,me)=>{var B;const ne=(e==null?void 0:e.harness)===ce.id;t({harness:ce.id,model:me,permissionMode:ne?e.permissionMode:((B=ce.options)==null?void 0:B.defaultPermissionMode)??null,reasoningLevel:yS(ce,me,ne?e.reasoningLevel:null)}),N()},T=(e==null?void 0:e.model)!=null?(O=m.find(ce=>ce.id===e.harness))==null?void 0:O.models.find(ce=>ce.id===e.model):void 0,D=e?e.model?T?Mf(T):wS(e.model):"Default model":"Model",z=(e==null?void 0:e.reasoningLevel)??o??((H=a[0])==null?void 0:H.id),$=(G=a.find(ce=>ce.id===z))==null?void 0:G.label,F=(e==null?void 0:e.permissionMode)??r??((W=n[0])==null?void 0:W.id),U=(re=n.find(ce=>ce.id===F))==null?void 0:re.label,V=(e==null?void 0:e.harness)==="opencode"?"Variant":"Effort",X=ce=>{l==null||l(ce),N()},Y=ce=>{i==null||i(ce),N()},Q=(ce,me,ne)=>h.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-md text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>C(ne),children:[h.jsx("span",{className:"flex-1",children:ce}),me&&h.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:me}),h.jsx(ea,{size:14,className:"shrink-0 text-muted"})]}),te=ce=>h.jsxs("button",{ref:b,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-left text-sm font-medium text-text hover:bg-surface",onClick:()=>{C("root"),w("")},children:[h.jsx(K8,{size:15}),ce]}),I=(ce,me,ne,B)=>h.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:ce.map(se=>h.jsxs("button",{className:li,onClick:()=>B(se.id),children:[h.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[h.jsxs("span",{children:[se.label,se.id===ne&&h.jsx("span",{className:"font-normal text-muted",children:" · Default"})]}),se.description&&h.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:se.description})]}),se.id===me&&h.jsx(Di,{size:13})]},se.id))});return h.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:x,children:[h.jsxs("button",{ref:g,type:"button",className:"composer-pill inline-flex min-w-0 max-w-full items-center gap-[5px] text-md text-text py-[5px] px-2 rounded-sm whitespace-nowrap transition-[background] duration-150 ease-standard [&:hover]:bg-surface",title:`Harness + model for this chat: ${D}${$?` · ${$}`:""}`,"aria-haspopup":"menu","aria-expanded":k,onClick:()=>{k?N():(C("root"),S(!0))},children:[(e==null?void 0:e.harness)&&h.jsx(yv,{harness:e.harness,size:14}),h.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[D,$&&h.jsx("span",{className:"model-picker-reasoning ml-1 text-muted",children:$})]}),h.jsx(Bl,{size:14,className:"shrink-0 text-muted"})]}),k&&h.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-[0_10px_26px_rgba(0,_0,_0,_0.16)] z-50 overflow-hidden w-72 [&.align-right]:left-auto [&.align-right]:right-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[y==="root"&&h.jsxs("div",{className:"model-root-menu p-1",children:[Q("Model",D,"models"),a.length>0&&Q(V,$,"reasoning"),n.length>0&&Q("Mode",U,"permissions")]}),y==="models"&&h.jsxs(h.Fragment,{children:[te("Model"),h.jsx("input",{autoFocus:!0,type:"text",placeholder:"Search models…",value:v,onChange:ce=>w(ce.target.value)}),h.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[E.map(({harness:ce,models:me,hidden:ne})=>h.jsxs("div",{className:"[&_.model-item]:pl-6",children:[h.jsxs("div",{className:OG,children:[h.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[h.jsx(yv,{harness:ce.id,size:14}),ce.name]}),!ce.agentReady&&h.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[h.jsx(s3,{size:10})," Unavailable"]})]}),ce.agentReady?h.jsxs(h.Fragment,{children:[ce.models.length===0&&h.jsxs("button",{className:li,onClick:()=>M(ce,null),children:[h.jsxs("span",{children:["Default model",h.jsx("span",{className:"model-id",children:"CLI configuration"})]}),(e==null?void 0:e.harness)===ce.id&&(e==null?void 0:e.model)===null&&h.jsx(Di,{size:13})]}),me.map(B=>h.jsxs("button",{className:li,title:B.id,onClick:()=>M(ce,B.id),children:[h.jsx("span",{children:Mf(B)}),(e==null?void 0:e.harness)===ce.id&&(e==null?void 0:e.model)===B.id&&h.jsx(Di,{size:13})]},B.id)),ne>0&&h.jsxs("div",{className:Sw,children:[ne," more — search to find"]}),v.trim().length>0&&!ce.models.some(B=>B.id===v.trim())&&h.jsx("button",{className:li,onClick:()=>M(ce,v.trim()),children:h.jsxs("span",{children:["Use “",v.trim(),"”",h.jsx("span",{className:"model-id",children:"pass as the model id"})]})})]}):h.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-xs text-muted model-unavailable leading-normal border-b border-b-border-variant",children:ce.agentNote?L2(ce.agentNote):"Not available"})]},ce.id)),m.length===0&&h.jsx("div",{className:Sw,children:"Detecting harnesses…"})]}),d&&e&&m.length>1&&h.jsxs("div",{className:"model-locked-note flex items-center gap-1.5 py-[7px] px-3 text-xs text-muted border-t border-t-border-variant [&_svg]:shrink-0",children:[h.jsx(s3,{size:11}),"Sessions keep their harness — new chat to switch"]})]}),y==="reasoning"&&h.jsxs(h.Fragment,{children:[te(V),I(a,z,o,X)]}),y==="permissions"&&h.jsxs(h.Fragment,{children:[te("Mode"),I(n,F,r,Y)]})]})]})}function BG(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const wv=6.5,kw=2*Math.PI*wv;function HG({usage:e}){return!e||e.usedTokens<=0?null:h.jsx($G,{usage:e})}function $G({usage:e}){const{open:t,setOpen:n,ref:r}=Vo(),{usedTokens:i,contextWindow:a}=e,o=a&&a>0?Math.min(100,Math.round(i/a*100)):null,l=o===null?"var(--accent)":BG(o);return h.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[h.jsx("button",{type:"button",className:"composer-bare inline-flex items-center gap-[3px] text-md text-text py-[5px] px-1 rounded-sm transition-[background] duration-150 ease-standard [&:hover]:bg-surface [&.context-ring]:inline-flex [&.context-ring]:items-center [&.context-ring]:mr-2 context-ring",title:"Context window used",onClick:()=>n(c=>!c),children:o===null?R0(i):h.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[h.jsx("circle",{cx:"8",cy:"8",r:wv,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),h.jsx("circle",{cx:"8",cy:"8",r:wv,fill:"none",stroke:l,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${kw*Math.max(o,2)/100} ${kw}`,transform:"rotate(-90 8 8)"})]})}),t&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 align-right context-meter-menu w-70 pt-2.5 px-3 pb-3 [&_.progress]:mt-2 [&_.progress]:mx-0 [&_.progress]:mb-0 [&_.progress-track]:h-[5px] [&_.progress-track]:border-0 [&_.progress-track]:bg-border",children:[h.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[h.jsx("span",{children:"Context window"}),h.jsx("span",{className:"context-meter-value text-text tabular-nums",children:o===null?`${R0(i)} tokens`:`${R0(i)} / ${R0(a)} (${o}%)`})]}),o!==null&&h.jsx(lC,{value:i,max:a,fillColor:l})]})]})}const Sv={name:"plan",description:"Toggle Plan mode for this chat",argHint:"",source:"command"},FG=new Set([Sv.name]);function Cw(e,t){if(t<0||t>e.length)return null;let n=t;for(;n>0&&!/\s/.test(e[n-1]);)n-=1;if(e[n]!=="/")return null;let r=t;for(;r0}}function PG(e,t){return t?e.filter(n=>n.source==="command"&&FG.has(n.name.toLowerCase())):e}function UG(e,t){let n=e.slice(0,t.start),r=e.slice(t.end);return n?r?/\s$/.test(n)&&/^\s/.test(r)&&(r=r.slice(1)):n=n.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:n+r,cursor:n.length}}function qG(e,t){const n=e.filter(r=>r.name.toLowerCase()!==Sv.name);return t?[Sv,...n]:n}function GG(e,t){if(!t)return null;const n=/(^|\s)\/plan(?=\s|$)/gi;return n.test(e)?{prompt:e.replace(n,"").trim()}:null}function VG(e,t,n){if(e==="command")return t!==void 0?t:n??void 0}const O2="orx:demo-read-sessions";function fC(){try{const e=JSON.parse(sessionStorage.getItem(O2)??"[]");return new Set(Array.isArray(e)?e.filter(t=>typeof t=="string"):[])}catch{return new Set}}function WG(e){try{const t=fC();t.add(e),sessionStorage.setItem(O2,JSON.stringify([...t]))}catch{}}function YG(){try{sessionStorage.removeItem(O2)}catch{}}function XG(e){return e.replace(/([\\`*_[\]<>$~])/g,"\\$1").replace(/(^|\n)(\s*)(#{1,6}|>|[-+]|\d+\.)\s/g,"$1$2\\$3 ").replace(/(^|\n)(\s*)(=+|-{1,2})(?=\s*(?:\n|$))/g,"$1$2\\$3").replace(/(^|\n)(\s*)(-{3,})(?=\s*(?:\n|$))/g,"$1$2\\$3")}function KG(e){const t=Math.max(0,...Array.from(e.matchAll(/`+/g),i=>i[0].length)),n="`".repeat(t+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${n}${r}${n}`}function ZG(e){const t=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),n="`".repeat(Math.max(3,t+1));return` ${n} ${e.replace(/^\n|\n$/g,"")} ${n} -`}function yv(e,t){return t?` +`}function kv(e,t){return t?` \\[ ${e} \\] -`:`\\(${e}\\)`}function WG(e,t){const n=t.trim().split(` +`:`\\(${e}\\)`}function QG(e,t){const n=t.trim().split(` `),r=" ".repeat(e.length+1);return[`${e} ${n[0]??""}`,...n.slice(1).map(i=>i?`${r}${i}`:"")].join(` -`)}function YG(e,t){if(e.length===0)return"";const n=Math.max(...e.map(o=>o.length)),r=o=>`| ${Array.from({length:n},(l,u)=>o[u]??"").join(" | ")} |`,i=t?e[0]:Array.from({length:n},()=>""),a=t?e.slice(1):e;return[r(i),r(Array.from({length:n},()=>"---")),...a.map(r)].join(` -`)}function XG(e,t){const n=Number(e.slice(1));return Number.isInteger(n)&&n>=1&&n<=6?`${"#".repeat(n)} ${t.trim()}`:void 0}function KG(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function ZG(e,t){return Math.min(e.length,t.length)/Math.max(e.length,t.length)>=.8&&(e.includes(t)||t.includes(e))}const QG=["tool-line flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap","text-lg"].join(" "),Ml=256,dC=1024,JG=2e4,Zg=8,G0="chat-annotations";function yl(e){return e instanceof Element?e:e.parentElement}function Sw(e){const t=document.createRange();return t.setStart(e.container,e.offset),t.collapse(!0),t}function Qg(e,t){return Sw(e).compareBoundaryPoints(Range.START_TO_START,Sw(t))<0}function kw(e,t){const n=document.createRange();return n.setStart(e.container,e.offset),n.setEnd(t.container,t.offset),n.cloneContents()}const eV=new Set(["A","B","CODE","EM","I","STRONG"]);function tV(e,t){var i,a;const n=yl(e.endContainer);if(Array.from(t.childNodes).every(o=>o.nodeType===Node.TEXT_NODE)){let o=yl(e.startContainer);for(;o&&o.matches(".md *")&&o.contains(n);){if(eV.has(o.tagName)){const l=o.cloneNode(!1);l instanceof HTMLElement&&(l.replaceChildren(...Array.from(t.childNodes)),t.replaceChildren(l))}o=o.parentElement}}const r=(i=yl(e.startContainer))==null?void 0:i.closest("pre");if(r!=null&&r.contains(n)){const o=(a=r.querySelector("code"))==null?void 0:a.cloneNode(!1),l=r.cloneNode(!1);l instanceof HTMLElement&&o instanceof HTMLElement&&(o.replaceChildren(...Array.from(t.childNodes)),l.replaceChildren(o),t.replaceChildren(l))}}function nV(e){e.querySelectorAll("button").forEach(t=>{t.replaceWith(document.createTextNode(t.textContent??""))}),e.querySelectorAll("script, style, iframe, object, embed, input, textarea, select").forEach(t=>t.remove()),e.querySelectorAll("*").forEach(t=>{for(const n of Array.from(t.attributes))(n.name.toLowerCase().startsWith("on")||n.name==="contenteditable"||n.name==="tabindex")&&t.removeAttribute(n.name)})}function rV(e,t){const n=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let i={container:e.startContainer,offset:e.startOffset};const a=Array.from(t.querySelectorAll(".katex")).filter(o=>e.intersectsNode(o));for(const o of a){const l=o.closest(".katex-display")??o,u=document.createRange();u.selectNode(l);const d={container:u.startContainer,offset:u.startOffset},m={container:u.endContainer,offset:u.endOffset};if(Qg(i,d)&&n.append(kw(i,d)),n.append(l.cloneNode(!0)),i=m,!Qg(i,r))break}return a.length===0?n.append(e.cloneContents()):Qg(i,r)&&n.append(kw(i,r)),tV(e,n),nV(n),n}function iV(e){const t=Array.from(e.querySelectorAll("tr")).map(n=>Array.from(n.querySelectorAll(":scope > th, :scope > td")).map(r=>zd(r).trim().replaceAll("|","\\|"))).filter(n=>n.length>0);return t.length>0?` +`)}function JG(e,t){if(e.length===0)return"";const n=Math.max(...e.map(o=>o.length)),r=o=>`| ${Array.from({length:n},(l,c)=>o[c]??"").join(" | ")} |`,i=t?e[0]:Array.from({length:n},()=>""),a=t?e.slice(1):e;return[r(i),r(Array.from({length:n},()=>"---")),...a.map(r)].join(` +`)}function eV(e,t){const n=Number(e.slice(1));return Number.isInteger(n)&&n>=1&&n<=6?`${"#".repeat(n)} ${t.trim()}`:void 0}function tV(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function nV(e,t){return Math.min(e.length,t.length)/Math.max(e.length,t.length)>=.8&&(e.includes(t)||t.includes(e))}const rV=["tool-line flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap","text-lg"].join(" "),Fo=256,pC=1024,mC=2e4,Jg=8,V0="chat-annotations";function Sl(e){return e instanceof Element?e:e.parentElement}function Ew(e){const t=document.createRange();return t.setStart(e.container,e.offset),t.collapse(!0),t}function eb(e,t){return Ew(e).compareBoundaryPoints(Range.START_TO_START,Ew(t))<0}function Aw(e,t){const n=document.createRange();return n.setStart(e.container,e.offset),n.setEnd(t.container,t.offset),n.cloneContents()}const iV=new Set(["A","B","CODE","EM","I","STRONG"]);function sV(e,t){var i,a;const n=Sl(e.endContainer);if(Array.from(t.childNodes).every(o=>o.nodeType===Node.TEXT_NODE)){let o=Sl(e.startContainer);for(;o&&o.matches(".md *")&&o.contains(n);){if(iV.has(o.tagName)){const l=o.cloneNode(!1);l instanceof HTMLElement&&(l.replaceChildren(...Array.from(t.childNodes)),t.replaceChildren(l))}o=o.parentElement}}const r=(i=Sl(e.startContainer))==null?void 0:i.closest("pre");if(r!=null&&r.contains(n)){const o=(a=r.querySelector("code"))==null?void 0:a.cloneNode(!1),l=r.cloneNode(!1);l instanceof HTMLElement&&o instanceof HTMLElement&&(o.replaceChildren(...Array.from(t.childNodes)),l.replaceChildren(o),t.replaceChildren(l))}}function aV(e){e.querySelectorAll("button").forEach(t=>{t.replaceWith(document.createTextNode(t.textContent??""))}),e.querySelectorAll("script, style, iframe, object, embed, input, textarea, select").forEach(t=>t.remove()),e.querySelectorAll("*").forEach(t=>{for(const n of Array.from(t.attributes))(n.name.toLowerCase().startsWith("on")||n.name==="contenteditable"||n.name==="tabindex")&&t.removeAttribute(n.name)})}function oV(e,t){const n=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let i={container:e.startContainer,offset:e.startOffset};const a=Array.from(t.querySelectorAll(".katex")).filter(o=>e.intersectsNode(o));for(const o of a){const l=o.closest(".katex-display")??o,c=document.createRange();c.selectNode(l);const d={container:c.startContainer,offset:c.startOffset},m={container:c.endContainer,offset:c.endOffset};if(eb(i,d)&&n.append(Aw(i,d)),n.append(l.cloneNode(!0)),i=m,!eb(i,r))break}return a.length===0?n.append(e.cloneContents()):eb(i,r)&&n.append(Aw(i,r)),sV(e,n),aV(n),n}function lV(e){const t=Array.from(e.querySelectorAll("tr")).map(n=>Array.from(n.querySelectorAll(":scope > th, :scope > td")).map(r=>Bd(r).trim().replaceAll("|","\\|"))).filter(n=>n.length>0);return t.length>0?` -${YG(t,!!e.querySelector("tr:first-child th"))} +${JG(t,!!e.querySelector("tr:first-child th"))} -`:""}function hC(e){const t=e.tagName==="OL",n=e.getAttribute("start"),r=n===null?1:Number(n);let i=Number.isFinite(r)?r:1;const a=[];for(const o of Array.from(e.children).filter(l=>l instanceof HTMLElement&&l.tagName==="LI")){const l=o.getAttribute("value"),u=l===null?i:Number(l),d=Number.isFinite(u)?u:i;i=d+1;const m=Array.from(o.childNodes).map(f=>f instanceof HTMLElement&&f.matches("UL, OL")?` -${hC(f).trim()} -`:zd(f)).join("").trim();a.push(WG(t?`${d}.`:"-",m))}return` +`:""}function gC(e){const t=e.tagName==="OL",n=e.getAttribute("start"),r=n===null?1:Number(n);let i=Number.isFinite(r)?r:1;const a=[];for(const o of Array.from(e.children).filter(l=>l instanceof HTMLElement&&l.tagName==="LI")){const l=o.getAttribute("value"),c=l===null?i:Number(l),d=Number.isFinite(c)?c:i;i=d+1;const m=Array.from(o.childNodes).map(f=>f instanceof HTMLElement&&f.matches("UL, OL")?` +${gC(f).trim()} +`:Bd(f)).join("").trim();a.push(QG(t?`${d}.`:"-",m))}return` ${a.join(` `)} -`}function zd(e){var r,i,a,o,l;if(e.nodeType===Node.TEXT_NODE)return qG(e.textContent??"");if(!(e instanceof HTMLElement))return Array.from(e.childNodes).map(zd).join("");if(e.matches(".katex-display")){const u=(i=(r=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:r.textContent)==null?void 0:i.trim();return u?yv(u,!0):""}if(e.matches(".katex")){const u=(o=(a=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:a.textContent)==null?void 0:o.trim();return u?yv(u,!1):""}if(e.tagName==="BR")return` -`;if(e.tagName==="TABLE")return iV(e);if(e.matches("UL, OL"))return hC(e);if(e.tagName==="CODE"&&((l=e.parentElement)==null?void 0:l.tagName)!=="PRE")return GG(e.textContent??"");if(e.tagName==="PRE")return VG(e.textContent??"");const t=Array.from(e.childNodes).map(zd).join("");if(!t)return"";if(e.matches("strong, b"))return`**${t}**`;if(e.matches("em, i"))return`*${t}*`;if(e.tagName==="A"){const u=e.getAttribute("href");return u?`[${t}](${u})`:t}if(e.tagName==="LI")return`${t.trim()} +`}function Bd(e){var r,i,a,o,l;if(e.nodeType===Node.TEXT_NODE)return XG(e.textContent??"");if(!(e instanceof HTMLElement))return Array.from(e.childNodes).map(Bd).join("");if(e.matches(".katex-display")){const c=(i=(r=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:r.textContent)==null?void 0:i.trim();return c?kv(c,!0):""}if(e.matches(".katex")){const c=(o=(a=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:a.textContent)==null?void 0:o.trim();return c?kv(c,!1):""}if(e.tagName==="BR")return` +`;if(e.tagName==="TABLE")return lV(e);if(e.matches("UL, OL"))return gC(e);if(e.tagName==="CODE"&&((l=e.parentElement)==null?void 0:l.tagName)!=="PRE")return KG(e.textContent??"");if(e.tagName==="PRE")return ZG(e.textContent??"");const t=Array.from(e.childNodes).map(Bd).join("");if(!t)return"";if(e.matches("strong, b"))return`**${t}**`;if(e.matches("em, i"))return`*${t}*`;if(e.tagName==="A"){const c=e.getAttribute("href");return c?`[${t}](${c})`:t}if(e.tagName==="LI")return`${t.trim()} `;if(e.matches("TH, TD"))return`${t.trim()} | `;if(e.tagName==="TR")return`${t.replace(/ \| $/,"")} `;if(e.tagName==="BLOCKQUOTE")return` ${t.trim().split(` -`).map(u=>`> ${u}`).join(` +`).map(c=>`> ${c}`).join(` `)} -`;const n=XG(e.tagName,t);return n?` +`;const n=eV(e.tagName,t);return n?` ${n} @@ -947,68 +944,65 @@ ${n} ${t.trim()} -`:t}function sV(e,t){return zd(e).replace(/\r\n?/g,` +`:t}function cV(e,t){return Bd(e).replace(/\r\n?/g,` `).replace(/[ \t]+\n/g,` `).replace(/\n{3,}/g,` -`).trim()||t}function Cw(e){return e.normalize("NFKC").replace(/[\s\u200B-\u200D\u2060\uFEFF]/g,"").toLowerCase()}function aV(e,t){var i,a,o,l;if(!KG(e))return;const n=Cw(e);if(n.length<8)return;let r;for(const u of t.querySelectorAll(".msg-assistant > .md .katex")){const m=[(i=u.querySelector(".katex-mathml"))==null?void 0:i.textContent,(a=u.querySelector(".katex-html"))==null?void 0:a.textContent,u.textContent].filter(k=>!!k).map(Cw).find(k=>ZG(k,n));if(!m)continue;const f=(l=(o=u.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:o.textContent)==null?void 0:l.trim();if(!f)continue;const g=!!u.closest(".katex-display"),b={markdown:yv(f,g).trim(),delta:Math.abs(m.length-n.length)};(!r||b.delta .md .katex")){const m=[(i=c.querySelector(".katex-mathml"))==null?void 0:i.textContent,(a=c.querySelector(".katex-html"))==null?void 0:a.textContent,c.textContent].filter(k=>!!k).map(Tw).find(k=>nV(k,n));if(!m)continue;const f=(l=(o=c.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:o.textContent)==null?void 0:l.trim();if(!f)continue;const g=!!c.closest(".katex-display"),b={markdown:kv(f,g).trim(),delta:Math.abs(m.length-n.length)};(!r||b.deltaN.width>0&&N.height>0),k=b[0]??n.getBoundingClientRect(),S=b.filter(N=>N.topk.top),x=S.length>0?S:[k],_=Math.min(...x.map(N=>N.left)),w=Math.max(...x.map(N=>N.right)),y=Math.min(...x.map(N=>N.top)),C=Math.max(...x.map(N=>N.bottom)),T=34,E=74,j=y>=T+Zg?y-T-Zg:C+Zg;return{text:sV(g,f),range:n.cloneRange(),x:Math.min(window.innerWidth-E,Math.max(E,_+(w-_)/2)),top:j}}function lV(e,t){const[n,r]=R.useState(null),i=R.useRef(!1),a=R.useCallback(()=>{const u=e.current;r(u?oV(u):null)},[e]);R.useEffect(()=>{let u=null;const d=()=>{i.current||a()},m=g=>{const b=e.current,k=g.target;!g.isPrimary||g.button!==0||!b||!(k instanceof Node)||!b.contains(k)||(i.current=!0,r(null))},f=g=>{!g.isPrimary||!i.current||(i.current=!1,u=window.requestAnimationFrame(a))};return document.addEventListener("selectionchange",d),document.addEventListener("pointerdown",m,!0),window.addEventListener("pointerup",f,!0),window.addEventListener("pointercancel",f,!0),()=>{document.removeEventListener("selectionchange",d),document.removeEventListener("pointerdown",m,!0),window.removeEventListener("pointerup",f,!0),window.removeEventListener("pointercancel",f,!0),u!==null&&window.cancelAnimationFrame(u),i.current=!1}},[a]),R.useEffect(()=>{if(!n)return;const u=d=>{const m=d.target;m instanceof Element&&m.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",u,!0),window.addEventListener("resize",a),()=>{document.removeEventListener("mousedown",u,!0),window.removeEventListener("resize",a)}},[n,a]);const o=R.useCallback(()=>{var u;n&&(t({text:n.text,range:n.range}),r(null),(u=window.getSelection())==null||u.removeAllRanges())},[n,t]),l=R.useCallback(()=>r(null),[]);return{action:n,add:o,dismiss:l}}function cV(e){R.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const t=e.flatMap(r=>r.range?[r.range]:[]);if(t.length===0){CSS.highlights.delete(G0);return}const n=new Highlight(...t);return CSS.highlights.set(G0,n),()=>{CSS.highlights.get(G0)===n&&CSS.highlights.delete(G0)}},[e])}function uV({annotation:e}){const t=R.useRef(null),[n,r]=R.useState();return R.useLayoutEffect(()=>{var a;const i=(a=t.current)==null?void 0:a.closest(".chat-thread-inner");r(i?aV(e.text,i):void 0)},[e.id,e.text]),h.jsx("div",{ref:t,children:h.jsx(za,{text:n??e.text})})}function dV({annotations:e,onRemove:t}){return e.map((n,r)=>h.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${t?"grid-cols-[24px_minmax(0,_1fr)_24px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[h.jsxs("span",{className:"text-sm text-muted text-right",children:[r+1,"."]}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"text-sm text-muted mb-1",children:"Selected text:"}),h.jsx(uV,{annotation:n})]}),t&&h.jsx("button",{type:"button",className:"inline-flex items-center justify-center w-6 h-6 rounded-sm text-muted [&:hover]:bg-surface [&:hover]:text-text",title:"Remove annotation","aria-label":`Remove annotation ${r+1}`,onClick:()=>t(n.id),children:h.jsx(Yr,{size:13})})]},n.id))}function D2({annotations:e,variant:t,onClear:n,onRemove:r}){const i=R.useRef(null),a=R.useRef(null),o=R.useId(),l=Go(i),u=t==="sent",d=R.useRef(null),m=()=>{d.current!==null&&window.clearTimeout(d.current),d.current=null,l.setOpen(!0)},f=()=>{d.current=window.setTimeout(()=>{var k;(k=a.current)!=null&&k.contains(document.activeElement)||l.setOpen(!1)},160)},g=()=>{const k=u||!l.open;l.setOpen(k),k&&window.requestAnimationFrame(()=>{var S;return(S=a.current)==null?void 0:S.focus()})},b=k=>{r==null||r(k),window.requestAnimationFrame(()=>{var x,_;(_=((x=a.current)==null?void 0:x.querySelector("button[aria-label^='Remove annotation']"))??a.current??i.current)==null||_.focus()})};return R.useEffect(()=>()=>{d.current!==null&&window.clearTimeout(d.current)},[]),h.jsxs("div",{className:u?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:l.ref,onMouseEnter:u?m:void 0,onMouseLeave:u?f:void 0,children:[h.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${u?"rounded-full":"rounded-sm"}`,children:[h.jsxs("button",{ref:i,type:"button",className:`inline-flex items-center gap-1.5 py-1 text-sm font-medium text-text [&:hover]:bg-surface ${u?"px-2.5":"pl-2 pr-1.5"}`,"aria-expanded":l.open,"aria-haspopup":"dialog","aria-controls":o,onClick:g,children:[h.jsx(rS,{size:u?13:14,className:"text-muted"}),e.length," ",e.length===1?"annotation":"annotations"]}),n&&h.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-l border-border [&:hover]:bg-surface [&:hover]:text-text",title:"Clear annotations","aria-label":"Clear annotations",onClick:n,children:h.jsx(Yr,{size:13})})]}),l.open&&h.jsx("div",{id:o,ref:a,tabIndex:-1,className:`annotation-menu absolute bottom-[calc(100%_+_8px)] z-50 w-[min(440px,_calc(100vw_-_48px))] max-h-80 overflow-y-auto overscroll-contain bg-background border border-border rounded-lg shadow-[0_4px_16px_rgba(0,_0,_0,_0.10)] p-2 text-left ${u?"right-0 after:absolute after:top-full after:left-0 after:right-0 after:h-2 after:content-['']":"left-3"}`,role:"dialog","aria-label":"Selected chat text",children:h.jsx(dV,{annotations:e,onRemove:r?b:void 0})})]})}function hV(e){return h.jsx(D2,{...e,variant:"composer"})}const fV=["prompt-collapsed text-muted text-lg font-[375] my-3.5 mx-0 [&_summary]:flex","[&_summary]:items-center [&_summary]:gap-2 [&_summary]:cursor-pointer","[&_summary]:list-none [&_summary]:select-none [&_summary::-webkit-details-marker]:hidden","[&_summary::after]:content-['›'] [&_summary::after]:text-muted","[&_summary::after]:transition-transform [&_summary::after]:duration-80 [&_summary::after]:ease-standard [&[open]_summary::after]:rotate-90"].join(" "),Ew=["prompt-collapsed-body mt-1.5 pl-3 border-l-2 border-l-border","text-md text-subtext"].join(" "),pV=["prompt-collapsed plan-resolved text-subtext my-3.5 mx-0","[&_summary]:flex [&_summary]:items-center [&_summary]:gap-2 [&_summary]:w-fit [&_summary]:max-w-full","[&_summary]:py-[3px] [&_summary]:px-1 [&_summary]:cursor-pointer [&_summary]:rounded-sm","[&_summary]:list-none [&_summary]:select-none [&_summary:hover]:bg-surface","[&_summary::-webkit-details-marker]:hidden","[&_summary_.plan-chevron]:transition-transform [&_summary_.plan-chevron]:duration-120","[&_summary_.plan-chevron]:ease-standard [&[open]_summary_.plan-chevron]:rotate-90"].join(" "),mV=["prompt-head text-xs font-semibold text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),wv=["prompt-actions flex flex-wrap gap-2 [&_.btn-primary]:inline-flex","[&_.btn-primary]:items-center [&_.btn-primary]:gap-1.5 [&_.btn-primary]:py-1.5 [&_.btn-primary]:px-[13px]","[&_.btn-primary]:font-[inherit] [&_.btn-primary]:text-sm","[&_.btn-primary]:font-semibold [&_.btn-primary]:border [&_.btn-primary]:border-transparent","[&_.btn-primary]:rounded-sm [&_.btn-primary]:cursor-pointer","[&_.btn-primary]:transition-[background,border-color] [&_.btn-primary]:duration-80 [&_.btn-primary]:ease-standard [&_.btn-ghost]:inline-flex","[&_.btn-ghost]:items-center [&_.btn-ghost]:gap-1.5 [&_.btn-ghost]:py-1.5 [&_.btn-ghost]:px-[13px]","[&_.btn-ghost]:font-[inherit] [&_.btn-ghost]:text-sm","[&_.btn-ghost]:font-semibold [&_.btn-ghost]:border [&_.btn-ghost]:border-transparent","[&_.btn-ghost]:rounded-sm [&_.btn-ghost]:cursor-pointer","[&_.btn-ghost]:transition-[background,border-color] [&_.btn-ghost]:duration-80 [&_.btn-ghost]:ease-standard","[&_.btn-primary]:bg-primary [&_.btn-primary]:text-background","[&_.btn-primary:hover:not(:disabled)]:opacity-90 [&_.btn-ghost]:bg-transparent","[&_.btn-ghost]:border-border [&_.btn-ghost]:text-subtext","[&_.btn-ghost:hover:not(:disabled)]:border-border-strong","[&_.btn-ghost:hover:not(:disabled)]:text-text","[&_.btn-ghost:hover:not(:disabled)]:bg-surface [&_button:disabled]:opacity-50","[&_button:disabled]:cursor-default"].join(" "),$c="local-",Aw=[];function gV(e,t){const n=e.findIndex(r=>r.id===t.id);if(n>=0){const r=e.slice();return r[n]=t,r}return t.role!=="user"?[...e,t]:[...e.filter(r=>!r.id.startsWith($c)),t]}function bV(e,t){switch(t.type){case"reset":return{messagesBySession:{},busySessions:new Set,queuedBySession:{},activeLeafBySession:{}};case"seed":return t.onlyIfAbsent&&t.sessionId in e.messagesBySession?e:{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:t.messages},queuedBySession:{...e.queuedBySession,[t.sessionId]:t.queued??[]},activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:t.activeLeafId??null}};case"upsertMessage":{const n=e.messagesBySession[t.sessionId]??[],r=n.some(l=>l.id===t.message.id),i=e.activeLeafBySession[t.sessionId]??null,a=t.message.role==="user"&&i!==null&&i.startsWith($c),o=t.message.parentId!=null&&t.message.parentId===i;return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:gV(n,t.message)},activeLeafBySession:r&&!a&&!o?e.activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:t.message.id}}}case"localError":{const n=e.messagesBySession[t.sessionId]??[],r={id:`${$c}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:t.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[t.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:[...n,r]},activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:r.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:t.leafId}};case"optimisticUser":{const n=e.messagesBySession[t.sessionId]??[],r=t.text?[{id:"p0",type:"text",text:t.text}]:[];t.attachments.forEach((a,o)=>r.push({id:`img${o}`,type:"image",text:a.url,name:a.name})),t.annotations.forEach((a,o)=>r.push({id:`annotation${o}`,type:"annotation",text:a.text}));const i={id:`${$c}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[t.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:[...n,i]},activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:i.id}}}case"busy":{const n=new Set(e.busySessions);return t.busy?n.add(t.sessionId):n.delete(t.sessionId),{...e,busySessions:n}}case"seedBusy":{const n=new Set(t.sessions),r=new Set(t.known);for(const i of e.busySessions)r.has(i)||n.add(i);return{...e,busySessions:n}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[t.sessionId]:t.items}};case"forget":{const n={...e.messagesBySession};delete n[t.sessionId];const r=new Set(e.busySessions);r.delete(t.sessionId);const i={...e.queuedBySession};delete i[t.sessionId];const a={...e.activeLeafBySession};return delete a[t.sessionId],{messagesBySession:n,busySessions:r,queuedBySession:i,activeLeafBySession:a}}}}function vV(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 gl(e){const t=e.replace(/\/+$/,"");return t.slice(t.lastIndexOf("/")+1)||t}function Ri(e,...t){for(const n of t){const r=e[n];if(typeof r=="string"&&r)return r}return null}function Jg(e,t,n){const r=e[t];if(!Array.isArray(r))return null;for(const i of r){if(!i||typeof i!="object"||!(n in i))continue;const a=i[n];if(typeof a=="string"&&a)return a}return null}function eb(e,t){const n=e[t];if(!Array.isArray(n))return[];const r=[];for(let i=0;i=Ml));i++);return r}function Fc(...e){const t=new Set,n=new RegExp(`^${Al}$`,"i");let r=0;for(const i of e)for(const a of i){if(t.size>=Ml||r++>=dC)return[...t];n.test(a)&&t.add(a.toLowerCase())}return[...t]}function L2(e){return e.replace(/^Exit code \d+\s*/i,"").split(` +`).trim();if(!f)return null;const g=oV(n,e),b=Array.from(n.getClientRects()).filter(T=>T.width>0&&T.height>0),k=b[0]??n.getBoundingClientRect(),S=b.filter(T=>T.topk.top),x=S.length>0?S:[k],v=Math.min(...x.map(T=>T.left)),w=Math.max(...x.map(T=>T.right)),y=Math.min(...x.map(T=>T.top)),C=Math.max(...x.map(T=>T.bottom)),N=34,E=74,M=y>=N+Jg?y-N-Jg:C+Jg;return{text:cV(g,f),range:n.cloneRange(),x:Math.min(window.innerWidth-E,Math.max(E,v+(w-v)/2)),top:M}}function hV(e,t){const[n,r]=R.useState(null),i=R.useRef(!1),a=R.useCallback(()=>{const c=e.current;r(c?dV(c):null)},[e]);R.useEffect(()=>{let c=null;const d=()=>{i.current||a()},m=g=>{const b=e.current,k=g.target;!g.isPrimary||g.button!==0||!b||!(k instanceof Node)||!b.contains(k)||(i.current=!0,r(null))},f=g=>{!g.isPrimary||!i.current||(i.current=!1,c=window.requestAnimationFrame(a))};return document.addEventListener("selectionchange",d),document.addEventListener("pointerdown",m,!0),window.addEventListener("pointerup",f,!0),window.addEventListener("pointercancel",f,!0),()=>{document.removeEventListener("selectionchange",d),document.removeEventListener("pointerdown",m,!0),window.removeEventListener("pointerup",f,!0),window.removeEventListener("pointercancel",f,!0),c!==null&&window.cancelAnimationFrame(c),i.current=!1}},[a]),R.useEffect(()=>{if(!n)return;const c=d=>{const m=d.target;m instanceof Element&&m.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",c,!0),window.addEventListener("resize",a),()=>{document.removeEventListener("mousedown",c,!0),window.removeEventListener("resize",a)}},[n,a]);const o=R.useCallback(()=>{var c;n&&(t({text:n.text,range:n.range}),r(null),(c=window.getSelection())==null||c.removeAllRanges())},[n,t]),l=R.useCallback(()=>r(null),[]);return{action:n,add:o,dismiss:l}}function fV(e){R.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const t=e.flatMap(r=>r.range?[r.range]:[]);if(t.length===0){CSS.highlights.delete(V0);return}const n=new Highlight(...t);return CSS.highlights.set(V0,n),()=>{CSS.highlights.get(V0)===n&&CSS.highlights.delete(V0)}},[e])}function pV({annotation:e}){const t=R.useRef(null),[n,r]=R.useState();return R.useLayoutEffect(()=>{var a;const i=(a=t.current)==null?void 0:a.closest(".chat-thread-inner");r(i?uV(e.text,i):void 0)},[e.id,e.text]),h.jsx("div",{ref:t,children:h.jsx(za,{text:n??e.text})})}function mV({annotations:e,onRemove:t}){return e.map((n,r)=>h.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${t?"grid-cols-[24px_minmax(0,_1fr)_24px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[h.jsxs("span",{className:"text-sm text-muted text-right",children:[r+1,"."]}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"text-sm text-muted mb-1",children:"Selected text:"}),h.jsx(pV,{annotation:n})]}),t&&h.jsx("button",{type:"button",className:"inline-flex items-center justify-center w-6 h-6 rounded-sm text-muted [&:hover]:bg-surface [&:hover]:text-text",title:"Remove annotation","aria-label":`Remove annotation ${r+1}`,onClick:()=>t(n.id),children:h.jsx(Vr,{size:13})})]},n.id))}function I2({annotations:e,variant:t,onClear:n,onRemove:r}){const i=R.useRef(null),a=R.useRef(null),o=R.useId(),l=Vo(i),c=t==="sent",d=R.useRef(null),m=()=>{d.current!==null&&window.clearTimeout(d.current),d.current=null,l.setOpen(!0)},f=()=>{d.current=window.setTimeout(()=>{var k;(k=a.current)!=null&&k.contains(document.activeElement)||l.setOpen(!1)},160)},g=()=>{const k=c||!l.open;l.setOpen(k),k&&window.requestAnimationFrame(()=>{var S;return(S=a.current)==null?void 0:S.focus()})},b=k=>{r==null||r(k),window.requestAnimationFrame(()=>{var x,v;(v=((x=a.current)==null?void 0:x.querySelector("button[aria-label^='Remove annotation']"))??a.current??i.current)==null||v.focus()})};return R.useEffect(()=>()=>{d.current!==null&&window.clearTimeout(d.current)},[]),h.jsxs("div",{className:c?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:l.ref,onMouseEnter:c?m:void 0,onMouseLeave:c?f:void 0,children:[h.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${c?"rounded-full":"rounded-sm"}`,children:[h.jsxs("button",{ref:i,type:"button",className:`inline-flex items-center gap-1.5 py-1 text-sm font-medium text-text [&:hover]:bg-surface ${c?"px-2.5":"pl-2 pr-1.5"}`,"aria-expanded":l.open,"aria-haspopup":"dialog","aria-controls":o,onClick:g,children:[h.jsx(iS,{size:c?13:14,className:"text-muted"}),e.length," ",e.length===1?"annotation":"annotations"]}),n&&h.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-l border-border [&:hover]:bg-surface [&:hover]:text-text",title:"Clear annotations","aria-label":"Clear annotations",onClick:n,children:h.jsx(Vr,{size:13})})]}),l.open&&h.jsx("div",{id:o,ref:a,tabIndex:-1,className:`annotation-menu absolute bottom-[calc(100%_+_8px)] z-50 w-[min(440px,_calc(100vw_-_48px))] max-h-80 overflow-y-auto overscroll-contain bg-background border border-border rounded-lg shadow-[0_4px_16px_rgba(0,_0,_0,_0.10)] p-2 text-left ${c?"right-0 after:absolute after:top-full after:left-0 after:right-0 after:h-2 after:content-['']":"left-3"}`,role:"dialog","aria-label":"Selected chat text",children:h.jsx(mV,{annotations:e,onRemove:r?b:void 0})})]})}function gV(e){return h.jsx(I2,{...e,variant:"composer"})}const bV=["prompt-collapsed text-muted text-lg font-[375] my-3.5 mx-0 [&_summary]:flex","[&_summary]:items-center [&_summary]:gap-2 [&_summary]:cursor-pointer","[&_summary]:list-none [&_summary]:select-none [&_summary::-webkit-details-marker]:hidden","[&_summary::after]:content-['›'] [&_summary::after]:text-muted","[&_summary::after]:transition-transform [&_summary::after]:duration-80 [&_summary::after]:ease-standard [&[open]_summary::after]:rotate-90"].join(" "),Nw=["prompt-collapsed-body mt-1.5 pl-3 border-l-2 border-l-border","text-md text-subtext"].join(" "),vV=["prompt-collapsed plan-resolved text-subtext my-3.5 mx-0","[&_summary]:flex [&_summary]:items-center [&_summary]:gap-2 [&_summary]:w-fit [&_summary]:max-w-full","[&_summary]:py-[3px] [&_summary]:px-1 [&_summary]:cursor-pointer [&_summary]:rounded-sm","[&_summary]:list-none [&_summary]:select-none [&_summary:hover]:bg-surface","[&_summary::-webkit-details-marker]:hidden","[&_summary_.plan-chevron]:transition-transform [&_summary_.plan-chevron]:duration-120","[&_summary_.plan-chevron]:ease-standard [&[open]_summary_.plan-chevron]:rotate-90"].join(" "),_V=["prompt-head text-xs font-semibold text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),Cv=["prompt-actions flex flex-wrap gap-2 [&_.btn-primary]:inline-flex","[&_.btn-primary]:items-center [&_.btn-primary]:gap-1.5 [&_.btn-primary]:py-1.5 [&_.btn-primary]:px-[13px]","[&_.btn-primary]:font-[inherit] [&_.btn-primary]:text-sm","[&_.btn-primary]:font-semibold [&_.btn-primary]:border [&_.btn-primary]:border-transparent","[&_.btn-primary]:rounded-sm [&_.btn-primary]:cursor-pointer","[&_.btn-primary]:transition-[background,border-color] [&_.btn-primary]:duration-80 [&_.btn-primary]:ease-standard [&_.btn-ghost]:inline-flex","[&_.btn-ghost]:items-center [&_.btn-ghost]:gap-1.5 [&_.btn-ghost]:py-1.5 [&_.btn-ghost]:px-[13px]","[&_.btn-ghost]:font-[inherit] [&_.btn-ghost]:text-sm","[&_.btn-ghost]:font-semibold [&_.btn-ghost]:border [&_.btn-ghost]:border-transparent","[&_.btn-ghost]:rounded-sm [&_.btn-ghost]:cursor-pointer","[&_.btn-ghost]:transition-[background,border-color] [&_.btn-ghost]:duration-80 [&_.btn-ghost]:ease-standard","[&_.btn-primary]:bg-primary [&_.btn-primary]:text-background","[&_.btn-primary:hover:not(:disabled)]:opacity-90 [&_.btn-ghost]:bg-transparent","[&_.btn-ghost]:border-border [&_.btn-ghost]:text-subtext","[&_.btn-ghost:hover:not(:disabled)]:border-border-strong","[&_.btn-ghost:hover:not(:disabled)]:text-text","[&_.btn-ghost:hover:not(:disabled)]:bg-surface [&_button:disabled]:opacity-50","[&_button:disabled]:cursor-default"].join(" "),$c="local-",jw=[];function xV(e,t){const n=e.findIndex(r=>r.id===t.id);if(n>=0){const r=e.slice();return r[n]=t,r}return t.role!=="user"?[...e,t]:[...e.filter(r=>!r.id.startsWith($c)),t]}function yV(e,t){switch(t.type){case"reset":return{messagesBySession:{},busySessions:new Set,queuedBySession:{},activeLeafBySession:{}};case"seed":return t.onlyIfAbsent&&t.sessionId in e.messagesBySession?e:{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:t.messages},queuedBySession:{...e.queuedBySession,[t.sessionId]:t.queued??[]},activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:t.activeLeafId??null}};case"upsertMessage":{const n=e.messagesBySession[t.sessionId]??[],r=n.some(l=>l.id===t.message.id),i=e.activeLeafBySession[t.sessionId]??null,a=t.message.role==="user"&&i!==null&&i.startsWith($c),o=t.message.parentId!=null&&t.message.parentId===i;return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:xV(n,t.message)},activeLeafBySession:r&&!a&&!o?e.activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:t.message.id}}}case"localError":{const n=e.messagesBySession[t.sessionId]??[],r={id:`${$c}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:t.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[t.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:[...n,r]},activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:r.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:t.leafId}};case"optimisticUser":{const n=e.messagesBySession[t.sessionId]??[],r=t.text?[{id:"p0",type:"text",text:t.text}]:[];t.attachments.forEach((a,o)=>r.push({id:`img${o}`,type:"image",text:a.url,name:a.name})),t.annotations.forEach((a,o)=>r.push({id:`annotation${o}`,type:"annotation",text:a.text}));const i={id:`${$c}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[t.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:[...n,i]},activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:i.id}}}case"busy":{const n=new Set(e.busySessions);return t.busy?n.add(t.sessionId):n.delete(t.sessionId),{...e,busySessions:n}}case"seedBusy":{const n=new Set(t.sessions),r=new Set(t.known);for(const i of e.busySessions)r.has(i)||n.add(i);return{...e,busySessions:n}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[t.sessionId]:t.items}};case"forget":{const n={...e.messagesBySession};delete n[t.sessionId];const r=new Set(e.busySessions);r.delete(t.sessionId);const i={...e.queuedBySession};delete i[t.sessionId];const a={...e.activeLeafBySession};return delete a[t.sessionId],{messagesBySession:n,busySessions:r,queuedBySession:i,activeLeafBySession:a}}}}function wV(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 vl(e){const t=e.replace(/\/+$/,"");return t.slice(t.lastIndexOf("/")+1)||t}function ji(e,...t){for(const n of t){const r=e[n];if(typeof r=="string"&&r)return r}return null}function tb(e,t,n){const r=e[t];if(!Array.isArray(r))return null;for(const i of r){if(!i||typeof i!="object"||!(n in i))continue;const a=i[n];if(typeof a=="string"&&a)return a}return null}function nb(e,t){const n=e[t];if(!Array.isArray(n))return[];const r=[];for(let i=0;i=Fo));i++);return r}function Fc(...e){const t=new Set,n=new RegExp(`^${Nl}$`,"i");let r=0;for(const i of e)for(const a of i){if(t.size>=Fo||r++>=pC)return[...t];n.test(a)&&t.add(a.toLowerCase())}return[...t]}function z2(e){return e.replace(/^Exit code \d+\s*/i,"").split(` `).filter(t=>!/^\s*\[orx-(?:run|experiment):[^\]]+\]\s*$/.test(t)).join(` -`).trim()}function _V(e){const t=e.changes;if(!Array.isArray(t))return null;for(const n of t){if(!n||typeof n!="object"||!("path"in n)||typeof n.path!="string")continue;const r="kind"in n?n.kind:null,i=r&&typeof r=="object"&&"type"in r&&typeof r.type=="string"?r.type:null;return{path:n.path,type:i}}return null}function xV(e){const t=e.trim(),n=t.match(/^\/bin\/(?:ba|z)?sh\s+-lc\s+([\s\S]+)$/);let r=((n==null?void 0:n[1])??t).trim();const i=r[0];return(i==='"'||i==="'")&&r[r.length-1]===i&&(r=r.slice(1,-1)),wV(r).replace(/[\t\r ]+/g," ").trim()}function yV(e){let t=null,n=!1;for(let r=0;r{n&&t.push(n),n=""};for(const o of e){if(i){n+=o,i=!1;continue}if(o==="\\"&&r!=="'"){i=!0;continue}if(r){o===r?r=null:n+=o;continue}if(o==='"'||o==="'"){r=o;continue}/\s/.test(o)?a():n+=o}return a(),t}function pC(e){const t=e==null?void 0:e.replace(/[)'\"]+$/,"");return!t||t==="-"||/^\d+$/.test(t)||/[$`]/.test(t)?null:t}function mC(e){const t=pC(e);if(!t)return null;const n=gl(t);return t.includes("/")||t.startsWith(".")||/\.[A-Za-z0-9][A-Za-z0-9_-]*$/.test(n)||/^(?:Dockerfile|Makefile|README|LICENSE|NOTICE|CHANGELOG)$/i.test(n)?t:null}function gC(e){var i,a;const t=fC(e);let n=0;for(;["do","then","else","if","while","until"].includes(t[n]);)n++;for(;/^[A-Za-z_][A-Za-z0-9_]*=/.test(t[n]??"");)n++;if(t[n]==="command")for(n++;(i=t[n])!=null&&i.startsWith("-");)n++;if(t[n]==="env")for(n++;(a=t[n])!=null&&a.startsWith("-")||/^[A-Za-z_][A-Za-z0-9_]*=/.test(t[n]??"");)n++;const r=t[n];return r?{name:r.split("/").pop()??r,args:t.slice(n+1)}:null}function SV(e){const{name:t,args:n}=e;if(t==="sed"){let i=0,a=!1;for(;i!a.startsWith("-")&&a.includes(":"));if(!t)return null;const n=t.indexOf(":"),r=t.slice(0,n),i=t.slice(n+1);return r&&mC(i)?{ref:r,path:i}:null}function CV(e){const t=e.match(/\b(?:rg|grep)\b(?:\s+-[^\s]+)*\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/);return(t==null?void 0:t[1])??(t==null?void 0:t[2])??(t==null?void 0:t[3])??null}function Tw(e,t){if(/[$`~]/.test(e)||/[$`~]/.test(t))return null;const n=t.startsWith("/")||!t.startsWith("/")&&e.startsWith("/"),r=t.startsWith("/")?[]:e.split("/").filter(Boolean);for(const a of t.split("/"))if(!(!a||a===".")){if(a===".."){r.length>0&&r[r.length-1]!==".."?r.pop():n||r.push(a);continue}r.push(a)}return`${n?"/":""}${r.join("/")}`||(n?"/":null)}function EV(e,t,n,r){if(e.startsWith("/"))return e;let i=r??"";for(let a=0;a!d.startsWith("-"));if(!l)return null;const u=Tw(i,l);if(!u)return null;i=u}return i?Tw(i,e):e}const Ta="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",Al=`(?:${Ta}|[0-9a-f]{8})`;function wd(e){const t=[];let n="",r="",i=null,a=!1;const o=()=>{(n.trim()||r.trim())&&t.push({raw:n.trim(),code:r.trim()}),n="",r=""},l=d=>{let m=1,f=null,g=!1;for(let b=d;b{let m=!1;for(let f=d;fn.test(r.code))}function Na(e,t){return Bd(e,t).length>0?!0:new RegExp(`(?:^|[\\s($;])orx\\s+${t}\\b`,"i").test(e)}function Sv(e,t){if(!e)return[];const n=new Set,r=e.slice(0,JG),i=t==="runs"?[new RegExp(`/runs/(${Ta})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${Ta})`,"gi"),new RegExp(`^\\s*RUN\\s+(${Ta})\\b`,"gim"),new RegExp(`={3,}\\s*(${Ta})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${Ta})`,"gi"),new RegExp(`^\\s*id:\\s*(${Ta})`,"gim"),new RegExp(`={3,}\\s*(${Ta})\\s*={3,}`,"gi")];for(const o of i)for(const l of r.matchAll(o))if(n.add(l[1]),n.size>=Ml)return[...n];const a=new RegExp(`^\\s*(${Ta})(?:\\s|$)`,"gim");for(const o of r.matchAll(a))if(n.add(o[1]),n.size>=Ml)break;return[...n]}function bC(e,t){let n=0;return t.map(r=>{const i=e.indexOf(r.raw,n),a=i===-1?e.indexOf(r.raw):i;return n=Math.max(n,a+r.raw.length),{invocation:r,offset:Math.max(0,a)}})}function vC(e,t,n,r){const i=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let a="";for(const o of e.matchAll(i)){if((o.index??0)>=n)break;a=o[1]??o[2]??o[3]??""}return[...a.matchAll(new RegExp(r,"gi"))].map(o=>o[0])}function _C(e,t,n,r){const i=new RegExp(`\\bfor\\s+${t}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let a="";for(const o of e.matchAll(i)){const l=o.index??0;if(l>=n)break;const u=l+o[0].length;u<=n&&/\bdone\b/.test(e.slice(u,n))||(a=o[1])}return/\$\(|`/.test(a)?[]:[...a.matchAll(new RegExp(r,"gi"))].map(o=>o[0])}function AV(e,t,n=[],r=[]){const i=Bd(e,"logs"),a=new Set;if(i.length===0){if(!Na(e,"logs"))return[];const l=n.length>0?[]:Sv(t,"runs");for(const u of n.length>0?n:l.length>0?l:r)if(a.add(u),a.size>=Ml)break;return Fc([...a])}let o=!1;for(const{invocation:l,offset:u}of bC(e,i)){const d=/\borx\s+logs\b/i.exec(l.raw);if(!d)continue;const m=fC(l.raw.slice(d.index+d[0].length));let f=null;for(let x=0;x0?[]:Sv(t,"runs"),u=n.length>0?n:l.length>0?l:r;for(const d of u)if(a.add(d),a.size>=Ml)break}return Fc([...a])}function Cc(e,t,n=[],r=[]){const i=Bd(e,"exp\\s+(?:status|desc)");if(i.length===0)return[];const a=new Set;let o=!1;for(const{invocation:l,offset:u}of bC(e,i)){let d=!1;for(const f of l.raw.matchAll(new RegExp(`\\borx\\s+exp\\s+(?:status|desc)\\s+["']?(${Al})`,"gi")))a.add(f[1]),d=!0;const m=/\borx\s+exp\s+(?:status|desc)\s+["']?\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?/.exec(l.raw);if(m){const f=m[1],g=vC(e,f,u,Al);if(g.length>0){for(const k of g)a.add(k);d=!0}const b=_C(e,f,u,Al);for(const k of b)a.add(k);b.length>0&&(d=!0)}d||(o=!0)}if(a.size===0||o){const l=n.length>0?[]:Sv(t,"experiments"),u=n.length>0?n:l.length>0?l:r;for(const d of u)if(a.add(d),a.size>=Ml)break}return Fc([...a])}function Js(e){var x,_,w,y;const t=e.tool??"tool",n=((x=e.state)==null?void 0:x.input)??{},r=n.arguments,i=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},a={...n,...i},o=Ri(a,"command","cmd"),l=((_=e.state)==null?void 0:_.output)||((w=e.state)==null?void 0:w.error),u=Fc(eb(a,"targetIds")),d=Fc(eb(a,"runTargetIds")),m=Fc(eb(a,"experimentTargetIds")),f=Ri(a,"filePath","file_path","notebookPath","notebook_path","path"),g=Ri(a,"description"),b=t.toLowerCase().split(/(?::|\.|__)+/),k=b.at(-1)??t.toLowerCase();if(k==="run"&&b.includes("web")){const C=Jg(a,"search_query","q"),T=Jg(a,"image_query","q"),E=Jg(a,"find","pattern");return C?{kind:"web",label:`Searched the web for “${C}”`}:T?{kind:"web",label:`Searched images for “${T}”`}:E?{kind:"web",label:`Searched a web page for “${E}”`}:Array.isArray(a.open)?{kind:"web",label:"Opened web pages"}:Array.isArray(a.weather)?{kind:"web",label:"Checked the weather"}:Array.isArray(a.finance)?{kind:"web",label:"Checked market data"}:Array.isArray(a.sports)?{kind:"web",label:"Checked sports data"}:Array.isArray(a.time)?{kind:"web",label:"Checked local times"}:{kind:"web",label:"Browsed the web"}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(k)??k){case"bash":{if(!o)return{kind:"command",label:"Ran a command"};const C=xV(o),T=Bd(C,"(?:lit|paper)")[0],E=T?cL(T.raw):null;if(E){const re=E.kind==="lit"?E.query?`Searched for “${E.query}”`:"Searched the literature":E.id?`Read ${E.id}`:"Read a paper";return{kind:E.kind==="lit"?"search":"read",label:re,litCall:E}}const j=wd(C),N=j.map(re=>gC(re.raw)),D=Na(C,"exp\\s+status"),z=Na(C,"exp\\s+desc"),$=Bd(C,"exp\\s+desc").some(re=>/(?:^|\s)--(?:set(?:=|\s)|stdin\b)/.test(re.raw)),F=$?"Updated experiment notes":"Read experiment notes",U=$?"Checked experiment status and updated notes":"Reviewed experiment status and notes";if(Na(C,"logs")){const re=AV(C,l,d,u);return{kind:"project",label:re.length===1?"Reviewed run log":"Reviewed run logs",runIds:re}}if(Na(C,"exp\\s+run"))return{kind:"project",label:"Started an experiment run"};if(Na(C,"exp\\s+wait"))return{kind:"project",label:"Waited for an experiment run"};if(Na(C,"exp\\s+cancel"))return{kind:"project",label:"Cancelled an experiment run"};const V=Na(C,"project\\s+view");if(V&&D&&z)return{kind:"project",label:U,experimentIds:Cc(C,l,m,u)};if(V&&z)return{kind:"project",label:F,experimentIds:Cc(C,l,m,u)};if(V&&D)return{kind:"project",label:"Checked experiment status",experimentIds:Cc(C,l,m,u)};if(V)return{kind:"project",label:"Read project details"};if(D&&z)return{kind:"project",label:U,experimentIds:Cc(C,l,m,u)};if(D)return{kind:"project",label:"Checked experiment status",experimentIds:Cc(C,l,m,u)};if(z)return{kind:"project",label:F,experimentIds:Cc(C,l,m,u)};if(Na(C,"runs?"))return{kind:"project",label:"Listed project runs"};const X=N.map(kV).find(re=>re!=null);if(X)return{kind:"read",label:`Read ${gl(X.path)}`,filePath:X.path,fileRef:X.ref,labelPrefix:"Read ",labelTarget:gl(X.path)};const Y=N.findIndex(re=>re!=null&&["sed","cat","head","tail"].includes(re.name)),Q=Y>=0?N[Y]:null,te=Q?SV(Q):null,I=te?EV(te,j,Y,Ri(a,"cwd","workdir")):null;if(te&&I)return{kind:"read",label:`Read ${gl(te)}`,filePath:I,labelPrefix:"Read ",labelTarget:gl(te)};if(N.some(re=>(re==null?void 0:re.name)==="find"||(re==null?void 0:re.name)==="ls"||(re==null?void 0:re.name)==="rg"&&re.args.includes("--files")))return{kind:"search",label:"Listed files"};const O=N.findIndex(re=>(re==null?void 0:re.name)==="rg"||(re==null?void 0:re.name)==="grep");if(O>=0){const re=CV(j[O].raw);return{kind:"search",label:re?`Searched code for “${re}”`:"Searched code",searchPattern:re??void 0}}const H=N.find(re=>(re==null?void 0:re.name)==="git"),G=H==null?void 0:H.args[0];if(G==="grep"){const re=H==null?void 0:H.args.slice(1).find(ce=>!ce.startsWith("-"));return{kind:"search",label:re?`Searched code for “${re}”`:"Searched code",searchPattern:re}}if(Q)return{kind:"read",label:"Read a file"};if(G==="status")return{kind:"command",label:"Checked Git status"};if(G==="diff")return{kind:"command",label:"Reviewed code changes"};if(G==="log")return{kind:"command",label:"Read Git history"};const W=re=>N.some(ce=>!ce||!["cargo","pnpm","npm","yarn"].includes(ce.name)?!1:ce.args[0]===re||ce.args[0]==="run"&&ce.args[1]===re);return W("test")?{kind:"command",label:"Ran tests"}:N.some(re=>(re==null?void 0:re.name)==="tsc")||W("typecheck")?{kind:"command",label:"Checked types"}:W("lint")?{kind:"command",label:"Checked code style"}:W("build")?{kind:"command",label:"Built the project"}:{kind:"command",label:`Ran ${C}`}}case"read":{const C=f?gl(f):null;return C?{kind:"read",label:`Read ${C}`,filePath:f??void 0,labelPrefix:"Read ",labelTarget:C}:{kind:"read",label:"Read a file"}}case"edit":case"write":case"notebookedit":{const C=_V(a),T=f??(C==null?void 0:C.path)??null,E=T?gl(T):null,j=(C==null?void 0:C.type)==="add"?"Created":(C==null?void 0:C.type)==="delete"?"Deleted":"Edited";return E?{kind:"edit",label:`${j} ${E}`,filePath:T??void 0,labelPrefix:`${j} `,labelTarget:E}:{kind:"edit",label:"Edited a file"}}case"grep":{const C=Ri(a,"pattern");return{kind:"search",label:C?`Searched code for “${C}”`:"Searched code",searchPattern:C??void 0}}case"glob":{const C=Ri(a,"pattern");return{kind:"search",label:C?`Listed files matching ${C}`:"Listed files"}}case"websearch":{const C=Ri(a,"query"),T=Ri(a,"url"),E=Ri(a,"pattern");return C?{kind:"web",label:`Searched the web for “${C}”`}:E&&T?{kind:"web",label:`Searched “${E}” on a page`}:T?{kind:"web",label:`Opened ${T}`}:{kind:"web",label:g??"Browsed the web"}}case"webfetch":{const C=Ri(a,"url");return{kind:"web",label:C?`Read ${C}`:g??"Read a web page"}}case"task":return{kind:"agent",label:g??"Ran a subagent"};case"subagent":return{kind:"agent",label:TV(a)};case"error":return{kind:"command",label:"Tool failed"};case"interrupted":return{kind:"command",label:"Tool was interrupted"};default:{const C=g??f??o??((y=e.state)==null?void 0:y.title)??"";return{kind:"command",label:C?`${t}: ${C}`:t}}}}function TV(e){const t=a=>a.length>60?`${a.slice(0,60)}…`:a,n=typeof e.prompt=="string"&&e.prompt?` — “${t(e.prompt)}”`:"",r=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",i=r&&r.charAt(0).toUpperCase()+r.slice(1);switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return i||`Spawned agent${n}`;case"sendInput":return r?`Sent input to ${r}`:`Sent input to agent${n}`;case"resumeAgent":return r?`Resumed ${r}`:"Resumed agent";case"wait":return`Waiting on ${r||"agent"}`;case"closeAgent":return`Closed ${r||"agent"}`}switch(typeof e.kind=="string"?e.kind:""){case"started":return i||"Sub-agent started";case"interacted":return r?`${i} reported back`:"Agent reported back";case"interrupted":return r?`${i} interrupted`:"Sub-agent interrupted"}return i||"Sub-agent"}function qf({activity:e,className:t=""}){if(e.litCall)return h.jsx(h_,{source:e.litCall.source,size:16,className:`tool-kind-icon shrink-0 ${t}`});const n={size:16,strokeWidth:1.75,className:`tool-kind-icon shrink-0 ${t}`};switch(e.kind){case"read":case"project":return h.jsx(W8,{...n});case"search":return h.jsx(eR,{...n});case"edit":return h.jsx(op,{...n});case"web":return h.jsx(yM,{...n});case"agent":return h.jsx(oS,{...n});case"command":return h.jsx(aS,{...n})}}function Nw({items:e,onOpen:t,targetType:n}){const[r,i]=R.useState(!1),a=R.useRef(null),o=R.useRef(!1);return R.useEffect(()=>{var l,u;!r||!o.current||(o.current=!1,(u=(l=a.current)==null?void 0:l.querySelector("button"))==null||u.focus())},[r]),h.jsxs("span",{className:"tool-target-overflow inline",children:[r&&h.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((l,u)=>h.jsxs("span",{children:[u>0&&", ",t?h.jsx("button",{className:"tool-target",onClick:d=>{d.preventDefault(),d.stopPropagation(),t(l.id)},children:l.label}):h.jsx("span",{children:l.label})]},l.id))}),r&&", ",h.jsx("button",{className:"tool-target-more","aria-expanded":r,"aria-label":r?`Hide additional ${n}`:`Show ${e.length} more ${n}`,onClick:l=>{l.preventDefault(),l.stopPropagation(),o.current=!r&&l.detail===0,i(u=>!u)},children:r?"show less":`+ ${e.length} more`})]})}function kv({activity:e,onOpenFile:t,onOpenRun:n,runExperimentName:r,onOpenExperiment:i,experimentName:a}){var o,l,u;if(e.searchPattern){const d=e.label.indexOf(e.searchPattern),m=d>=0?e.label.slice(0,d):"Searched code for “",f=d>=0?e.label.slice(d+e.searchPattern.length):"”";return h.jsxs(h.Fragment,{children:[m,e.searchPattern.split(/([|/_-])/).map((g,b)=>h.jsxs("span",{children:[g,/^[|/_-]$/.test(g)&&h.jsx("wbr",{})]},`${b}-${g}`)),f]})}if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return h.jsxs("a",{className:"tool-target",href:oL(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,h.jsx(Aj,{className:"inline ml-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&t){const d=e.filePath;return h.jsxs(h.Fragment,{children:[e.labelPrefix,h.jsx("button",{className:"tool-target",onClick:m=>{m.preventDefault(),m.stopPropagation(),t(d,void 0,void 0,e.fileRef)},children:e.labelTarget})]})}if((l=e.runIds)!=null&&l.length){const d=r?e.runIds.filter(b=>!!r(b)):e.runIds;if(d.length===0)return e.label;const m=d.length>1,f=d.slice(0,3),g=d.slice(f.length).map(b=>({id:b,label:(r==null?void 0:r(b))||"Experiment"}));return h.jsxs(h.Fragment,{children:[m?"Reviewed run logs for ":"Reviewed run log ",f.map((b,k)=>h.jsxs("span",{children:[k>0&&", ",n?h.jsx("button",{className:"tool-target",title:`Open logs for run ${b}`,onClick:S=>{S.preventDefault(),S.stopPropagation(),n(b)},children:(r==null?void 0:r(b))||"Experiment"}):h.jsx("span",{children:(r==null?void 0:r(b))||"Experiment"})]},b)),g.length>0&&h.jsxs(h.Fragment,{children:[", ",h.jsx(Nw,{items:g,onOpen:n,targetType:"run logs"})]})]})}if((u=e.experimentIds)!=null&&u.length){const d=a?e.experimentIds.filter(g=>!!a(g)):e.experimentIds;if(d.length===0)return e.label;const m=d.slice(0,3),f=d.slice(m.length).map(g=>({id:g,label:(a==null?void 0:a(g))||"Experiment"}));return h.jsxs(h.Fragment,{children:[e.label," for ",m.map((g,b)=>h.jsxs("span",{children:[b>0&&", ",i?h.jsx("button",{className:"tool-target",title:`Open experiment ${(a==null?void 0:a(g))||""}`.trim(),onClick:k=>{k.preventDefault(),k.stopPropagation(),i(g)},children:(a==null?void 0:a(g))||"Experiment"}):h.jsx("span",{children:(a==null?void 0:a(g))||"Experiment"})]},g)),f.length>0&&h.jsxs(h.Fragment,{children:[", ",h.jsx(Nw,{items:f,onOpen:i,targetType:"experiments"})]})]})}return e.label}function NV(e){const t=f=>e.filter(g=>g.kind===f).length,n=[],r=t("read"),i=t("search"),a=t("edit"),o=t("project"),l=t("web"),u=t("command"),d=t("agent");r&&n.push(r===1?"Read a file":"Read files"),i&&n.push("searched code"),a&&n.push(a===1?"edited a file":"edited files"),o&&n.push("reviewed project data"),l&&n.push("browsed the web"),u&&n.push(u===1?"ran a command":"ran commands"),d&&n.push(d===1?"worked with a subagent":"worked with subagents");const m=n.join(", ");return m?`${m[0].toUpperCase()}${m.slice(1)}`:"Used tools"}function O2(e){const t=[[/^Reviewed run logs?/,e.label.startsWith("Reviewed run logs")?"Reading run logs":"Reading run log"],[/^Reviewed /,"Reviewing "],[/^Read /,"Reading "],[/^Searched /,"Searching "],[/^Listed /,"Listing "],[/^Edited /,"Editing "],[/^Updated /,"Updating "],[/^Created /,"Creating "],[/^Deleted /,"Deleting "],[/^Ran /,"Running "],[/^Started /,"Starting "],[/^Waited /,"Waiting "],[/^Checked /,"Checking "],[/^Built /,"Building "],[/^Cancelled /,"Cancelling "]];let n=e.label;for(const[r,i]of t)if(r.test(n)){n=n.replace(r,i);break}return{...e,label:n}}function xC(e,t){const n=Js({tool:e,state:{status:"running",input:t}}),r=[[/^Reviewed /,"Review "],[/^Searched /,"Search "],[/^Listed /,"List "],[/^Edited /,"Edit "],[/^Updated /,"Update "],[/^Created /,"Create "],[/^Deleted /,"Delete "],[/^Ran /,"Run "],[/^Started /,"Start "],[/^Waited /,"Wait "],[/^Checked /,"Check "],[/^Built /,"Build "],[/^Cancelled /,"Cancel "]];for(const[i,a]of r)if(i.test(n.label))return n.label.replace(i,a);return n.label}function jV(e,t,n){var i,a;const r=o=>{const l=o.slice(0,3),u=o.length-l.length;return`${l.join(", ")}${u>0?`, + ${u} more`:""}`};if((i=e.runIds)!=null&&i.length){const o=e.runIds.map(l=>(t==null?void 0:t(l))||"").filter(Boolean);return o.length===0?e.label:`${e.label}${o.length>1?" for ":" "}${r(o)}`}if((a=e.experimentIds)!=null&&a.length){const o=e.experimentIds.map(l=>(n==null?void 0:n(l))||"").filter(Boolean);return o.length===0?e.label:`${e.label} for ${r(o)}`}return e.label}function MV(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const RV=250;function DV(e,t){const[n,r]=R.useState(e),i=R.useRef(Date.now()),a=R.useRef(e);return R.useEffect(()=>{if(a.current=e,(e==null?void 0:e.label)===(n==null?void 0:n.label)||t&&e!=null&&n!=null)return;if(e==null||n==null){i.current=Date.now(),r(e);return}const o=RV-(Date.now()-i.current);if(o<=0){i.current=Date.now(),r(e);return}const l=window.setTimeout(()=>{i.current=Date.now(),r(a.current)},o);return()=>window.clearTimeout(l)},[e,n,t]),e!=null&&e.label===(n==null?void 0:n.label)?e:n}const LV=160;function yC(e){const[t,n]=R.useState(!1);return R.useEffect(()=>{if(!e){n(!1);return}const r=window.setTimeout(()=>n(!0),LV);return()=>window.clearTimeout(r)},[e]),e&&t}function OV(e){const t=["read","search","edit","project","web","command","agent"];for(const n of t){const r=e.find(i=>i.kind===n);if(r)return r}return e[0]??{kind:"command",label:"Used tools"}}function jw(e){var n,r;if(((n=e.state)==null?void 0:n.status)!=="completed")return null;const t=Js(e);return JSON.stringify([t.kind,t.label,t.filePath??null,t.fileRef??null,((r=t.litCall)==null?void 0:r.kind)==="paper"?t.litCall.id??null:null,t.runIds??null,t.experimentIds??null])}function IV(e){const t=[];for(const n of e){const r=jw(n),i=t[t.length-1];r&&i&&jw(i.part)===r?i.count++:t.push({part:n,count:1})}return t}function Mw({part:e,repeatCount:t=1,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o}){const l=e.state,u=Js(e),d=(l==null?void 0:l.status)==="error",m=L2((l==null?void 0:l.error)||(l==null?void 0:l.output)||""),f=d&&!!m,[g,b]=R.useState(!1),k=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`,S=h.jsxs(h.Fragment,{children:[d&&h.jsx("span",{className:"sr-only",children:"Failed: "}),d?h.jsx(Z8,{size:16,strokeWidth:1.75,className:"tool-kind-icon shrink-0 text-accent-red self-start mt-[5px]","aria-hidden":"true"}):h.jsx(qf,{activity:u,className:"text-muted self-start mt-[5px]"}),h.jsxs("span",{className:`tool-line flex-1 min-w-0 whitespace-normal break-words text-lg ${d?"text-accent-red":"text-subtext"}`,children:[h.jsx(kv,{activity:u,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o}),t>1&&h.jsxs("span",{className:"tool-repeat-count ml-1 text-muted font-normal",title:`${t} consecutive identical calls`,children:["×",t]})]})]});return f?h.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[S,h.jsx("button",{type:"button",className:"tool-row-detail-toggle shrink-0 inline-flex items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":g,"aria-controls":k,"aria-label":`${g?"Hide":"Show"} error details for ${u.label}`,onClick:()=>b(x=>!x),children:h.jsx(ta,{size:12,className:`text-accent-red transition-transform duration-120 ease-standard ${g?"rotate-90":""}`})})]}),g&&h.jsx("div",{className:"tool-detail mt-1 mr-0 mb-1 ml-6",id:k,children:h.jsx("div",{className:"tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",children:m.slice(0,2e4)})})]}):h.jsx("div",{className:"tool-row flex items-center gap-2 min-w-0 py-[3px] px-1",children:S})}function zV({parts:e,pendingTail:t,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var C,T,E;const[l,u]=R.useState(!1),d=IV(e),m=d.map(({part:j})=>Js(j)),f=t?e.at(-1):void 0,g=((C=f==null?void 0:f.state)==null?void 0:C.status)!=="error"?(f&&O2(Js(f)))??null:null,b=!!f&&((T=f.state)==null?void 0:T.status)==="running"&&(MV((E=f.state)==null?void 0:E.input)||(g==null?void 0:g.label)==="Running a command"),k=DV(g,b),S=yC(k!=null),x=NV(m),_=k??OV(m),w=k?jV(k,i,o):x;if(e.length===1)return k?h.jsx("div",{className:"tool-group my-3.5 mx-0",children:h.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-lg text-subtext",children:[h.jsx(qf,{activity:k,className:`${S?"tool-running-shimmer-icon":"text-muted"} self-start mt-[5px]`}),h.jsx("span",{className:`${S?"tool-running-shimmer":""} tool-active-label min-w-0 whitespace-normal break-words`,title:w,children:h.jsx(kv,{activity:k,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):h.jsx("div",{className:"tool-group my-3.5 mx-0",children:h.jsx(Mw,{part:e[0],onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o})});const y=l;return h.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[h.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-lg text-subtext text-left",children:[h.jsx(qf,{activity:_,className:`${S?"tool-running-shimmer-icon":"text-muted"} mt-[5px]`}),k?h.jsx("span",{className:`tool-group-label tool-active-label min-w-0 whitespace-normal break-words ${S?"tool-running-shimmer":""}`,title:w,children:h.jsx(kv,{activity:k,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):h.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-left",onClick:()=>u(j=>!j),"aria-expanded":y,children:w}),h.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex items-center justify-center self-center shrink-0 p-px cursor-pointer rounded-sm",onClick:()=>u(j=>!j),"aria-expanded":y,"aria-label":y?"Collapse tool activity":"Expand tool activity",children:h.jsx(ta,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${y?"open":""}`})})]}),h.jsx("div",{className:`tool-group-disclosure ${y?"open":""}`,"aria-hidden":!y,inert:!y,children:h.jsx("div",{className:"tool-group-disclosure-inner",children:h.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 mr-0 mb-1 ml-6",children:d.map(({part:j,count:N})=>h.jsx(Mw,{part:j,repeatCount:N,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o},j.id))})})})]})}function BV({part:e,onRespond:t,onOpenFile:n,onOpenPlan:r}){var m;const i=e.prompt,[a,o]=R.useState([]),l=!t,u=f=>t==null?void 0:t({promptId:e.id,...f});if(i.resolved){if(i.kind==="permission")return null;if(i.kind==="plan"){const b=i.approved===!0?{label:"Plan approved",icon:Oi,iconClass:"text-accent-green"}:i.approved===!1&&i.note?{label:"Plan revision requested",icon:op,iconClass:"text-accent-amber"}:i.approved===!1?{label:"Plan rejected",icon:Yr,iconClass:"text-accent-red"}:{label:"Plan resolved",icon:ah,iconClass:"text-muted"},k=b.icon;return h.jsxs("details",{className:pV,children:[h.jsxs("summary",{children:[h.jsx("span",{className:"plan-resolved-label text-lg font-[375] wrap-anywhere",children:i.synthesized?"Plan":"Proposed plan"}),h.jsx(k,{size:17,strokeWidth:1.8,className:`shrink-0 ${b.iconClass}`}),h.jsx("span",{className:"plan-resolved-label prompt-outcome text-lg font-[375] wrap-anywhere",children:b.label}),h.jsx(ta,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),h.jsxs("div",{className:`${Ew} ml-6`,children:[h.jsx(za,{text:i.plan??"",onOpenFile:n}),i.note&&h.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:i.note})]})]})}const f=(i.answers??[]).join(", ")||i.note||"",g=(i.annotations??[]).map((b,k)=>({id:`${e.id}-annotation-${k}`,text:b.text}));return h.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[g.length>0&&h.jsx(D2,{annotations:g,variant:"sent"}),h.jsxs("details",{className:fV,children:[h.jsxs("summary",{children:[h.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:i.header||i.question||"Question"}),h.jsx("span",{className:`prompt-outcome font-[375] text-subtext wrap-anywhere [&.approved]:text-accent-green [&.chosen]:text-accent-green [&.approved::before]:content-['✓_'] [&.chosen::before]:content-['✓_'] [&.revised]:text-accent-amber [&.rejected]:text-accent-amber ${f?"chosen":""}`,children:f||"Resolved"})]}),h.jsxs("div",{className:Ew,children:[i.header&&i.question&&h.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:i.question}),(i.options??[]).length>0&&h.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 pl-4.5 [&_.sel]:text-text [&_.sel]:font-semibold",children:(i.options??[]).map(b=>{var k;return h.jsx("li",{className:(k=i.answers)!=null&&k.includes(b.label)?"sel":"",children:b.label},b.label)})}),i.note&&i.note!==f&&h.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:i.note})]})]})]})}if(i.kind==="plan"){const f=!!r;return h.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-l-[3px] border-l-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-l-accent-blue [&.permission]:border-l-accent-amber [&.question]:border-l-accent-purple [&.readonly]:opacity-60 plan ${l?"readonly":""}`,children:[h.jsx("div",{className:"prompt-head text-lg font-semibold text-text",children:i.synthesized?"Plan mode — ready to proceed?":"Proposed plan"}),h.jsx("div",{className:`prompt-plan text-base leading-[1.6] text-text max-h-85 overflow-y-auto [&.clamped]:max-h-[9.5em] [&.clamped]:overflow-hidden [&.clamped]:relative [&.clamped::after]:content-[''] [&.clamped::after]:absolute [&.clamped::after]:inset-x-0 [&.clamped::after]:bottom-0 [&.clamped::after]:top-auto [&.clamped::after]:h-8.5 [&.clamped::after]:bg-[linear-gradient(to_bottom,_transparent,_var(--surface))] [&.clamped::after]:pointer-events-none ${f?"clamped":""}`,children:h.jsx(za,{text:i.plan??"",onOpenFile:n})}),f&&h.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",onClick:()=>r(i.plan??"",e.id),children:"View full plan"}),!l&&!f&&h.jsxs("div",{className:wv,children:[h.jsx("button",{className:"btn-primary",onClick:()=>u({approve:!0,resumeMode:"auto"}),children:"Accept and auto mode"}),h.jsx("button",{className:"btn-ghost",onClick:()=>u({approve:!0,resumeMode:"bypassPermissions"}),children:"Accept and bypass all"}),h.jsx("button",{className:"btn-ghost",onClick:()=>u({approve:!1}),children:"Reject"})]})]})}if(i.kind==="permission"){const f=i.toolInput??{},g=Ri(f,"command","cmd","filePath","file_path","path")||"",b=typeof((m=i.toolInput)==null?void 0:m.reason)=="string"&&i.toolInput.reason||"",k=Ri(f,"description")||"",S=b||k||xC(i.tool,f),x=`permission-heading-${e.id}`;return h.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-[0_1px_2px_rgb(0_0_0_/_4%)] [&.readonly]:opacity-60 ${l?"readonly":""}`,role:"group","aria-labelledby":x,children:[h.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[h.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:h.jsx(gR,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),h.jsx("span",{id:x,className:"text-base font-semibold text-text",children:"Approval required"})]}),h.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[h.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:S}),g&&h.jsx("code",{className:"prompt-command block max-h-36 overflow-auto whitespace-pre-wrap wrap-anywhere rounded-md border border-border-variant bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-text",children:g}),!l&&h.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[h.jsx("button",{className:"rounded-sm border border-transparent bg-transparent px-3 py-1.5 text-sm font-semibold text-subtext transition-[background,color] duration-80 ease-standard hover:bg-surface hover:text-text",onClick:()=>u({approve:!1}),children:"Deny"}),h.jsx("button",{className:"rounded-sm border border-text bg-text px-3 py-1.5 text-sm font-semibold text-background transition-opacity duration-80 ease-standard hover:opacity-85",onClick:()=>u({approve:!0}),children:"Allow"})]})]})]})}const d=f=>o(g=>i.multiSelect?g.includes(f)?g.filter(b=>b!==f):[...g,f]:[f]);return h.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-l-[3px] border-l-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-l-accent-blue [&.permission]:border-l-accent-amber [&.question]:border-l-accent-purple [&.readonly]:opacity-60 question ${l?"readonly":""}`,children:[i.header&&h.jsx("div",{className:mV,children:i.header}),i.question&&h.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:i.question}),h.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(i.options??[]).map(f=>{const g=a.includes(f.label);return h.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-left border border-border rounded-sm bg-background text-text cursor-pointer transition-[border-color,background] duration-80 ease-standard [&:hover:not(:disabled)]:border-border-strong [&:hover:not(:disabled)]:bg-surface [&.sel]:border-primary [&.sel]:bg-primary-subtle [&:disabled]:cursor-default ${g?"sel":""}`,disabled:l,onClick:()=>l?void 0:i.multiSelect?d(f.label):u({answers:[f.label]}),children:[h.jsx("span",{className:"prompt-option-label block text-md font-semibold",children:f.label}),f.description&&h.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:f.description})]},f.label)})}),i.multiSelect&&!l&&h.jsx("div",{className:wv,children:h.jsx("button",{className:"btn-primary",disabled:a.length===0,onClick:()=>u({answers:a}),children:"Submit"})})]})}function Gf(e,t){if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(t!==void 0)return e.id===t}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function HV(e,t){return e.role==="user"?!0:e.parts.some(n=>Gf(n,t))}function $V(e){const t=e.text??"",n=t.startsWith("data:")?t:HD(t),r=t.startsWith("data:")?"":t.includes("__")?t.slice(t.indexOf("__")+2):t,i=e.name||r||"attachment",a=t.startsWith("data:application/pdf")||/\.pdf$/i.test(i)||/\.pdf$/i.test(t);return{src:n,isPdf:a,name:i}}const tb=[dh,"w-6 h-6 rounded-sm [&:disabled]:opacity-40 [&:disabled]:cursor-default","[&:disabled:hover]:bg-transparent [&:disabled:hover]:text-subtext"].join(" ");function Rw({count:e,index:t,prevId:n,nextId:r,onSelect:i,pagerDisabled:a,actionLabel:o,icon:l,onAction:u,disabled:d}){const m=e>1;return h.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${m?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[m&&h.jsxs(h.Fragment,{children:[h.jsx("button",{className:tb,title:"Previous version","aria-label":"Previous version",disabled:a||!n,onClick:()=>n&&i(n),children:h.jsx(X8,{size:14})}),h.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[t+1,"/",e]}),h.jsx("button",{className:tb,title:"Next version","aria-label":"Next version",disabled:a||!r,onClick:()=>r&&i(r),children:h.jsx(ta,{size:14})})]}),h.jsx("button",{className:tb,title:o,"aria-label":o,disabled:d,onClick:u,children:l})]})}const FV=R.memo(function({message:t,activePermissionId:n,pendingTailToolId:r,onOpenFile:i,onOpenRun:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:d,onOpenPlan:m,onOpenSubagent:f,skills:g,predictTextTail:b=!1,forkCount:k,forkIndex:S=0,forkPrevId:x,forkNextId:_,forkDisabled:w,branchDisabled:y,onFork:C,onSelectFork:T}){const[E,j]=R.useState(null);if(t.role==="user"){const N=t.parts.filter(X=>X.type==="text").map(X=>X.text??"").join(` -`),D=N.match(/^\/(\S+)([\s\S]*)$/),z=D?g==null?void 0:g.find(X=>X.name===D[1]):void 0,$=t.parts.filter(X=>X.type==="image"&&X.text).map($V),F=$.filter(X=>!X.isPdf),U=$.filter(X=>X.isPdf),V=t.parts.filter(X=>X.type==="annotation"&&X.text).map(X=>({id:X.id,text:X.text??""}));if(E!==null){const X=()=>{const Y=E.trim();!Y||w||(j(null),C(t.id,Y))};return h.jsx("div",{className:"msg-user-group self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:h.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[h.jsx("textarea",{className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":"Edit message",value:E,autoFocus:!0,onChange:Y=>j(Y.target.value),onKeyDown:Y=>{Y.key==="Escape"?(Y.preventDefault(),j(null)):Y.key==="Enter"&&!Y.shiftKey&&!Y.nativeEvent.isComposing&&(Y.preventDefault(),X())}}),h.jsxs("div",{className:`${wv} justify-end`,children:[h.jsx("button",{className:"btn-ghost",onClick:()=>j(null),children:"Cancel"}),h.jsx("button",{className:"btn-primary",onClick:X,disabled:w||!E.trim(),children:"Send"})]})]})})}return h.jsxs("div",{className:"msg-user-group group/turn self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[V.length>0&&h.jsx(D2,{annotations:V,variant:"sent"}),h.jsxs("div",{className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:mr-0.5 [&_.skill-chip]:align-baseline",children:[z?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"skill-chip inline-flex items-center py-px px-[7px] font-mono text-md font-medium text-primary bg-primary-subtle border border-border-variant rounded-sm",children:["/",z.name]}),D[2]]}):N,F.length>0&&h.jsx("div",{className:"msg-images flex flex-wrap gap-1.5 mt-2 [&_img]:max-w-55 [&_img]:max-h-40 [&_img]:border [&_img]:border-border-variant [&_img]:rounded-xs [&_img]:block",children:F.map((X,Y)=>h.jsx("a",{href:X.src,target:"_blank",rel:"noreferrer",children:h.jsx("img",{src:X.src,alt:"attachment"})},Y))}),U.length>0&&h.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:U.map((X,Y)=>h.jsxs("a",{className:"msg-file inline-flex items-center gap-1.5 max-w-60 py-1.5 px-2.5 border border-border-variant rounded-sm text-text no-underline [&:hover]:border-text [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap",href:X.src,target:"_blank",rel:"noreferrer",children:[h.jsx(ah,{size:15}),h.jsx("span",{children:X.name})]},Y))})]}),k!==void 0&&h.jsx(Rw,{count:k,index:S,prevId:x,nextId:_,onSelect:T,pagerDisabled:y,actionLabel:"Edit and re-send",icon:h.jsx(op,{size:13}),onAction:()=>j(N),disabled:w})]})}return h.jsxs("div",{className:"msg-assistant group/turn text-lg leading-[1.62] text-text min-w-0",children:[wC(t.parts,{activePermissionId:n,pendingTailToolId:r,onOpenFile:i,onOpenRun:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:d,onOpenPlan:m,onOpenSubagent:f,predictTextTail:b}),k!==void 0&&h.jsx(Rw,{count:k,index:S,prevId:x,nextId:_,onSelect:T,pagerDisabled:y,actionLabel:"Try another response",icon:h.jsx(KM,{size:13}),onAction:()=>C(t.id),disabled:w})]})});function wC(e,t){var _,w;const{activePermissionId:n,pendingTailToolId:r,onOpenFile:i,onOpenRun:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:d,onOpenPlan:m,onOpenSubagent:f,predictTextTail:g=!1}=t,b=e.filter(y=>y.type!=="steer"&&Gf(y,n)).at(-1),k=[];let S=[];const x=()=>{S.length!==0&&(k.push(h.jsx(zV,{parts:S,pendingTail:S.some(y=>y.id===r),onOpenFile:i,onOpenRun:a,runExperimentName:o,onOpenExperiment:l,experimentName:u},`tg-${S[0].id}`)),S=[])};for(const y of e)if(Gf(y,n)){if(y.type==="tool"&&(UV(y.tool)||(((_=y.children)==null?void 0:_.length)??0)>0)){x(),k.push(h.jsx(GV,{part:y,pendingTail:g&&((w=y.state)==null?void 0:w.status)==="running"||y.id===r,onOpenSubagent:f},y.id));continue}if(y.type==="tool"){S.push(y);continue}x(),y.type==="text"?k.push(h.jsx(za,{text:y.text,onOpenFile:i,onOpenRun:a,predict:g&&y.id===(b==null?void 0:b.id)},y.id)):y.type==="steer"?k.push(h.jsx("div",{role:"note","aria-label":"You, mid-task",className:"msg-steer my-2 ml-auto w-fit max-w-[88%] bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere",children:y.text},y.id)):y.type==="prompt"&&y.prompt&&k.push(h.jsx(BV,{part:y,onRespond:d,onOpenFile:i,onOpenPlan:m},y.id))}return x(),k}function PV(e){return Js(e).label}function UV(e){const t=(e??"").toLowerCase();return t==="subagent"||t==="task"||t==="agent"}function SC(e){var n,r;const t=((n=e.state)==null?void 0:n.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return t.startsWith("Async agent launched")?"":t}function I2(e,t){for(const n of e){if(n.id===t)return n;const r=n.children&&I2(n.children,t);if(r)return r}return null}function qV({spawn:e,onOpenFile:t,onOpenRun:n,runExperimentName:r,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}){var k,S,x,_;const l=e.children??[],u=((k=e.state)==null?void 0:k.status)==="running",d=((S=e.state)==null?void 0:S.status)==="error",m=d?L2(((x=e.state)==null?void 0:x.error)||((_=e.state)==null?void 0:_.output)||""):"",f=wC(l,{onOpenFile:t,onOpenRun:n,runExperimentName:r,onOpenExperiment:i,experimentName:a,onOpenSubagent:o,predictTextTail:u,pendingTailToolId:u?kC(l):null}),b=l.some(w=>w.type==="text"&&!!w.text)?"":SC(e);return h.jsxs("div",{className:"msg-assistant text-lg leading-[1.62] text-text min-w-0",children:[d&&h.jsx("span",{className:"sr-only",children:"Failed: "}),m&&h.jsx("div",{className:"tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",children:m.slice(0,2e4)}),f.length===0&&!b&&!m?h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:u?"Working…":"No activity"}):h.jsxs(h.Fragment,{children:[f,b&&h.jsx(za,{text:b,onOpenFile:t,onOpenRun:n})]})]})}function GV({part:e,pendingTail:t,onOpenSubagent:n}){var d,m,f,g;const r=((d=e.state)==null?void 0:d.status)==="error",i=L2(((m=e.state)==null?void 0:m.error)||((f=e.state)==null?void 0:f.output)||""),a=t&&!r?O2(Js(e)):Js(e),o=yC(!!(t&&!r)),l=(((g=e.children)==null?void 0:g.length)??0)===0&&!r&&!SC(e),u=h.jsxs(h.Fragment,{children:[r&&h.jsx("span",{className:"sr-only",children:"Failed: "}),r?h.jsx(Z8,{size:16,strokeWidth:1.75,className:"subagent-icon shrink-0 text-accent-red","aria-hidden":"true"}):h.jsx(qf,{activity:a,className:`subagent-icon shrink-0 ${o?"tool-running-shimmer-icon":"text-muted"}`}),h.jsx("span",{className:`${QG} ${o?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:a.label})]});return l?h.jsx("div",{className:"subagent-row flex items-center gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-lg text-left rounded-sm [&_.tool-line]:text-lg",children:u}):h.jsxs("button",{className:"subagent-row flex items-center gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-lg text-left rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default [&_.tool-line]:text-lg",title:r&&i?i:"Open sub-agent transcript",onClick:()=>n==null?void 0:n(e.id,a.label),disabled:!n,children:[u,h.jsx(ta,{size:12,className:"subagent-row-chevron shrink-0 text-muted"})]})}function VV(e){const t=new Map;let n;for(let i=e.length-1;i>=0;i--)if(e[i].role==="assistant"){n=e[i];break}if(!n)return{messageId:"",states:t};const r=(i,a)=>{var o,l;for(const u of i){const d=`${a}/${u.id}`;u.type==="tool"&&((o=u.state)!=null&&o.status)&&t.set(d,{status:u.state.status,part:u}),(l=u.children)!=null&&l.length&&r(u.children,d)}};return r(n.parts,n.id),{messageId:n.id,states:t}}function z2(e){const t=(n,r)=>{var i;for(const a of n){const o=a.prompt;if(a.type==="prompt"&&(o==null?void 0:o.kind)==="permission"&&!o.resolved){const l=o.toolInput??{},d=Ri(l,"reason","description")||xC(o.tool,l);return{id:a.id,path:`${r}/${a.id}`,label:d}}if((i=a.children)!=null&&i.length){const l=t(a.children,`${r}/${a.id}`);if(l)return l}}return null};for(const n of e){if(n.role!=="assistant")continue;const r=t(n.parts,n.id);if(r)return r}return null}function WV(e){const[t,n]=R.useState({text:"",sequence:0}),r=R.useRef(null);return R.useEffect(()=>{var b,k;const i=((b=e[0])==null?void 0:b.id)??"",{messageId:a,states:o}=VV(e),l=z2(e);if(!r.current||r.current.transcript!==i){r.current={transcript:i,messageId:a,states:o,permissionPath:(l==null?void 0:l.path)??null},n(S=>({text:l?`Approval required: ${l.label}`:"",sequence:S.sequence+1}));return}const u=r.current.messageId===a?r.current.states:new Map,d=r.current.permissionPath,m=[...o].filter(([S,x])=>{var _;return((_=u.get(S))==null?void 0:_.status)!==x.status});if(r.current={transcript:i,messageId:a,states:o,permissionPath:(l==null?void 0:l.path)??null},l&&l.path!==d){n(S=>({text:`Approval required: ${l.label}`,sequence:S.sequence+1}));return}const f=m.filter(([,S])=>S.status==="error");if(f.length>0){const S=f.slice(0,2).map(([,x])=>Js(x.part).label).join(", ");n(x=>({text:`${f.length===1?"Tool activity failed":`${f.length} tool activities failed`}: ${S}`,sequence:x.sequence+1}));return}const g=m.filter(([,S])=>S.status==="running");if(g.length>0){const S=(k=g.at(-1))==null?void 0:k[1].part;n(x=>({text:S?O2(Js(S)).label:"Running a tool",sequence:x.sequence+1}));return}m.some(([,S])=>S.status==="completed")&&n(S=>({text:"Tool activity completed",sequence:S.sequence+1}))},[e]),t}function kC(e){var t;for(let n=e.length-1;n>=0;n--){const r=e[n];if(!(r.type==="steer"||!Gf(r)))return r.type!=="tool"||((t=r.state)==null?void 0:t.status)==="error"?null:r.id}return null}function CC(e){const t=e.at(-1);if((t==null?void 0:t.role)!=="assistant")return null;const n=kC(t.parts);return n?{messageId:t.id,toolId:n}:null}const YV=R.memo(function({messages:t,allMessages:n,canFork:r,onFork:i,onSelectFork:a,busy:o,onOpenFile:l,onOpenRun:u,runExperimentName:d,onOpenExperiment:m,experimentName:f,onRespond:g,onOpenPlan:b,onOpenSubagent:k,skills:S}){var E;const x=((E=z2(t))==null?void 0:E.id)??null,_=R.useMemo(()=>t.filter(j=>HV(j,x)),[t,x]),w=R.useMemo(()=>{const j=_.filter(D=>!D.id.startsWith($c)),N=j.filter((D,z)=>D.role==="user"||!j[z+1]||j[z+1].role==="user");return YD(n,t,N,D=>D.startsWith($c))},[t,_,n]),y=_.at(-1),C=WV(t),T=o?CC(t):null;return h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:h.jsx("span",{children:C.text},C.sequence)}),_.map(j=>{var N,D,z,$;return h.jsx(FV,{message:j,forkCount:(N=w.get(j.id))==null?void 0:N.count,forkIndex:(D=w.get(j.id))==null?void 0:D.index,forkPrevId:(z=w.get(j.id))==null?void 0:z.prevId,forkNextId:($=w.get(j.id))==null?void 0:$.nextId,forkDisabled:!r,branchDisabled:o,onFork:i,onSelectFork:a,activePermissionId:x,pendingTailToolId:(T==null?void 0:T.messageId)===j.id?T.toolId:null,onOpenFile:l,onOpenRun:u,runExperimentName:d,onOpenExperiment:m,experimentName:f,onRespond:g,onOpenPlan:b,onOpenSubagent:k,skills:S,predictTextTail:o&&j===y&&j.role==="assistant"},j.id)})]})}),Dw=(e,t)=>e==="all"?!0:e==="archived"?t:!t,EC=[{id:"active",label:"Active",railLabel:"Recents"},{id:"archived",label:"Archived",railLabel:"Archived"},{id:"all",label:"All",railLabel:"All sessions"}];function XV({value:e,onChange:t}){const{open:n,setOpen:r,ref:i}=Go();return h.jsxs("div",{className:"rail-filter relative inline-flex",ref:i,children:[h.jsx("button",{className:`${dh} rail-filter-btn w-6 h-6 rounded-sm ${e!=="active"?"active":""}`,title:"Filter sessions","aria-label":"Filter sessions",onClick:()=>r(a=>!a),children:h.jsx(oR,{size:13})}),n&&h.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:EC.map(a=>h.jsxs("button",{className:ui,onClick:()=>{t(a.id),r(!1)},children:[h.jsx("span",{children:a.label}),e===a.id&&h.jsx(Oi,{size:13})]},a.id))})]})}const KV=14,ZV=500,QV=1200;function AC({title:e,animate:t}){return t?h.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((n,r)=>n===" "?h.jsx("span",{"aria-hidden":!0,children:n},r):h.jsx("span",{"aria-hidden":!0,className:"title-reveal-char inline-block animate-[title-char-in_240ms_ease-out_both] [@media((prefers-reduced-motion:_reduce))]:animate-none",style:{animationDelay:`${Math.min(r*KV,ZV)}ms`},children:n},r))}):h.jsx(h.Fragment,{children:e})}function JV({session:e,active:t,unread:n,busy:r,waiting:i,revealTitle:a,onOpen:o,onRename:l,onSetArchived:u,onDelete:d}){var T;const{open:m,setOpen:f,ref:g}=Go(),b=((T=e.title)==null?void 0:T.trim())||"Untitled",[k,S]=R.useState(!1),[x,_]=R.useState(""),w=R.useRef(null);function y(){var E;_(((E=e.title)==null?void 0:E.trim())||""),S(!0)}function C(){var j;const E=x.trim();S(!1),E&&E!==(((j=e.title)==null?void 0:j.trim())||"")&&l(E)}return R.useEffect(()=>{var E,j;k&&((E=w.current)==null||E.focus(),(j=w.current)==null||j.select())},[k]),h.jsxs("div",{ref:g,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-left py-[7px] px-2.5 rounded-md text-md text-text cursor-pointer select-none [&:hover]:bg-surface [&.active]:bg-surface [&.active]:font-medium [&_.session-dot]:w-3.5 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:text-ellipsis [&_.session-title]:whitespace-nowrap [&.unread_.session-title]:font-semibold [&_.session-time]:text-2xs [&_.session-time]:text-muted [&_.session-time]:shrink-0 [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-within_.session-menu-btn]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-time]:hidden [&:focus-within_.session-time]:hidden [&.menu-open_.session-time]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-time]:hidden ${t?"active":""} ${n?"unread":""} ${m?"menu-open":""} ${k?"editing":""}`,title:`${dd[e.harness]}${e.model?` · ${e.model}`:""}`,onClick:()=>{k||(m?f(!1):o())},onKeyDown:E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),m?f(!1):o())},children:[h.jsx("span",{className:"session-dot",children:r?h.jsx("span",{className:`busy-dot ${i?"waiting":""}`}):n&&h.jsx("span",{className:"unread-dot"})}),k?h.jsx("input",{ref:w,className:"session-title-input","aria-label":"Session title",value:x,onChange:E=>_(E.target.value),onClick:E=>E.stopPropagation(),onBlur:C,onKeyDown:E=>{E.stopPropagation(),E.key==="Enter"?(E.preventDefault(),C()):E.key==="Escape"&&(E.preventDefault(),S(!1))}}):h.jsx("span",{className:"session-title",children:h.jsx(AC,{title:b,animate:a!==void 0},a??"static")}),h.jsx("span",{className:"session-time",children:vV(e.updatedAt)}),h.jsx("button",{className:"session-menu-btn",title:"Session options","aria-label":"Session options",onClick:E=>{E.stopPropagation(),f(j=>!j)},children:h.jsx(eS,{size:14})}),m&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[h.jsx("button",{className:ui,onClick:E=>{E.stopPropagation(),f(!1),y()},children:h.jsx("span",{children:"Rename"})}),h.jsx("button",{className:ui,onClick:E=>{E.stopPropagation(),f(!1),u(!e.archived)},children:h.jsx("span",{children:e.archived?"Unarchive":"Archive"})}),h.jsx("button",{className:`${ui} danger`,onClick:E=>{E.stopPropagation(),f(!1),d()},children:h.jsx("span",{children:"Delete"})})]})]})}function eW({projectId:e,projectName:t,paperId:n,railHeader:r,railOpen:i,onShowRail:a,mainView:o,onSelectMainView:l,experimentsActive:u,filesActive:d,artifactsActive:m,onOpenExperiments:f,onOpenArtifacts:g,onOpenFile:b,onOpenRun:k,runExperimentName:S,onOpenExperiment:x,experimentName:_,onOpenPlan:w,onOpenSubagent:y,onOpenWorktree:C,onOpenDemoWelcome:T,onActiveSessionChange:E,preferredAgent:j,onPreferredAgentChange:N,children:D}){var Ft,Sn,ti;const[z,$]=R.useState([]),[F,U]=R.useState(null),[V,X]=R.useState(new Set),[Y,Q]=R.useState("active"),[te,I]=R.useState(""),[O,H]=R.useState([]),G=R.useRef(0),W=R.useRef({projectId:e,activeId:F});W.current={projectId:e,activeId:F};const[re,ce]=R.useState([]),[pe,ne]=R.useState(null),[B,se]=R.useState(null),oe=R.useRef(Promise.resolve()),_e=R.useRef(0),be=R.useRef(0),[Ce,Le]=R.useState(null),Fe=R.useRef(null),Ve=R.useRef(!1),Pe=R.useRef(null),[dt,Qe]=R.useReducer(bV,{messagesBySession:{},busySessions:new Set,queuedBySession:{},activeLeafBySession:{}}),[qe,ut]=R.useState([]),[Zt,Dt]=R.useState(j);R.useEffect(()=>Dt(j),[j]);const[Ge,rt]=R.useState({}),[ve,je]=R.useState(new Map),Ue=R.useRef(new Map),Je=R.useRef(new Set),De=R.useRef(new Set),tt=R.useRef(0),it=R.useRef([]),Tt=R.useRef(null),yt=R.useRef(null),Xt=R.useRef(!0),ht=R.useRef(null),sn=Go(),mn=R.useCallback(ie=>{var xe;G.current+=1,H(Ae=>[...Ae,{id:`annotation-${G.current}`,...ie}]),(xe=ht.current)==null||xe.focus()},[]),Un=lV(yt,mn);cV(O),R.useEffect(()=>{H([]),Un.dismiss()},[F,e,Un.dismiss]);const[Gi,Vi]=R.useState([]),[Rs,Nr]=R.useState(0),[pi,mr]=R.useState(!1),[Wo,Jr]=R.useState(0),[Qt,cn]=R.useState(null),mi=R.useRef(null),[la,Ds]=R.useState(0);R.useLayoutEffect(()=>{Ds(Qt&&mi.current?mi.current.offsetWidth+8:0),us()},[Qt]);function us(){var ie;mi.current&&(mi.current.style.transform=`translateY(${-(((ie=ht.current)==null?void 0:ie.scrollTop)??0)}px)`)}const jr=R.useRef(!1);R.useEffect(()=>{ED(e).then(Vi).catch(()=>{})},[e,o]);function xr(ie){var xe;if(ie.source==="command"&&ie.name==="plan"&&zn){Ya(te,zn);return}if(zn!=null&&zn.inline){const Ae=te.slice(0,zn.start),Z=te.slice(zn.end),le=`/${ie.name}`,me=Z?"":" ",Re=Ae.length+le.length+me.length;I(`${Ae}${le}${me}${Z}`),mr(!0),window.requestAnimationFrame(()=>{var Oe,Ze;(Oe=ht.current)==null||Oe.focus(),(Ze=ht.current)==null||Ze.setSelectionRange(Re,Re),Jr(Re)});return}cn(ie),I(""),(xe=ht.current)==null||xe.focus()}function yr(){var ie;cn(null),(ie=ht.current)==null||ie.focus()}function gi(ie){ne(null);let Z=re.reduce((le,me)=>le+me.size,0);for(const le of ie){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(le.type))continue;if(le.size>31457280){ne(`${le.name} is too large — each attachment must be under 30 MB.`);continue}if(Z+le.size>41943040){ne("Attachments exceed the 40 MB total limit — remove one and try again.");continue}Z+=le.size;const me=new FileReader;me.onload=()=>{const Re=me.result;ce(Oe=>[...Oe,{dataUrl:Re,mediaType:le.type,name:le.name,size:le.size}])},me.readAsDataURL(le)}}function Rn(ie){const xe=Array.from(ie.clipboardData.items).filter(Ae=>Ae.kind==="file"&&(Ae.type.startsWith("image/")||Ae.type==="application/pdf")).map(Ae=>Ae.getAsFile()).filter(Ae=>Ae!==null);xe.length>0&&(ie.preventDefault(),gi(xe))}const pt=z.find(ie=>ie.id===F),_t=Zt??MG(qe),yn=pt?{harness:pt.harness,model:Ge.model??pt.model,permissionMode:Ge.permissionMode??pt.permissionMode,reasoningLevel:Ge.reasoningLevel??pt.reasoningLevel}:_t?{..._t,...Ge}:null,We=yn?qe.find(ie=>ie.id===yn.harness):void 0,St=We==null?void 0:We.options,ca=HG(Gi,St==null?void 0:St.planActivation),zn=Qt?null:ww(te,Wo),bi=(zn==null?void 0:zn.query)??null,zr=bi!==null&&!pi?zG(ca,(zn==null?void 0:zn.inline)??!1).filter(ie=>ie.name.startsWith(bi)):[],Br=zr.length>0,Mr=Math.min(Rs,Math.max(0,zr.length-1));R.useEffect(()=>Nr(0),[bi]);const $t=yn&&{...yn,reasoningLevel:yS(We,yn.model,yn.reasoningLevel)},qn=up(We,$t==null?void 0:$t.model),Jt=ie=>{if(!$t)return;const xe={...$t,...ie};Dt(xe),N(xe).catch(()=>{}),pt?rt(Ae=>({...Ae,...ie})):ie.harness&&ie.harness!==$t.harness&&rt({})},ar=R.useCallback(ie=>{const xe=oe.current.catch(()=>{}).then(ie);return oe.current=xe.then(()=>{},()=>{}),xe},[]),vi=ie=>{if(ie==="plan"&&(We==null?void 0:We.id)==="claude-code"?rt(Z=>({...Z,permissionMode:ie})):(rt(Z=>{const le={...Z};return delete le.permissionMode,le}),Jt({permissionMode:ie})),!pt)return;const xe=pt.id,Ae=++_e.current;se(null),ar(()=>zD(xe,ie)).then(Z=>{$(le=>le.map(me=>me.id===Z.id?Z:me)),_e.current===Ae&&rt(le=>{const me={...le};return delete me.permissionMode,me})}).catch(()=>{_e.current===Ae&&(rt(Z=>{const le={...Z};return delete le.permissionMode,le}),se("Could not update permissions. Try again."))})},Hr=ie=>Jt({reasoningLevel:ie}),ei=($t==null?void 0:$t.harness)==="claude-code"?$t.permissionMode==="plan":(St==null?void 0:St.planActivation)==="command"?Ce??(pt==null?void 0:pt.planMode)??!1:!1;R.useEffect(()=>{Ce===null||(pt==null?void 0:pt.planMode)!==Ce||(Fe.current=null,Le(null))},[pt==null?void 0:pt.planMode,Ce]);async function ds(ie){if(Fe.current=ie,Le(ie),!pt)return;const xe=pt.id,Ae=++be.current;se(null);try{const Z=await ar(()=>ID(xe,ie));$(le=>le.map(me=>me.id===Z.id?Z:me)),be.current===Ae&&(Fe.current=null,Le(null),se(null))}catch(Z){throw be.current===Ae&&(Fe.current=null,Le(null)),Z}}async function hs(){if(($t==null?void 0:$t.harness)==="claude-code"){vi("auto");return}if(pt)try{await ds(!1)}catch{se("Could not exit Plan mode. Try again.")}}async function ua(){const ie=!ei;try{if(($t==null?void 0:$t.harness)==="claude-code")vi(ie?"plan":"auto");else if((St==null?void 0:St.planActivation)==="command")await ds(ie);else throw new Error("The selected harness is unavailable")}catch{se("Could not toggle Plan mode. Try again.")}}function Ya(ie,xe){const Ae=BG(ie,xe);I(Ae.text),cn(null),mr(!0),ua(),window.requestAnimationFrame(()=>{var Z,le;(Z=ht.current)==null||Z.focus(),(le=ht.current)==null||le.setSelectionRange(Ae.cursor,Ae.cursor),Jr(Ae.cursor)})}it.current=z;const Gn=R.useCallback(async()=>{const ie=it.current.map(xe=>xe.id);try{const xe=(await df(e)).filter(Z=>!De.current.has(Z.id)),Ae=new Set(xe.map(Z=>Z.id));for(const Z of ie)Ae.has(Z)||Bs(Z);return $(Z=>{const le=new Map(Z.map(me=>[me.id,me.contextUsage]));return xe.map(me=>({...me,contextUsage:me.contextUsage??le.get(me.id)}))}),Ue.current=new Map(xe.map(Z=>[Z.id,Z.title])),Qe({type:"seedBusy",sessions:xe.filter(Z=>Z.busy).map(Z=>Z.id),known:xe.map(Z=>Z.id)}),xe}catch{return null}},[e]);R.useEffect(()=>{$([]),it.current=[],U(null);const ie=uC();X(e===lg?new Set([lS,cS].filter(xe=>!ie.has(xe))):new Set),I(""),cn(null),ce([]),Qe({type:"reset"}),Je.current=new Set,je(new Map),Ue.current=new Map,Gn().then(xe=>{xe&&U(Ae=>{var Z,le;return Ae??(e===lg?(Z=xe.find(me=>me.id===pd))==null?void 0:Z.id:void 0)??((le=xe.find(me=>!me.archived))==null?void 0:le.id)??null})})},[e,Gn]),R.useEffect(()=>{!F||Je.current.has(F)||(Je.current.add(F),md(F).then(({messages:ie,queued:xe,activeLeafId:Ae})=>Qe({type:"seed",sessionId:F,messages:ie,queued:xe,activeLeafId:Ae})).catch(()=>{Qe({type:"seed",sessionId:F,messages:[],onlyIfAbsent:!0}),Je.current.delete(F)}))},[F]),R.useEffect(()=>Ad(ie=>{switch(ie.type){case"session":{if(ie.session.projectId!==e||De.current.has(ie.session.id))return;const xe=Ue.current.has(ie.session.id),Ae=Ue.current.get(ie.session.id)!==ie.session.title;Ue.current.set(ie.session.id,ie.session.title),xe&&Ae&&ie.session.titleSource==="generated"&&(je(Z=>{const le=new Map(Z);return le.set(ie.session.id,(Z.get(ie.session.id)??0)+1),le}),window.setTimeout(()=>{je(Z=>{if(!Z.has(ie.session.id))return Z;const le=new Map(Z);return le.delete(ie.session.id),le})},QV)),$(Z=>{const le=Z.findIndex(Re=>Re.id===ie.session.id);if(le<0)return[ie.session,...Z];const me=Z.slice();return me[le]={...ie.session,contextUsage:ie.session.contextUsage??Z[le].contextUsage},me});break}case"sessionDeleted":Bs(ie.sessionId);break;case"message":tt.current++,Qe({type:"upsertMessage",sessionId:ie.sessionId,message:ie.message});break;case"busy":Qe({type:"busy",sessionId:ie.sessionId,busy:ie.busy});break;case"queued":Qe({type:"setQueued",sessionId:ie.sessionId,items:ie.items});break;case"branch":Qe({type:"activeLeaf",sessionId:ie.sessionId,leafId:ie.activeLeafId});break;case"usage":$(xe=>xe.map(Ae=>Ae.id===ie.sessionId?{...Ae,contextUsage:ie.usage}:Ae));break}}),[e]),R.useEffect(()=>Ad(ie=>{if(ie.type!=="reconnected"||(Gn(),!F||!Je.current.has(F)))return;const xe=Ae=>{const Z=tt.current;md(F).then(({messages:le,queued:me,activeLeafId:Re})=>{Qe({type:"seed",sessionId:F,messages:le,queued:me,activeLeafId:Re}),Ae&&tt.current!==Z&&xe(!1)}).catch(()=>{})};xe(!0)}),[F,Gn]);const _i=F?dt.messagesBySession[F]??Aw:Aw,gr=F?dt.activeLeafBySession[F]??null:null,Dn=R.useRef(gr);Dn.current=gr;const or=R.useMemo(()=>VD(_i,gr),[_i,gr]),Ln=F?dt.busySessions.has(F):!1,Ls=!Ln&&!!(We!=null&&We.agentReady),Wi=Ln&&CC(or)!=null,$r=F?dt.queuedBySession[F]??[]:[];R.useEffect(()=>{const ie=$r.reduce((xe,Ae)=>Ae.planMode??xe,void 0);ie!==void 0?(Ve.current=!0,Fe.current=ie,Le(ie)):Ve.current&&(Ve.current=!1,Fe.current=null,Le(null))},[$r]);const Xa=!!F&&!(F in dt.messagesBySession),wn=R.useMemo(()=>{const ie=new Set;for(const xe of dt.busySessions)(dt.messagesBySession[xe]??[]).some(Ae=>Ae.parts.some(Z=>Z.type==="prompt"&&Z.prompt&&!Z.prompt.resolved&&Z.prompt.nativeId))&&ie.add(xe);return ie},[dt.busySessions,dt.messagesBySession]),Yi=F?wn.has(F):!1,en=pt,Os=en?ve.get(en.id):void 0,gn=R.useMemo(()=>{var ie;for(let xe=or.length-1;xe>=0;xe--)for(const Ae of or[xe].parts)if(Ae.type==="prompt"&&((ie=Ae.prompt)==null?void 0:ie.kind)==="plan"&&!Ae.prompt.resolved)return{promptId:Ae.id,plan:Ae.prompt.plan??"",synthesized:!!Ae.prompt.synthesized};return null},[or]),Vn=R.useMemo(()=>{const ie=en==null?void 0:en.harness;if(!F||ie!=="claude-code"&&ie!=="codex")return null;for(let xe=or.length-1;xe>=0;xe--)for(const Ae of or[xe].parts)if(!(Ae.type!=="prompt"||!Ae.prompt||Ae.prompt.resolved)&&Ae.prompt.kind==="question")return Ae.prompt.nativeId&&!dt.busySessions.has(F)?null:Ae.id;return null},[or,en==null?void 0:en.harness,F,dt.busySessions]),[xi,fs]=R.useState(null),Ul=xi&&xi.sessionId===F?xi:null;R.useEffect(()=>{if(!xi)return;const ie=dt.busySessions.has(xi.sessionId),xe=xi.sessionId===F&&gn&&gn.promptId!==xi.promptId;(!ie||xe)&&fs(null)},[xi,gn,dt.busySessions,F]);const ql=R.useMemo(()=>z2(or),[or]),Ka=Ln&&!!(We!=null&&We.supportsSteering)&&!!(We!=null&&We.agentReady)&&!gn&&!Vn&&!ql&&re.length===0&&O.length===0,Is=R.useMemo(()=>w&&F?(ie,xe)=>w(ie,F,xe):void 0,[w,F]),Gl=R.useMemo(()=>y&&F?(ie,xe)=>y(F,ie,xe):void 0,[y,F]),Vl=R.useMemo(()=>b&&((ie,xe,Ae,Z)=>b(ie,F??void 0,xe,Ae,Z)),[b,F]);R.useEffect(()=>{_e.current+=1,be.current+=1;const ie=(F?dt.queuedBySession[F]??[]:[]).reduce((xe,Ae)=>Ae.planMode??xe,void 0);Ve.current=ie!==void 0,Fe.current=ie??null,Le(ie??null),rt({}),se(null)},[F]),R.useEffect(()=>{E==null||E(F)},[F,E]);const Xi=o==="chat"&&(or.length>0||Ln);R.useLayoutEffect(()=>{Xt.current=!0;const ie=Tt.current;ie&&(ie.scrollTop=ie.scrollHeight)},[F,Xi]),R.useLayoutEffect(()=>{const ie=Tt.current;ie&&Xt.current&&(ie.scrollTop=ie.scrollHeight)},[or,Ln]),R.useEffect(()=>{const ie=Tt.current,xe=yt.current;if(!ie||!xe)return;const Ae=new ResizeObserver(()=>{Xt.current&&(ie.scrollTop=ie.scrollHeight)});return Ae.observe(xe),Ae.observe(ie),()=>Ae.disconnect()},[Xi]);async function Fr({queue:ie=!1}={}){const xe=te.trim(),Ae=Qt?`/${Qt.name}${xe?` ${xe}`:""}`:xe,Z=Vn?null:$G(Ae,St==null?void 0:St.planActivation),le=!!Z,me=!ei,Re=FG(St==null?void 0:St.planActivation,le?me:void 0,Fe.current),Oe=le&&(We==null?void 0:We.id)==="claude-code"?me?"plan":"auto":void 0,Ze=Z?Z.prompt:Ae,ot=re,At=O,Kt=At.map(kn=>({text:kn.text})),Pr=e;let Rr=F;const Ur=()=>{const kn=W.current;return kn.projectId===Pr&&kn.activeId===Rr},qr=()=>{Ur()&&(I(kn=>kn||Ae),ce(kn=>kn.length?kn:ot),H(kn=>kn.length?kn:At))};if(le&&!Ze&&ot.length===0&&At.length===0){I(""),cn(null),mr(!1);try{if((We==null?void 0:We.id)==="claude-code")vi(me?"plan":"auto");else if((St==null?void 0:St.planActivation)==="command")await ds(me);else throw new Error("The selected harness is unavailable")}catch{se("Could not toggle Plan mode. Try again."),qr()}return}const lr=$t?{...$t,...Oe?{permissionMode:Oe}:{}}:null;Oe&&vi(Oe);let wi=null;const eo=Fe.current;le&&(St==null?void 0:St.planActivation)==="command"&&(wi=++be.current,Fe.current=me,Le(me));const ms=()=>{wi===null||be.current!==wi||(Fe.current=eo,Le(eo))};if(!Ze&&ot.length===0&&At.length===0)return;if((Ze||At.length>0)&&Vn&&ot.length===0){I(""),cn(null),H([]),Wn({promptId:Vn,answers:[],note:Ze||void 0,annotations:Kt}).then(kn=>{kn||qr()});return}if(Ln){if(!F||!(We!=null&&We.agentReady)){ms();return}const kn=F;I(""),cn(null),ce([]),H([]),ne(null);const bs=lr?{model:lr.model,permissionMode:lr.permissionMode,planMode:(St==null?void 0:St.planActivation)==="command"?Re??(pt==null?void 0:pt.planMode):Re,reasoningLevel:lr.reasoningLevel}:{};rt({});const to=ot.map(cr=>({mediaType:cr.mediaType,dataBase64:cr.dataUrl.slice(cr.dataUrl.indexOf(",")+1),name:cr.name}));try{await ar(()=>o3(kn,Ze,bs,to.length?to:void 0,Kt,Ka&&!ie&&!le?"steer":void 0))}catch{ms(),qr()}return}if(!(We!=null&&We.agentReady)){ms();return}if(!lr){ms();return}I(""),cn(null),ce([]),H([]),ne(null);let gs=F;try{if(!gs){const Yn=await RD(e,lr.harness,{model:lr.model,permissionMode:lr.permissionMode,planMode:Re,reasoningLevel:lr.reasoningLevel});Je.current.add(Yn.id),$(Wl=>[Yn,...Wl]),U(Yn.id),gs=Yn.id,Rr=Yn.id,W.current={projectId:e,activeId:Yn.id}}Qe({type:"optimisticUser",sessionId:gs,text:Ze||"Asked about selected text",attachments:ot.map(Yn=>({url:Yn.dataUrl,mediaType:Yn.mediaType,name:Yn.name})),annotations:At}),Qe({type:"busy",sessionId:gs,busy:!0}),Xt.current=!0,Y==="archived"&&Q("active");const kn=lr?{model:lr.model,permissionMode:lr.permissionMode,planMode:Re,reasoningLevel:lr.reasoningLevel}:{};rt({});const bs=ot.map(Yn=>({mediaType:Yn.mediaType,dataBase64:Yn.dataUrl.slice(Yn.dataUrl.indexOf(",")+1),name:Yn.name})),to=gs;if(!to)throw new Error("chat session was not created");await ar(()=>o3(to,Ze,kn,bs.length?bs:void 0,Kt))}catch(kn){if(qr(),ms(),!gs)return;const bs=kn instanceof Error?kn.message:String(kn);if(!/session is busy/i.test(bs)&&await df(e).then(cr=>{var Yn;return!!((Yn=cr.find(Wl=>Wl.id===gs))!=null&&Yn.busy)}).catch(()=>!1)){Ur()&&(I(cr=>cr===Ze?"":cr),ce(cr=>cr===ot?[]:cr),H(cr=>cr===At?[]:cr));return}Qe({type:"busy",sessionId:gs,busy:!1}),Qe({type:"localError",sessionId:gs,text:`Message not sent: ${bs}`})}}function Za(){F&&PD(F)}const Yo=R.useCallback((ie,xe)=>{if(!F||Ln||!(We!=null&&We.agentReady))return;const Ae=F;Qe({type:"busy",sessionId:Ae,busy:!0}),Xt.current=!0,ar(()=>$D(Ae,ie,xe)).catch(Z=>{Qe({type:"busy",sessionId:Ae,busy:!1});const le=Z instanceof Error?Z.message:String(Z);Qe({type:"localError",sessionId:Ae,text:`Could not re-sample: ${le}`})})},[F,Ln,We==null?void 0:We.agentReady,ar]),Ki=R.useCallback(ie=>{if(!F||Ln)return;const xe=F,Ae=Dn.current;Qe({type:"activeLeaf",sessionId:xe,leafId:ie}),ar(()=>FD(xe,ie)).catch(Z=>{Qe({type:"activeLeaf",sessionId:xe,leafId:Ae});const le=Z instanceof Error?Z.message:String(Z);Qe({type:"localError",sessionId:xe,text:`Could not switch fork: ${le}`})})},[F,Ln,ar]);function zs(ie){if(!F)return;const xe=F;Qe({type:"setQueued",sessionId:xe,items:$r.filter(Ae=>Ae.id!==ie)}),BD(xe,ie).catch(()=>{})}R.useEffect(()=>{if(!Ln||o!=="chat")return;function ie(xe){var Ae;xe.key!=="Escape"||xe.defaultPrevented||(xe.preventDefault(),Za(),(Ae=ht.current)==null||Ae.focus())}return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[Ln,F,o]);function Bs(ie){De.current.add(ie),$(xe=>xe.filter(Ae=>Ae.id!==ie)),U(xe=>xe===ie?null:xe),X(xe=>{if(!xe.has(ie))return xe;const Ae=new Set(xe);return Ae.delete(ie),Ae}),Je.current.delete(ie),Ue.current.delete(ie),Qe({type:"forget",sessionId:ie})}function Qa(ie,xe){const Ae=ie.archived;$(Z=>Z.map(le=>le.id===ie.id?{...le,archived:xe}:le)),Dw(Y,xe)||U(Z=>Z===ie.id?null:Z),LD(ie.id,xe).catch(()=>{$(Z=>Z.map(le=>le.id===ie.id?{...le,archived:Ae}:le))})}function yi(ie,xe){const Ae=ie.title;$(Z=>Z.map(le=>le.id===ie.id?{...le,title:xe}:le)),OD(ie.id,xe).catch(()=>{$(Z=>Z.map(le=>le.id===ie.id?{...le,title:Ae}:le))})}async function bn(ie){var Ae;const xe=((Ae=ie.title)==null?void 0:Ae.trim())||"Untitled";if(window.confirm(`Delete "${xe}"? +`).trim()}function SV(e){const t=e.changes;if(!Array.isArray(t))return null;for(const n of t){if(!n||typeof n!="object"||!("path"in n)||typeof n.path!="string")continue;const r="kind"in n?n.kind:null,i=r&&typeof r=="object"&&"type"in r&&typeof r.type=="string"?r.type:null;return{path:n.path,type:i}}return null}function kV(e){const t=e.trim(),n=t.match(/^\/bin\/(?:ba|z)?sh\s+-lc\s+([\s\S]+)$/);let r=((n==null?void 0:n[1])??t).trim();const i=r[0];return(i==='"'||i==="'")&&r[r.length-1]===i&&(r=r.slice(1,-1)),EV(r).replace(/[\t\r ]+/g," ").trim()}function CV(e){let t=null,n=!1;for(let r=0;r{n&&t.push(n),n=""};for(const o of e){if(i){n+=o,i=!1;continue}if(o==="\\"&&r!=="'"){i=!0;continue}if(r){o===r?r=null:n+=o;continue}if(o==='"'||o==="'"){r=o;continue}/\s/.test(o)?a():n+=o}return a(),t}function vC(e){const t=e==null?void 0:e.replace(/[)'\"]+$/,"");return!t||t==="-"||/^\d+$/.test(t)||/[$`]/.test(t)?null:t}function _C(e){const t=vC(e);if(!t)return null;const n=vl(t);return t.includes("/")||t.startsWith(".")||/\.[A-Za-z0-9][A-Za-z0-9_-]*$/.test(n)||/^(?:Dockerfile|Makefile|README|LICENSE|NOTICE|CHANGELOG)$/i.test(n)?t:null}function xC(e){var i,a;const t=bC(e);let n=0;for(;["do","then","else","if","while","until"].includes(t[n]);)n++;for(;/^[A-Za-z_][A-Za-z0-9_]*=/.test(t[n]??"");)n++;if(t[n]==="command")for(n++;(i=t[n])!=null&&i.startsWith("-");)n++;if(t[n]==="env")for(n++;(a=t[n])!=null&&a.startsWith("-")||/^[A-Za-z_][A-Za-z0-9_]*=/.test(t[n]??"");)n++;const r=t[n];return r?{name:r.split("/").pop()??r,args:t.slice(n+1)}:null}function AV(e){const{name:t,args:n}=e;if(t==="sed"){let i=0,a=!1;for(;i!a.startsWith("-")&&a.includes(":"));if(!t)return null;const n=t.indexOf(":"),r=t.slice(0,n),i=t.slice(n+1);return r&&_C(i)?{ref:r,path:i}:null}function NV(e){const t=e.match(/\b(?:rg|grep)\b(?:\s+-[^\s]+)*\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/);return(t==null?void 0:t[1])??(t==null?void 0:t[2])??(t==null?void 0:t[3])??null}function Mw(e,t){if(/[$`~]/.test(e)||/[$`~]/.test(t))return null;const n=t.startsWith("/")||!t.startsWith("/")&&e.startsWith("/"),r=t.startsWith("/")?[]:e.split("/").filter(Boolean);for(const a of t.split("/"))if(!(!a||a===".")){if(a===".."){r.length>0&&r[r.length-1]!==".."?r.pop():n||r.push(a);continue}r.push(a)}return`${n?"/":""}${r.join("/")}`||(n?"/":null)}function jV(e,t,n,r){if(e.startsWith("/"))return e;let i=r??"";for(let a=0;a!d.startsWith("-"));if(!l)return null;const c=Mw(i,l);if(!c)return null;i=c}return i?Mw(i,e):e}const Gs="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",MV=new RegExp(`\\bchat_(${Gs})\\b`,"gi"),Nl=`(?:${Gs}|[0-9a-f]{8})`;function Sd(e){const t=[];let n="",r="",i=null,a=!1;const o=()=>{(n.trim()||r.trim())&&t.push({raw:n.trim(),code:r.trim()}),n="",r=""},l=d=>{let m=1,f=null,g=!1;for(let b=d;b{let m=!1;for(let f=d;fn.test(r.code))}function Us(e,t){return Hd(e,t).length>0?!0:new RegExp(`(?:^|[\\s($;])orx\\s+${t}\\b`,"i").test(e)}function RV(e){if(!e)return[];const t=new Set;for(const n of e.slice(0,mC).matchAll(MV))if(t.add(n[0].toLowerCase()),t.size>=Fo)break;return[...t]}function Ev(e,t){if(!e)return[];const n=new Set,r=e.slice(0,mC),i=t==="runs"?[new RegExp(`/runs/(${Gs})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${Gs})`,"gi"),new RegExp(`^\\s*RUN\\s+(${Gs})\\b`,"gim"),new RegExp(`={3,}\\s*(${Gs})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${Gs})`,"gi"),new RegExp(`^\\s*id:\\s*(${Gs})`,"gim"),new RegExp(`={3,}\\s*(${Gs})\\s*={3,}`,"gi")];for(const o of i)for(const l of r.matchAll(o))if(n.add(l[1]),n.size>=Fo)return[...n];const a=new RegExp(`^\\s*(${Gs})(?:\\s|$)`,"gim");for(const o of r.matchAll(a))if(n.add(o[1]),n.size>=Fo)break;return[...n]}function yC(e,t){let n=0;return t.map(r=>{const i=e.indexOf(r.raw,n),a=i===-1?e.indexOf(r.raw):i;return n=Math.max(n,a+r.raw.length),{invocation:r,offset:Math.max(0,a)}})}function wC(e,t,n,r){const i=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let a="";for(const o of e.matchAll(i)){if((o.index??0)>=n)break;a=o[1]??o[2]??o[3]??""}return[...a.matchAll(new RegExp(r,"gi"))].map(o=>o[0])}function SC(e,t,n,r){const i=new RegExp(`\\bfor\\s+${t}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let a="";for(const o of e.matchAll(i)){const l=o.index??0;if(l>=n)break;const c=l+o[0].length;c<=n&&/\bdone\b/.test(e.slice(c,n))||(a=o[1])}return/\$\(|`/.test(a)?[]:[...a.matchAll(new RegExp(r,"gi"))].map(o=>o[0])}function DV(e,t,n=[],r=[]){const i=Hd(e,"logs"),a=new Set;if(i.length===0){if(!Us(e,"logs"))return[];const l=n.length>0?[]:Ev(t,"runs");for(const c of n.length>0?n:l.length>0?l:r)if(a.add(c),a.size>=Fo)break;return Fc([...a])}let o=!1;for(const{invocation:l,offset:c}of yC(e,i)){const d=/\borx\s+logs\b/i.exec(l.raw);if(!d)continue;const m=bC(l.raw.slice(d.index+d[0].length));let f=null;for(let x=0;x0?[]:Ev(t,"runs"),c=n.length>0?n:l.length>0?l:r;for(const d of c)if(a.add(d),a.size>=Fo)break}return Fc([...a])}function Cc(e,t,n=[],r=[]){const i=Hd(e,"exp\\s+(?:status|desc)");if(i.length===0)return[];const a=new Set;let o=!1;for(const{invocation:l,offset:c}of yC(e,i)){let d=!1;for(const f of l.raw.matchAll(new RegExp(`\\borx\\s+exp\\s+(?:status|desc)\\s+["']?(${Nl})`,"gi")))a.add(f[1]),d=!0;const m=/\borx\s+exp\s+(?:status|desc)\s+["']?\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?/.exec(l.raw);if(m){const f=m[1],g=wC(e,f,c,Nl);if(g.length>0){for(const k of g)a.add(k);d=!0}const b=SC(e,f,c,Nl);for(const k of b)a.add(k);b.length>0&&(d=!0)}d||(o=!0)}if(a.size===0||o){const l=n.length>0?[]:Ev(t,"experiments"),c=n.length>0?n:l.length>0?l:r;for(const d of c)if(a.add(d),a.size>=Fo)break}return Fc([...a])}function Qs(e){var x,v,w,y;const t=e.tool??"tool",n=((x=e.state)==null?void 0:x.input)??{},r=n.arguments,i=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},a={...n,...i},o=ji(a,"command","cmd"),l=((v=e.state)==null?void 0:v.output)||((w=e.state)==null?void 0:w.error),c=Fc(nb(a,"targetIds")),d=Fc(nb(a,"runTargetIds")),m=Fc(nb(a,"experimentTargetIds")),f=ji(a,"filePath","file_path","notebookPath","notebook_path","path"),g=ji(a,"description"),b=t.toLowerCase().split(/(?::|\.|__)+/),k=b.at(-1)??t.toLowerCase();if(k==="run"&&b.includes("web")){const C=tb(a,"search_query","q"),N=tb(a,"image_query","q"),E=tb(a,"find","pattern");return C?{kind:"web",label:`Searched the web for “${C}”`}:N?{kind:"web",label:`Searched images for “${N}”`}:E?{kind:"web",label:`Searched a web page for “${E}”`}:Array.isArray(a.open)?{kind:"web",label:"Opened web pages"}:Array.isArray(a.weather)?{kind:"web",label:"Checked the weather"}:Array.isArray(a.finance)?{kind:"web",label:"Checked market data"}:Array.isArray(a.sports)?{kind:"web",label:"Checked sports data"}:Array.isArray(a.time)?{kind:"web",label:"Checked local times"}:{kind:"web",label:"Browsed the web"}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(k)??k){case"bash":{if(!o)return{kind:"command",label:"Ran a command"};const C=kV(o),N=Hd(C,"(?:lit|paper)")[0],E=N?fL(N.raw):null;if(E){const re=E.kind==="lit"?E.query?`Searched for “${E.query}”`:"Searched the literature":E.id?`Read ${E.id}`:"Read a paper";return{kind:E.kind==="lit"?"search":"read",label:re,litCall:E}}if(Us(C,"agent\\s+spawn"))return{kind:"agent",label:"Delegated a task to a new agent",spawnedSessionIds:RV(l)};const M=Sd(C),T=M.map(re=>xC(re.raw)),D=Us(C,"exp\\s+status"),z=Us(C,"exp\\s+desc"),$=Hd(C,"exp\\s+desc").some(re=>/(?:^|\s)--(?:set(?:=|\s)|stdin\b)/.test(re.raw)),F=$?"Updated experiment notes":"Read experiment notes",U=$?"Checked experiment status and updated notes":"Reviewed experiment status and notes";if(Us(C,"logs")){const re=DV(C,l,d,c);return{kind:"project",label:re.length===1?"Reviewed run log":"Reviewed run logs",runIds:re}}if(Us(C,"exp\\s+run"))return{kind:"project",label:"Started an experiment run"};if(Us(C,"exp\\s+wait"))return{kind:"project",label:"Waited for an experiment run"};if(Us(C,"exp\\s+cancel"))return{kind:"project",label:"Cancelled an experiment run"};const V=Us(C,"project\\s+view");if(V&&D&&z)return{kind:"project",label:U,experimentIds:Cc(C,l,m,c)};if(V&&z)return{kind:"project",label:F,experimentIds:Cc(C,l,m,c)};if(V&&D)return{kind:"project",label:"Checked experiment status",experimentIds:Cc(C,l,m,c)};if(V)return{kind:"project",label:"Read project details"};if(D&&z)return{kind:"project",label:U,experimentIds:Cc(C,l,m,c)};if(D)return{kind:"project",label:"Checked experiment status",experimentIds:Cc(C,l,m,c)};if(z)return{kind:"project",label:F,experimentIds:Cc(C,l,m,c)};if(Us(C,"runs?"))return{kind:"project",label:"Listed project runs"};const X=T.map(TV).find(re=>re!=null);if(X)return{kind:"read",label:`Read ${vl(X.path)}`,filePath:X.path,fileRef:X.ref,labelPrefix:"Read ",labelTarget:vl(X.path)};const Y=T.findIndex(re=>re!=null&&["sed","cat","head","tail"].includes(re.name)),Q=Y>=0?T[Y]:null,te=Q?AV(Q):null,I=te?jV(te,M,Y,ji(a,"cwd","workdir")):null;if(te&&I)return{kind:"read",label:`Read ${vl(te)}`,filePath:I,labelPrefix:"Read ",labelTarget:vl(te)};if(T.some(re=>(re==null?void 0:re.name)==="find"||(re==null?void 0:re.name)==="ls"||(re==null?void 0:re.name)==="rg"&&re.args.includes("--files")))return{kind:"search",label:"Listed files"};const O=T.findIndex(re=>(re==null?void 0:re.name)==="rg"||(re==null?void 0:re.name)==="grep");if(O>=0){const re=NV(M[O].raw);return{kind:"search",label:re?`Searched code for “${re}”`:"Searched code",searchPattern:re??void 0}}const H=T.find(re=>(re==null?void 0:re.name)==="git"),G=H==null?void 0:H.args[0];if(G==="grep"){const re=H==null?void 0:H.args.slice(1).find(ce=>!ce.startsWith("-"));return{kind:"search",label:re?`Searched code for “${re}”`:"Searched code",searchPattern:re}}if(Q)return{kind:"read",label:"Read a file"};if(G==="status")return{kind:"command",label:"Checked Git status"};if(G==="diff")return{kind:"command",label:"Reviewed code changes"};if(G==="log")return{kind:"command",label:"Read Git history"};const W=re=>T.some(ce=>!ce||!["cargo","pnpm","npm","yarn"].includes(ce.name)?!1:ce.args[0]===re||ce.args[0]==="run"&&ce.args[1]===re);return W("test")?{kind:"command",label:"Ran tests"}:T.some(re=>(re==null?void 0:re.name)==="tsc")||W("typecheck")?{kind:"command",label:"Checked types"}:W("lint")?{kind:"command",label:"Checked code style"}:W("build")?{kind:"command",label:"Built the project"}:{kind:"command",label:`Ran ${C}`}}case"read":{const C=f?vl(f):null;return C?{kind:"read",label:`Read ${C}`,filePath:f??void 0,labelPrefix:"Read ",labelTarget:C}:{kind:"read",label:"Read a file"}}case"edit":case"write":case"notebookedit":{const C=SV(a),N=f??(C==null?void 0:C.path)??null,E=N?vl(N):null,M=(C==null?void 0:C.type)==="add"?"Created":(C==null?void 0:C.type)==="delete"?"Deleted":"Edited";return E?{kind:"edit",label:`${M} ${E}`,filePath:N??void 0,labelPrefix:`${M} `,labelTarget:E}:{kind:"edit",label:"Edited a file"}}case"grep":{const C=ji(a,"pattern");return{kind:"search",label:C?`Searched code for “${C}”`:"Searched code",searchPattern:C??void 0}}case"glob":{const C=ji(a,"pattern");return{kind:"search",label:C?`Listed files matching ${C}`:"Listed files"}}case"websearch":{const C=ji(a,"query"),N=ji(a,"url"),E=ji(a,"pattern");return C?{kind:"web",label:`Searched the web for “${C}”`}:E&&N?{kind:"web",label:`Searched “${E}” on a page`}:N?{kind:"web",label:`Opened ${N}`}:{kind:"web",label:g??"Browsed the web"}}case"webfetch":{const C=ji(a,"url");return{kind:"web",label:C?`Read ${C}`:g??"Read a web page"}}case"task":return{kind:"agent",label:g??"Ran a subagent"};case"subagent":return{kind:"agent",label:LV(a)};case"error":return{kind:"command",label:"Tool failed"};case"interrupted":return{kind:"command",label:"Tool was interrupted"};default:{const C=g??f??o??((y=e.state)==null?void 0:y.title)??"";return{kind:"command",label:C?`${t}: ${C}`:t}}}}function LV(e){const t=a=>a.length>60?`${a.slice(0,60)}…`:a,n=typeof e.prompt=="string"&&e.prompt?` — “${t(e.prompt)}”`:"",r=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",i=r&&r.charAt(0).toUpperCase()+r.slice(1);switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return i||`Spawned agent${n}`;case"sendInput":return r?`Sent input to ${r}`:`Sent input to agent${n}`;case"resumeAgent":return r?`Resumed ${r}`:"Resumed agent";case"wait":return`Waiting on ${r||"agent"}`;case"closeAgent":return`Closed ${r||"agent"}`}switch(typeof e.kind=="string"?e.kind:""){case"started":return i||"Sub-agent started";case"interacted":return r?`${i} reported back`:"Agent reported back";case"interrupted":return r?`${i} interrupted`:"Sub-agent interrupted"}return i||"Sub-agent"}function Gf({activity:e,className:t=""}){if(e.litCall)return h.jsx(g_,{source:e.litCall.source,size:16,className:`tool-kind-icon shrink-0 ${t}`});const n={size:16,strokeWidth:1.75,className:`tool-kind-icon shrink-0 ${t}`};switch(e.kind){case"read":case"project":return h.jsx(Y8,{...n});case"search":return h.jsx(iR,{...n});case"edit":return h.jsx(cp,{...n});case"web":return h.jsx(AM,{...n});case"agent":return h.jsx(c_,{...n});case"command":return h.jsx(oS,{...n})}}function rb({items:e,onOpen:t,targetType:n}){const[r,i]=R.useState(!1),a=R.useRef(null),o=R.useRef(!1);return R.useEffect(()=>{var l,c;!r||!o.current||(o.current=!1,(c=(l=a.current)==null?void 0:l.querySelector("button"))==null||c.focus())},[r]),h.jsxs("span",{className:"tool-target-overflow inline",children:[r&&h.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((l,c)=>h.jsxs("span",{children:[c>0&&", ",t?h.jsx("button",{className:"tool-target",onClick:d=>{d.preventDefault(),d.stopPropagation(),t(l.id)},children:l.label}):h.jsx("span",{children:l.label})]},l.id))}),r&&", ",h.jsx("button",{className:"tool-target-more","aria-expanded":r,"aria-label":r?`Hide additional ${n}`:`Show ${e.length} more ${n}`,onClick:l=>{l.preventDefault(),l.stopPropagation(),o.current=!r&&l.detail===0,i(c=>!c)},children:r?"show less":`+ ${e.length} more`})]})}function Av({activity:e,onOpenFile:t,onOpenRun:n,onOpenSpawnedSession:r,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var l,c,d,m;if(e.searchPattern){const f=e.label.indexOf(e.searchPattern),g=f>=0?e.label.slice(0,f):"Searched code for “",b=f>=0?e.label.slice(f+e.searchPattern.length):"”";return h.jsxs(h.Fragment,{children:[g,e.searchPattern.split(/([|/_-])/).map((k,S)=>h.jsxs("span",{children:[k,/^[|/_-]$/.test(k)&&h.jsx("wbr",{})]},`${S}-${k}`)),b]})}if(((l=e.litCall)==null?void 0:l.kind)==="paper"&&e.litCall.id)return h.jsxs("a",{className:"tool-target",href:dL(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,h.jsx(Dj,{className:"inline ml-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&t){const f=e.filePath;return h.jsxs(h.Fragment,{children:[e.labelPrefix,h.jsx("button",{className:"tool-target",onClick:g=>{g.preventDefault(),g.stopPropagation(),t(f,void 0,void 0,e.fileRef)},children:e.labelTarget})]})}if((c=e.spawnedSessionIds)!=null&&c.length&&r){const f=e.spawnedSessionIds,g=f.length===1,b=f.slice(0,3),k=f.slice(b.length).map((S,x)=>({id:S,label:`agent ${b.length+x+1}`}));return h.jsxs(h.Fragment,{children:[g?"Delegated a task to ":"Delegated tasks to ",b.map((S,x)=>h.jsxs("span",{children:[x>0&&", ",h.jsx("button",{className:"tool-target",title:"Open the session this agent spawned",onClick:v=>{v.preventDefault(),v.stopPropagation(),r(S)},children:g?"a new agent":`agent ${x+1}`})]},S)),k.length>0&&h.jsxs(h.Fragment,{children:[", ",h.jsx(rb,{items:k,onOpen:r,targetType:"agent sessions"})]})]})}if((d=e.runIds)!=null&&d.length){const f=i?e.runIds.filter(S=>!!i(S)):e.runIds;if(f.length===0)return e.label;const g=f.length>1,b=f.slice(0,3),k=f.slice(b.length).map(S=>({id:S,label:(i==null?void 0:i(S))||"Experiment"}));return h.jsxs(h.Fragment,{children:[g?"Reviewed run logs for ":"Reviewed run log ",b.map((S,x)=>h.jsxs("span",{children:[x>0&&", ",n?h.jsx("button",{className:"tool-target",title:`Open logs for run ${S}`,onClick:v=>{v.preventDefault(),v.stopPropagation(),n(S)},children:(i==null?void 0:i(S))||"Experiment"}):h.jsx("span",{children:(i==null?void 0:i(S))||"Experiment"})]},S)),k.length>0&&h.jsxs(h.Fragment,{children:[", ",h.jsx(rb,{items:k,onOpen:n,targetType:"run logs"})]})]})}if((m=e.experimentIds)!=null&&m.length){const f=o?e.experimentIds.filter(k=>!!o(k)):e.experimentIds;if(f.length===0)return e.label;const g=f.slice(0,3),b=f.slice(g.length).map(k=>({id:k,label:(o==null?void 0:o(k))||"Experiment"}));return h.jsxs(h.Fragment,{children:[e.label," for ",g.map((k,S)=>h.jsxs("span",{children:[S>0&&", ",a?h.jsx("button",{className:"tool-target",title:`Open experiment ${(o==null?void 0:o(k))||""}`.trim(),onClick:x=>{x.preventDefault(),x.stopPropagation(),a(k)},children:(o==null?void 0:o(k))||"Experiment"}):h.jsx("span",{children:(o==null?void 0:o(k))||"Experiment"})]},k)),b.length>0&&h.jsxs(h.Fragment,{children:[", ",h.jsx(rb,{items:b,onOpen:a,targetType:"experiments"})]})]})}return e.label}function OV(e){const t=f=>e.filter(g=>g.kind===f).length,n=[],r=t("read"),i=t("search"),a=t("edit"),o=t("project"),l=t("web"),c=t("command"),d=t("agent");r&&n.push(r===1?"Read a file":"Read files"),i&&n.push("searched code"),a&&n.push(a===1?"edited a file":"edited files"),o&&n.push("reviewed project data"),l&&n.push("browsed the web"),c&&n.push(c===1?"ran a command":"ran commands"),d&&n.push(d===1?"worked with a subagent":"worked with subagents");const m=n.join(", ");return m?`${m[0].toUpperCase()}${m.slice(1)}`:"Used tools"}function B2(e){const t=[[/^Reviewed run logs?/,e.label.startsWith("Reviewed run logs")?"Reading run logs":"Reading run log"],[/^Reviewed /,"Reviewing "],[/^Read /,"Reading "],[/^Searched /,"Searching "],[/^Listed /,"Listing "],[/^Edited /,"Editing "],[/^Updated /,"Updating "],[/^Created /,"Creating "],[/^Deleted /,"Deleting "],[/^Ran /,"Running "],[/^Started /,"Starting "],[/^Waited /,"Waiting "],[/^Checked /,"Checking "],[/^Built /,"Building "],[/^Cancelled /,"Cancelling "],[/^Delegated /,"Delegating "]];let n=e.label;for(const[r,i]of t)if(r.test(n)){n=n.replace(r,i);break}return{...e,label:n}}function kC(e,t){const n=Qs({tool:e,state:{status:"running",input:t}}),r=[[/^Reviewed /,"Review "],[/^Searched /,"Search "],[/^Listed /,"List "],[/^Edited /,"Edit "],[/^Updated /,"Update "],[/^Created /,"Create "],[/^Deleted /,"Delete "],[/^Delegated /,"Delegate "],[/^Ran /,"Run "],[/^Started /,"Start "],[/^Waited /,"Wait "],[/^Checked /,"Check "],[/^Built /,"Build "],[/^Cancelled /,"Cancel "]];for(const[i,a]of r)if(i.test(n.label))return n.label.replace(i,a);return n.label}function IV(e,t,n){var i,a;const r=o=>{const l=o.slice(0,3),c=o.length-l.length;return`${l.join(", ")}${c>0?`, + ${c} more`:""}`};if((i=e.runIds)!=null&&i.length){const o=e.runIds.map(l=>(t==null?void 0:t(l))||"").filter(Boolean);return o.length===0?e.label:`${e.label}${o.length>1?" for ":" "}${r(o)}`}if((a=e.experimentIds)!=null&&a.length){const o=e.experimentIds.map(l=>(n==null?void 0:n(l))||"").filter(Boolean);return o.length===0?e.label:`${e.label} for ${r(o)}`}return e.label}function zV(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const BV=250;function HV(e,t){const[n,r]=R.useState(e),i=R.useRef(Date.now()),a=R.useRef(e);return R.useEffect(()=>{if(a.current=e,(e==null?void 0:e.label)===(n==null?void 0:n.label)||t&&e!=null&&n!=null)return;if(e==null||n==null){i.current=Date.now(),r(e);return}const o=BV-(Date.now()-i.current);if(o<=0){i.current=Date.now(),r(e);return}const l=window.setTimeout(()=>{i.current=Date.now(),r(a.current)},o);return()=>window.clearTimeout(l)},[e,n,t]),e!=null&&e.label===(n==null?void 0:n.label)?e:n}const $V=160;function CC(e){const[t,n]=R.useState(!1);return R.useEffect(()=>{if(!e){n(!1);return}const r=window.setTimeout(()=>n(!0),$V);return()=>window.clearTimeout(r)},[e]),e&&t}function FV(e){const t=["read","search","edit","project","web","command","agent"];for(const n of t){const r=e.find(i=>i.kind===n);if(r)return r}return e[0]??{kind:"command",label:"Used tools"}}function Rw(e){var n,r;if(((n=e.state)==null?void 0:n.status)!=="completed")return null;const t=Qs(e);return JSON.stringify([t.kind,t.label,t.filePath??null,t.fileRef??null,((r=t.litCall)==null?void 0:r.kind)==="paper"?t.litCall.id??null:null,t.runIds??null,t.experimentIds??null,t.spawnedSessionIds??null])}function PV(e){const t=[];for(const n of e){const r=Rw(n),i=t[t.length-1];r&&i&&Rw(i.part)===r?i.count++:t.push({part:n,count:1})}return t}function Dw({part:e,repeatCount:t=1,onOpenFile:n,onOpenRun:r,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}){const c=e.state,d=Qs(e),m=(c==null?void 0:c.status)==="error",f=z2((c==null?void 0:c.error)||(c==null?void 0:c.output)||""),g=m&&!!f,[b,k]=R.useState(!1),S=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`,x=h.jsxs(h.Fragment,{children:[m&&h.jsx("span",{className:"sr-only",children:"Failed: "}),m?h.jsx(Q8,{size:16,strokeWidth:1.75,className:"tool-kind-icon shrink-0 text-accent-red self-start mt-[5px]","aria-hidden":"true"}):h.jsx(Gf,{activity:d,className:"text-muted self-start mt-[5px]"}),h.jsxs("span",{className:`tool-line flex-1 min-w-0 whitespace-normal break-words text-lg ${m?"text-accent-red":"text-subtext"}`,children:[h.jsx(Av,{activity:d,onOpenFile:n,onOpenRun:r,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}),t>1&&h.jsxs("span",{className:"tool-repeat-count ml-1 text-muted font-normal",title:`${t} consecutive identical calls`,children:["×",t]})]})]});return g?h.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[x,h.jsx("button",{type:"button",className:"tool-row-detail-toggle shrink-0 inline-flex items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":b,"aria-controls":S,"aria-label":`${b?"Hide":"Show"} error details for ${d.label}`,onClick:()=>k(v=>!v),children:h.jsx(ea,{size:12,className:`text-accent-red transition-transform duration-120 ease-standard ${b?"rotate-90":""}`})})]}),b&&h.jsx("div",{className:"tool-detail mt-1 mr-0 mb-1 ml-6",id:S,children:h.jsx("div",{className:"tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",children:f.slice(0,2e4)})})]}):h.jsx("div",{className:"tool-row flex items-center gap-2 min-w-0 py-[3px] px-1",children:x})}function UV({parts:e,pendingTail:t,onOpenFile:n,onOpenRun:r,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}){var N,E,M;const[c,d]=R.useState(!1),m=PV(e),f=m.map(({part:T})=>Qs(T)),g=t?e.at(-1):void 0,b=((N=g==null?void 0:g.state)==null?void 0:N.status)!=="error"?(g&&B2(Qs(g)))??null:null,k=!!g&&((E=g.state)==null?void 0:E.status)==="running"&&(zV((M=g.state)==null?void 0:M.input)||(b==null?void 0:b.label)==="Running a command"),S=HV(b,k),x=CC(S!=null),v=OV(f),w=S??FV(f),y=S?IV(S,a,l):v;if(e.length===1)return S?h.jsx("div",{className:"tool-group my-3.5 mx-0",children:h.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-lg text-subtext",children:[h.jsx(Gf,{activity:S,className:`${x?"tool-running-shimmer-icon":"text-muted"} self-start mt-[5px]`}),h.jsx("span",{className:`${x?"tool-running-shimmer":""} tool-active-label min-w-0 whitespace-normal break-words`,title:y,children:h.jsx(Av,{activity:S,onOpenFile:n,onOpenRun:r,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l})})]})}):h.jsx("div",{className:"tool-group my-3.5 mx-0",children:h.jsx(Dw,{part:e[0],onOpenFile:n,onOpenRun:r,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l})});const C=c;return h.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[h.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-lg text-subtext text-left",children:[h.jsx(Gf,{activity:w,className:`${x?"tool-running-shimmer-icon":"text-muted"} mt-[5px]`}),S?h.jsx("span",{className:`tool-group-label tool-active-label min-w-0 whitespace-normal break-words ${x?"tool-running-shimmer":""}`,title:y,children:h.jsx(Av,{activity:S,onOpenFile:n,onOpenRun:r,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l})}):h.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-left",onClick:()=>d(T=>!T),"aria-expanded":C,children:y}),h.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex items-center justify-center self-center shrink-0 p-px cursor-pointer rounded-sm",onClick:()=>d(T=>!T),"aria-expanded":C,"aria-label":C?"Collapse tool activity":"Expand tool activity",children:h.jsx(ea,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${C?"open":""}`})})]}),h.jsx("div",{className:`tool-group-disclosure ${C?"open":""}`,"aria-hidden":!C,inert:!C,children:h.jsx("div",{className:"tool-group-disclosure-inner",children:h.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 mr-0 mb-1 ml-6",children:m.map(({part:T,count:D})=>h.jsx(Dw,{part:T,repeatCount:D,onOpenFile:n,onOpenRun:r,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l},T.id))})})})]})}function qV({part:e,onRespond:t,onOpenFile:n,onOpenPlan:r}){var m;const i=e.prompt,[a,o]=R.useState([]),l=!t,c=f=>t==null?void 0:t({promptId:e.id,...f});if(i.resolved){if(i.kind==="permission")return null;if(i.kind==="plan"){const b=i.approved===!0?{label:"Plan approved",icon:Di,iconClass:"text-accent-green"}:i.approved===!1&&i.note?{label:"Plan revision requested",icon:cp,iconClass:"text-accent-amber"}:i.approved===!1?{label:"Plan rejected",icon:Vr,iconClass:"text-accent-red"}:{label:"Plan resolved",icon:oh,iconClass:"text-muted"},k=b.icon;return h.jsxs("details",{className:vV,children:[h.jsxs("summary",{children:[h.jsx("span",{className:"plan-resolved-label text-lg font-[375] wrap-anywhere",children:i.synthesized?"Plan":"Proposed plan"}),h.jsx(k,{size:17,strokeWidth:1.8,className:`shrink-0 ${b.iconClass}`}),h.jsx("span",{className:"plan-resolved-label prompt-outcome text-lg font-[375] wrap-anywhere",children:b.label}),h.jsx(ea,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),h.jsxs("div",{className:`${Nw} ml-6`,children:[h.jsx(za,{text:i.plan??"",onOpenFile:n}),i.note&&h.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:i.note})]})]})}const f=(i.answers??[]).join(", ")||i.note||"",g=(i.annotations??[]).map((b,k)=>({id:`${e.id}-annotation-${k}`,text:b.text}));return h.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[g.length>0&&h.jsx(I2,{annotations:g,variant:"sent"}),h.jsxs("details",{className:bV,children:[h.jsxs("summary",{children:[h.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:i.header||i.question||"Question"}),h.jsx("span",{className:`prompt-outcome font-[375] text-subtext wrap-anywhere [&.approved]:text-accent-green [&.chosen]:text-accent-green [&.approved::before]:content-['✓_'] [&.chosen::before]:content-['✓_'] [&.revised]:text-accent-amber [&.rejected]:text-accent-amber ${f?"chosen":""}`,children:f||"Resolved"})]}),h.jsxs("div",{className:Nw,children:[i.header&&i.question&&h.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:i.question}),(i.options??[]).length>0&&h.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 pl-4.5 [&_.sel]:text-text [&_.sel]:font-semibold",children:(i.options??[]).map(b=>{var k;return h.jsx("li",{className:(k=i.answers)!=null&&k.includes(b.label)?"sel":"",children:b.label},b.label)})}),i.note&&i.note!==f&&h.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:i.note})]})]})]})}if(i.kind==="plan"){const f=!!r;return h.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-l-[3px] border-l-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-l-accent-blue [&.permission]:border-l-accent-amber [&.question]:border-l-accent-purple [&.readonly]:opacity-60 plan ${l?"readonly":""}`,children:[h.jsx("div",{className:"prompt-head text-lg font-semibold text-text",children:i.synthesized?"Plan mode — ready to proceed?":"Proposed plan"}),h.jsx("div",{className:`prompt-plan text-base leading-[1.6] text-text max-h-85 overflow-y-auto [&.clamped]:max-h-[9.5em] [&.clamped]:overflow-hidden [&.clamped]:relative [&.clamped::after]:content-[''] [&.clamped::after]:absolute [&.clamped::after]:inset-x-0 [&.clamped::after]:bottom-0 [&.clamped::after]:top-auto [&.clamped::after]:h-8.5 [&.clamped::after]:bg-[linear-gradient(to_bottom,_transparent,_var(--surface))] [&.clamped::after]:pointer-events-none ${f?"clamped":""}`,children:h.jsx(za,{text:i.plan??"",onOpenFile:n})}),f&&h.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",onClick:()=>r(i.plan??"",e.id),children:"View full plan"}),!l&&!f&&h.jsxs("div",{className:Cv,children:[h.jsx("button",{className:"btn-primary",onClick:()=>c({approve:!0,resumeMode:"auto"}),children:"Accept and auto mode"}),h.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!0,resumeMode:"bypassPermissions"}),children:"Accept and bypass all"}),h.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!1}),children:"Reject"})]})]})}if(i.kind==="permission"){const f=i.toolInput??{},g=ji(f,"command","cmd","filePath","file_path","path")||"",b=typeof((m=i.toolInput)==null?void 0:m.reason)=="string"&&i.toolInput.reason||"",k=ji(f,"description")||"",S=b||k||kC(i.tool,f),x=`permission-heading-${e.id}`;return h.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-[0_1px_2px_rgb(0_0_0_/_4%)] [&.readonly]:opacity-60 ${l?"readonly":""}`,role:"group","aria-labelledby":x,children:[h.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[h.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:h.jsx(xR,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),h.jsx("span",{id:x,className:"text-base font-semibold text-text",children:"Approval required"})]}),h.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[h.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:S}),g&&h.jsx("code",{className:"prompt-command block max-h-36 overflow-auto whitespace-pre-wrap wrap-anywhere rounded-md border border-border-variant bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-text",children:g}),!l&&h.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[h.jsx("button",{className:"rounded-sm border border-transparent bg-transparent px-3 py-1.5 text-sm font-semibold text-subtext transition-[background,color] duration-80 ease-standard hover:bg-surface hover:text-text",onClick:()=>c({approve:!1}),children:"Deny"}),h.jsx("button",{className:"rounded-sm border border-text bg-text px-3 py-1.5 text-sm font-semibold text-background transition-opacity duration-80 ease-standard hover:opacity-85",onClick:()=>c({approve:!0}),children:"Allow"})]})]})]})}const d=f=>o(g=>i.multiSelect?g.includes(f)?g.filter(b=>b!==f):[...g,f]:[f]);return h.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-l-[3px] border-l-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-l-accent-blue [&.permission]:border-l-accent-amber [&.question]:border-l-accent-purple [&.readonly]:opacity-60 question ${l?"readonly":""}`,children:[i.header&&h.jsx("div",{className:_V,children:i.header}),i.question&&h.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:i.question}),h.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(i.options??[]).map(f=>{const g=a.includes(f.label);return h.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-left border border-border rounded-sm bg-background text-text cursor-pointer transition-[border-color,background] duration-80 ease-standard [&:hover:not(:disabled)]:border-border-strong [&:hover:not(:disabled)]:bg-surface [&.sel]:border-primary [&.sel]:bg-primary-subtle [&:disabled]:cursor-default ${g?"sel":""}`,disabled:l,onClick:()=>l?void 0:i.multiSelect?d(f.label):c({answers:[f.label]}),children:[h.jsx("span",{className:"prompt-option-label block text-md font-semibold",children:f.label}),f.description&&h.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:f.description})]},f.label)})}),i.multiSelect&&!l&&h.jsx("div",{className:Cv,children:h.jsx("button",{className:"btn-primary",disabled:a.length===0,onClick:()=>c({answers:a}),children:"Submit"})})]})}function Vf(e,t){if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(t!==void 0)return e.id===t}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function GV(e,t){return e.role==="user"?!0:e.parts.some(n=>Vf(n,t))}function VV(e){const t=e.text??"",n=t.startsWith("data:")?t:UD(t),r=t.startsWith("data:")?"":t.includes("__")?t.slice(t.indexOf("__")+2):t,i=e.name||r||"attachment",a=t.startsWith("data:application/pdf")||/\.pdf$/i.test(i)||/\.pdf$/i.test(t);return{src:n,isPdf:a,name:i}}const ib=[hh,"w-6 h-6 rounded-sm [&:disabled]:opacity-40 [&:disabled]:cursor-default","[&:disabled:hover]:bg-transparent [&:disabled:hover]:text-subtext"].join(" ");function WV({count:e,index:t,prevId:n,nextId:r,onSelect:i,pagerDisabled:a,onEdit:o,editDisabled:l}){const c=e>1;return h.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${c?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[c&&h.jsxs(h.Fragment,{children:[h.jsx("button",{className:ib,title:"Previous version","aria-label":"Previous version",disabled:a||!n,onClick:()=>n&&i(n),children:h.jsx(K8,{size:14})}),h.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[t+1,"/",e]}),h.jsx("button",{className:ib,title:"Next version","aria-label":"Next version",disabled:a||!r,onClick:()=>r&&i(r),children:h.jsx(ea,{size:14})})]}),h.jsx("button",{className:ib,title:"Edit and re-send","aria-label":"Edit and re-send",disabled:l,onClick:o,children:h.jsx(cp,{size:13})})]})}const YV=R.memo(function({message:t,activePermissionId:n,pendingTailToolId:r,onOpenFile:i,onOpenRun:a,onOpenSpawnedSession:o,runExperimentName:l,onOpenExperiment:c,experimentName:d,onRespond:m,onOpenPlan:f,onOpenSubagent:g,skills:b,predictTextTail:k=!1,forkCount:S,forkIndex:x=0,forkPrevId:v,forkNextId:w,forkDisabled:y,branchDisabled:C,onFork:N,onSelectFork:E}){const[M,T]=R.useState(null);if(t.role==="user"){const D=t.parts.filter(Y=>Y.type==="text").map(Y=>Y.text??"").join(` +`),z=D.match(/^\/(\S+)([\s\S]*)$/),$=z?b==null?void 0:b.find(Y=>Y.name===z[1]):void 0,F=t.parts.filter(Y=>Y.type==="image"&&Y.text).map(VV),U=F.filter(Y=>!Y.isPdf),V=F.filter(Y=>Y.isPdf),X=t.parts.filter(Y=>Y.type==="annotation"&&Y.text).map(Y=>({id:Y.id,text:Y.text??""}));if(M!==null){const Y=()=>{const Q=M.trim();!Q||y||(T(null),N(t.id,Q))};return h.jsx("div",{className:"msg-user-group self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:h.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[h.jsx("textarea",{className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":"Edit message",value:M,autoFocus:!0,onChange:Q=>T(Q.target.value),onKeyDown:Q=>{Q.key==="Escape"?(Q.preventDefault(),T(null)):Q.key==="Enter"&&!Q.shiftKey&&!Q.nativeEvent.isComposing&&(Q.preventDefault(),Y())}}),h.jsxs("div",{className:`${Cv} justify-end`,children:[h.jsx("button",{className:"btn-ghost",onClick:()=>T(null),children:"Cancel"}),h.jsx("button",{className:"btn-primary",onClick:Y,disabled:y||!M.trim(),children:"Send"})]})]})})}return h.jsxs("div",{className:"msg-user-group group/turn self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[X.length>0&&h.jsx(I2,{annotations:X,variant:"sent"}),h.jsxs("div",{className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:mr-0.5 [&_.skill-chip]:align-baseline",children:[$?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"skill-chip inline-flex items-center py-px px-[7px] font-mono text-md font-medium text-primary bg-primary-subtle border border-border-variant rounded-sm",children:["/",$.name]}),z[2]]}):D,U.length>0&&h.jsx("div",{className:"msg-images flex flex-wrap gap-1.5 mt-2 [&_img]:max-w-55 [&_img]:max-h-40 [&_img]:border [&_img]:border-border-variant [&_img]:rounded-xs [&_img]:block",children:U.map((Y,Q)=>h.jsx("a",{href:Y.src,target:"_blank",rel:"noreferrer",children:h.jsx("img",{src:Y.src,alt:"attachment"})},Q))}),V.length>0&&h.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:V.map((Y,Q)=>h.jsxs("a",{className:"msg-file inline-flex items-center gap-1.5 max-w-60 py-1.5 px-2.5 border border-border-variant rounded-sm text-text no-underline [&:hover]:border-text [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap",href:Y.src,target:"_blank",rel:"noreferrer",children:[h.jsx(oh,{size:15}),h.jsx("span",{children:Y.name})]},Q))})]}),S!==void 0&&h.jsx(WV,{count:S,index:x,prevId:v,nextId:w,onSelect:E,pagerDisabled:C,onEdit:()=>T(D),editDisabled:y})]})}return h.jsx("div",{className:"msg-assistant text-lg leading-[1.62] text-text min-w-0",children:EC(t.parts,{activePermissionId:n,pendingTailToolId:r,onOpenFile:i,onOpenRun:a,onOpenSpawnedSession:o,runExperimentName:l,onOpenExperiment:c,experimentName:d,onRespond:m,onOpenPlan:f,onOpenSubagent:g,predictTextTail:k})})});function EC(e,t){var w,y;const{activePermissionId:n,pendingTailToolId:r,onOpenFile:i,onOpenRun:a,onOpenSpawnedSession:o,runExperimentName:l,onOpenExperiment:c,experimentName:d,onRespond:m,onOpenPlan:f,onOpenSubagent:g,predictTextTail:b=!1}=t,k=e.filter(C=>C.type!=="steer"&&Vf(C,n)).at(-1),S=[];let x=[];const v=()=>{x.length!==0&&(S.push(h.jsx(UV,{parts:x,pendingTail:x.some(C=>C.id===r),onOpenFile:i,onOpenRun:a,onOpenSpawnedSession:o,runExperimentName:l,onOpenExperiment:c,experimentName:d},`tg-${x[0].id}`)),x=[])};for(const C of e)if(Vf(C,n)){if(C.type==="tool"&&(KV(C.tool)||(((w=C.children)==null?void 0:w.length)??0)>0)){v(),S.push(h.jsx(QV,{part:C,pendingTail:b&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:g},C.id));continue}if(C.type==="tool"){x.push(C);continue}v(),C.type==="text"?S.push(h.jsx(za,{text:C.text,onOpenFile:i,onOpenRun:a,predict:b&&C.id===(k==null?void 0:k.id)},C.id)):C.type==="steer"?S.push(h.jsx("div",{role:"note","aria-label":"You, mid-task",className:"msg-steer my-2 ml-auto w-fit max-w-[88%] bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere",children:C.text},C.id)):C.type==="prompt"&&C.prompt&&S.push(h.jsx(qV,{part:C,onRespond:m,onOpenFile:i,onOpenPlan:f},C.id))}return v(),S}function XV(e){return Qs(e).label}function KV(e){const t=(e??"").toLowerCase();return t==="subagent"||t==="task"||t==="agent"}function AC(e){var n,r;const t=((n=e.state)==null?void 0:n.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return t.startsWith("Async agent launched")?"":t}function H2(e,t){for(const n of e){if(n.id===t)return n;const r=n.children&&H2(n.children,t);if(r)return r}return null}function ZV({spawn:e,onOpenFile:t,onOpenRun:n,runExperimentName:r,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}){var k,S,x,v;const l=e.children??[],c=((k=e.state)==null?void 0:k.status)==="running",d=((S=e.state)==null?void 0:S.status)==="error",m=d?z2(((x=e.state)==null?void 0:x.error)||((v=e.state)==null?void 0:v.output)||""):"",f=EC(l,{onOpenFile:t,onOpenRun:n,runExperimentName:r,onOpenExperiment:i,experimentName:a,onOpenSubagent:o,predictTextTail:c,pendingTailToolId:c?TC(l):null}),b=l.some(w=>w.type==="text"&&!!w.text)?"":AC(e);return h.jsxs("div",{className:"msg-assistant text-lg leading-[1.62] text-text min-w-0",children:[d&&h.jsx("span",{className:"sr-only",children:"Failed: "}),m&&h.jsx("div",{className:"tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",children:m.slice(0,2e4)}),f.length===0&&!b&&!m?h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:c?"Working…":"No activity"}):h.jsxs(h.Fragment,{children:[f,b&&h.jsx(za,{text:b,onOpenFile:t,onOpenRun:n})]})]})}function QV({part:e,pendingTail:t,onOpenSubagent:n}){var d,m,f,g;const r=((d=e.state)==null?void 0:d.status)==="error",i=z2(((m=e.state)==null?void 0:m.error)||((f=e.state)==null?void 0:f.output)||""),a=t&&!r?B2(Qs(e)):Qs(e),o=CC(!!(t&&!r)),l=(((g=e.children)==null?void 0:g.length)??0)===0&&!r&&!AC(e),c=h.jsxs(h.Fragment,{children:[r&&h.jsx("span",{className:"sr-only",children:"Failed: "}),r?h.jsx(Q8,{size:16,strokeWidth:1.75,className:"subagent-icon shrink-0 text-accent-red","aria-hidden":"true"}):h.jsx(Gf,{activity:a,className:`subagent-icon shrink-0 ${o?"tool-running-shimmer-icon":"text-muted"}`}),h.jsx("span",{className:`${rV} ${o?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:a.label})]});return l?h.jsx("div",{className:"subagent-row flex items-center gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-lg text-left rounded-sm [&_.tool-line]:text-lg",children:c}):h.jsxs("button",{className:"subagent-row flex items-center gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-lg text-left rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default [&_.tool-line]:text-lg",title:r&&i?i:"Open sub-agent transcript",onClick:()=>n==null?void 0:n(e.id,a.label),disabled:!n,children:[c,h.jsx(ea,{size:12,className:"subagent-row-chevron shrink-0 text-muted"})]})}function JV(e){const t=new Map;let n;for(let i=e.length-1;i>=0;i--)if(e[i].role==="assistant"){n=e[i];break}if(!n)return{messageId:"",states:t};const r=(i,a)=>{var o,l;for(const c of i){const d=`${a}/${c.id}`;c.type==="tool"&&((o=c.state)!=null&&o.status)&&t.set(d,{status:c.state.status,part:c}),(l=c.children)!=null&&l.length&&r(c.children,d)}};return r(n.parts,n.id),{messageId:n.id,states:t}}function $2(e){const t=(n,r)=>{var i;for(const a of n){const o=a.prompt;if(a.type==="prompt"&&(o==null?void 0:o.kind)==="permission"&&!o.resolved){const l=o.toolInput??{},d=ji(l,"reason","description")||kC(o.tool,l);return{id:a.id,path:`${r}/${a.id}`,label:d}}if((i=a.children)!=null&&i.length){const l=t(a.children,`${r}/${a.id}`);if(l)return l}}return null};for(const n of e){if(n.role!=="assistant")continue;const r=t(n.parts,n.id);if(r)return r}return null}function eW(e){const[t,n]=R.useState({text:"",sequence:0}),r=R.useRef(null);return R.useEffect(()=>{var b,k;const i=((b=e[0])==null?void 0:b.id)??"",{messageId:a,states:o}=JV(e),l=$2(e);if(!r.current||r.current.transcript!==i){r.current={transcript:i,messageId:a,states:o,permissionPath:(l==null?void 0:l.path)??null},n(S=>({text:l?`Approval required: ${l.label}`:"",sequence:S.sequence+1}));return}const c=r.current.messageId===a?r.current.states:new Map,d=r.current.permissionPath,m=[...o].filter(([S,x])=>{var v;return((v=c.get(S))==null?void 0:v.status)!==x.status});if(r.current={transcript:i,messageId:a,states:o,permissionPath:(l==null?void 0:l.path)??null},l&&l.path!==d){n(S=>({text:`Approval required: ${l.label}`,sequence:S.sequence+1}));return}const f=m.filter(([,S])=>S.status==="error");if(f.length>0){const S=f.slice(0,2).map(([,x])=>Qs(x.part).label).join(", ");n(x=>({text:`${f.length===1?"Tool activity failed":`${f.length} tool activities failed`}: ${S}`,sequence:x.sequence+1}));return}const g=m.filter(([,S])=>S.status==="running");if(g.length>0){const S=(k=g.at(-1))==null?void 0:k[1].part;n(x=>({text:S?B2(Qs(S)).label:"Running a tool",sequence:x.sequence+1}));return}m.some(([,S])=>S.status==="completed")&&n(S=>({text:"Tool activity completed",sequence:S.sequence+1}))},[e]),t}function TC(e){var t;for(let n=e.length-1;n>=0;n--){const r=e[n];if(!(r.type==="steer"||!Vf(r)))return r.type!=="tool"||((t=r.state)==null?void 0:t.status)==="error"?null:r.id}return null}function NC(e){const t=e.at(-1);if((t==null?void 0:t.role)!=="assistant")return null;const n=TC(t.parts);return n?{messageId:t.id,toolId:n}:null}const tW=R.memo(function({messages:t,allMessages:n,canFork:r,onFork:i,onSelectFork:a,busy:o,onOpenFile:l,onOpenRun:c,onOpenSpawnedSession:d,runExperimentName:m,onOpenExperiment:f,experimentName:g,onRespond:b,onOpenPlan:k,onOpenSubagent:S,skills:x}){var M;const v=((M=$2(t))==null?void 0:M.id)??null,w=R.useMemo(()=>t.filter(T=>GV(T,v)),[t,v]),y=R.useMemo(()=>{const T=w.filter(D=>D.role==="user"&&!D.id.startsWith($c));return QD(n,t,T,D=>D.startsWith($c))},[t,w,n]),C=w.at(-1),N=eW(t),E=o?NC(t):null;return h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:h.jsx("span",{children:N.text},N.sequence)}),w.map(T=>{var D,z,$,F;return h.jsx(YV,{message:T,forkCount:(D=y.get(T.id))==null?void 0:D.count,forkIndex:(z=y.get(T.id))==null?void 0:z.index,forkPrevId:($=y.get(T.id))==null?void 0:$.prevId,forkNextId:(F=y.get(T.id))==null?void 0:F.nextId,forkDisabled:!r,branchDisabled:o,onFork:i,onSelectFork:a,activePermissionId:v,pendingTailToolId:(E==null?void 0:E.messageId)===T.id?E.toolId:null,onOpenFile:l,onOpenRun:c,onOpenSpawnedSession:d,runExperimentName:m,onOpenExperiment:f,experimentName:g,onRespond:b,onOpenPlan:k,onOpenSubagent:S,skills:x,predictTextTail:o&&T===C&&T.role==="assistant"},T.id)})]})}),Lw=(e,t)=>e==="all"?!0:e==="archived"?t:!t,jC=[{id:"active",label:"Active",railLabel:"Recents"},{id:"archived",label:"Archived",railLabel:"Archived"},{id:"all",label:"All",railLabel:"All sessions"}];function nW({value:e,onChange:t}){const{open:n,setOpen:r,ref:i}=Vo();return h.jsxs("div",{className:"rail-filter relative inline-flex",ref:i,children:[h.jsx("button",{className:`${hh} rail-filter-btn w-6 h-6 rounded-sm ${e!=="active"?"active":""}`,title:"Filter sessions","aria-label":"Filter sessions",onClick:()=>r(a=>!a),children:h.jsx(dR,{size:13})}),n&&h.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:jC.map(a=>h.jsxs("button",{className:li,onClick:()=>{t(a.id),r(!1)},children:[h.jsx("span",{children:a.label}),e===a.id&&h.jsx(Di,{size:13})]},a.id))})]})}const rW=14,iW=500,sW=1200;function MC({title:e,animate:t}){return t?h.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((n,r)=>n===" "?h.jsx("span",{"aria-hidden":!0,children:n},r):h.jsx("span",{"aria-hidden":!0,className:"title-reveal-char inline-block animate-[title-char-in_240ms_ease-out_both] [@media((prefers-reduced-motion:_reduce))]:animate-none",style:{animationDelay:`${Math.min(r*rW,iW)}ms`},children:n},r))}):h.jsx(h.Fragment,{children:e})}function aW({session:e,active:t,unread:n,busy:r,waiting:i,revealTitle:a,onOpen:o,onRename:l,onSetArchived:c,onDelete:d}){var N;const{open:m,setOpen:f,ref:g}=Vo(),b=((N=e.title)==null?void 0:N.trim())||"Untitled",[k,S]=R.useState(!1),[x,v]=R.useState(""),w=R.useRef(null);function y(){var E;v(((E=e.title)==null?void 0:E.trim())||""),S(!0)}function C(){var M;const E=x.trim();S(!1),E&&E!==(((M=e.title)==null?void 0:M.trim())||"")&&l(E)}return R.useEffect(()=>{var E,M;k&&((E=w.current)==null||E.focus(),(M=w.current)==null||M.select())},[k]),h.jsxs("div",{ref:g,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-left py-[7px] px-2.5 rounded-md text-md text-text cursor-pointer select-none [&:hover]:bg-surface [&.active]:bg-surface [&.active]:font-medium [&_.session-dot]:w-3.5 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:text-ellipsis [&_.session-title]:whitespace-nowrap [&.unread_.session-title]:font-semibold [&_.session-time]:text-2xs [&_.session-time]:text-muted [&_.session-time]:shrink-0 [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-within_.session-menu-btn]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-time]:hidden [&:focus-within_.session-time]:hidden [&.menu-open_.session-time]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-time]:hidden ${t?"active":""} ${n?"unread":""} ${m?"menu-open":""} ${k?"editing":""}`,title:`${hd[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?" · Spawned by another agent":""}`,onClick:()=>{k||(m?f(!1):o())},onKeyDown:E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),m?f(!1):o())},children:[h.jsx("span",{className:"session-dot",children:r?h.jsx("span",{className:`busy-dot ${i?"waiting":""}`}):n&&h.jsx("span",{className:"unread-dot"})}),e.parentSessionId&&!k&&h.jsx(c_,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),k?h.jsx("input",{ref:w,className:"session-title-input","aria-label":"Session title",value:x,onChange:E=>v(E.target.value),onClick:E=>E.stopPropagation(),onBlur:C,onKeyDown:E=>{E.stopPropagation(),E.key==="Enter"?(E.preventDefault(),C()):E.key==="Escape"&&(E.preventDefault(),S(!1))}}):h.jsx("span",{className:"session-title",children:h.jsx(MC,{title:b,animate:a!==void 0},a??"static")}),h.jsx("span",{className:"session-time",children:wV(e.updatedAt)}),h.jsx("button",{className:"session-menu-btn",title:"Session options","aria-label":"Session options",onClick:E=>{E.stopPropagation(),f(M=>!M)},children:h.jsx(tS,{size:14})}),m&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[h.jsx("button",{className:li,onClick:E=>{E.stopPropagation(),f(!1),y()},children:h.jsx("span",{children:"Rename"})}),h.jsx("button",{className:li,onClick:E=>{E.stopPropagation(),f(!1),c(!e.archived)},children:h.jsx("span",{children:e.archived?"Unarchive":"Archive"})}),h.jsx("button",{className:`${li} danger`,onClick:E=>{E.stopPropagation(),f(!1),d()},children:h.jsx("span",{children:"Delete"})})]})]})}function oW({projectId:e,projectName:t,paperId:n,railHeader:r,railOpen:i,onShowRail:a,mainView:o,onSelectMainView:l,experimentsActive:c,filesActive:d,artifactsActive:m,onOpenExperiments:f,onOpenArtifacts:g,onOpenFile:b,onOpenRun:k,runExperimentName:S,onOpenExperiment:x,experimentName:v,onOpenPlan:w,onOpenSubagent:y,onOpenWorktree:C,onOpenDemoWelcome:N,onActiveSessionChange:E,preferredAgent:M,onPreferredAgentChange:T,children:D}){var Sn,Jr,ua;const[z,$]=R.useState([]),[F,U]=R.useState(null),[V,X]=R.useState(new Set),[Y,Q]=R.useState("active"),[te,I]=R.useState(""),[O,H]=R.useState([]),G=R.useRef(0),W=R.useRef({projectId:e,activeId:F});W.current={projectId:e,activeId:F};const[re,ce]=R.useState([]),[me,ne]=R.useState(null),[B,se]=R.useState(null),le=R.useRef(Promise.resolve()),_e=R.useRef(0),be=R.useRef(0),[Ce,Le]=R.useState(null),$e=R.useRef(null),Ge=R.useRef(!1),Fe=R.useRef(null),[ut,Ke]=R.useReducer(yV,{messagesBySession:{},busySessions:new Set,queuedBySession:{},activeLeafBySession:{}}),[Ue,ct]=R.useState([]),[Kt,Rt]=R.useState(M);R.useEffect(()=>Rt(M),[M]);const[qe,nt]=R.useState({}),[ve,je]=R.useState(new Map),Pe=R.useRef(new Map),Ze=R.useRef(new Set),De=R.useRef(new Set),et=R.useRef(0),rt=R.useRef([]),At=R.useRef(null),xt=R.useRef(null),Xt=R.useRef(!0),dt=R.useRef(null),rn=Vo(),mn=R.useCallback(ie=>{var ye;G.current+=1,H(K=>[...K,{id:`annotation-${G.current}`,...ie}]),(ye=dt.current)==null||ye.focus()},[]),qn=hV(xt,mn);fV(O),R.useEffect(()=>{H([]),qn.dismiss()},[F,e,qn.dismiss]);const[Ui,qi]=R.useState([]),[Ts,Tr]=R.useState(0),[hi,pr]=R.useState(!1),[Yo,Zr]=R.useState(0),[Zt,ln]=R.useState(null),fi=R.useRef(null),[oa,Ns]=R.useState(0);R.useLayoutEffect(()=>{Ns(Zt&&fi.current?fi.current.offsetWidth+8:0),ls()},[Zt]);function ls(){var ie;fi.current&&(fi.current.style.transform=`translateY(${-(((ie=dt.current)==null?void 0:ie.scrollTop)??0)}px)`)}const Nr=R.useRef(!1);R.useEffect(()=>{jD(e).then(qi).catch(()=>{})},[e,o]);function _r(ie){var ye;if(ie.source==="command"&&ie.name==="plan"&&zn){Ya(te,zn);return}if(zn!=null&&zn.inline){const K=te.slice(0,zn.start),ae=te.slice(zn.end),he=`/${ie.name}`,Ee=ae?"":" ",Me=K.length+he.length+Ee.length;I(`${K}${he}${Ee}${ae}`),pr(!0),window.requestAnimationFrame(()=>{var Qe,it;(Qe=dt.current)==null||Qe.focus(),(it=dt.current)==null||it.setSelectionRange(Me,Me),Zr(Me)});return}ln(ie),I(""),(ye=dt.current)==null||ye.focus()}function xr(){var ie;ln(null),(ie=dt.current)==null||ie.focus()}function pi(ie){ne(null);let ae=re.reduce((he,Ee)=>he+Ee.size,0);for(const he of ie){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(he.type))continue;if(he.size>31457280){ne(`${he.name} is too large — each attachment must be under 30 MB.`);continue}if(ae+he.size>41943040){ne("Attachments exceed the 40 MB total limit — remove one and try again.");continue}ae+=he.size;const Ee=new FileReader;Ee.onload=()=>{const Me=Ee.result;ce(Qe=>[...Qe,{dataUrl:Me,mediaType:he.type,name:he.name,size:he.size}])},Ee.readAsDataURL(he)}}function Mn(ie){const ye=Array.from(ie.clipboardData.items).filter(K=>K.kind==="file"&&(K.type.startsWith("image/")||K.type==="application/pdf")).map(K=>K.getAsFile()).filter(K=>K!==null);ye.length>0&&(ie.preventDefault(),pi(ye))}const ft=z.find(ie=>ie.id===F),vt=Kt??IG(Ue),yn=ft?{harness:ft.harness,model:qe.model??ft.model,permissionMode:qe.permissionMode??ft.permissionMode,reasoningLevel:qe.reasoningLevel??ft.reasoningLevel}:vt?{...vt,...qe}:null,Ve=yn?Ue.find(ie=>ie.id===yn.harness):void 0,wt=Ve==null?void 0:Ve.options,la=qG(Ui,wt==null?void 0:wt.planActivation),zn=Zt?null:Cw(te,Yo),mi=(zn==null?void 0:zn.query)??null,Ir=mi!==null&&!hi?PG(la,(zn==null?void 0:zn.inline)??!1).filter(ie=>ie.name.startsWith(mi)):[],zr=Ir.length>0,jr=Math.min(Ts,Math.max(0,Ir.length-1));R.useEffect(()=>Tr(0),[mi]);const $t=yn&&{...yn,reasoningLevel:yS(Ve,yn.model,yn.reasoningLevel)},Gn=hp(Ve,$t==null?void 0:$t.model),Qt=ie=>{if(!$t)return;const ye={...$t,...ie};Rt(ye),T(ye).catch(()=>{}),ft?nt(K=>({...K,...ie})):ie.harness&&ie.harness!==$t.harness&&nt({})},ar=R.useCallback(ie=>{const ye=le.current.catch(()=>{}).then(ie);return le.current=ye.then(()=>{},()=>{}),ye},[]),gi=ie=>{if(ie==="plan"&&(Ve==null?void 0:Ve.id)==="claude-code"?nt(ae=>({...ae,permissionMode:ie})):(nt(ae=>{const he={...ae};return delete he.permissionMode,he}),Qt({permissionMode:ie})),!ft)return;const ye=ft.id,K=++_e.current;se(null),ar(()=>FD(ye,ie)).then(ae=>{$(he=>he.map(Ee=>Ee.id===ae.id?ae:Ee)),_e.current===K&&nt(he=>{const Ee={...he};return delete Ee.permissionMode,Ee})}).catch(()=>{_e.current===K&&(nt(ae=>{const he={...ae};return delete he.permissionMode,he}),se("Could not update permissions. Try again."))})},Br=ie=>Qt({reasoningLevel:ie}),Qr=($t==null?void 0:$t.harness)==="claude-code"?$t.permissionMode==="plan":(wt==null?void 0:wt.planActivation)==="command"?Ce??(ft==null?void 0:ft.planMode)??!1:!1;R.useEffect(()=>{Ce===null||(ft==null?void 0:ft.planMode)!==Ce||($e.current=null,Le(null))},[ft==null?void 0:ft.planMode,Ce]);async function cs(ie){if($e.current=ie,Le(ie),!ft)return;const ye=ft.id,K=++be.current;se(null);try{const ae=await ar(()=>$D(ye,ie));$(he=>he.map(Ee=>Ee.id===ae.id?ae:Ee)),be.current===K&&($e.current=null,Le(null),se(null))}catch(ae){throw be.current===K&&($e.current=null,Le(null)),ae}}async function us(){if(($t==null?void 0:$t.harness)==="claude-code"){gi("auto");return}if(ft)try{await cs(!1)}catch{se("Could not exit Plan mode. Try again.")}}async function ca(){const ie=!Qr;try{if(($t==null?void 0:$t.harness)==="claude-code")gi(ie?"plan":"auto");else if((wt==null?void 0:wt.planActivation)==="command")await cs(ie);else throw new Error("The selected harness is unavailable")}catch{se("Could not toggle Plan mode. Try again.")}}function Ya(ie,ye){const K=UG(ie,ye);I(K.text),ln(null),pr(!0),ca(),window.requestAnimationFrame(()=>{var ae,he;(ae=dt.current)==null||ae.focus(),(he=dt.current)==null||he.setSelectionRange(K.cursor,K.cursor),Zr(K.cursor)})}rt.current=z;const Vn=R.useCallback(async()=>{const ie=rt.current.map(ye=>ye.id);try{const ye=(await hf(e)).filter(ae=>!De.current.has(ae.id)),K=new Set(ye.map(ae=>ae.id));for(const ae of ie)K.has(ae)||Ls(ae);return $(ae=>{const he=new Map(ae.map(Ee=>[Ee.id,Ee.contextUsage]));return ye.map(Ee=>({...Ee,contextUsage:Ee.contextUsage??he.get(Ee.id)}))}),Pe.current=new Map(ye.map(ae=>[ae.id,ae.title])),Ke({type:"seedBusy",sessions:ye.filter(ae=>ae.busy).map(ae=>ae.id),known:ye.map(ae=>ae.id)}),ye}catch{return null}},[e]);R.useEffect(()=>{$([]),rt.current=[],U(null);const ie=fC();X(e===ug?new Set([lS,cS].filter(ye=>!ie.has(ye))):new Set),I(""),ln(null),ce([]),Ke({type:"reset"}),Ze.current=new Set,je(new Map),Pe.current=new Map,Vn().then(ye=>{ye&&U(K=>{var ae,he;return K??(e===ug?(ae=ye.find(Ee=>Ee.id===md))==null?void 0:ae.id:void 0)??((he=ye.find(Ee=>!Ee.archived))==null?void 0:he.id)??null})})},[e,Vn]),R.useEffect(()=>{!F||Ze.current.has(F)||(Ze.current.add(F),gd(F).then(({messages:ie,queued:ye,activeLeafId:K})=>Ke({type:"seed",sessionId:F,messages:ie,queued:ye,activeLeafId:K})).catch(()=>{Ke({type:"seed",sessionId:F,messages:[],onlyIfAbsent:!0}),Ze.current.delete(F)}))},[F]),R.useEffect(()=>Td(ie=>{switch(ie.type){case"session":{if(ie.session.projectId!==e||De.current.has(ie.session.id))return;const ye=Pe.current.has(ie.session.id),K=Pe.current.get(ie.session.id)!==ie.session.title;Pe.current.set(ie.session.id,ie.session.title),ye&&K&&ie.session.titleSource==="generated"&&(je(ae=>{const he=new Map(ae);return he.set(ie.session.id,(ae.get(ie.session.id)??0)+1),he}),window.setTimeout(()=>{je(ae=>{if(!ae.has(ie.session.id))return ae;const he=new Map(ae);return he.delete(ie.session.id),he})},sW)),$(ae=>{const he=ae.findIndex(Me=>Me.id===ie.session.id);if(he<0)return[ie.session,...ae];const Ee=ae.slice();return Ee[he]={...ie.session,contextUsage:ie.session.contextUsage??ae[he].contextUsage},Ee});break}case"sessionDeleted":Ls(ie.sessionId);break;case"message":et.current++,Ke({type:"upsertMessage",sessionId:ie.sessionId,message:ie.message});break;case"busy":Ke({type:"busy",sessionId:ie.sessionId,busy:ie.busy});break;case"queued":Ke({type:"setQueued",sessionId:ie.sessionId,items:ie.items});break;case"branch":Ke({type:"activeLeaf",sessionId:ie.sessionId,leafId:ie.activeLeafId});break;case"usage":$(ye=>ye.map(K=>K.id===ie.sessionId?{...K,contextUsage:ie.usage}:K));break}}),[e]),R.useEffect(()=>Td(ie=>{if(ie.type!=="reconnected"||(Vn(),!F||!Ze.current.has(F)))return;const ye=K=>{const ae=et.current;gd(F).then(({messages:he,queued:Ee,activeLeafId:Me})=>{Ke({type:"seed",sessionId:F,messages:he,queued:Ee,activeLeafId:Me}),K&&et.current!==ae&&ye(!1)}).catch(()=>{})};ye(!0)}),[F,Vn]);const bi=F?ut.messagesBySession[F]??jw:jw,mr=F?ut.activeLeafBySession[F]??null:null,Rn=R.useRef(mr);Rn.current=mr;const or=R.useMemo(()=>KD(bi,mr),[bi,mr]),Dn=F?ut.busySessions.has(F):!1,js=!Dn&&!!(Ve!=null&&Ve.agentReady),Gi=Dn&&NC(or)!=null,Hr=F?ut.queuedBySession[F]??[]:[];R.useEffect(()=>{const ie=Hr.reduce((ye,K)=>K.planMode??ye,void 0);ie!==void 0?(Ge.current=!0,$e.current=ie,Le(ie)):Ge.current&&(Ge.current=!1,$e.current=null,Le(null))},[Hr]);const Xa=!!F&&!(F in ut.messagesBySession),wn=R.useMemo(()=>{const ie=new Set;for(const ye of ut.busySessions)(ut.messagesBySession[ye]??[]).some(K=>K.parts.some(ae=>ae.type==="prompt"&&ae.prompt&&!ae.prompt.resolved&&ae.prompt.nativeId))&&ie.add(ye);return ie},[ut.busySessions,ut.messagesBySession]),Vi=F?wn.has(F):!1,Jt=ft,Ms=Jt?ve.get(Jt.id):void 0,gn=R.useMemo(()=>{var ie;for(let ye=or.length-1;ye>=0;ye--)for(const K of or[ye].parts)if(K.type==="prompt"&&((ie=K.prompt)==null?void 0:ie.kind)==="plan"&&!K.prompt.resolved)return{promptId:K.id,plan:K.prompt.plan??"",synthesized:!!K.prompt.synthesized};return null},[or]),Wn=R.useMemo(()=>{const ie=Jt==null?void 0:Jt.harness;if(!F||ie!=="claude-code"&&ie!=="codex")return null;for(let ye=or.length-1;ye>=0;ye--)for(const K of or[ye].parts)if(!(K.type!=="prompt"||!K.prompt||K.prompt.resolved)&&K.prompt.kind==="question")return K.prompt.nativeId&&!ut.busySessions.has(F)?null:K.id;return null},[or,Jt==null?void 0:Jt.harness,F,ut.busySessions]),[vi,ds]=R.useState(null),ql=vi&&vi.sessionId===F?vi:null;R.useEffect(()=>{if(!vi)return;const ie=ut.busySessions.has(vi.sessionId),ye=vi.sessionId===F&&gn&&gn.promptId!==vi.promptId;(!ie||ye)&&ds(null)},[vi,gn,ut.busySessions,F]);const Gl=R.useMemo(()=>$2(or),[or]),Ka=Dn&&!!(Ve!=null&&Ve.supportsSteering)&&!!(Ve!=null&&Ve.agentReady)&&!gn&&!Wn&&!Gl&&re.length===0&&O.length===0,Rs=R.useMemo(()=>w&&F?(ie,ye)=>w(ie,F,ye):void 0,[w,F]),Vl=R.useMemo(()=>y&&F?(ie,ye)=>y(F,ie,ye):void 0,[y,F]),Wl=R.useMemo(()=>b&&((ie,ye,K,ae)=>b(ie,F??void 0,ye,K,ae)),[b,F]);R.useEffect(()=>{_e.current+=1,be.current+=1;const ie=(F?ut.queuedBySession[F]??[]:[]).reduce((ye,K)=>K.planMode??ye,void 0);Ge.current=ie!==void 0,$e.current=ie??null,Le(ie??null),nt({}),se(null)},[F]),R.useEffect(()=>{E==null||E(F)},[F,E]);const Wi=o==="chat"&&(or.length>0||Dn);R.useLayoutEffect(()=>{Xt.current=!0;const ie=At.current;ie&&(ie.scrollTop=ie.scrollHeight)},[F,Wi]),R.useLayoutEffect(()=>{const ie=At.current;ie&&Xt.current&&(ie.scrollTop=ie.scrollHeight)},[or,Dn]),R.useEffect(()=>{const ie=At.current,ye=xt.current;if(!ie||!ye)return;const K=new ResizeObserver(()=>{Xt.current&&(ie.scrollTop=ie.scrollHeight)});return K.observe(ye),K.observe(ie),()=>K.disconnect()},[Wi]);async function $r({queue:ie=!1}={}){const ye=te.trim(),K=Zt?`/${Zt.name}${ye?` ${ye}`:""}`:ye,ae=Wn?null:GG(K,wt==null?void 0:wt.planActivation),he=!!ae,Ee=!Qr,Me=VG(wt==null?void 0:wt.planActivation,he?Ee:void 0,$e.current),Qe=he&&(Ve==null?void 0:Ve.id)==="claude-code"?Ee?"plan":"auto":void 0,it=ae?ae.prompt:K,St=re,Bt=O,wr=Bt.map(fn=>({text:fn.text})),Fr=e;let Pr=F;const xi=()=>{const fn=W.current;return fn.projectId===Fr&&fn.activeId===Pr},zs=()=>{xi()&&(I(fn=>fn||K),ce(fn=>fn.length?fn:St),H(fn=>fn.length?fn:Bt))};if(he&&!it&&St.length===0&&Bt.length===0){I(""),ln(null),pr(!1);try{if((Ve==null?void 0:Ve.id)==="claude-code")gi(Ee?"plan":"auto");else if((wt==null?void 0:wt.planActivation)==="command")await cs(Ee);else throw new Error("The selected harness is unavailable")}catch{se("Could not toggle Plan mode. Try again."),zs()}return}const Ln=$t?{...$t,...Qe?{permissionMode:Qe}:{}}:null;Qe&&gi(Qe);let da=null;const eo=$e.current;he&&(wt==null?void 0:wt.planActivation)==="command"&&(da=++be.current,$e.current=Ee,Le(Ee));const Ko=()=>{da===null||be.current!==da||($e.current=eo,Le(eo))};if(!it&&St.length===0&&Bt.length===0)return;if((it||Bt.length>0)&&Wn&&St.length===0){I(""),ln(null),H([]),Yn({promptId:Wn,answers:[],note:it||void 0,annotations:wr}).then(fn=>{fn||zs()});return}if(Dn){if(!F||!(Ve!=null&&Ve.agentReady)){Ko();return}const fn=F;I(""),ln(null),ce([]),H([]),ne(null);const ha=Ln?{model:Ln.model,permissionMode:Ln.permissionMode,planMode:(wt==null?void 0:wt.planActivation)==="command"?Me??(ft==null?void 0:ft.planMode):Me,reasoningLevel:Ln.reasoningLevel}:{};nt({});const to=St.map(lr=>({mediaType:lr.mediaType,dataBase64:lr.dataUrl.slice(lr.dataUrl.indexOf(",")+1),name:lr.name}));try{await ar(()=>u3(fn,it,ha,to.length?to:void 0,wr,Ka&&!ie&&!he?"steer":void 0))}catch{Ko(),zs()}return}if(!(Ve!=null&&Ve.agentReady)){Ko();return}if(!Ln){Ko();return}I(""),ln(null),ce([]),H([]),ne(null);let fs=F;try{if(!fs){const Fn=await ID(e,Ln.harness,{model:Ln.model,permissionMode:Ln.permissionMode,planMode:Me,reasoningLevel:Ln.reasoningLevel});Ze.current.add(Fn.id),$(pu=>[Fn,...pu]),U(Fn.id),fs=Fn.id,Pr=Fn.id,W.current={projectId:e,activeId:Fn.id}}Ke({type:"optimisticUser",sessionId:fs,text:it||"Asked about selected text",attachments:St.map(Fn=>({url:Fn.dataUrl,mediaType:Fn.mediaType,name:Fn.name})),annotations:Bt}),Ke({type:"busy",sessionId:fs,busy:!0}),Xt.current=!0,Y==="archived"&&Q("active");const fn=Ln?{model:Ln.model,permissionMode:Ln.permissionMode,planMode:Me,reasoningLevel:Ln.reasoningLevel}:{};nt({});const ha=St.map(Fn=>({mediaType:Fn.mediaType,dataBase64:Fn.dataUrl.slice(Fn.dataUrl.indexOf(",")+1),name:Fn.name})),to=fs;if(!to)throw new Error("chat session was not created");await ar(()=>u3(to,it,fn,ha.length?ha:void 0,wr))}catch(fn){if(zs(),Ko(),!fs)return;const ha=fn instanceof Error?fn.message:String(fn);if(!/session is busy/i.test(ha)&&await hf(e).then(lr=>{var Fn;return!!((Fn=lr.find(pu=>pu.id===fs))!=null&&Fn.busy)}).catch(()=>!1)){xi()&&(I(lr=>lr===it?"":lr),ce(lr=>lr===St?[]:lr),H(lr=>lr===Bt?[]:lr));return}Ke({type:"busy",sessionId:fs,busy:!1}),Ke({type:"localError",sessionId:fs,text:`Message not sent: ${ha}`})}}function Za(){F&&VD(F)}const Xo=R.useCallback((ie,ye)=>{if(!F||Dn||!(Ve!=null&&Ve.agentReady))return;const K=F;Ke({type:"busy",sessionId:K,busy:!0}),Xt.current=!0,ar(()=>qD(K,ie,ye)).catch(ae=>{Ke({type:"busy",sessionId:K,busy:!1});const he=ae instanceof Error?ae.message:String(ae);Ke({type:"localError",sessionId:K,text:`Could not re-send: ${he}`})})},[F,Dn,Ve==null?void 0:Ve.agentReady,ar]),Yi=R.useCallback(ie=>{if(!F||Dn)return;const ye=F,K=Rn.current;Ke({type:"activeLeaf",sessionId:ye,leafId:ie}),ar(()=>GD(ye,ie)).catch(ae=>{Ke({type:"activeLeaf",sessionId:ye,leafId:K});const he=ae instanceof Error?ae.message:String(ae);Ke({type:"localError",sessionId:ye,text:`Could not switch fork: ${he}`})})},[F,Dn,ar]);function Ds(ie){if(!F)return;const ye=F;Ke({type:"setQueued",sessionId:ye,items:Hr.filter(K=>K.id!==ie)}),PD(ye,ie).catch(()=>{})}R.useEffect(()=>{if(!Dn||o!=="chat")return;function ie(ye){var K;ye.key!=="Escape"||ye.defaultPrevented||(ye.preventDefault(),Za(),(K=dt.current)==null||K.focus())}return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[Dn,F,o]);function Ls(ie){De.current.add(ie),$(ye=>ye.filter(K=>K.id!==ie)),U(ye=>ye===ie?null:ye),X(ye=>{if(!ye.has(ie))return ye;const K=new Set(ye);return K.delete(ie),K}),Ze.current.delete(ie),Pe.current.delete(ie),Ke({type:"forget",sessionId:ie})}function Qa(ie,ye){const K=ie.archived;$(ae=>ae.map(he=>he.id===ie.id?{...he,archived:ye}:he)),Lw(Y,ye)||U(ae=>ae===ie.id?null:ae),BD(ie.id,ye).catch(()=>{$(ae=>ae.map(he=>he.id===ie.id?{...he,archived:K}:he))})}function _i(ie,ye){const K=ie.title;$(ae=>ae.map(he=>he.id===ie.id?{...he,title:ye}:he)),HD(ie.id,ye).catch(()=>{$(ae=>ae.map(he=>he.id===ie.id?{...he,title:K}:he))})}async function bn(ie){var K;const ye=((K=ie.title)==null?void 0:K.trim())||"Untitled";if(window.confirm(`Delete "${ye}"? -Its transcript is permanently removed.`)){try{await DD(ie.id)}catch(Z){window.alert(`Failed to delete "${xe}": ${Z instanceof Error?Z.message:String(Z)}`);return}Bs(ie.id)}}const Wn=R.useCallback(ie=>{if(!F)return Promise.resolve(!1);const xe=F;return Qe({type:"busy",sessionId:xe,busy:!0}),ar(()=>UD(xe,ie)).then(()=>!0).catch(()=>!1).finally(()=>{md(xe).then(({messages:Ae,queued:Z,activeLeafId:le})=>Qe({type:"seed",sessionId:xe,messages:Ae,queued:Z,activeLeafId:le})).catch(()=>{}),df(e).then(Ae=>{var Z;return Qe({type:"busy",sessionId:xe,busy:!!((Z=Ae.find(le=>le.id===xe))!=null&&Z.busy)})}).catch(()=>{})})},[F,e,ar]),Ja=z.filter(ie=>Dw(Y,ie.archived)),Hs=/Mac|iPhone|iPad/.test(navigator.platform),wr=Hs?"⌘ ⇧ Enter":"Ctrl + Shift + Enter",br=Hs?"⌘ Enter":"Ctrl + Enter",ps=R.useCallback(()=>{Q("active"),U(null),l("chat")},[l]);R.useEffect(()=>{const ie=xe=>{xe.repeat||xe.key!=="Enter"||!xe.metaKey&&!xe.ctrlKey||xe.altKey||!xe.shiftKey||(xe.preventDefault(),ps())};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[ps]);const Sr=h.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-2.5 mr-3.5 mb-2.5 ml-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:py-1 [&_.rail-body]:px-2 floating-panel border border-border rounded-lg shadow-[0_6px_24px_color-mix(in_oklab,_var(--text)_5%,_transparent),_0_1px_4px_color-mix(in_oklab,_var(--text)_4%,_transparent)] overflow-visible",children:[r,h.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${d?"active":""}`,onClick:C,children:[h.jsx(Ed,{size:15}),"Files"]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${m?"active":""}`,"data-onboarding":"nav-artifacts",onClick:g,children:[h.jsx(r_,{size:15}),"Artifacts"]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${u?"active":""}`,onClick:f,children:[h.jsx(Eb,{size:15}),"Experiments"]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${o==="skills"?"active":""}`,onClick:()=>l("skills"),children:[h.jsx(Nj,{size:15}),"Skills"]}),CG.map(ie=>h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${o!=="chat"&&o!=="skills"&&ie.activeTabs.includes(o)?"active":""}`,"data-onboarding":ie.id==="compute"?"nav-compute":void 0,onClick:()=>l(ie.id),children:[ie.icon,ie.label]},ie.id))]}),h.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pr-2.5 pb-1.5 pl-4.5",children:[h.jsx("div",{className:"rail-section-label p-0 text-md font-medium text-subtext",children:((Ft=EC.find(ie=>ie.id===Y))==null?void 0:Ft.railLabel)??"Recents"}),h.jsxs("div",{className:"rail-section-actions flex items-center gap-0.5",children:[h.jsxs("button",{className:"rail-section-new inline-flex items-center gap-1 py-[3px] px-1.5 rounded-sm text-subtext text-xs font-medium [&:hover]:text-text [&:hover]:bg-surface tip-up [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":wr,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:ps,children:[h.jsx(i_,{size:13}),"Task"]}),h.jsx(XV,{value:Y,onChange:Q})]})]}),h.jsxs("div",{className:"rail-body",children:[Ja.map(ie=>h.jsx(JV,{session:ie,active:ie.id===F&&o==="chat",unread:V.has(ie.id),busy:dt.busySessions.has(ie.id),waiting:wn.has(ie.id),revealTitle:ve.get(ie.id),onOpen:()=>{U(ie.id),e===lg&&PG(ie.id),X(xe=>{if(!xe.has(ie.id))return xe;const Ae=new Set(xe);return Ae.delete(ie.id),Ae}),l("chat")},onRename:xe=>yi(ie,xe),onSetArchived:xe=>Qa(ie,xe),onDelete:()=>void bn(ie)},ie.id)),Ja.length===0&&h.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-md text-muted",children:Y==="archived"?"No archived sessions":z.length>0?"No active sessions":"No sessions yet"})]})]}),Zi=`chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&.rail-hidden]:max-w-none [&.rail-hidden]:py-0 [&.rail-hidden]:px-0.5 [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:left-0 [&::after]:right-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none${i?"":" rail-hidden"}`,$s=!i&&h.jsx("button",{className:nr,title:"Show sidebar","aria-label":"Show sidebar",onClick:a,children:h.jsx(iS,{size:15})});return o!=="chat"?h.jsxs(h.Fragment,{children:[i&&Sr,h.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!i&&h.jsx("div",{className:Zi,children:$s}),h.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:D})]})]}):h.jsxs(h.Fragment,{children:[i&&Sr,h.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[h.jsxs("div",{className:Zi,children:[$s,h.jsx("div",{className:Td,title:en?((Sn=en.title)==null?void 0:Sn.trim())||"Untitled":"New session",children:en?h.jsx(AC,{title:((ti=en.title)==null?void 0:ti.trim())||"Untitled",animate:Os!==void 0},Os??"static"):"New session"}),T&&h.jsx("button",{className:nr,"data-tip":"About this demo","aria-label":"About this demo",onClick:T,children:h.jsx(Uj,{size:15})})]}),Xa?h.jsxs("div",{className:"chat-loading flex-1 flex items-center justify-center gap-3 text-subtext text-xl p-5 [&_.spinner]:w-5.5 [&_.spinner]:h-5.5 [&_.spinner]:border-[3px]","aria-live":"polite","aria-busy":"true",children:[h.jsx("span",{className:Pt}),h.jsx("span",{children:"Loading conversation…"})]}):Xi?h.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:Tt,onScroll:ie=>{const xe=ie.currentTarget;Xt.current=xe.scrollHeight-xe.scrollTop-xe.clientHeight<60,Un.dismiss()},children:h.jsxs("div",{className:"chat-thread-inner max-w-readable my-0 mx-auto pt-4 px-4 pb-8 flex flex-col gap-4",ref:yt,children:[h.jsx(YV,{messages:or,allMessages:_i,canFork:Ls,onFork:Yo,onSelectFork:Ki,busy:Ln,onOpenFile:Vl,onOpenRun:k,runExperimentName:S,onOpenExperiment:x,experimentName:_,onRespond:Wn,onOpenPlan:Is,onOpenSubagent:Gl,skills:ca}),Ln&&(Yi?h.jsx("div",{className:"working flex items-center gap-2 text-subtext text-md pt-0.5 px-0 pb-2 [&.awaiting]:italic awaiting",children:"Waiting for your input…"}):h.jsxs("div",{className:"working flex items-center gap-2 text-subtext text-md pt-0.5 px-0 pb-2 [&.awaiting]:italic",children:[h.jsx("span",{className:Pt})," ",Wi?"Working…":"Thinking…"]}))]})}):h.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center @container text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[h.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:h.jsx(c_,{})}),h.jsx("h2",{children:"What should we research?"}),h.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-semibold",children:[h.jsx(Ed,{size:19}),h.jsx("span",{children:t})]}),h.jsxs("div",{className:"chat-empty-starters grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2.5 w-[min(100%,_620px)] mt-19 [@container((min-width:_500px))]:grid-cols-[repeat(4,_minmax(0,_1fr))] [@container((min-width:_500px))]:w-[min(100%,_720px)]",children:[h.jsxs("button",{type:"button",className:"chat-empty-starter min-h-28 flex flex-col items-start justify-between gap-5 p-4 border border-border rounded-lg text-text bg-background shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_5%,_transparent)] text-left text-md font-medium leading-[1.35] transition-[border-color,background,translate] duration-120 ease-standard [&:hover]:border-muted [&:hover]:bg-surface [&:hover]:-translate-y-px [&.blue_svg]:text-accent-blue [&.purple_svg]:text-accent-purple [&.green_svg]:text-accent-green [&.orange_svg]:text-accent-orange blue",onClick:()=>{var ie;cn(null),I("Explore this codebase and explain its architecture, key components, and open research questions."),(ie=ht.current)==null||ie.focus()},children:[h.jsx(W8,{size:16}),h.jsx("span",{children:"Explore this codebase"})]}),h.jsxs("button",{type:"button",className:"chat-empty-starter min-h-28 flex flex-col items-start justify-between gap-5 p-4 border border-border rounded-lg text-text bg-background shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_5%,_transparent)] text-left text-md font-medium leading-[1.35] transition-[border-color,background,translate] duration-120 ease-standard [&:hover]:border-muted [&:hover]:bg-surface [&:hover]:-translate-y-px [&.blue_svg]:text-accent-blue [&.purple_svg]:text-accent-purple [&.green_svg]:text-accent-green [&.orange_svg]:text-accent-orange purple",onClick:()=>{var xe;const ie=Gi.find(Ae=>Ae.name==="reproduce-paper");n&&ie?(cn(ie),I("")):(cn(null),I(n?"/reproduce-paper ":"Find and summarize the research most relevant to this project.")),(xe=ht.current)==null||xe.focus()},children:[h.jsx(oh,{size:16}),h.jsx("span",{children:n?"Reproduce the linked paper":"Review relevant literature"})]}),h.jsxs("button",{type:"button",className:"chat-empty-starter min-h-28 flex flex-col items-start justify-between gap-5 p-4 border border-border rounded-lg text-text bg-background shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_5%,_transparent)] text-left text-md font-medium leading-[1.35] transition-[border-color,background,translate] duration-120 ease-standard [&:hover]:border-muted [&:hover]:bg-surface [&:hover]:-translate-y-px [&.blue_svg]:text-accent-blue [&.purple_svg]:text-accent-purple [&.green_svg]:text-accent-green [&.orange_svg]:text-accent-orange green",onClick:()=>{var ie;cn(null),I("Set up and run an experiment for this project, including a baseline and meaningful variants."),(ie=ht.current)==null||ie.focus()},children:[h.jsx(Eb,{size:16}),h.jsx("span",{children:"Run an experiment"})]}),h.jsxs("button",{type:"button",className:"chat-empty-starter min-h-28 flex flex-col items-start justify-between gap-5 p-4 border border-border rounded-lg text-text bg-background shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_5%,_transparent)] text-left text-md font-medium leading-[1.35] transition-[border-color,background,translate] duration-120 ease-standard [&:hover]:border-muted [&:hover]:bg-surface [&:hover]:-translate-y-px [&.blue_svg]:text-accent-blue [&.purple_svg]:text-accent-purple [&.green_svg]:text-accent-green [&.orange_svg]:text-accent-orange orange",onClick:()=>{var ie;cn(null),I("Analyze the latest experiment results and recommend the most useful next iteration."),(ie=ht.current)==null||ie.focus()},children:[h.jsx(Y8,{size:16}),h.jsx("span",{children:"Analyze results"})]})]})]}),Un.action&&h.jsxs("button",{type:"button",className:"chat-selection-action fixed z-50 inline-flex items-center gap-1.5 py-1.5 px-3 border border-border rounded-md bg-background text-text text-sm font-medium shadow-[0_2px_8px_rgba(0,_0,_0,_0.10)] whitespace-nowrap [&:hover]:bg-surface",style:{left:Un.action.x,top:Un.action.top,transform:"translateX(-50%)"},onMouseDown:ie=>ie.preventDefault(),onClick:Un.add,children:[h.jsx(rS,{size:14}),"Ask about this"]}),h.jsxs("div",{className:"composer pt-0 px-3 pb-3 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&::before]:content-[''] [&::before]:absolute [&::before]:bottom-full [&::before]:left-0 [&::before]:right-0 [&::before]:h-6 [&::before]:bg-[linear-gradient(to_top,_var(--base),_transparent)] [&::before]:pointer-events-none [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[gn&&!(Ul&&gn.promptId===Ul.promptId)&&h.jsx(kq,{synthesized:gn.synthesized,agentLabel:en?dd[en.harness]:"The agent",showResumeModes:(en==null?void 0:en.harness)==="claude-code",onView:()=>Is==null?void 0:Is(gn.plan,gn.promptId),onApprove:ie=>Wn({promptId:gn.promptId,approve:!0,...ie?{resumeMode:ie}:{}}),onReject:()=>Wn({promptId:gn.promptId,approve:!1}),onRevise:ie=>{F&&fs({sessionId:F,promptId:gn.promptId}),Wn({promptId:gn.promptId,approve:!1,note:ie})}}),$r.length>0&&h.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:$r.map(ie=>h.jsxs("div",{className:"queued-chip flex items-center gap-2 py-1.5 px-2.5 text-sm text-subtext bg-surface border border-border rounded-sm",title:ie.text,children:[h.jsx(Xj,{size:13,className:"shrink-0 text-muted"}),h.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:ie.text}),h.jsx("span",{className:"shrink-0 text-xs text-muted uppercase tracking-wide",children:"Queued"}),h.jsx("button",{title:"Cancel queued message","aria-label":"Cancel queued message",onClick:()=>zs(ie.id),className:"shrink-0 inline-flex items-center justify-center w-4 h-4 p-0 border-0 rounded-full text-muted cursor-pointer [&:hover]:bg-text [&:hover]:text-background",children:h.jsx(Yr,{size:11})})]},ie.id))}),h.jsxs("div",{className:"composer-box relative flex flex-col border border-border rounded-md bg-background","data-onboarding":"composer",children:[We&&!We.agentReady&&h.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-xs leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[h.jsxs("strong",{children:[We.name," is unavailable."]})," ",We.agentNote?M2(We.agentNote):"Re-check its setup."]}),Br&&h.jsx(TG,{skills:zr,activeIndex:Mr,onPick:xr,onHover:Nr}),O.length>0&&h.jsx(hV,{annotations:O,onClear:()=>{H([]),window.requestAnimationFrame(()=>{var ie;return(ie=ht.current)==null?void 0:ie.focus()})},onRemove:ie=>{const xe=O.filter(Ae=>Ae.id!==ie);H(xe),xe.length===0&&window.requestAnimationFrame(()=>{var Ae;return(Ae=ht.current)==null?void 0:Ae.focus()})}}),re.length>0&&h.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:re.map((ie,xe)=>{const Ae=()=>ce(Z=>Z.filter((le,me)=>me!==xe));return ie.mediaType==="application/pdf"?h.jsxs("div",{className:"attachment-file [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background relative inline-flex items-center gap-2 max-w-55 py-2 px-2.5 border border-border rounded-sm text-text bg-surface [&_svg]:shrink-0 [&_svg]:text-muted",title:ie.name,children:[h.jsx(ah,{size:22}),h.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:ie.name??"document.pdf"}),h.jsx("button",{title:"Remove file","aria-label":"Remove file",onClick:Ae,children:h.jsx(Yr,{size:11})})]},xe):h.jsxs("div",{className:"attachment-thumb relative [&_img]:w-13 [&_img]:h-13 [&_img]:object-cover [&_img]:border [&_img]:border-border [&_img]:rounded-sm [&_img]:block [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background",children:[h.jsx("img",{src:ie.dataUrl,alt:"pasted"}),h.jsx("button",{title:"Remove image","aria-label":"Remove image",onClick:Ae,children:h.jsx(Yr,{size:11})})]},xe)})}),pe&&h.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:pe}),B&&h.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:B}),h.jsxs("div",{className:"composer-input relative flex overflow-hidden [&_textarea]:flex-1",children:[Qt&&h.jsxs("span",{ref:mi,className:"skill-chip inline-flex items-center py-px px-[7px] font-mono text-md font-medium text-primary bg-primary-subtle border border-border-variant rounded-sm composer-chip absolute top-[9px] left-3 z-1 pointer-events-none",children:["/",Qt.name]}),h.jsx("textarea",{ref:ht,value:te,style:Qt?{textIndent:la}:void 0,onScroll:us,placeholder:Vn?"Type a custom answer…":Qt?["reproduce-paper","paper-to-marimo"].includes(Qt.name)&&n?`[optional — defaults to ${n} on your default compute]`:Qt.argHint:Ka&&We?`Steer ${dd[We.id]}… (${br} to queue)`:$t?We!=null&&We.agentReady?`Message ${dd[$t.harness]}… ( / for commands)`:`${dd[$t.harness]} is unavailable — open the model picker`:"Ask the research agent… ( / for commands)",rows:2,onPaste:Rn,onDragOver:ie=>{ie.dataTransfer.types.includes("Files")&&ie.preventDefault()},onDrop:ie=>{ie.dataTransfer.files.length!==0&&(ie.preventDefault(),gi(Array.from(ie.dataTransfer.files)))},onChange:ie=>{const xe=ie.target.value,Ae=ie.target.selectionStart;Jr(Ae);const Z=Ae>0&&/\s/.test(xe[Ae-1])?ww(xe,Ae-1):null;if((Z==null?void 0:Z.query)==="plan"){Ya(xe,Z);return}if(!Qt&&!Vn&&!jr.current){const le=xe.match(/^\/(\S+)\s([\s\S]*)$/),me=le&&ca.find(Re=>Re.name===le[1].toLowerCase());if(me){cn(me),I(le[2]),mr(!1);return}}I(xe),mr(!1)},onSelect:ie=>Jr(ie.currentTarget.selectionStart),onCompositionStart:()=>{jr.current=!0},onCompositionEnd:()=>{jr.current=!1},onKeyDown:ie=>{if(Br){if(ie.key==="ArrowDown"||ie.key==="ArrowUp"){ie.preventDefault();const xe=ie.key==="ArrowDown"?1:-1;Nr((Mr+xe+zr.length)%zr.length);return}if(ie.key==="Enter"||ie.key==="Tab"){ie.preventDefault(),xr(zr[Mr]);return}if(ie.key==="Escape"){ie.preventDefault(),mr(!0);return}}if(Qt&&ie.key==="Backspace"&&ie.currentTarget.selectionStart===0&&ie.currentTarget.selectionEnd===0){ie.preventDefault(),yr();return}ie.key==="Enter"&&!ie.shiftKey&&!ie.nativeEvent.isComposing&&(ie.preventDefault(),Fr({queue:ie.metaKey||ie.ctrlKey}))}})]}),h.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[h.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:sn.ref,children:[h.jsx("button",{type:"button",className:"composer-bare inline-flex items-center justify-center rounded-sm p-1.5 text-text transition-[background] duration-150 ease-standard hover:bg-surface",title:"Data sources","aria-label":"Data sources","aria-haspopup":"dialog","aria-expanded":sn.open,onClick:()=>sn.setOpen(ie=>!ie),children:h.jsx(fR,{size:16})}),sn.open&&h.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] left-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-[0_10px_26px_rgba(0,_0,_0,_0.16)]",children:[h.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:"Data sources"}),h.jsx(hL,{})]})]}),h.jsx("input",{ref:Pe,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:ie=>{gi(Array.from(ie.target.files??[])),ie.target.value=""}}),h.jsx("button",{type:"button",className:"composer-attach inline-flex shrink-0 items-center justify-center w-7.5 h-7.5 rounded-sm text-text cursor-pointer transition-[background] duration-150 ease-standard [&:hover]:bg-surface",title:"Attach a PDF or image","aria-label":"Attach a PDF or image",onClick:()=>{var ie;return(ie=Pe.current)==null?void 0:ie.click()},children:h.jsx(GM,{size:16})}),ei&&h.jsxs("button",{type:"button",className:"plan-indicator group inline-flex h-7.5 shrink-0 items-center gap-1.5 rounded-sm bg-surface px-2 text-sm text-muted transition-colors hover:text-text focus-visible:text-text",title:"Exit Plan mode","aria-label":"Exit Plan mode",onClick:()=>void hs(),children:[h.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[h.jsx(NM,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),h.jsx(Yr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),h.jsx("span",{children:"Plan"})]}),h.jsx("div",{className:"min-w-0 flex-1"}),h.jsx(RG,{value:$t,onSelect:Jt,permissionChoices:We!=null&&We.agentReady?(St==null?void 0:St.permissionModes)??[]:[],defaultPermissionId:(St==null?void 0:St.defaultPermissionMode)??null,onSelectPermission:vi,reasoningChoices:We!=null&&We.agentReady?qn.choices:[],defaultReasoningId:qn.defaultId,onSelectReasoning:Hr,onHarnesses:ut,lockHarness:!!pt}),h.jsx(LG,{usage:pt==null?void 0:pt.contextUsage}),Ln&&!Vn?h.jsx("button",{className:"send-btn inline-flex shrink-0 items-center justify-center w-8 h-8 rounded-md bg-primary text-background transition-[background,opacity] duration-100 ease-standard [&:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))] [&:disabled]:opacity-40 [&:disabled]:cursor-default [&.stop]:bg-surface [&.stop]:text-text [&.stop:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--surface)_88%,_var(--text))] stop",title:"Stop","aria-label":"Stop",onClick:Za,children:h.jsx(Yr,{size:16})}):h.jsx("button",{className:"send-btn inline-flex shrink-0 items-center justify-center w-8 h-8 rounded-md bg-primary text-background transition-[background,opacity] duration-100 ease-standard [&:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))] [&:disabled]:opacity-40 [&:disabled]:cursor-default [&.stop]:bg-surface [&.stop]:text-text [&.stop:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--surface)_88%,_var(--text))]",title:"Send","aria-label":"Send",onClick:()=>void Fr(),disabled:!(We!=null&&We.agentReady)||!Qt&&!te.trim()&&re.length===0&&O.length===0,children:h.jsx(J8,{size:16})})]})]})]})]})]})}const Lw=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function tW({sessionId:e,spawnPartId:t,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:l}){const[u,d]=R.useState(null),m=R.useRef(null),f=R.useRef(null),g=R.useRef(!0);if(R.useLayoutEffect(()=>{g.current=!0;const k=m.current;k&&(k.scrollTop=k.scrollHeight)},[e,t]),R.useLayoutEffect(()=>{const k=m.current;k&&g.current&&(k.scrollTop=k.scrollHeight)},[u]),R.useEffect(()=>{const k=m.current,S=f.current;if(!k||!S)return;const x=new ResizeObserver(()=>{g.current&&(k.scrollTop=k.scrollHeight)});return x.observe(S),x.observe(k),()=>x.disconnect()},[u===null]),R.useEffect(()=>{let k=!0;const S=new Set;let x=0;const _=()=>{const y=++x;md(e).then(({messages:C})=>{!k||y!==x||d(T=>{if(!T)return C;const E=C.map(N=>S.has(N.id)?T.find(D=>D.id===N.id)??N:N),j=new Set(C.map(N=>N.id));return[...E,...T.filter(N=>!j.has(N.id))]})}).catch(()=>k&&d(C=>C??[]))};_();const w=Ad(y=>{if(y.type==="reconnected"){S.clear(),_();return}y.type!=="message"||y.sessionId!==e||(S.add(y.message.id),d(C=>{const T=C?C.slice():[],E=T.findIndex(j=>j.id===y.message.id);return E===-1?T.push(y.message):T[E]=y.message,T}))});return()=>{k=!1,w()}},[e]),u===null)return h.jsx("div",{className:ja,children:h.jsx("div",{className:Lw,children:h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:"Loading…"})})});let b=null;for(const k of u)if(b=I2(k.parts,t),b)break;return h.jsx("div",{className:ja,children:h.jsx("div",{className:Lw,ref:m,onScroll:k=>{const S=k.currentTarget;g.current=S.scrollHeight-S.scrollTop-S.clientHeight<60},children:h.jsx("div",{ref:f,children:b?h.jsx(qV,{spawn:b,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:l}):h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:"This sub-agent is no longer available."})})})})}function Ow(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.push.apply(n,r)}return n}function Wt(e){for(var t=1;t=0||(m[u]=o[u]);return m})(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Bt(e,t){return NC(e)||(function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var a,o,l,u,d=[],m=!0,f=!1;try{if(l=(i=i.call(n)).next,r===0){if(Object(i)!==i)return;m=!1}else for(;!(m=(a=l.call(i)).done)&&(d.push(a.value),d.length!==r);m=!0);}catch(g){f=!0,o=g}finally{try{if(!m&&i.return!=null&&(u=i.return(),Object(u)!==u))return}finally{if(f)throw o}}return d}})(e,t)||Lp(e,t)||MC()}function TC(e){return NC(e)||jC(e)||Lp(e)||MC()}function Bi(e){return(function(t){if(Array.isArray(t))return Ev(t)})(e)||jC(e)||Lp(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 NC(e){if(Array.isArray(e))return e}function jC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Lp(e,t){if(e){if(typeof e=="string")return Ev(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)?Ev(e,t):void 0}}function Ev(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:i}}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 a,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return o=u.done,u},e:function(u){l=!0,a=u},f:function(){try{o||n.return==null||n.return()}finally{if(l)throw a}}}}var V0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yh(e,t){return e(t={exports:{}},t.exports),t.exports}var Li=yh((function(e){/*! +Its transcript is permanently removed.`)){try{await zD(ie.id)}catch(ae){window.alert(`Failed to delete "${ye}": ${ae instanceof Error?ae.message:String(ae)}`);return}Ls(ie.id)}}const Yn=R.useCallback(ie=>{if(!F)return Promise.resolve(!1);const ye=F;return Ke({type:"busy",sessionId:ye,busy:!0}),ar(()=>WD(ye,ie)).then(()=>!0).catch(()=>!1).finally(()=>{gd(ye).then(({messages:K,queued:ae,activeLeafId:he})=>Ke({type:"seed",sessionId:ye,messages:K,queued:ae,activeLeafId:he})).catch(()=>{}),hf(e).then(K=>{var ae;return Ke({type:"busy",sessionId:ye,busy:!!((ae=K.find(he=>he.id===ye))!=null&&ae.busy)})}).catch(()=>{})})},[F,e,ar]),Ja=z.filter(ie=>Lw(Y,ie.archived)),Os=/Mac|iPhone|iPad/.test(navigator.platform),yr=Os?"⌘ ⇧ Enter":"Ctrl + Shift + Enter",gr=Os?"⌘ Enter":"Ctrl + Enter",hs=R.useCallback(()=>{Q("active"),U(null),l("chat")},[l]),Mr=R.useCallback(ie=>{Q("all"),U(ie),l("chat")},[l]);R.useEffect(()=>{const ie=ye=>{ye.repeat||ye.key!=="Enter"||!ye.metaKey&&!ye.ctrlKey||ye.altKey||!ye.shiftKey||(ye.preventDefault(),hs())};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[hs]);const Xi=h.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-2.5 mr-3.5 mb-2.5 ml-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:py-1 [&_.rail-body]:px-2 floating-panel border border-border rounded-lg shadow-[0_6px_24px_color-mix(in_oklab,_var(--text)_5%,_transparent),_0_1px_4px_color-mix(in_oklab,_var(--text)_4%,_transparent)] overflow-visible",children:[r,h.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${d?"active":""}`,onClick:C,children:[h.jsx(Ad,{size:15}),"Files"]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${m?"active":""}`,"data-onboarding":"nav-artifacts",onClick:g,children:[h.jsx(a_,{size:15}),"Artifacts"]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${c?"active":""}`,onClick:f,children:[h.jsx(Nb,{size:15}),"Experiments"]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${o==="skills"?"active":""}`,onClick:()=>l("skills"),children:[h.jsx(Oj,{size:15}),"Skills"]}),jG.map(ie=>h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${o!=="chat"&&o!=="skills"&&ie.activeTabs.includes(o)?"active":""}`,"data-onboarding":ie.id==="compute"?"nav-compute":void 0,onClick:()=>l(ie.id),children:[ie.icon,ie.label]},ie.id))]}),h.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pr-2.5 pb-1.5 pl-4.5",children:[h.jsx("div",{className:"rail-section-label p-0 text-md font-medium text-subtext",children:((Sn=jC.find(ie=>ie.id===Y))==null?void 0:Sn.railLabel)??"Recents"}),h.jsxs("div",{className:"rail-section-actions flex items-center gap-0.5",children:[h.jsxs("button",{className:"rail-section-new inline-flex items-center gap-1 py-[3px] px-1.5 rounded-sm text-subtext text-xs font-medium [&:hover]:text-text [&:hover]:bg-surface tip-up [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":yr,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:hs,children:[h.jsx(o_,{size:13}),"Task"]}),h.jsx(nW,{value:Y,onChange:Q})]})]}),h.jsxs("div",{className:"rail-body",children:[Ja.map(ie=>h.jsx(aW,{session:ie,active:ie.id===F&&o==="chat",unread:V.has(ie.id),busy:ut.busySessions.has(ie.id),waiting:wn.has(ie.id),revealTitle:ve.get(ie.id),onOpen:()=>{U(ie.id),e===ug&&WG(ie.id),X(ye=>{if(!ye.has(ie.id))return ye;const K=new Set(ye);return K.delete(ie.id),K}),l("chat")},onRename:ye=>_i(ie,ye),onSetArchived:ye=>Qa(ie,ye),onDelete:()=>void bn(ie)},ie.id)),Ja.length===0&&h.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-md text-muted",children:Y==="archived"?"No archived sessions":z.length>0?"No active sessions":"No sessions yet"})]})]}),Is=`chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&.rail-hidden]:max-w-none [&.rail-hidden]:py-0 [&.rail-hidden]:px-0.5 [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:left-0 [&::after]:right-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none${i?"":" rail-hidden"}`,Ft=!i&&h.jsx("button",{className:nr,title:"Show sidebar","aria-label":"Show sidebar",onClick:a,children:h.jsx(sS,{size:15})});return o!=="chat"?h.jsxs(h.Fragment,{children:[i&&Xi,h.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!i&&h.jsx("div",{className:Is,children:Ft}),h.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:D})]})]}):h.jsxs(h.Fragment,{children:[i&&Xi,h.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[h.jsxs("div",{className:Is,children:[Ft,h.jsx("div",{className:Nd,title:Jt?((Jr=Jt.title)==null?void 0:Jr.trim())||"Untitled":"New session",children:Jt?h.jsx(MC,{title:((ua=Jt.title)==null?void 0:ua.trim())||"Untitled",animate:Ms!==void 0},Ms??"static"):"New session"}),N&&h.jsx("button",{className:nr,"data-tip":"About this demo","aria-label":"About this demo",onClick:N,children:h.jsx(Xj,{size:15})})]}),Xa?h.jsxs("div",{className:"chat-loading flex-1 flex items-center justify-center gap-3 text-subtext text-xl p-5 [&_.spinner]:w-5.5 [&_.spinner]:h-5.5 [&_.spinner]:border-[3px]","aria-live":"polite","aria-busy":"true",children:[h.jsx("span",{className:Pt}),h.jsx("span",{children:"Loading conversation…"})]}):Wi?h.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:At,onScroll:ie=>{const ye=ie.currentTarget;Xt.current=ye.scrollHeight-ye.scrollTop-ye.clientHeight<60,qn.dismiss()},children:h.jsxs("div",{className:"chat-thread-inner max-w-readable my-0 mx-auto pt-4 px-4 pb-8 flex flex-col gap-4",ref:xt,children:[h.jsx(tW,{messages:or,allMessages:bi,canFork:js,onFork:Xo,onSelectFork:Yi,busy:Dn,onOpenFile:Wl,onOpenRun:k,onOpenSpawnedSession:Mr,runExperimentName:S,onOpenExperiment:x,experimentName:v,onRespond:Yn,onOpenPlan:Rs,onOpenSubagent:Vl,skills:la}),Dn&&(Vi?h.jsx("div",{className:"working flex items-center gap-2 text-subtext text-md pt-0.5 px-0 pb-2 [&.awaiting]:italic awaiting",children:"Waiting for your input…"}):h.jsxs("div",{className:"working flex items-center gap-2 text-subtext text-md pt-0.5 px-0 pb-2 [&.awaiting]:italic",children:[h.jsx("span",{className:Pt})," ",Gi?"Working…":"Thinking…"]}))]})}):h.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center @container text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[h.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:h.jsx(f_,{})}),h.jsx("h2",{children:"What should we research?"}),h.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-semibold",children:[h.jsx(Ad,{size:19}),h.jsx("span",{children:t})]}),h.jsxs("div",{className:"chat-empty-starters grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2.5 w-[min(100%,_620px)] mt-19 [@container((min-width:_500px))]:grid-cols-[repeat(4,_minmax(0,_1fr))] [@container((min-width:_500px))]:w-[min(100%,_720px)]",children:[h.jsxs("button",{type:"button",className:"chat-empty-starter min-h-28 flex flex-col items-start justify-between gap-5 p-4 border border-border rounded-lg text-text bg-background shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_5%,_transparent)] text-left text-md font-medium leading-[1.35] transition-[border-color,background,translate] duration-120 ease-standard [&:hover]:border-muted [&:hover]:bg-surface [&:hover]:-translate-y-px [&.blue_svg]:text-accent-blue [&.purple_svg]:text-accent-purple [&.green_svg]:text-accent-green [&.orange_svg]:text-accent-orange blue",onClick:()=>{var ie;ln(null),I("Explore this codebase and explain its architecture, key components, and open research questions."),(ie=dt.current)==null||ie.focus()},children:[h.jsx(Y8,{size:16}),h.jsx("span",{children:"Explore this codebase"})]}),h.jsxs("button",{type:"button",className:"chat-empty-starter min-h-28 flex flex-col items-start justify-between gap-5 p-4 border border-border rounded-lg text-text bg-background shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_5%,_transparent)] text-left text-md font-medium leading-[1.35] transition-[border-color,background,translate] duration-120 ease-standard [&:hover]:border-muted [&:hover]:bg-surface [&:hover]:-translate-y-px [&.blue_svg]:text-accent-blue [&.purple_svg]:text-accent-purple [&.green_svg]:text-accent-green [&.orange_svg]:text-accent-orange purple",onClick:()=>{var ye;const ie=Ui.find(K=>K.name==="reproduce-paper");n&&ie?(ln(ie),I("")):(ln(null),I(n?"/reproduce-paper ":"Find and summarize the research most relevant to this project.")),(ye=dt.current)==null||ye.focus()},children:[h.jsx(lh,{size:16}),h.jsx("span",{children:n?"Reproduce the linked paper":"Review relevant literature"})]}),h.jsxs("button",{type:"button",className:"chat-empty-starter min-h-28 flex flex-col items-start justify-between gap-5 p-4 border border-border rounded-lg text-text bg-background shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_5%,_transparent)] text-left text-md font-medium leading-[1.35] transition-[border-color,background,translate] duration-120 ease-standard [&:hover]:border-muted [&:hover]:bg-surface [&:hover]:-translate-y-px [&.blue_svg]:text-accent-blue [&.purple_svg]:text-accent-purple [&.green_svg]:text-accent-green [&.orange_svg]:text-accent-orange green",onClick:()=>{var ie;ln(null),I("Set up and run an experiment for this project, including a baseline and meaningful variants."),(ie=dt.current)==null||ie.focus()},children:[h.jsx(Nb,{size:16}),h.jsx("span",{children:"Run an experiment"})]}),h.jsxs("button",{type:"button",className:"chat-empty-starter min-h-28 flex flex-col items-start justify-between gap-5 p-4 border border-border rounded-lg text-text bg-background shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_5%,_transparent)] text-left text-md font-medium leading-[1.35] transition-[border-color,background,translate] duration-120 ease-standard [&:hover]:border-muted [&:hover]:bg-surface [&:hover]:-translate-y-px [&.blue_svg]:text-accent-blue [&.purple_svg]:text-accent-purple [&.green_svg]:text-accent-green [&.orange_svg]:text-accent-orange orange",onClick:()=>{var ie;ln(null),I("Analyze the latest experiment results and recommend the most useful next iteration."),(ie=dt.current)==null||ie.focus()},children:[h.jsx(X8,{size:16}),h.jsx("span",{children:"Analyze results"})]})]})]}),qn.action&&h.jsxs("button",{type:"button",className:"chat-selection-action fixed z-50 inline-flex items-center gap-1.5 py-1.5 px-3 border border-border rounded-md bg-background text-text text-sm font-medium shadow-[0_2px_8px_rgba(0,_0,_0,_0.10)] whitespace-nowrap [&:hover]:bg-surface",style:{left:qn.action.x,top:qn.action.top,transform:"translateX(-50%)"},onMouseDown:ie=>ie.preventDefault(),onClick:qn.add,children:[h.jsx(iS,{size:14}),"Ask about this"]}),h.jsxs("div",{className:"composer pt-0 px-3 pb-3 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&::before]:content-[''] [&::before]:absolute [&::before]:bottom-full [&::before]:left-0 [&::before]:right-0 [&::before]:h-6 [&::before]:bg-[linear-gradient(to_top,_var(--base),_transparent)] [&::before]:pointer-events-none [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[gn&&!(ql&&gn.promptId===ql.promptId)&&h.jsx(Nq,{synthesized:gn.synthesized,agentLabel:Jt?hd[Jt.harness]:"The agent",showResumeModes:(Jt==null?void 0:Jt.harness)==="claude-code",onView:()=>Rs==null?void 0:Rs(gn.plan,gn.promptId),onApprove:ie=>Yn({promptId:gn.promptId,approve:!0,...ie?{resumeMode:ie}:{}}),onReject:()=>Yn({promptId:gn.promptId,approve:!1}),onRevise:ie=>{F&&ds({sessionId:F,promptId:gn.promptId}),Yn({promptId:gn.promptId,approve:!1,note:ie})}}),Hr.length>0&&h.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Hr.map(ie=>h.jsxs("div",{className:"queued-chip flex items-center gap-2 py-1.5 px-2.5 text-sm text-subtext bg-surface border border-border rounded-sm",title:ie.text,children:[h.jsx(tM,{size:13,className:"shrink-0 text-muted"}),h.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:ie.text}),h.jsx("span",{className:"shrink-0 text-xs text-muted uppercase tracking-wide",children:"Queued"}),h.jsx("button",{title:"Cancel queued message","aria-label":"Cancel queued message",onClick:()=>Ds(ie.id),className:"shrink-0 inline-flex items-center justify-center w-4 h-4 p-0 border-0 rounded-full text-muted cursor-pointer [&:hover]:bg-text [&:hover]:text-background",children:h.jsx(Vr,{size:11})})]},ie.id))}),h.jsxs("div",{className:"composer-box relative flex flex-col border border-border rounded-md bg-background","data-onboarding":"composer",children:[Ve&&!Ve.agentReady&&h.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-xs leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[h.jsxs("strong",{children:[Ve.name," is unavailable."]})," ",Ve.agentNote?L2(Ve.agentNote):"Re-check its setup."]}),zr&&h.jsx(DG,{skills:Ir,activeIndex:jr,onPick:_r,onHover:Tr}),O.length>0&&h.jsx(gV,{annotations:O,onClear:()=>{H([]),window.requestAnimationFrame(()=>{var ie;return(ie=dt.current)==null?void 0:ie.focus()})},onRemove:ie=>{const ye=O.filter(K=>K.id!==ie);H(ye),ye.length===0&&window.requestAnimationFrame(()=>{var K;return(K=dt.current)==null?void 0:K.focus()})}}),re.length>0&&h.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:re.map((ie,ye)=>{const K=()=>ce(ae=>ae.filter((he,Ee)=>Ee!==ye));return ie.mediaType==="application/pdf"?h.jsxs("div",{className:"attachment-file [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background relative inline-flex items-center gap-2 max-w-55 py-2 px-2.5 border border-border rounded-sm text-text bg-surface [&_svg]:shrink-0 [&_svg]:text-muted",title:ie.name,children:[h.jsx(oh,{size:22}),h.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:ie.name??"document.pdf"}),h.jsx("button",{title:"Remove file","aria-label":"Remove file",onClick:K,children:h.jsx(Vr,{size:11})})]},ye):h.jsxs("div",{className:"attachment-thumb relative [&_img]:w-13 [&_img]:h-13 [&_img]:object-cover [&_img]:border [&_img]:border-border [&_img]:rounded-sm [&_img]:block [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background",children:[h.jsx("img",{src:ie.dataUrl,alt:"pasted"}),h.jsx("button",{title:"Remove image","aria-label":"Remove image",onClick:K,children:h.jsx(Vr,{size:11})})]},ye)})}),me&&h.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:me}),B&&h.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:B}),h.jsxs("div",{className:"composer-input relative flex overflow-hidden [&_textarea]:flex-1",children:[Zt&&h.jsxs("span",{ref:fi,className:"skill-chip inline-flex items-center py-px px-[7px] font-mono text-md font-medium text-primary bg-primary-subtle border border-border-variant rounded-sm composer-chip absolute top-[9px] left-3 z-1 pointer-events-none",children:["/",Zt.name]}),h.jsx("textarea",{ref:dt,value:te,style:Zt?{textIndent:oa}:void 0,onScroll:ls,placeholder:Wn?"Type a custom answer…":Zt?["reproduce-paper","paper-to-marimo"].includes(Zt.name)&&n?`[optional — defaults to ${n} on your default compute]`:Zt.argHint:Ka&&Ve?`Steer ${hd[Ve.id]}… (${gr} to queue)`:$t?Ve!=null&&Ve.agentReady?`Message ${hd[$t.harness]}… ( / for commands)`:`${hd[$t.harness]} is unavailable — open the model picker`:"Ask the research agent… ( / for commands)",rows:2,onPaste:Mn,onDragOver:ie=>{ie.dataTransfer.types.includes("Files")&&ie.preventDefault()},onDrop:ie=>{ie.dataTransfer.files.length!==0&&(ie.preventDefault(),pi(Array.from(ie.dataTransfer.files)))},onChange:ie=>{const ye=ie.target.value,K=ie.target.selectionStart;Zr(K);const ae=K>0&&/\s/.test(ye[K-1])?Cw(ye,K-1):null;if((ae==null?void 0:ae.query)==="plan"){Ya(ye,ae);return}if(!Zt&&!Wn&&!Nr.current){const he=ye.match(/^\/(\S+)\s([\s\S]*)$/),Ee=he&&la.find(Me=>Me.name===he[1].toLowerCase());if(Ee){ln(Ee),I(he[2]),pr(!1);return}}I(ye),pr(!1)},onSelect:ie=>Zr(ie.currentTarget.selectionStart),onCompositionStart:()=>{Nr.current=!0},onCompositionEnd:()=>{Nr.current=!1},onKeyDown:ie=>{if(zr){if(ie.key==="ArrowDown"||ie.key==="ArrowUp"){ie.preventDefault();const ye=ie.key==="ArrowDown"?1:-1;Tr((jr+ye+Ir.length)%Ir.length);return}if(ie.key==="Enter"||ie.key==="Tab"){ie.preventDefault(),_r(Ir[jr]);return}if(ie.key==="Escape"){ie.preventDefault(),pr(!0);return}}if(Zt&&ie.key==="Backspace"&&ie.currentTarget.selectionStart===0&&ie.currentTarget.selectionEnd===0){ie.preventDefault(),xr();return}ie.key==="Enter"&&!ie.shiftKey&&!ie.nativeEvent.isComposing&&(ie.preventDefault(),$r({queue:ie.metaKey||ie.ctrlKey}))}})]}),h.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[h.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:rn.ref,children:[h.jsx("button",{type:"button",className:"composer-bare inline-flex items-center justify-center rounded-sm p-1.5 text-text transition-[background] duration-150 ease-standard hover:bg-surface",title:"Data sources","aria-label":"Data sources","aria-haspopup":"dialog","aria-expanded":rn.open,onClick:()=>rn.setOpen(ie=>!ie),children:h.jsx(bR,{size:16})}),rn.open&&h.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] left-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-[0_10px_26px_rgba(0,_0,_0,_0.16)]",children:[h.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:"Data sources"}),h.jsx(gL,{})]})]}),h.jsx("input",{ref:Fe,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:ie=>{pi(Array.from(ie.target.files??[])),ie.target.value=""}}),h.jsx("button",{type:"button",className:"composer-attach inline-flex shrink-0 items-center justify-center w-7.5 h-7.5 rounded-sm text-text cursor-pointer transition-[background] duration-150 ease-standard [&:hover]:bg-surface",title:"Attach a PDF or image","aria-label":"Attach a PDF or image",onClick:()=>{var ie;return(ie=Fe.current)==null?void 0:ie.click()},children:h.jsx(ZM,{size:16})}),Qr&&h.jsxs("button",{type:"button",className:"plan-indicator group inline-flex h-7.5 shrink-0 items-center gap-1.5 rounded-sm bg-surface px-2 text-sm text-muted transition-colors hover:text-text focus-visible:text-text",title:"Exit Plan mode","aria-label":"Exit Plan mode",onClick:()=>void us(),children:[h.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[h.jsx(OM,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),h.jsx(Vr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),h.jsx("span",{children:"Plan"})]}),h.jsx("div",{className:"min-w-0 flex-1"}),h.jsx(zG,{value:$t,onSelect:Qt,permissionChoices:Ve!=null&&Ve.agentReady?(wt==null?void 0:wt.permissionModes)??[]:[],defaultPermissionId:(wt==null?void 0:wt.defaultPermissionMode)??null,onSelectPermission:gi,reasoningChoices:Ve!=null&&Ve.agentReady?Gn.choices:[],defaultReasoningId:Gn.defaultId,onSelectReasoning:Br,onHarnesses:ct,lockHarness:!!ft}),h.jsx(HG,{usage:ft==null?void 0:ft.contextUsage}),Dn&&!Wn?h.jsx("button",{className:"send-btn inline-flex shrink-0 items-center justify-center w-8 h-8 rounded-md bg-primary text-background transition-[background,opacity] duration-100 ease-standard [&:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))] [&:disabled]:opacity-40 [&:disabled]:cursor-default [&.stop]:bg-surface [&.stop]:text-text [&.stop:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--surface)_88%,_var(--text))] stop",title:"Stop","aria-label":"Stop",onClick:Za,children:h.jsx(Vr,{size:16})}):h.jsx("button",{className:"send-btn inline-flex shrink-0 items-center justify-center w-8 h-8 rounded-md bg-primary text-background transition-[background,opacity] duration-100 ease-standard [&:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))] [&:disabled]:opacity-40 [&:disabled]:cursor-default [&.stop]:bg-surface [&.stop]:text-text [&.stop:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--surface)_88%,_var(--text))]",title:"Send","aria-label":"Send",onClick:()=>void $r(),disabled:!(Ve!=null&&Ve.agentReady)||!Zt&&!te.trim()&&re.length===0&&O.length===0,children:h.jsx(eS,{size:16})})]})]})]})]})]})}const Ow=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function lW({sessionId:e,spawnPartId:t,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:l}){const[c,d]=R.useState(null),m=R.useRef(null),f=R.useRef(null),g=R.useRef(!0);if(R.useLayoutEffect(()=>{g.current=!0;const k=m.current;k&&(k.scrollTop=k.scrollHeight)},[e,t]),R.useLayoutEffect(()=>{const k=m.current;k&&g.current&&(k.scrollTop=k.scrollHeight)},[c]),R.useEffect(()=>{const k=m.current,S=f.current;if(!k||!S)return;const x=new ResizeObserver(()=>{g.current&&(k.scrollTop=k.scrollHeight)});return x.observe(S),x.observe(k),()=>x.disconnect()},[c===null]),R.useEffect(()=>{let k=!0;const S=new Set;let x=0;const v=()=>{const y=++x;gd(e).then(({messages:C})=>{!k||y!==x||d(N=>{if(!N)return C;const E=C.map(T=>S.has(T.id)?N.find(D=>D.id===T.id)??T:T),M=new Set(C.map(T=>T.id));return[...E,...N.filter(T=>!M.has(T.id))]})}).catch(()=>k&&d(C=>C??[]))};v();const w=Td(y=>{if(y.type==="reconnected"){S.clear(),v();return}y.type!=="message"||y.sessionId!==e||(S.add(y.message.id),d(C=>{const N=C?C.slice():[],E=N.findIndex(M=>M.id===y.message.id);return E===-1?N.push(y.message):N[E]=y.message,N}))});return()=>{k=!1,w()}},[e]),c===null)return h.jsx("div",{className:ja,children:h.jsx("div",{className:Ow,children:h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:"Loading…"})})});let b=null;for(const k of c)if(b=H2(k.parts,t),b)break;return h.jsx("div",{className:ja,children:h.jsx("div",{className:Ow,ref:m,onScroll:k=>{const S=k.currentTarget;g.current=S.scrollHeight-S.scrollTop-S.clientHeight<60},children:h.jsx("div",{ref:f,children:b?h.jsx(ZV,{spawn:b,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:l}):h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:"This sub-agent is no longer available."})})})})}function Iw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.push.apply(n,r)}return n}function Wt(e){for(var t=1;t=0||(m[c]=o[c]);return m})(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zt(e,t){return DC(e)||(function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var a,o,l,c,d=[],m=!0,f=!1;try{if(l=(i=i.call(n)).next,r===0){if(Object(i)!==i)return;m=!1}else for(;!(m=(a=l.call(i)).done)&&(d.push(a.value),d.length!==r);m=!0);}catch(g){f=!0,o=g}finally{try{if(!m&&i.return!=null&&(c=i.return(),Object(c)!==c))return}finally{if(f)throw o}}return d}})(e,t)||Ip(e,t)||OC()}function RC(e){return DC(e)||LC(e)||Ip(e)||OC()}function Ii(e){return(function(t){if(Array.isArray(t))return Nv(t)})(e)||LC(e)||Ip(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 DC(e){if(Array.isArray(e))return e}function LC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ip(e,t){if(e){if(typeof e=="string")return Nv(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)?Nv(e,t):void 0}}function Nv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}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 a,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return o=c.done,c},e:function(c){l=!0,a=c},f:function(){try{o||n.return==null||n.return()}finally{if(l)throw a}}}}var W0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wh(e,t){return e(t={exports:{}},t.exports),t.exports}var Ri=wh((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=[],i=0;i-1?_.slice(0,y):C;switch(C){case"diff":S--;break e;case"deleted":case"new":var T=_.slice(y+1);T.indexOf("file mode")===0&&(o[C==="new"?"newMode":"oldMode"]=T.slice(10));break;case"similarity":o.similarity=parseInt(_.split(" ")[2],10);break;case"index":var E=_.slice(y+1).split(" "),j=E[0].split("..");o.oldRevision=j[0],o.newRevision=j[1],E[1]&&(o.oldMode=o.newMode=E[1]);break;case"copy":case"rename":var N=_.slice(y+1);N.indexOf("from")===0?o.oldPath=N.slice(5):o.newPath=N.slice(3),w=C;break;case"---":var D=_.slice(y+1),z=b[++S].slice(4);D==="/dev/null"?(z=z.slice(2),w="add"):z==="/dev/null"?(D=D.slice(2),w="delete"):(w="modify",D=D.slice(2),z=z.slice(2)),D&&(o.oldPath=D),z&&(o.newPath=z),g=5;break e}}o.type=w||"modify"}else if(x.indexOf("Binary")===0)o.isBinary=!0,o.type=x.indexOf("/dev/null and")>=0?"add":x.indexOf("and /dev/null")>=0?"delete":"modify",g=2,o=null;else if(g===5)if(x.indexOf("@@")===0){var $=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(x);l={content:x,oldStart:$[1]-0,newStart:$[4]-0,oldLines:$[3]-0||1,newLines:$[6]-0||1,changes:[]},o.hunks.push(l),u=l.oldStart,d=l.newStart}else{var F=x.slice(0,1),U={content:x.slice(1)};switch(F){case"+":U.type="insert",U.isInsert=!0,U.lineNumber=d,d++;break;case"-":U.type="delete",U.isDelete=!0,U.lineNumber=u,u++;break;case" ":U.type="normal",U.isNormal=!0,U.oldLineNumber=u,U.newLineNumber=d,u++,d++;break;case"\\":var V=l.changes[l.changes.length-1];V.isDelete||(o.newEndingNewLine=!1),V.isInsert||(o.oldEndingNewLine=!1)}U.type&&l.changes.push(U)}S++}return f}};e.exports=i})()}));function Vo(e){return e.type==="insert"}function Hi(e){return e.type==="delete"}function Ha(e){return e.type==="normal"}function sW(e,t){var n=t.nearbySequences==="zip"?(function(r){var i=r.reduce((function(a,o,l){var u=Bt(a,3),d=u[0],m=u[1],f=u[2];return m?Vo(o)&&f>=0?(d.splice(f+1,0,o),[d,o,f+2]):(d.push(o),[d,o,Hi(o)&&Hi(m)?f:l]):(d.push(o),[d,o,Hi(o)?l:-1])}),[[],null,-1]);return Bt(i,1)[0]})(e.changes):e.changes;return Wt(Wt({},e),{},{isPlain:!1,changes:n})}function Av(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=(function(r){if(r.startsWith("diff --git"))return r;var i=r.indexOf(` +*/(function(){var t={}.hasOwnProperty;function n(){for(var r=[],i=0;i-1?v.slice(0,y):C;switch(C){case"diff":S--;break e;case"deleted":case"new":var N=v.slice(y+1);N.indexOf("file mode")===0&&(o[C==="new"?"newMode":"oldMode"]=N.slice(10));break;case"similarity":o.similarity=parseInt(v.split(" ")[2],10);break;case"index":var E=v.slice(y+1).split(" "),M=E[0].split("..");o.oldRevision=M[0],o.newRevision=M[1],E[1]&&(o.oldMode=o.newMode=E[1]);break;case"copy":case"rename":var T=v.slice(y+1);T.indexOf("from")===0?o.oldPath=T.slice(5):o.newPath=T.slice(3),w=C;break;case"---":var D=v.slice(y+1),z=b[++S].slice(4);D==="/dev/null"?(z=z.slice(2),w="add"):z==="/dev/null"?(D=D.slice(2),w="delete"):(w="modify",D=D.slice(2),z=z.slice(2)),D&&(o.oldPath=D),z&&(o.newPath=z),g=5;break e}}o.type=w||"modify"}else if(x.indexOf("Binary")===0)o.isBinary=!0,o.type=x.indexOf("/dev/null and")>=0?"add":x.indexOf("and /dev/null")>=0?"delete":"modify",g=2,o=null;else if(g===5)if(x.indexOf("@@")===0){var $=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(x);l={content:x,oldStart:$[1]-0,newStart:$[4]-0,oldLines:$[3]-0||1,newLines:$[6]-0||1,changes:[]},o.hunks.push(l),c=l.oldStart,d=l.newStart}else{var F=x.slice(0,1),U={content:x.slice(1)};switch(F){case"+":U.type="insert",U.isInsert=!0,U.lineNumber=d,d++;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=d,c++,d++;break;case"\\":var V=l.changes[l.changes.length-1];V.isDelete||(o.newEndingNewLine=!1),V.isInsert||(o.oldEndingNewLine=!1)}U.type&&l.changes.push(U)}S++}return f}};e.exports=i})()}));function Wo(e){return e.type==="insert"}function zi(e){return e.type==="delete"}function Ha(e){return e.type==="normal"}function hW(e,t){var n=t.nearbySequences==="zip"?(function(r){var i=r.reduce((function(a,o,l){var c=zt(a,3),d=c[0],m=c[1],f=c[2];return m?Wo(o)&&f>=0?(d.splice(f+1,0,o),[d,o,f+2]):(d.push(o),[d,o,zi(o)&&zi(m)?f:l]):(d.push(o),[d,o,zi(o)?l:-1])}),[[],null,-1]);return zt(i,1)[0]})(e.changes):e.changes;return Wt(Wt({},e),{},{isPlain:!1,changes:n})}function jv(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=(function(r){if(r.startsWith("diff --git"))return r;var i=r.indexOf(` `),a=r.indexOf(` -`,i+1),o=r.slice(0,i),l=r.slice(i+1,a),u=o.split(" ").slice(1,-3).join(" "),d=l.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(u," b/").concat(d),"index 1111111..2222222 100644","--- a/".concat(u),"+++ b/".concat(d),r.slice(a+1)].join(` -`)})(e.trimStart());return iW.parse(n).map((function(r){return(function(i,a){var o=i.hunks.map((function(l){return sW(l,a)}));return Wt(Wt({},i),{},{hunks:o})})(r,t)}))}function aW(e){return e[0]}function oW(e){return e[e.length-1]}function Tv(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function Hd(e){return e==="old"?function(t){return Vo(t)?-1:Ha(t)?t.oldLineNumber:t.lineNumber}:function(t){return Hi(t)?-1:Ha(t)?t.newLineNumber:t.lineNumber}}function DC(e,t){return function(n,r){var i=n[e],a=i+n[t];return r>=i&&r=a&&i-1},mW=function(e,t){var n=this.__data__,r=Op(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Nc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tl))return!1;var d=a.get(e),m=a.get(t);if(d&&m)return d==t&&m==e;var f=-1,g=!0,b=2&n?new QW:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},xn={};xn["[object Float32Array]"]=xn["[object Float64Array]"]=xn["[object Int8Array]"]=xn["[object Int16Array]"]=xn["[object Int32Array]"]=xn["[object Uint8Array]"]=xn["[object Uint8ClampedArray]"]=xn["[object Uint16Array]"]=xn["[object Uint32Array]"]=!0,xn["[object Arguments]"]=xn["[object Array]"]=xn["[object ArrayBuffer]"]=xn["[object Boolean]"]=xn["[object DataView]"]=xn["[object Date]"]=xn["[object Error]"]=xn["[object Function]"]=xn["[object Map]"]=xn["[object Number]"]=xn["[object Object]"]=xn["[object RegExp]"]=xn["[object Set]"]=xn["[object String]"]=xn["[object WeakMap]"]=!1;var pY=function(e){return Jc(e)&&$2(e.length)&&!!xn[fu(e)]},mY=function(e){return function(t){return e(t)}},Uw=yh((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,i=r&&r.exports===n&&IC.process,a=(function(){try{var o=r&&r.require&&r.require("util").types;return o||i&&i.binding&&i.binding("util")}catch{}})();e.exports=a})),qw=Uw&&Uw.isTypedArray,F2=qw?mY(qw):pY,gY=Object.prototype.hasOwnProperty,bY=function(e,t){var n=Fi(e),r=!n&&Hp(e),i=!n&&!r&&Vf(e),a=!n&&!r&&!i&&F2(e),o=n||r||i||a,l=o?cY(e.length,String):[],u=l.length;for(var d in e)!gY.call(e,d)||o&&(d=="length"||i&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||PC(d,u))||l.push(d);return l},vY=Object.prototype,UC=function(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||vY)},_Y=(function(e,t){return function(n){return e(t(n))}})(Object.keys,Object),xY=Object.prototype.hasOwnProperty,qC=function(e){if(!UC(e))return _Y(e);var t=[];for(var n in Object(e))xY.call(e,n)&&n!="constructor"&&t.push(n);return t},$p=function(e){return e!=null&&$2(e.length)&&!BC(e)},P2=function(e){return $p(e)?bY(e):qC(e)},Gw=function(e){return iY(e,P2,lY)},yY=Object.prototype.hasOwnProperty,wY=function(e,t,n,r,i,a){var o=1&n,l=Gw(e),u=l.length;if(u!=Gw(t).length&&!o)return!1;for(var d=u;d--;){var m=l[d];if(!(o?m in t:yY.call(t,m)))return!1}var f=a.get(e),g=a.get(t);if(f&&g)return f==t&&g==e;var b=!0;a.set(e,t),a.set(t,e);for(var k=o;++d1)return!1;if(e.length===1){var t=Bt(e,1)[0];return t.type==="text"&&!t.value}return!0}function uX(e){var t=e.changeKey,n=e.text,r=e.tokens,i=e.renderToken,a=Fo(e,lX),o=i?function(l,u){return i(l,Kw,u)}:Kw;return h.jsx("td",Wt(Wt({},a),{},{"data-change-key":t,children:r?cX(r)?" ":r.map(o):n||" "}))}var QC=R.memo(uX);function JC(e,t){return function(){var n=t==="old"?Gp(e):Vp(e);return n===-1?void 0:n}}function eE(e,t){return function(n){return e&&n?h.jsx("a",{href:t?"#"+t:void 0,children:n}):n}}function Wf(e,t){return t?function(n){e(),t(n)}:e}function Zw(e,t,n,r){return R.useMemo((function(){var i=ZC(e,(function(a){return function(o){return a&&a(t,o)}}));return i.onMouseEnter=Wf(n,i.onMouseEnter),i.onMouseLeave=Wf(r,i.onMouseLeave),i}),[e,n,r,t])}function Qw(e,t,n,r,i,a,o,l,u){var d={change:t,side:r,inHoverState:l,renderDefault:JC(t,r),wrapInAnchor:eE(i,a)};return h.jsx("td",Wt(Wt({className:e},o),{},{"data-change-key":n,children:u(d)}))}function dX(e){var t,n,r,i=e.change,a=e.selected,o=e.tokens,l=e.className,u=e.generateLineClassName,d=e.gutterClassName,m=e.codeClassName,f=e.gutterEvents,g=e.codeEvents,b=e.hideGutter,k=e.gutterAnchor,S=e.generateAnchorID,x=e.renderToken,_=e.renderGutter,w=i.type,y=i.content,C=Io(i),T=(t=Bt(R.useState(!1),2),n=t[0],r=t[1],[n,R.useCallback((function(){return r(!0)}),[]),R.useCallback((function(){return r(!1)}),[])]),E=Bt(T,3),j=E[0],N=E[1],D=E[2],z=R.useMemo((function(){return{change:i}}),[i]),$=Zw(f,z,N,D),F=Zw(g,z,N,D),U=S(i),V=u({changes:[i],defaultGenerate:function(){return l}}),X=Li("diff-gutter","diff-gutter-".concat(w),d,{"diff-gutter-selected":a}),Y=Li("diff-code","diff-code-".concat(w),m,{"diff-code-selected":a});return h.jsxs("tr",{id:U,className:Li("diff-line",V),children:[!b&&Qw(X,i,C,"old",k,U,$,j,_),!b&&Qw(X,i,C,"new",k,U,$,j,_),h.jsx(QC,Wt({className:Y,changeKey:C,text:y,tokens:o,renderToken:x},F))]})}var hX=R.memo(dX);function fX(e){var t=e.hideGutter,n=e.element;return h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:t?1:3,className:"diff-widget-content",children:n})})}var pX=["hideGutter","selectedChanges","tokens","lineClassName"],mX=["hunk","widgets","className"];function gX(e){var t=e.hunk,n=e.widgets,r=e.className,i=Fo(e,mX),a=(function(o,l){return o.reduce((function(u,d){var m=Io(d);u.push(["change",m,d]);var f=l[m];return f&&u.push(["widget",m,f]),u}),[])})(t.changes,n);return h.jsx("tbody",{className:Li("diff-hunk",r),children:a.map((function(o){return(function(l,u){var d=Bt(l,3),m=d[0],f=d[1],g=d[2],b=u.hideGutter,k=u.selectedChanges,S=u.tokens,x=u.lineClassName,_=Fo(u,pX);if(m==="change"){var w=Hi(g)?"old":"new",y=Hi(g)?Gp(g):Vp(g),C=S?S[w][y-1]:null;return h.jsx(hX,Wt({className:x,change:g,hideGutter:b,selected:k.includes(f),tokens:C},_),"change".concat(f))}return m==="widget"?h.jsx(fX,{hideGutter:b,element:g},"widget".concat(f)):null})(o,i)}))})}var tE=0;function Y0(e,t,n,r){var i=R.useCallback((function(){return t(e)}),[e,t]),a=R.useCallback((function(){return t("")}),[t]);return R.useMemo((function(){var o=ZC(r,(function(l){return function(u){return l&&l({side:e,change:n},u)}}));return o.onMouseEnter=Wf(i,o.onMouseEnter),o.onMouseLeave=Wf(a,o.onMouseLeave),o}),[n,r,i,e,a])}function ib(e){var t=e.change,n=e.side,r=e.selected,i=e.tokens,a=e.gutterClassName,o=e.codeClassName,l=e.gutterEvents,u=e.codeEvents,d=e.anchorID,m=e.gutterAnchor,f=e.gutterAnchorTarget,g=e.hideGutter,b=e.hover,k=e.renderToken,S=e.renderGutter;if(!t){var x=Li("diff-gutter","diff-gutter-omit",a),_=Li("diff-code","diff-code-omit",o);return[!g&&h.jsx("td",{className:x},"gutter"),h.jsx("td",{className:_},"code")]}var w=t.type,y=t.content,C=Io(t),T=n===tE?"old":"new",E=Wt({id:d||void 0,className:Li("diff-gutter","diff-gutter-".concat(w),Cv({"diff-gutter-selected":r},"diff-line-hover-"+T,b),a),children:S({change:t,side:T,inHoverState:b,renderDefault:JC(t,T),wrapInAnchor:eE(m,f)})},l),j=Li("diff-code","diff-code-".concat(w),Cv({"diff-code-selected":r},"diff-line-hover-"+T,b),o);return[!g&&h.jsx("td",Wt(Wt({},E),{},{"data-change-key":C}),"gutter"),h.jsx(QC,Wt({className:j,changeKey:C,text:y,tokens:i,renderToken:k},u),"code")]}function bX(e){var t=e.className,n=e.oldChange,r=e.newChange,i=e.oldSelected,a=e.newSelected,o=e.oldTokens,l=e.newTokens,u=e.monotonous,d=e.gutterClassName,m=e.codeClassName,f=e.gutterEvents,g=e.codeEvents,b=e.hideGutter,k=e.generateAnchorID,S=e.generateLineClassName,x=e.gutterAnchor,_=e.renderToken,w=e.renderGutter,y=Bt(R.useState(""),2),C=y[0],T=y[1],E=Y0("old",T,n,f),j=Y0("new",T,r,f),N=Y0("old",T,n,g),D=Y0("new",T,r,g),z=n&&k(n),$=r&&k(r),F=S({changes:[n,r],defaultGenerate:function(){return t}}),U={monotonous:u,hideGutter:b,gutterClassName:d,codeClassName:m,gutterEvents:f,codeEvents:g,renderToken:_,renderGutter:w},V=Wt(Wt({},U),{},{change:n,side:tE,selected:i,tokens:o,gutterEvents:E,codeEvents:N,anchorID:z,gutterAnchor:x,gutterAnchorTarget:z,hover:C==="old"}),X=Wt(Wt({},U),{},{change:r,side:1,selected:a,tokens:l,gutterEvents:j,codeEvents:D,anchorID:n===r?null:$,gutterAnchor:x,gutterAnchorTarget:n===r?z:$,hover:C==="new"});if(u)return h.jsx("tr",{className:Li("diff-line",F),children:ib(n?V:X)});var Y=(function(Q,te){return Q&&!te?"diff-line-old-only":!Q&&te?"diff-line-new-only":Q===te?"diff-line-normal":"diff-line-compare"})(n,r);return h.jsxs("tr",{className:Li("diff-line",Y,F),children:[ib(V),ib(X)]})}var vX=R.memo(bX);function _X(e){var t=e.hideGutter,n=e.oldElement,r=e.newElement;return e.monotonous?h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n||r})}):n===r?h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:t?2:4,className:"diff-widget-content",children:n})}):h.jsxs("tr",{className:"diff-widget",children:[h.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n}),h.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:r})]})}var xX=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],yX=["hunk","widgets","className"];function X0(e,t){return(e?Io(e):"00")+(t?Io(t):"00")}function wX(e){var t=e.hunk,n=e.widgets,r=e.className,i=Fo(e,yX),a=(function(o,l){for(var u=function(_){if(!_)return null;var w=Io(_);return l[w]||null},d=[],m=0;m=i&&r=a&&i-1},wW=function(e,t){var n=this.__data__,r=zp(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Nc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tl))return!1;var d=a.get(e),m=a.get(t);if(d&&m)return d==t&&m==e;var f=-1,g=!0,b=2&n?new sY:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},xn={};xn["[object Float32Array]"]=xn["[object Float64Array]"]=xn["[object Int8Array]"]=xn["[object Int16Array]"]=xn["[object Int32Array]"]=xn["[object Uint8Array]"]=xn["[object Uint8ClampedArray]"]=xn["[object Uint16Array]"]=xn["[object Uint32Array]"]=!0,xn["[object Arguments]"]=xn["[object Array]"]=xn["[object ArrayBuffer]"]=xn["[object Boolean]"]=xn["[object DataView]"]=xn["[object Date]"]=xn["[object Error]"]=xn["[object Function]"]=xn["[object Map]"]=xn["[object Number]"]=xn["[object Object]"]=xn["[object RegExp]"]=xn["[object Set]"]=xn["[object String]"]=xn["[object WeakMap]"]=!1;var yY=function(e){return Jc(e)&&U2(e.length)&&!!xn[fu(e)]},wY=function(e){return function(t){return e(t)}},qw=wh((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,i=r&&r.exports===n&&$C.process,a=(function(){try{var o=r&&r.require&&r.require("util").types;return o||i&&i.binding&&i.binding("util")}catch{}})();e.exports=a})),Gw=qw&&qw.isTypedArray,q2=Gw?wY(Gw):yY,SY=Object.prototype.hasOwnProperty,kY=function(e,t){var n=Hi(e),r=!n&&Fp(e),i=!n&&!r&&Wf(e),a=!n&&!r&&!i&&q2(e),o=n||r||i||a,l=o?gY(e.length,String):[],c=l.length;for(var d in e)!SY.call(e,d)||o&&(d=="length"||i&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||VC(d,c))||l.push(d);return l},CY=Object.prototype,WC=function(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||CY)},EY=(function(e,t){return function(n){return e(t(n))}})(Object.keys,Object),AY=Object.prototype.hasOwnProperty,YC=function(e){if(!WC(e))return EY(e);var t=[];for(var n in Object(e))AY.call(e,n)&&n!="constructor"&&t.push(n);return t},Pp=function(e){return e!=null&&U2(e.length)&&!PC(e)},G2=function(e){return Pp(e)?kY(e):YC(e)},Vw=function(e){return dY(e,G2,mY)},TY=Object.prototype.hasOwnProperty,NY=function(e,t,n,r,i,a){var o=1&n,l=Vw(e),c=l.length;if(c!=Vw(t).length&&!o)return!1;for(var d=c;d--;){var m=l[d];if(!(o?m in t:TY.call(t,m)))return!1}var f=a.get(e),g=a.get(t);if(f&&g)return f==t&&g==e;var b=!0;a.set(e,t),a.set(t,e);for(var k=o;++d1)return!1;if(e.length===1){var t=zt(e,1)[0];return t.type==="text"&&!t.value}return!0}function bX(e){var t=e.changeKey,n=e.text,r=e.tokens,i=e.renderToken,a=Po(e,mX),o=i?function(l,c){return i(l,Zw,c)}:Zw;return h.jsx("td",Wt(Wt({},a),{},{"data-change-key":t,children:r?gX(r)?" ":r.map(o):n||" "}))}var nE=R.memo(bX);function rE(e,t){return function(){var n=t==="old"?Wp(e):Yp(e);return n===-1?void 0:n}}function iE(e,t){return function(n){return e&&n?h.jsx("a",{href:t?"#"+t:void 0,children:n}):n}}function Yf(e,t){return t?function(n){e(),t(n)}:e}function Qw(e,t,n,r){return R.useMemo((function(){var i=tE(e,(function(a){return function(o){return a&&a(t,o)}}));return i.onMouseEnter=Yf(n,i.onMouseEnter),i.onMouseLeave=Yf(r,i.onMouseLeave),i}),[e,n,r,t])}function Jw(e,t,n,r,i,a,o,l,c){var d={change:t,side:r,inHoverState:l,renderDefault:rE(t,r),wrapInAnchor:iE(i,a)};return h.jsx("td",Wt(Wt({className:e},o),{},{"data-change-key":n,children:c(d)}))}function vX(e){var t,n,r,i=e.change,a=e.selected,o=e.tokens,l=e.className,c=e.generateLineClassName,d=e.gutterClassName,m=e.codeClassName,f=e.gutterEvents,g=e.codeEvents,b=e.hideGutter,k=e.gutterAnchor,S=e.generateAnchorID,x=e.renderToken,v=e.renderGutter,w=i.type,y=i.content,C=Io(i),N=(t=zt(R.useState(!1),2),n=t[0],r=t[1],[n,R.useCallback((function(){return r(!0)}),[]),R.useCallback((function(){return r(!1)}),[])]),E=zt(N,3),M=E[0],T=E[1],D=E[2],z=R.useMemo((function(){return{change:i}}),[i]),$=Qw(f,z,T,D),F=Qw(g,z,T,D),U=S(i),V=c({changes:[i],defaultGenerate:function(){return l}}),X=Ri("diff-gutter","diff-gutter-".concat(w),d,{"diff-gutter-selected":a}),Y=Ri("diff-code","diff-code-".concat(w),m,{"diff-code-selected":a});return h.jsxs("tr",{id:U,className:Ri("diff-line",V),children:[!b&&Jw(X,i,C,"old",k,U,$,M,v),!b&&Jw(X,i,C,"new",k,U,$,M,v),h.jsx(nE,Wt({className:Y,changeKey:C,text:y,tokens:o,renderToken:x},F))]})}var _X=R.memo(vX);function xX(e){var t=e.hideGutter,n=e.element;return h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:t?1:3,className:"diff-widget-content",children:n})})}var yX=["hideGutter","selectedChanges","tokens","lineClassName"],wX=["hunk","widgets","className"];function SX(e){var t=e.hunk,n=e.widgets,r=e.className,i=Po(e,wX),a=(function(o,l){return o.reduce((function(c,d){var m=Io(d);c.push(["change",m,d]);var f=l[m];return f&&c.push(["widget",m,f]),c}),[])})(t.changes,n);return h.jsx("tbody",{className:Ri("diff-hunk",r),children:a.map((function(o){return(function(l,c){var d=zt(l,3),m=d[0],f=d[1],g=d[2],b=c.hideGutter,k=c.selectedChanges,S=c.tokens,x=c.lineClassName,v=Po(c,yX);if(m==="change"){var w=zi(g)?"old":"new",y=zi(g)?Wp(g):Yp(g),C=S?S[w][y-1]:null;return h.jsx(_X,Wt({className:x,change:g,hideGutter:b,selected:k.includes(f),tokens:C},v),"change".concat(f))}return m==="widget"?h.jsx(xX,{hideGutter:b,element:g},"widget".concat(f)):null})(o,i)}))})}var sE=0;function X0(e,t,n,r){var i=R.useCallback((function(){return t(e)}),[e,t]),a=R.useCallback((function(){return t("")}),[t]);return R.useMemo((function(){var o=tE(r,(function(l){return function(c){return l&&l({side:e,change:n},c)}}));return o.onMouseEnter=Yf(i,o.onMouseEnter),o.onMouseLeave=Yf(a,o.onMouseLeave),o}),[n,r,i,e,a])}function ob(e){var t=e.change,n=e.side,r=e.selected,i=e.tokens,a=e.gutterClassName,o=e.codeClassName,l=e.gutterEvents,c=e.codeEvents,d=e.anchorID,m=e.gutterAnchor,f=e.gutterAnchorTarget,g=e.hideGutter,b=e.hover,k=e.renderToken,S=e.renderGutter;if(!t){var x=Ri("diff-gutter","diff-gutter-omit",a),v=Ri("diff-code","diff-code-omit",o);return[!g&&h.jsx("td",{className:x},"gutter"),h.jsx("td",{className:v},"code")]}var w=t.type,y=t.content,C=Io(t),N=n===sE?"old":"new",E=Wt({id:d||void 0,className:Ri("diff-gutter","diff-gutter-".concat(w),Tv({"diff-gutter-selected":r},"diff-line-hover-"+N,b),a),children:S({change:t,side:N,inHoverState:b,renderDefault:rE(t,N),wrapInAnchor:iE(m,f)})},l),M=Ri("diff-code","diff-code-".concat(w),Tv({"diff-code-selected":r},"diff-line-hover-"+N,b),o);return[!g&&h.jsx("td",Wt(Wt({},E),{},{"data-change-key":C}),"gutter"),h.jsx(nE,Wt({className:M,changeKey:C,text:y,tokens:i,renderToken:k},c),"code")]}function kX(e){var t=e.className,n=e.oldChange,r=e.newChange,i=e.oldSelected,a=e.newSelected,o=e.oldTokens,l=e.newTokens,c=e.monotonous,d=e.gutterClassName,m=e.codeClassName,f=e.gutterEvents,g=e.codeEvents,b=e.hideGutter,k=e.generateAnchorID,S=e.generateLineClassName,x=e.gutterAnchor,v=e.renderToken,w=e.renderGutter,y=zt(R.useState(""),2),C=y[0],N=y[1],E=X0("old",N,n,f),M=X0("new",N,r,f),T=X0("old",N,n,g),D=X0("new",N,r,g),z=n&&k(n),$=r&&k(r),F=S({changes:[n,r],defaultGenerate:function(){return t}}),U={monotonous:c,hideGutter:b,gutterClassName:d,codeClassName:m,gutterEvents:f,codeEvents:g,renderToken:v,renderGutter:w},V=Wt(Wt({},U),{},{change:n,side:sE,selected:i,tokens:o,gutterEvents:E,codeEvents:T,anchorID:z,gutterAnchor:x,gutterAnchorTarget:z,hover:C==="old"}),X=Wt(Wt({},U),{},{change:r,side:1,selected:a,tokens:l,gutterEvents:M,codeEvents:D,anchorID:n===r?null:$,gutterAnchor:x,gutterAnchorTarget:n===r?z:$,hover:C==="new"});if(c)return h.jsx("tr",{className:Ri("diff-line",F),children:ob(n?V:X)});var Y=(function(Q,te){return Q&&!te?"diff-line-old-only":!Q&&te?"diff-line-new-only":Q===te?"diff-line-normal":"diff-line-compare"})(n,r);return h.jsxs("tr",{className:Ri("diff-line",Y,F),children:[ob(V),ob(X)]})}var CX=R.memo(kX);function EX(e){var t=e.hideGutter,n=e.oldElement,r=e.newElement;return e.monotonous?h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n||r})}):n===r?h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:t?2:4,className:"diff-widget-content",children:n})}):h.jsxs("tr",{className:"diff-widget",children:[h.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n}),h.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:r})]})}var AX=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],TX=["hunk","widgets","className"];function K0(e,t){return(e?Io(e):"00")+(t?Io(t):"00")}function NX(e){var t=e.hunk,n=e.widgets,r=e.className,i=Po(e,TX),a=(function(o,l){for(var c=function(v){if(!v)return null;var w=Io(v);return l[w]||null},d=[],m=0;m=(a==null?void 0:a.value.length))return[e];var l=function(f,g){var b=a.value.slice(f,g);return[].concat(Bi(i),[Wt(Wt({},a),{},{value:b})])};if(t>0){var u=l(0,t);o.push(Lc(u))}var d=l(Math.max(t,0),n);if(o.push(r?(function(f,g){return[g].concat(Bi(Lc(f)))})(d,r):Lc(d)),n1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,i=Fo(e,PX);n.push(i);var a,o=B2(r);try{for(o.s();!(a=o.n()).done;)sE(a.value,t,n)}catch(l){o.e(l)}finally{o.f()}n.pop()}else t.push(Lc([].concat(Bi(n.slice(1)),[e])));return t}function UX(e){return e.reduce((function(t,n){var r=t[t.length-1],i=(function(u){var d=W2(u);return d.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[Z0(r(t.oldSource)),Z0(r(n))]}var i=zt(qX(e),2),a=i[0],o=i[1],l=t.highlight?function(c){return Z0(t.refractor.highlight(c,t.language))}:function(c){return Z0([{type:"text",value:c}])};return[l(a),l(o)]}function Lc(e){return e.map((function(t){return Wt({},t)}))}function VX(e,t){return[].concat(Ii(Lc(e.slice(0,-1))),[t])}function WX(e){return e.type==="text"}function K2(e){var t=e[e.length-1];if(WX(t))return t;throw new Error("Invalid token path with leaf of type ".concat(t.type))}function YX(e,t,n,r){var i=e.slice(0,-1),a=K2(e),o=[];if(n<=0||t>=(a==null?void 0:a.value.length))return[e];var l=function(f,g){var b=a.value.slice(f,g);return[].concat(Ii(i),[Wt(Wt({},a),{},{value:b})])};if(t>0){var c=l(0,t);o.push(Lc(c))}var d=l(Math.max(t,0),n);if(o.push(r?(function(f,g){return[g].concat(Ii(Lc(f)))})(d,r):Lc(d)),n1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,i=Po(e,XX);n.push(i);var a,o=F2(r);try{for(o.s();!(a=o.n()).done;)cE(a.value,t,n)}catch(l){o.e(l)}finally{o.f()}n.pop()}else t.push(Lc([].concat(Ii(n.slice(1)),[e])));return t}function KX(e){return e.reduce((function(t,n){var r=t[t.length-1],i=(function(c){var d=K2(c);return d.value.includes(` `)?d.value.split(` -`).map((function(m){return HX(u,Wt(Wt({},d),{},{value:m}))})):[u]})(n),a=TC(i),o=a[0],l=a.slice(1);return[].concat(Bi(t.slice(0,-1)),[[].concat(Bi(r),[o])],Bi(l.map((function(u){return[u]}))))}),[[]])}function n7(e){return UX(sE(e))}var qX=function(e,t,n){var r=(n=typeof n=="function"?n:void 0)?n(e,t):void 0;return r===void 0?Fp(e,t,void 0,n):!!r},GX=function(e,t){return Fp(e,t)},VX=function(e){var t=e==null?0:e.length;return t?e[t-1]:void 0};function WX(e,t){if(!e.children)throw new Error("parent node missing children property");var n,r,i=VX(e.children);return i&&(r=t,(n=i).type===r.type&&(n.type==="text"||n.children&&r.children&&qX(n,r,(function(a,o,l){return l==="chlidren"||GX(a,o)}))))?e.children[e.children.length-1]=(function(a,o){return"value"in a&&"value"in o?Wt(Wt({},a),{},{value:"".concat(a.value).concat(o.value)}):a})(i,t):e.children.push(t),e.children[e.children.length-1]}function r7(e){var t,n={type:"root",children:[]},r=B2(e);try{var i=function(){var a=t.value;a.reduce((function(o,l,u){return WX(o,u===a.length-1?Wt({},l):Wt(Wt({},l),{},{children:[]}))}),n)};for(r.s();!(t=r.n()).done;)i()}catch(a){r.e(a)}finally{r.f()}return n}var YX=Object.prototype.hasOwnProperty,XX=rE((function(e,t,n){YX.call(e,n)?e[n].push(t):G2(e,n,[t])})),KX=Object.prototype.hasOwnProperty,ZX=function(e){if(e==null)return!0;if($p(e)&&(Fi(e)||typeof e=="string"||typeof e.splice=="function"||Vf(e)||F2(e)||Hp(e)))return!e.length;var t=Dv(e);if(t=="[object Map]"||t=="[object Set]")return!e.size;if(UC(e))return!qC(e).length;for(var n in e)if(KX.call(e,n))return!1;return!0},QX=function(e,t){var n=t.start,r=t.length,i=n+r,a=e.reduce((function(o,l){var u=Bt(o,2),d=u[0],m=u[1],f=m+W2(l).value.length;if(m>i||fr.length?n:r,u=n.length>r.length?r:n,d=l.indexOf(u);if(d!=-1)return o=[new t.Diff(1,l.substring(0,d)),new t.Diff(0,u),new t.Diff(1,l.substring(d+u.length))],n.length>r.length&&(o[0][0]=o[2][0]=-1),o;if(u.length==1)return[new t.Diff(-1,n),new t.Diff(1,r)];var m=this.diff_halfMatch_(n,r);if(m){var f=m[0],g=m[1],b=m[2],k=m[3],S=m[4],x=this.diff_main(f,b,i,a),_=this.diff_main(g,k,i,a);return x.concat([new t.Diff(0,S)],_)}return i&&n.length>100&&r.length>100?this.diff_lineMode_(n,r,a):this.diff_bisect_(n,r,a)},t.prototype.diff_lineMode_=function(n,r,i){var a=this.diff_linesToChars_(n,r);n=a.chars1,r=a.chars2;var o=a.lineArray,l=this.diff_main(n,r,!1,i);this.diff_charsToLines_(l,o),this.diff_cleanupSemantic(l),l.push(new t.Diff(0,""));for(var u=0,d=0,m=0,f="",g="";u=1&&m>=1){l.splice(u-d-m,d+m),u=u-d-m;for(var b=this.diff_main(f,g,!1,i),k=b.length-1;k>=0;k--)l.splice(u,0,b[k]);u+=b.length}m=0,d=0,f="",g=""}u++}return l.pop(),l},t.prototype.diff_bisect_=function(n,r,i){for(var a=n.length,o=r.length,l=Math.ceil((a+o)/2),u=l,d=2*l,m=new Array(d),f=new Array(d),g=0;gi);y++){for(var C=-y+S;C<=y-x;C+=2){for(var T=u+C,E=($=C==-y||C!=y&&m[T-1]a)x+=2;else if(E>o)S+=2;else if(k&&(D=u+b-C)>=0&&D=(N=a-f[D]))return this.diff_bisectSplit_(n,r,$,E,i)}for(var j=-y+_;j<=y-w;j+=2){for(var N,D=u+j,z=(N=j==-y||j!=y&&f[D-1]a)w+=2;else if(z>o)_+=2;else if(!k&&(T=u+b-j)>=0&&T=(N=a-N))return this.diff_bisectSplit_(n,r,$,E,i)}}}return[new t.Diff(-1,n),new t.Diff(1,r)]},t.prototype.diff_bisectSplit_=function(n,r,i,a,o){var l=n.substring(0,i),u=r.substring(0,a),d=n.substring(i),m=r.substring(a),f=this.diff_main(l,u,!1,o),g=this.diff_main(d,m,!1,o);return f.concat(g)},t.prototype.diff_linesToChars_=function(n,r){var i=[],a={};function o(d){for(var m="",f=0,g=-1,b=i.length;ga?n=n.substring(i-a):ir.length?n:r,a=n.length>r.length?r:n;if(i.length<4||2*a.length=S.length?[w,y,C,T,N]:null}var u,d,m,f,g,b=l(i,a,Math.ceil(i.length/4)),k=l(i,a,Math.ceil(i.length/2));return b||k?(u=k?b&&b[4].length>k[4].length?b:k:b,n.length>r.length?(d=u[0],m=u[1],f=u[2],g=u[3]):(f=u[0],g=u[1],d=u[2],m=u[3]),[d,m,f,g,u[4]]):null},t.prototype.diff_cleanupSemantic=function(n){for(var r=!1,i=[],a=0,o=null,l=0,u=0,d=0,m=0,f=0;l0?i[a-1]:-1,u=0,d=0,m=0,f=0,o=null,r=!0)),l++;for(r&&this.diff_cleanupMerge(n),this.diff_cleanupSemanticLossless(n),l=1;l=S?(k>=g.length/2||k>=b.length/2)&&(n.splice(l,0,new t.Diff(0,b.substring(0,k))),n[l-1][1]=g.substring(0,g.length-k),n[l+1][1]=b.substring(k),l++):(S>=g.length/2||S>=b.length/2)&&(n.splice(l,0,new t.Diff(0,g.substring(0,S))),n[l-1][0]=1,n[l-1][1]=b.substring(0,b.length-S),n[l+1][0]=-1,n[l+1][1]=g.substring(S),l++),l++}l++}},t.prototype.diff_cleanupSemanticLossless=function(n){function r(S,x){if(!S||!x)return 6;var _=S.charAt(S.length-1),w=x.charAt(0),y=_.match(t.nonAlphaNumericRegex_),C=w.match(t.nonAlphaNumericRegex_),T=y&&_.match(t.whitespaceRegex_),E=C&&w.match(t.whitespaceRegex_),j=T&&_.match(t.linebreakRegex_),N=E&&w.match(t.linebreakRegex_),D=j&&S.match(t.blanklineEndRegex_),z=N&&x.match(t.blanklineStartRegex_);return D||z?5:j||N?4:y&&!T&&E?3:T||E?2:y||C?1:0}for(var i=1;i=b&&(b=k,m=a,f=o,g=l)}n[i-1][1]!=m&&(m?n[i-1][1]=m:(n.splice(i-1,1),i--),n[i][1]=f,g?n[i+1][1]=g:(n.splice(i+1,1),i--))}i++}},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,i=[],a=0,o=null,l=0,u=!1,d=!1,m=!1,f=!1;l0?i[a-1]:-1,m=f=!1),r=!0)),l++;r&&this.diff_cleanupMerge(n)},t.prototype.diff_cleanupMerge=function(n){n.push(new t.Diff(0,""));for(var r,i=0,a=0,o=0,l="",u="";i1?(a!==0&&o!==0&&((r=this.diff_commonPrefix(u,l))!==0&&(i-a-o>0&&n[i-a-o-1][0]==0?n[i-a-o-1][1]+=u.substring(0,r):(n.splice(0,0,new t.Diff(0,u.substring(0,r))),i++),u=u.substring(r),l=l.substring(r)),(r=this.diff_commonSuffix(u,l))!==0&&(n[i][1]=u.substring(u.length-r)+n[i][1],u=u.substring(0,u.length-r),l=l.substring(0,l.length-r))),i-=a+o,n.splice(i,a+o),l.length&&(n.splice(i,0,new t.Diff(-1,l)),i++),u.length&&(n.splice(i,0,new t.Diff(1,u)),i++),i++):i!==0&&n[i-1][0]==0?(n[i-1][1]+=n[i][1],n.splice(i,1)):i++,o=0,a=0,l="",u=""}n[n.length-1][1]===""&&n.pop();var d=!1;for(i=1;ir));i++)l=a,u=o;return n.length!=i&&n[i][0]===-1?u:u+(r-l)},t.prototype.diff_prettyHtml=function(n){for(var r=[],i=/&/g,a=//g,l=/\n/g,u=0;u");switch(d){case 1:r[u]=''+m+"";break;case-1:r[u]=''+m+"";break;case 0:r[u]=""+m+""}}return r.join("")},t.prototype.diff_text1=function(n){for(var r=[],i=0;ithis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var a=this.match_alphabet_(r),o=this;function l(E,j){var N=E/r.length,D=Math.abs(i-j);return o.Match_Distance?N+D/o.Match_Distance:D?1:N}var u=this.Match_Threshold,d=n.indexOf(r,i);d!=-1&&(u=Math.min(l(0,d),u),(d=n.lastIndexOf(r,i+r.length))!=-1&&(u=Math.min(l(0,d),u)));var m,f,g=1<=x;y--){var C=a[n.charAt(y-1)];if(w[y]=S===0?(w[y+1]<<1|1)&C:(w[y+1]<<1|1)&C|(b[y+1]|b[y])<<1|1|b[y+1],w[y]&g){var T=l(S,y-1);if(T<=u){if(u=T,!((d=y-1)>i))break;x=Math.max(1,2*i-d)}}}if(l(S+1,i)>u)break;b=w}return d},t.prototype.match_alphabet_=function(n){for(var r={},i=0;i2&&(this.diff_cleanupSemantic(o),this.diff_cleanupEfficiency(o));else if(n&&typeof n=="object"&&r===void 0&&i===void 0)o=n,a=this.diff_text1(o);else if(typeof n=="string"&&r&&typeof r=="object"&&i===void 0)a=n,o=r;else{if(typeof n!="string"||typeof r!="string"||!i||typeof i!="object")throw new Error("Unknown call format to patch_make.");a=n,o=i}if(o.length===0)return[];for(var l=[],u=new t.patch_obj,d=0,m=0,f=0,g=a,b=a,k=0;k=2*this.Patch_Margin&&d&&(this.patch_addContext_(u,g),l.push(u),u=new t.patch_obj,d=0,g=b,m=f)}S!==1&&(m+=x.length),S!==-1&&(f+=x.length)}return d&&(this.patch_addContext_(u,g),l.push(u)),l},t.prototype.patch_deepCopy=function(n){for(var r=[],i=0;ithis.Match_MaxBits?(u=this.match_main(r,f.substring(0,this.Match_MaxBits),m))!=-1&&((g=this.match_main(r,f.substring(f.length-this.Match_MaxBits),m+f.length-this.Match_MaxBits))==-1||u>=g)&&(u=-1):u=this.match_main(r,f,m),u==-1)o[l]=!1,a-=n[l].length2-n[l].length1;else if(o[l]=!0,a=u-m,f==(d=g==-1?r.substring(u,u+f.length):r.substring(u,g+this.Match_MaxBits)))r=r.substring(0,u)+this.diff_text2(n[l].diffs)+r.substring(u+f.length);else{var b=this.diff_main(f,d,!1);if(f.length>this.Match_MaxBits&&this.diff_levenshtein(b)/f.length>this.Patch_DeleteThreshold)o[l]=!1;else{this.diff_cleanupSemanticLossless(b);for(var k,S=0,x=0;xl[0][1].length){var u=r-l[0][1].length;l[0][1]=i.substring(l[0][1].length)+l[0][1],o.start1-=u,o.start2-=u,o.length1+=u,o.length2+=u}return(l=(o=n[n.length-1]).diffs).length==0||l[l.length-1][0]!=0?(l.push(new t.Diff(0,i)),o.length1+=r,o.length2+=r):r>l[l.length-1][1].length&&(u=r-l[l.length-1][1].length,l[l.length-1][1]+=i.substring(0,u),o.length1+=u,o.length2+=u),i},t.prototype.patch_splitMax=function(n){for(var r=this.Match_MaxBits,i=0;i2*r?(d.length1+=g.length,o+=g.length,m=!1,d.diffs.push(new t.Diff(f,g)),a.diffs.shift()):(g=g.substring(0,r-d.length1-this.Patch_Margin),d.length1+=g.length,o+=g.length,f===0?(d.length2+=g.length,l+=g.length):m=!1,d.diffs.push(new t.Diff(f,g)),g==a.diffs[0][1]?a.diffs.shift():a.diffs[0][1]=a.diffs[0][1].substring(g.length))}u=(u=this.diff_text2(d.diffs)).substring(u.length-this.Patch_Margin);var b=this.diff_text1(a.diffs).substring(0,this.Patch_Margin);b!==""&&(d.length1+=b.length,d.length2+=b.length,d.diffs.length!==0&&d.diffs[d.diffs.length-1][0]===0?d.diffs[d.diffs.length-1][1]+=b:d.diffs.push(new t.Diff(0,b))),m||n.splice(++i,0,d)}}},t.prototype.patch_toText=function(n){for(var r=[],i=0;ii||fr.length?n:r,c=n.length>r.length?r:n,d=l.indexOf(c);if(d!=-1)return o=[new t.Diff(1,l.substring(0,d)),new t.Diff(0,c),new t.Diff(1,l.substring(d+c.length))],n.length>r.length&&(o[0][0]=o[2][0]=-1),o;if(c.length==1)return[new t.Diff(-1,n),new t.Diff(1,r)];var m=this.diff_halfMatch_(n,r);if(m){var f=m[0],g=m[1],b=m[2],k=m[3],S=m[4],x=this.diff_main(f,b,i,a),v=this.diff_main(g,k,i,a);return x.concat([new t.Diff(0,S)],v)}return i&&n.length>100&&r.length>100?this.diff_lineMode_(n,r,a):this.diff_bisect_(n,r,a)},t.prototype.diff_lineMode_=function(n,r,i){var a=this.diff_linesToChars_(n,r);n=a.chars1,r=a.chars2;var o=a.lineArray,l=this.diff_main(n,r,!1,i);this.diff_charsToLines_(l,o),this.diff_cleanupSemantic(l),l.push(new t.Diff(0,""));for(var c=0,d=0,m=0,f="",g="";c=1&&m>=1){l.splice(c-d-m,d+m),c=c-d-m;for(var b=this.diff_main(f,g,!1,i),k=b.length-1;k>=0;k--)l.splice(c,0,b[k]);c+=b.length}m=0,d=0,f="",g=""}c++}return l.pop(),l},t.prototype.diff_bisect_=function(n,r,i){for(var a=n.length,o=r.length,l=Math.ceil((a+o)/2),c=l,d=2*l,m=new Array(d),f=new Array(d),g=0;gi);y++){for(var C=-y+S;C<=y-x;C+=2){for(var N=c+C,E=($=C==-y||C!=y&&m[N-1]a)x+=2;else if(E>o)S+=2;else if(k&&(D=c+b-C)>=0&&D=(T=a-f[D]))return this.diff_bisectSplit_(n,r,$,E,i)}for(var M=-y+v;M<=y-w;M+=2){for(var T,D=c+M,z=(T=M==-y||M!=y&&f[D-1]a)w+=2;else if(z>o)v+=2;else if(!k&&(N=c+b-M)>=0&&N=(T=a-T))return this.diff_bisectSplit_(n,r,$,E,i)}}}return[new t.Diff(-1,n),new t.Diff(1,r)]},t.prototype.diff_bisectSplit_=function(n,r,i,a,o){var l=n.substring(0,i),c=r.substring(0,a),d=n.substring(i),m=r.substring(a),f=this.diff_main(l,c,!1,o),g=this.diff_main(d,m,!1,o);return f.concat(g)},t.prototype.diff_linesToChars_=function(n,r){var i=[],a={};function o(d){for(var m="",f=0,g=-1,b=i.length;ga?n=n.substring(i-a):ir.length?n:r,a=n.length>r.length?r:n;if(i.length<4||2*a.length=S.length?[w,y,C,N,T]:null}var c,d,m,f,g,b=l(i,a,Math.ceil(i.length/4)),k=l(i,a,Math.ceil(i.length/2));return b||k?(c=k?b&&b[4].length>k[4].length?b:k:b,n.length>r.length?(d=c[0],m=c[1],f=c[2],g=c[3]):(f=c[0],g=c[1],d=c[2],m=c[3]),[d,m,f,g,c[4]]):null},t.prototype.diff_cleanupSemantic=function(n){for(var r=!1,i=[],a=0,o=null,l=0,c=0,d=0,m=0,f=0;l0?i[a-1]:-1,c=0,d=0,m=0,f=0,o=null,r=!0)),l++;for(r&&this.diff_cleanupMerge(n),this.diff_cleanupSemanticLossless(n),l=1;l=S?(k>=g.length/2||k>=b.length/2)&&(n.splice(l,0,new t.Diff(0,b.substring(0,k))),n[l-1][1]=g.substring(0,g.length-k),n[l+1][1]=b.substring(k),l++):(S>=g.length/2||S>=b.length/2)&&(n.splice(l,0,new t.Diff(0,g.substring(0,S))),n[l-1][0]=1,n[l-1][1]=b.substring(0,b.length-S),n[l+1][0]=-1,n[l+1][1]=g.substring(S),l++),l++}l++}},t.prototype.diff_cleanupSemanticLossless=function(n){function r(S,x){if(!S||!x)return 6;var v=S.charAt(S.length-1),w=x.charAt(0),y=v.match(t.nonAlphaNumericRegex_),C=w.match(t.nonAlphaNumericRegex_),N=y&&v.match(t.whitespaceRegex_),E=C&&w.match(t.whitespaceRegex_),M=N&&v.match(t.linebreakRegex_),T=E&&w.match(t.linebreakRegex_),D=M&&S.match(t.blanklineEndRegex_),z=T&&x.match(t.blanklineStartRegex_);return D||z?5:M||T?4:y&&!N&&E?3:N||E?2:y||C?1:0}for(var i=1;i=b&&(b=k,m=a,f=o,g=l)}n[i-1][1]!=m&&(m?n[i-1][1]=m:(n.splice(i-1,1),i--),n[i][1]=f,g?n[i+1][1]=g:(n.splice(i+1,1),i--))}i++}},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,i=[],a=0,o=null,l=0,c=!1,d=!1,m=!1,f=!1;l0?i[a-1]:-1,m=f=!1),r=!0)),l++;r&&this.diff_cleanupMerge(n)},t.prototype.diff_cleanupMerge=function(n){n.push(new t.Diff(0,""));for(var r,i=0,a=0,o=0,l="",c="";i1?(a!==0&&o!==0&&((r=this.diff_commonPrefix(c,l))!==0&&(i-a-o>0&&n[i-a-o-1][0]==0?n[i-a-o-1][1]+=c.substring(0,r):(n.splice(0,0,new t.Diff(0,c.substring(0,r))),i++),c=c.substring(r),l=l.substring(r)),(r=this.diff_commonSuffix(c,l))!==0&&(n[i][1]=c.substring(c.length-r)+n[i][1],c=c.substring(0,c.length-r),l=l.substring(0,l.length-r))),i-=a+o,n.splice(i,a+o),l.length&&(n.splice(i,0,new t.Diff(-1,l)),i++),c.length&&(n.splice(i,0,new t.Diff(1,c)),i++),i++):i!==0&&n[i-1][0]==0?(n[i-1][1]+=n[i][1],n.splice(i,1)):i++,o=0,a=0,l="",c=""}n[n.length-1][1]===""&&n.pop();var d=!1;for(i=1;ir));i++)l=a,c=o;return n.length!=i&&n[i][0]===-1?c:c+(r-l)},t.prototype.diff_prettyHtml=function(n){for(var r=[],i=/&/g,a=//g,l=/\n/g,c=0;c");switch(d){case 1:r[c]=''+m+"";break;case-1:r[c]=''+m+"";break;case 0:r[c]=""+m+""}}return r.join("")},t.prototype.diff_text1=function(n){for(var r=[],i=0;ithis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var a=this.match_alphabet_(r),o=this;function l(E,M){var T=E/r.length,D=Math.abs(i-M);return o.Match_Distance?T+D/o.Match_Distance:D?1:T}var c=this.Match_Threshold,d=n.indexOf(r,i);d!=-1&&(c=Math.min(l(0,d),c),(d=n.lastIndexOf(r,i+r.length))!=-1&&(c=Math.min(l(0,d),c)));var m,f,g=1<=x;y--){var C=a[n.charAt(y-1)];if(w[y]=S===0?(w[y+1]<<1|1)&C:(w[y+1]<<1|1)&C|(b[y+1]|b[y])<<1|1|b[y+1],w[y]&g){var N=l(S,y-1);if(N<=c){if(c=N,!((d=y-1)>i))break;x=Math.max(1,2*i-d)}}}if(l(S+1,i)>c)break;b=w}return d},t.prototype.match_alphabet_=function(n){for(var r={},i=0;i2&&(this.diff_cleanupSemantic(o),this.diff_cleanupEfficiency(o));else if(n&&typeof n=="object"&&r===void 0&&i===void 0)o=n,a=this.diff_text1(o);else if(typeof n=="string"&&r&&typeof r=="object"&&i===void 0)a=n,o=r;else{if(typeof n!="string"||typeof r!="string"||!i||typeof i!="object")throw new Error("Unknown call format to patch_make.");a=n,o=i}if(o.length===0)return[];for(var l=[],c=new t.patch_obj,d=0,m=0,f=0,g=a,b=a,k=0;k=2*this.Patch_Margin&&d&&(this.patch_addContext_(c,g),l.push(c),c=new t.patch_obj,d=0,g=b,m=f)}S!==1&&(m+=x.length),S!==-1&&(f+=x.length)}return d&&(this.patch_addContext_(c,g),l.push(c)),l},t.prototype.patch_deepCopy=function(n){for(var r=[],i=0;ithis.Match_MaxBits?(c=this.match_main(r,f.substring(0,this.Match_MaxBits),m))!=-1&&((g=this.match_main(r,f.substring(f.length-this.Match_MaxBits),m+f.length-this.Match_MaxBits))==-1||c>=g)&&(c=-1):c=this.match_main(r,f,m),c==-1)o[l]=!1,a-=n[l].length2-n[l].length1;else if(o[l]=!0,a=c-m,f==(d=g==-1?r.substring(c,c+f.length):r.substring(c,g+this.Match_MaxBits)))r=r.substring(0,c)+this.diff_text2(n[l].diffs)+r.substring(c+f.length);else{var b=this.diff_main(f,d,!1);if(f.length>this.Match_MaxBits&&this.diff_levenshtein(b)/f.length>this.Patch_DeleteThreshold)o[l]=!1;else{this.diff_cleanupSemanticLossless(b);for(var k,S=0,x=0;xl[0][1].length){var c=r-l[0][1].length;l[0][1]=i.substring(l[0][1].length)+l[0][1],o.start1-=c,o.start2-=c,o.length1+=c,o.length2+=c}return(l=(o=n[n.length-1]).diffs).length==0||l[l.length-1][0]!=0?(l.push(new t.Diff(0,i)),o.length1+=r,o.length2+=r):r>l[l.length-1][1].length&&(c=r-l[l.length-1][1].length,l[l.length-1][1]+=i.substring(0,c),o.length1+=c,o.length2+=c),i},t.prototype.patch_splitMax=function(n){for(var r=this.Match_MaxBits,i=0;i2*r?(d.length1+=g.length,o+=g.length,m=!1,d.diffs.push(new t.Diff(f,g)),a.diffs.shift()):(g=g.substring(0,r-d.length1-this.Patch_Margin),d.length1+=g.length,o+=g.length,f===0?(d.length2+=g.length,l+=g.length):m=!1,d.diffs.push(new t.Diff(f,g)),g==a.diffs[0][1]?a.diffs.shift():a.diffs[0][1]=a.diffs[0][1].substring(g.length))}c=(c=this.diff_text2(d.diffs)).substring(c.length-this.Patch_Margin);var b=this.diff_text1(a.diffs).substring(0,this.Patch_Margin);b!==""&&(d.length1+=b.length,d.length2+=b.length,d.diffs.length!==0&&d.diffs[d.diffs.length-1][0]===0?d.diffs[d.diffs.length-1][1]+=b:d.diffs.push(new t.Diff(0,b))),m||n.splice(++i,0,d)}}},t.prototype.patch_toText=function(n){for(var r=[],i=0;i1&&arguments[1]!==void 0?arguments[1]:{}).type,n=(t===void 0?"block":t)==="block"?iK:sK,r=V2(e.map((function(l){return l.changes})),aE).map(n).reduce((function(l,u){var d=Bt(l,2),m=d[0],f=d[1],g=Bt(u,2),b=g[0],k=g[1];return[m.concat(b),f.concat(k)]}),[[],[]]),i=Bt(r,2),a=i[0],o=i[1];return JX(s7(a),s7(o))}var oK=["enhancers"],c7=function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.enhancers,i=r===void 0?[]:r,a=Bt(BX(e,Fo(n,oK)),2),o=a[0],l=a[1],u=[n7(o),n7(l)],d=(t=[u[0],u[1]],i.reduce((function(S,x){return x(S)}),t)),m=Bt(d,2),f=m[0],g=m[1],b=[f.map(r7),g.map(r7)],k=b[1];return{old:b[0].map((function(S){var x;return(x=S.children)!==null&&x!==void 0?x:[]})),new:k.map((function(S){var x;return(x=S.children)!==null&&x!==void 0?x:[]}))}};const Ov=["openresearch-diff flex flex-col gap-4","[&_.openresearch-diff-file]:[--openresearch-diff-selection-background-color:color-mix(_in_oklab,_var(--surface)_76%,_var(--primary)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-gutter-selection-background-color:color-mix(_in_oklab,_var(--surface)_68%,_var(--primary)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-gutter-background-color:color-mix(_in_oklab,_var(--base)_84%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-gutter-background-color:color-mix(_in_oklab,_var(--base)_86%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-code-background-color:color-mix(_in_oklab,_var(--base)_91%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-code-background-color:color-mix(_in_oklab,_var(--base)_92%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-edit-background-color:color-mix(_in_oklab,_var(--base)_72%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-edit-background-color:color-mix(_in_oklab,_var(--base)_78%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-divider-color:var(--border)]","[&_.openresearch-diff-file]:[--openresearch-diff-omit-gutter-line-color:color-mix(in_oklab,_var(--base)_86%,_var(--text))]","[&_.openresearch-diff-file]:[--openresearch-diff-unified-gutter-text-color:color-mix(in_oklab,_var(--text)_45%,_var(--base))]","[&_.openresearch-diff-file]:[--diff-background-color:var(--base)]","[&_.openresearch-diff-file]:[--diff-text-color:var(--text)]","[&_.openresearch-diff-file]:[--diff-font-family:var(--mono)]","[&_.openresearch-diff-file]:[--diff-selection-text-color:var(--primary)]","[&_.openresearch-diff-file]:[--diff-selection-background-color:var(--openresearch-diff-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-background-color:var(--openresearch-diff-gutter-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-code-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-code-selected-background-color:var(--diff-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-insert-text-color:var(--accent-green)]","[&_.openresearch-diff-file]:[--diff-gutter-insert-background-color:var(--openresearch-diff-insert-gutter-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-text-color:var(--accent-red)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-background-color:var(--openresearch-diff-delete-gutter-background-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-background-color:var(--openresearch-diff-insert-code-background-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-background-color:var(--openresearch-diff-delete-code-background-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-background-color:var(--openresearch-diff-insert-edit-background-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-background-color:var(--openresearch-diff-delete-edit-background-color)]","[&_.openresearch-diff-file]:[--diff-omit-gutter-line-color:var(--openresearch-diff-omit-gutter-line-color)]","[&_.openresearch-diff-file]:w-full [&_.openresearch-diff-file]:text-sm","[&_.openresearch-diff-file]:leading-[1.55] [&_.openresearch-diff-file.diff-unified]:table-auto","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:first-child]:collapse","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:first-child]:w-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[1%]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:first-child]:hidden","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:sticky","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:left-0","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:z-1","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[1%]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pr-2.5 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pb-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pl-3.5","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:whitespace-nowrap","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-right","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-[var(--openresearch-diff-unified-gutter-text-color)]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-r [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-r-[var(--openresearch-diff-divider-color)]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line]:leading-[1.55]","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-[var(--openresearch-diff-insert-code-background-color)]","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-[var(--openresearch-diff-delete-code-background-color)]","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:px-4","[&_.openresearch-diff-file_.diff-code]:whitespace-pre","[&_.openresearch-diff-file_.diff-code]:break-normal","[&_.openresearch-diff-file_.diff-code]:wrap-normal","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-[var(--openresearch-diff-divider-color)]"].join(" "),lK=2e3,cK={highlight(e,t){return lt.highlight(e,t).children}};function uK(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function Y2(e){let t=0,n=0;for(const r of e.hunks)for(const i of r.changes)i.type==="insert"?t++:i.type==="delete"&&n++;return{additions:t,deletions:n}}function dK(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function Iv(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 hK(e){const t=[aK(e.hunks,{type:"line"})],n=J_(dK(e));return n&<.registered(n)?c7(e.hunks,{enhancers:t,highlight:!0,language:n,refractor:cK}):c7(e.hunks,{enhancers:t,highlight:!1})}function fK(e,t){if(!e.trim())return{files:[],failed:!1};try{return{files:Av(e,{nearbySequences:"zip"}),failed:!1}}catch{if(t){const n=Array.from(e.matchAll(/^diff --git /gm),i=>i.index),r=n[n.length-1];if(n.length>1&&r!==void 0)try{return{files:Av(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const pK=({change:e,side:t})=>t==="old"?null:uK(e);function u7(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/1024).toFixed(1)} KB`}function lE({bytesRead:e,byteLimit:t}){return h.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-md [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-md [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[h.jsx("h4",{children:"Diff preview truncated"}),h.jsxs("p",{children:["Showing the first ",u7(t)," (",u7(e)," read). View the complete diff locally with git."]})]})}function cE({file:e,defaultExpanded:t}){const[n,r]=R.useState(t),{additions:i,deletions:a}=R.useMemo(()=>Y2(e),[e]),o=n&&i+a<=lK,l=R.useMemo(()=>{if(o)try{return hK(e)}catch{return}},[e,o]);return h.jsxs("section",{className:`diff-file-card overflow-hidden border border-border rounded-md bg-background [&.expanded_.diff-file-header]:border-b [&.expanded_.diff-file-header]:border-b-border ${n?"expanded":""}`,children:[h.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-left py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-2xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-semibold [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-2xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":n,onClick:()=>r(u=>!u),children:[h.jsx("span",{className:"chev",children:n?h.jsx(zl,{size:14}):h.jsx(ta,{size:14})}),h.jsx("span",{className:"path",children:h.jsx("code",{children:Iv(e)})}),h.jsxs("span",{className:"stats",children:[h.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",i]}),h.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",a]})]})]}),n&&(e.hunks.length===0?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:"No textual diff for this file."}):h.jsx("div",{className:"diff-file-body overflow-x-auto bg-background",children:h.jsx(TX,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:pK,tokens:l,viewType:"unified"})}))]})}function mK({files:e,className:t}){return h.jsx("div",{className:t?`${Ov} ${t}`:Ov,children:e.map((n,r)=>h.jsx(cE,{file:n,defaultExpanded:r===0},`${n.oldPath}→${n.newPath}#${r}`))})}function gK(e){switch(e.type){case"add":return"A";case"delete":return"D";case"rename":return"R";case"copy":return"C";case"modify":return"M"}}function uE({diff:e,partial:t=!1}){var g;const n=R.useMemo(()=>fK(e,t),[e,t]),r=n.files,i=R.useMemo(()=>r.map((b,k)=>({file:b,key:`${b.oldPath}→${b.newPath}#${k}`,changes:Y2(b)})),[r]),[a,o]=R.useState(null),[l,u]=R.useState(!1),d=l&&!t,m=i.some(b=>b.key===a)?a:((g=i[0])==null?void 0:g.key)??null,f=i.find(b=>b.key===m)??null;return n.failed?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:t?"No complete file preview was available before the cutoff.":"Unable to parse this diff."}):i.length===0?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:"No changes."}):h.jsxs("div",{className:"diff-explorer @container",children:[h.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-xs [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[h.jsx("strong",{children:t?`${i.length} ${i.length===1?"file":"files"} shown (partial)`:i.length===1?"1 changed file":`${i.length} changed files`}),!t&&h.jsx("button",{type:"button",onClick:()=>u(b=>!b),children:d?"Back to preview":"View full diff"})]}),d?h.jsx(mK,{files:r}):h.jsxs("div",{className:"diff-explorer-layout grid grid-cols-[minmax(180px,_260px)_minmax(0,_1fr)] items-start gap-3.5 [@container((max-width:_960px))]:grid-cols-1",children:[h.jsx("div",{className:"diff-explorer-files sticky top-0 max-h-[min(70vh,_720px)] overflow-auto border border-border rounded-md bg-background [&_button]:grid [&_button]:grid-cols-[18px_minmax(0,_1fr)_auto_auto] [&_button]:items-center [&_button]:gap-[7px] [&_button]:w-full [&_button]:py-2 [&_button]:px-[9px] [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-left [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-[inset_2px_0_0_var(--text)] [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":"Changed files",children:i.map(b=>h.jsxs("button",{type:"button",className:b.key===m?"active":"","aria-pressed":b.key===m,onClick:()=>o(b.key),children:[h.jsx("span",{className:`diff-file-status font-mono text-xs font-semibold text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${b.file.type}`,children:gK(b.file)}),h.jsx("code",{title:Iv(b.file),children:Iv(b.file)}),h.jsxs("span",{className:"diff-explorer-stat font-mono text-2xs diff-stat-add text-accent-green",children:["+",b.changes.additions]}),h.jsxs("span",{className:"diff-explorer-stat font-mono text-2xs diff-stat-del text-accent-red",children:["−",b.changes.deletions]})]},b.key))}),h.jsx("div",{className:`${Ov} diff-explorer-preview min-w-0`,children:f&&h.jsx(cE,{file:f.file,defaultExpanded:!0},f.key)})]})]})}function bK({experiment:e,refreshKey:t,onLoadingChange:n}){const[r,i]=R.useState(null),[a,o]=R.useState(null);return R.useEffect(()=>{let l=!1;return n(!0),o(null),i(null),OR(e.id).then(u=>{l||i(u)}).catch(u=>{l||o(u.message)}).finally(()=>{l||n(!1)}),()=>{l=!0}},[e.id,t,n]),h.jsx("div",{className:`${zc} branch-changes [&_>_.changes-note]:my-3.5 [&_>_.changes-note]:mx-4 [&_>_.openresearch-diff]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.truncated-notice]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0`,children:a?h.jsxs("div",{className:ws,children:["Failed to load changes: ",a]}):r?r.diff.trim()?h.jsxs(h.Fragment,{children:[r.truncated&&h.jsx(lE,{bytesRead:r.bytesRead,byteLimit:r.byteLimit}),h.jsx(uE,{diff:r.diff,partial:r.truncated})]}):h.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?"No committed changes from the parent branch.":"This is the baseline branch, so there is no parent comparison."}):h.jsx("div",{className:ws,children:"Loading changes…"})})}function dE({view:e,onViewChange:t,showViewToggle:n=!0,branchLabel:r,branchTitle:i,githubHref:a,githubTitle:o,refreshing:l,onRefresh:u}){return h.jsxs("div",{className:"code-tab-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant shrink-0 [&_>_.seg]:p-0.5 [&_>_.seg]:rounded-sm [&_>_.seg_button]:py-0.5 [&_>_.seg_button]:px-2 [&_>_.seg_button]:text-sm [&_>_.seg_button]:font-medium",children:[n&&h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-md [&_button]:font-semibold [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":"Code browser view",children:[h.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>t("files"),children:"Files"}),h.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>t("changes"),children:"Changes"})]}),r&&h.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-[color-mix(in_oklab,_var(--text)_8%,_transparent)] text-subtext text-xs [&_>_svg]:shrink-0",title:i,children:[h.jsx(oh,{size:12}),h.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap font-mono",children:r})]}),a&&h.jsx("a",{className:nr,href:a,target:"_blank",rel:"noopener noreferrer",title:o,"aria-label":o,children:h.jsx(Dp,{size:13})}),h.jsx("span",{style:{flex:1}}),h.jsx("button",{className:nr,title:"Refresh","aria-label":"Refresh",onClick:u,children:l?h.jsx("span",{className:Pt}):h.jsx(sS,{size:13})})]})}const vK=/\.(md|mdx|markdown)$/i,_K=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,xK=/\.(csv|tsv|xlsx?|ods)$/i,yK=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,wK=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,SK=/\.pdf$/i,kK=/\.(docx?|log|rtf|txt)$/i;function CK(e){return _K.test(e)}function X2(e){return vK.test(e)}function hE({name:e}){const t=X2(e)?"markdown":CK(e)?"image":xK.test(e)?"spreadsheet":yK.test(e)?"code":wK.test(e)?"archive":SK.test(e)?"pdf":kK.test(e)?"document":"file";let n;return t==="markdown"?n=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),h.jsx("path",{d:"M2.6 10.5v-5h1.2l1.6 2 1.6-2h1.2v5H6.8V7.6L5.4 9.3 4 7.6v2.9H2.6Zm8.5-5v2.4h1.3L10.5 10 8.6 7.9h1.3V5.5h1.2Z",fill:"currentColor"})]}):t==="image"?n=h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),h.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),h.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):t==="spreadsheet"?n=h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),h.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):t==="code"?n=h.jsx("path",{d:"M6.2 3 1.8 8l4.4 5 1.3-1.2L4.2 8l3.3-3.8L6.2 3Zm3.6 0-1.3 1.2L11.8 8l-3.3 3.8 1.3 1.2 4.4-5-4.4-5Z",fill:"currentColor"}):t==="archive"?n=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),h.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):n=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),h.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),h.jsx("svg",{className:`file-tree-icon w-[15px] h-[15px] shrink-0 text-muted overflow-visible [&.markdown]:text-accent-blue [&.image]:text-accent-purple [&.spreadsheet]:text-accent-green [&.code]:text-accent-orange [&.archive]:text-accent-amber [&.pdf]:text-accent-red [&.document]:text-subtext ${t}`,viewBox:"0 0 16 16","aria-hidden":"true",children:n})}const fE=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-left cursor-pointer font-[inherit]","text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),d7=["file-tree-chevron text-muted shrink-0 [button&]:inline-flex","[button&]:items-center [button&]:justify-center [button&]:w-[13px]","[button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent","[button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90"].join(" ");function h7(){return{dirs:new Map,files:[]}}function pE(e){const t=h7();for(const n of e){const r=n.split("/");let i=t;for(let a=0;aa(n),title:n,children:[u?h.jsx(zl,{size:13,className:d7}):h.jsx(ta,{size:13,className:d7}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),u&&h.jsx(K2,{node:t,parentPath:n,depth:r+1,toggled:i,onToggle:a,onOpenFile:o})]})}function K2({node:e,parentPath:t,depth:n,toggled:r,onToggle:i,onOpenFile:a}){const o=[...e.dirs.keys()].sort((u,d)=>u.localeCompare(d)),l=[...e.files].sort((u,d)=>u.localeCompare(d));return h.jsxs(h.Fragment,{children:[o.map(u=>{const d=t?`${t}/${u}`:u;return h.jsx(EK,{name:u,node:e.dirs.get(u),path:d,depth:n,toggled:r,onToggle:i,onOpenFile:a},`d:${d}`)}),l.map(u=>{const d=t?`${t}/${u}`:u;return h.jsxs("button",{type:"button",className:fE,style:{paddingLeft:8+n*14},onClick:()=>a(d),title:d,children:[h.jsx(hE,{name:u}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:u})]},`f:${d}`)})]})}function AK({projectId:e,project:t,experiment:n,view:r,toggled:i,onViewChange:a,onToggledChange:o,onOpenFile:l}){const u=n.branchName,d=`${e}:${u}`,[m,f]=R.useState(null),[g,b]=R.useState(null),[k,S]=R.useState(!1),[x,_]=R.useState(!1),[w,y]=R.useState(0),[C,T]=R.useState(void 0),E=R.useRef(0),j=R.useRef(null),N=R.useCallback(()=>{j.current=d;const F=++E.current;S(!0),Tb(e,{ref:u}).then(U=>{F===E.current&&(f(U),b(null))}).catch(U=>{F===E.current&&b(U.message)}).finally(()=>{F===E.current&&S(!1)})},[e,u,d]);R.useEffect(()=>(E.current++,j.current=null,f(null),b(null),S(!1),()=>{E.current++}),[d]),R.useEffect(()=>{r==="files"&&j.current!==d&&N()},[r,d,N]),R.useEffect(()=>{T(void 0);const F=n.chatSessionId;if(!F)return;let U=!1;return mS(F).then(V=>{!U&&V.exists&&V.branch===u&&T(F)}).catch(()=>{}),()=>{U=!0}},[n.chatSessionId,u]);const D=R.useMemo(()=>m?pE(m.entries):null,[m]),z=r==="files"?k:x,$=R.useCallback(F=>{const U=new Set(i);U.has(F)?U.delete(F):U.add(F),o(U)},[i,o]);return h.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[h.jsx(dE,{view:r,onViewChange:a,branchLabel:u,branchTitle:`Committed branch ${u}`,githubHref:t.githubEnabled?cp(t.githubOwner,t.githubRepo,u):void 0,githubTitle:`Open ${u} on GitHub`,refreshing:z,onRefresh:()=>r==="files"?N():y(F=>F+1)}),r==="changes"?h.jsx(bK,{experiment:n,refreshKey:w,onLoadingChange:_},n.id):h.jsxs(h.Fragment,{children:[(m==null?void 0:m.truncated)&&h.jsx("div",{className:ws,children:"listing truncated"}),g&&D&&h.jsxs("div",{className:ws,children:["Refresh failed: ",g]}),h.jsx("div",{className:zc,children:D?D.dirs.size===0&&D.files.length===0?h.jsx("div",{className:ws,children:"No files."}):h.jsx("div",{className:"file-tree py-1.5 px-0 text-md",children:h.jsx(K2,{node:D,parentPath:"",depth:0,toggled:i,onToggle:$,onOpenFile:F=>C?l(F,C):l(F,void 0,u)})}):h.jsx("div",{className:ws,children:g?`Failed to load: ${g}`:"Loading…"})})]})]})}const TK=5e3;function NK({sessionId:e,project:t,view:n,toggled:r,onViewChange:i,onToggledChange:a,onOpenFile:o}){var D;const l=t.id,[u,d]=R.useState(null),[m,f]=R.useState(null),[g,b]=R.useState(null),[k,S]=R.useState(!0),x=R.useRef(0),_=R.useCallback(()=>{const z=++x.current;S(!0),(async()=>{if(!e)return[null,await Tb(l,{ref:t.baselineBranch})];const F=await mS(e),U=F.exists?{sessionId:e}:{ref:t.baselineBranch};return[F,await Tb(l,U)]})().then(([F,U])=>{z===x.current&&(d(F),f(U),b(null))}).catch(F=>{z===x.current&&b(F.message)}).finally(()=>{z===x.current&&S(!1)})},[e,l,t.baselineBranch]);R.useEffect(()=>(d(null),f(null),b(null),_(),()=>{x.current++}),[_]),R.useEffect(()=>{if(!e)return;let z=!1,$=!1,F=!1,U=null;const V=()=>{U||(U=setInterval(_,TK))},X=()=>{U&&(clearInterval(U),U=null)},Y=Ad(Q=>{Q.type!=="busy"||Q.sessionId!==e||($=!0,Q.busy&&!z?(z=!0,V()):!Q.busy&&z&&(z=!1,X(),_()))});return df(l).then(Q=>{var te;F||$||z||(te=Q.find(I=>I.id===e))!=null&&te.busy&&(z=!0,V())}).catch(()=>{}),()=>{F=!0,Y(),X()}},[e,l,_]);const w=R.useMemo(()=>m?pE(m.entries):null,[m]),y=R.useCallback(z=>{const $=new Set(r);$.has(z)?$.delete(z):$.add(z),a($)},[r,a]),C=e&&(u!=null&&u.exists)?u:null,T=(C==null?void 0:C.branch)??(C!=null&&C.baselineBranch?`detached @ ${C.baselineBranch}`:"detached"),E=((D=C==null?void 0:C.files)==null?void 0:D.length)??0,j=C?`Current worktree · ${T}${E>0?"*":""}`:`Default branch · ${t.baselineBranch}`,N=C?C.branch:t.baselineBranch;return h.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[h.jsx(dE,{view:C?n:"files",onViewChange:i,showViewToggle:!!C,branchLabel:j,branchTitle:j,githubHref:t.githubEnabled&&N?cp(t.githubOwner,t.githubRepo,N):void 0,githubTitle:N?`Open ${N} on GitHub`:void 0,refreshing:k,onRefresh:_}),g&&(u||m)&&h.jsxs("div",{className:ws,children:["Refresh failed: ",g]}),!m||e&&!u?h.jsx("div",{className:zc,children:h.jsx("div",{className:ws,children:g?`Failed to load: ${g}`:"Loading…"})}):C&&n==="changes"?h.jsx("div",{className:`${zc} wt-changes pt-0 px-4 pb-6 [&_>_:first-child]:mt-3.5`,children:E===0||!C.diff?h.jsx("div",{className:"changes-note text-sm text-muted",children:"No changes yet."}):h.jsxs(h.Fragment,{children:[C.diff.truncated&&h.jsx(lE,{bytesRead:C.diff.bytesRead,byteLimit:C.diff.byteLimit}),h.jsx(uE,{diff:C.diff.diff,partial:C.diff.truncated})]})}):h.jsxs("div",{className:zc,children:[m.truncated&&h.jsx("div",{className:ws,children:"Listing truncated."}),w?w.dirs.size===0&&w.files.length===0?h.jsx("div",{className:ws,children:"No files."}):h.jsx("div",{className:"file-tree py-1.5 px-0 text-md",children:h.jsx(K2,{node:w,parentPath:"",depth:0,toggled:r,onToggle:y,onOpenFile:z=>C?o(z,e):o(z,void 0,t.baselineBranch)})}):h.jsx("div",{className:ws,children:"Loading…"})]})]})}function mE({text:e,path:t,highlightLine:n,scrollRequest:r,onScrollRequestHandled:i}){const a=R.useMemo(()=>T2(e,J_(t)),[e,t]),o=e?e.split(` -`).length-(e.endsWith(` -`)?1:0):0,l=n&&o>0?Math.min(Math.max(Math.trunc(n),1),o):void 0,u=R.useRef(null),d=R.useRef(null),[m,f]=R.useState(null);return R.useLayoutEffect(()=>{const g=u.current;if(!l||!g){f(null);return}const b=getComputedStyle(g),k=Number.parseFloat(b.paddingTop)||0,S=Number.parseFloat(b.lineHeight)||0;if(!S){f(null);return}f({line:l,top:k+(l-1)*S,height:S})},[a,l]),R.useLayoutEffect(()=>{var g;r!==void 0&&(m&&m.line===l?((g=d.current)==null||g.scrollIntoView({block:"center"}),i==null||i()):o===0&&(i==null||i()))},[m,o,i,r,l]),h.jsxs("div",{className:"file-view-codewrap flex items-start min-w-max relative",children:[o>0&&h.jsx("pre",{className:"file-view-gutter m-0 pt-3.5 pb-3.5 font-mono text-sm leading-[1.55] pl-3.5 pr-2.5 text-right text-muted select-none sticky left-0 bg-background border-r border-r-border-variant shrink-0","aria-hidden":"true",children:Array.from({length:o},(g,b)=>b+1).join(` -`)}),h.jsx("pre",{className:"file-view-code m-0 pt-3.5 pb-3.5 font-mono text-sm leading-[1.55] pl-4 pr-4 [tab-size:4] min-w-max",ref:u,children:h.jsx("code",{children:a})}),m&&h.jsx("div",{ref:d,className:"file-view-line-highlight absolute left-0 right-0 pointer-events-none bg-[color-mix(in_srgb,_var(--primary)_16%,_transparent)] shadow-[inset_2px_0_0_var(--primary)]",style:{top:m.top,height:m.height},"aria-hidden":"true"})]})}function gE(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function f7({url:e,name:t}){return h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["This browser can’t preview this media format."," ",h.jsxs("a",{href:e,download:t,children:["Download ",t]})]})}function bE({kind:e,url:t,name:n}){const[r,i]=R.useState(!1);if(R.useEffect(()=>i(!1),[e,t]),r)return h.jsx(f7,{url:t,name:n});let a;return e==="image"?a=h.jsx("div",{className:"fpreview-image flex min-h-0 flex-1 items-start justify-center overflow-auto p-6 [&_img]:max-w-full [&_img]:h-auto [&_img]:border [&_img]:border-border [&_img]:rounded-sm",children:h.jsx("img",{src:t,alt:n,onError:()=>i(!0)})}):e==="audio"?a=h.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:h.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:t,"aria-label":n,onError:()=>i(!0)})}):e==="video"?a=h.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:h.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:t,"aria-label":n,onError:()=>i(!0)})}):a=h.jsx("object",{className:"fpreview-pdf block min-h-0 flex-1 w-full border-0","aria-label":n,data:t,type:"application/pdf",onError:()=>i(!0),children:h.jsx(f7,{url:t,name:n})}),h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a,h.jsx("div",{className:"shrink-0 border-t border-border-variant py-1.5 px-3 text-right text-xs",children:h.jsxs("a",{href:t,download:n,children:["Download ",n]})})]})}const p7=`${nr} tip-up [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]`;function jK(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function MK(e,t,n){const r=n.indexOf("#"),i=r===-1?n:n.slice(0,r),a=r===-1?"":n.slice(r),o=i.indexOf("?"),l=o===-1?i:i.slice(0,o),u=o===-1?"":i.slice(o+1),d=l.startsWith("/")?[]:t.split("/").filter(b=>b.length>0);for(const b of l.split("/"))if(!(!b||b==="."))if(b===".."){if(d.length===0)return null;d.pop()}else d.push(b);const m=d.join("/");if(!m)return null;const f=new URLSearchParams(u);f.delete("path");const g=f.toString();return`${uh(e,m)}${g?`&${g}`:""}${a}`}function RK(e){if(!e.startsWith("---"))return e;const t=e.indexOf(` ----`,3);return t===-1?e:e.slice(t+4).replace(/^\r?\n/,"")}const vE="orx:files-tree-width",_E="orx:artifacts-collapsed:",xE=180,yE=560,DK=8,LK=280;function OK(){try{const e=Number(localStorage.getItem(vE));if(Number.isFinite(e)&&e>=xE&&e<=yE)return e}catch{}return LK}function IK(e){try{const t=localStorage.getItem(`${_E}${e}`);if(!t)return new Set;const n=JSON.parse(t);return Array.isArray(n)?new Set(n.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function zv(e,t){for(const n of e){if(n.path===t)return n;if(n.isDir&&t.startsWith(n.path+"/")){const r=zv(n.children??[],t);if(r)return r}}return null}function wE({projectId:e,folder:t,markdown:n}){const r=i=>jK(i)?i:MK(e,t,i);return h.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-[color-mix(in_oklab,_var(--border)_50%,_transparent)] [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-[0.9em] [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-[1.05em] [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-[0.9em] [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:pl-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:pl-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-md [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-left [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-left [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pr-0 [&_blockquote]:pb-0.5 [&_blockquote]:pl-2.5 [&_blockquote]:border-l-[3px] [&_blockquote]:border-l-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text artifact-md text-lg [&_h1]:text-[2em] [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-[1.5em] [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-[1.2em] [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-[1em] [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:h.jsx(XB,{remarkPlugins:[qk,[Gk,Jk]],rehypePlugins:[_k],components:{a:({href:i,children:a,...o})=>{const l=!i||i.startsWith("#"),u=l?i:r(i);return u?h.jsx("a",{...o,href:u,...l?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):h.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=r(i);return o?h.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[h.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&h.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...eC},children:Zk(RK(n))})})}function zK(e){return e.presentation==="text"&&X2(e.name)?"markdown":gE(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function SE(e){return e.toLowerCase()===Nf.toLowerCase()}function BK(e,t,n){const[r,i]=R.useState(null),[a,o]=R.useState(!1),[l,u]=R.useState(!1),[d,m]=R.useState(null),f=R.useRef(0),g=R.useRef(!1),b=n==="markdown"||n==="text"&&t.size<=vS;return R.useEffect(()=>{if(o(!1),u(!1),m(null),!b)return;let S=!1;const x=++f.current;return _S(e,t.path).then(w=>{if(!w)throw new Error("Artifact not found");return w}).then(w=>{S||x!==f.current||(w.binary?o(!0):(g.current=!0,i(w.content)),u(w.truncated))}).catch(w=>{!S&&x===f.current&&!g.current&&m(w instanceof Error?w.message:String(w))}),()=>{S=!0}},[e,t.path,t.modifiedAt,n,b]),{text:r,replaceText:S=>{f.current+=1,g.current=!0,i(S)},binary:a,truncated:l,error:d,wantsText:b}}function HK({projectId:e,entry:t,onDelete:n,onChanged:r}){const i=zK(t),{text:a,replaceText:o,binary:l,truncated:u,error:d,wantsText:m}=BK(e,t,i),[f,g]=R.useState(!1),[b,k]=R.useState(!1),[S,x]=R.useState(""),[_,w]=R.useState(!1),[y,C]=R.useState(null),T=i==="markdown",E=SE(t.path),j=t.path.split("/").slice(0,-1).join("/"),N=`${uh(e,t.path)}&v=${t.modifiedAt}`,D=async()=>{w(!0),C(null);try{await mD(e,S),o(S),k(!1),g(!1),r()}catch($){C($ instanceof Error?$.message:String($))}finally{w(!1)}};let z;return b?z=h.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2 p-4",children:[h.jsx("textarea",{className:"min-h-0 flex-1 resize-none font-mono text-sm leading-relaxed","aria-label":"Edit project brief",value:S,onChange:$=>x($.target.value)}),y&&h.jsxs("div",{className:"text-sm text-accent-red",children:["Could not save: ",y]})]}):i==="image"||i==="audio"||i==="video"||i==="pdf"?z=h.jsx(bE,{kind:i,url:N,name:t.name}):i==="download"||!m||l?z=h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[i==="download"||l?"Binary or unsupported file — no inline preview.":"File too large to preview inline."," ",h.jsx("a",{href:N,...i==="download"||l?{download:t.name}:{target:"_blank",rel:"noopener noreferrer"},children:i==="download"||l?"Download":"Open raw"})]}):d?z=h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["Failed to load: ",d]}):a===null?z=h.jsxs("div",{className:pr,children:[h.jsx("span",{className:Pt})," Loading…"]}):T&&!f?z=h.jsx(wE,{projectId:e,folder:j,markdown:a}):z=h.jsx(mE,{text:a,path:t.path}),h.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0",children:[h.jsxs("div",{className:"fpreview-head h-10 flex items-center gap-2 py-0 px-3.5 border-b border-b-border-variant text-subtext shrink-0",children:[h.jsx(ah,{size:13,style:{flexShrink:0}}),h.jsx("code",{className:"fpreview-path font-mono text-sm text-text flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",title:t.path,children:t.path}),h.jsxs("span",{className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:["Modified"," ",new Date(t.modifiedAt).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})]}),(i==="text"||i==="download")&&h.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:Lo(t.size)}),E&&!b&&a!==null&&!u&&h.jsxs("button",{className:rr,"data-tip":"Edit project brief","data-tip-align":"end","aria-label":"Edit project brief",onClick:()=>{x(a),C(null),k(!0)},children:[h.jsx(op,{size:13})," Edit"]}),E&&b&&h.jsxs(h.Fragment,{children:[h.jsxs("button",{className:rr,"data-tip":"Cancel editing","data-tip-align":"end","aria-label":"Cancel editing",disabled:_,onClick:()=>{k(!1),C(null)},children:[h.jsx(Yr,{size:13})," Cancel"]}),h.jsxs("button",{className:uL,"data-tip":_?"Saving…":"Save project brief","data-tip-align":"end","aria-label":_?"Saving project brief":"Save project brief",disabled:_,onClick:()=>void D(),children:[h.jsx(Oi,{size:13})," ",_?"Saving…":"Save"]})]}),T&&!b&&h.jsx("button",{className:`${nr} ${f?"active":""}`,"data-tip":f?"Rendered view":"View source","data-tip-align":"end","aria-label":f?"Rendered view":"View source",onClick:()=>g($=>!$),children:h.jsx(Q8,{size:13})}),h.jsx("a",{className:nr,href:N,target:"_blank",rel:"noopener noreferrer","data-tip":"Open raw in new tab","data-tip-align":"end","aria-label":"Open raw in new tab",children:h.jsx(Cd,{size:13})}),!E&&h.jsx("button",{className:nr,"data-tip":"Delete artifact","data-tip-align":"end","aria-label":"Delete artifact",onClick:()=>{window.confirm(`Delete "${t.path}" from the artifacts directory?`)&&n(t.path)},children:h.jsx(ch,{size:13})})]}),h.jsxs("div",{className:`fpreview-body flex-1 min-h-0 overflow-auto [&.doc]:pt-4.5 [&.doc]:px-7 [&.doc]:pb-12 [&.doc_.artifact-md]:max-w-readable [&.doc_.artifact-md]:my-0 [&.doc_.artifact-md]:mx-auto ${T&&!f&&!b?"doc":""}`,children:[z,u&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:"File truncated — showing the first 512 KB."})]})]})}function kE({entries:e,depth:t,collapsed:n,selected:r,onToggle:i,onSelect:a,onOpenFile:o,onDelete:l}){return h.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(u=>{var m;const d={paddingLeft:8+Math.min(t,DK)*14};if(u.isDir){const f=!n.has(u.path);return h.jsxs("div",{className:"min-w-0 max-w-full",children:[h.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-left cursor-pointer font-[inherit] text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:d,onClick:()=>i(u.path),children:[h.jsx("button",{className:"file-tree-chevron text-muted shrink-0 [button&]:inline-flex [button&]:items-center [button&]:justify-center [button&]:w-[13px] [button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent [button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90","aria-label":f?`Collapse ${u.name}`:`Expand ${u.name}`,onClick:g=>{g.stopPropagation(),i(u.path)},children:h.jsx(ta,{size:13,className:f?"open":""})}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:u.name}),h.jsx("button",{className:`${dh} ft-row-delete w-4.5 h-4.5 opacity-35 [&:focus-visible]:opacity-100`,"data-tip":"Delete folder","data-tip-align":"end","aria-label":`Delete folder ${u.name}`,onClick:g=>{g.stopPropagation(),window.confirm(`Delete "${u.path}" from the artifacts directory?`)&&l(u.path)},children:h.jsx(ch,{size:12})})]}),f&&(((m=u.children)==null?void 0:m.length)??0)>0&&h.jsx(kE,{entries:u.children??[],depth:t+1,collapsed:n,selected:r,onToggle:i,onSelect:a,onOpenFile:o,onDelete:l})]},u.path)}return h.jsxs("button",{type:"button",className:`file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-left cursor-pointer font-[inherit] text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===u.path?"selected":""}`,style:d,title:`${u.path} — double-click or Command/Ctrl+Enter to open in a tab`,"aria-keyshortcuts":"Meta+Enter Control+Enter","aria-pressed":r===u.path,onClick:()=>a(u.path),onDoubleClick:()=>o(u.path),onKeyDown:f=>{f.key!=="Enter"||!f.metaKey&&!f.ctrlKey||(f.preventDefault(),f.stopPropagation(),a(u.path),o(u.path))},children:[h.jsx(hE,{name:u.name}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:u.name})]},u.path)})})}function m7({dir:e,onOpenStorage:t}){const[n,r]=R.useState(!1);return h.jsxs("div",{className:"ftree-footer shrink-0 flex items-center gap-0.5 py-[5px] px-2 border-t border-t-border-variant [&_code]:flex-1 [&_code]:min-w-0 [&_code]:[direction:rtl] [&_code]:text-left [&_code]:font-mono [&_code]:text-xs [&_code]:text-muted [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_.icon-btn]:w-5.5 [&_.icon-btn]:h-5.5",title:e,children:[h.jsx("code",{children:e}),h.jsx("button",{className:p7,"data-tip":n?"Copied!":"Copy path","aria-label":"Copy artifacts directory path",onClick:()=>{var i;(i=navigator.clipboard)==null||i.writeText(e),r(!0),setTimeout(()=>r(!1),1200)},children:n?h.jsx(Oi,{size:12}):h.jsx(n_,{size:12})}),h.jsx("button",{className:p7,"data-tip":"Storage settings","data-tip-align":"end","aria-label":"Storage settings",onClick:t,children:h.jsx(rR,{size:12})})]})}function $K({project:e,artifacts:t,onChanged:n,onOpenFile:r,onOpenStorage:i}){var w;const[a,o]=R.useState(null),[l,u]=R.useState(()=>IK(e.id)),[d,m]=R.useState(OK),f=R.useRef(null),g=((w=t==null?void 0:t.entries.find(y=>!y.isDir&&SE(y.path)))==null?void 0:w.path)??null;R.useEffect(()=>{!a&&g&&o(g)},[a,g]),R.useEffect(()=>{try{localStorage.setItem(`${_E}${e.id}`,JSON.stringify([...l]))}catch{}},[e.id,l]);const b=y=>{var N;y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId);const C=((N=f.current)==null?void 0:N.getBoundingClientRect().left)??0,T=document.body.style.userSelect;document.body.style.userSelect="none";const E=D=>{const z=Math.round(D.clientX-C),$=Math.min(Math.max(z,xE),yE);m($);try{localStorage.setItem(vE,String($))}catch{}},j=()=>{window.removeEventListener("pointermove",E),window.removeEventListener("pointerup",j),window.removeEventListener("pointercancel",j),document.body.style.userSelect=T};window.addEventListener("pointermove",E),window.addEventListener("pointerup",j),window.addEventListener("pointercancel",j)};R.useEffect(()=>{if(!a||!t)return;const y=zv(t.entries,a);(!y||y.isDir)&&o(null)},[a,t]);const k=y=>u(C=>{const T=new Set(C);return T.has(y)?T.delete(y):T.add(y),T}),S=y=>{(a===y||a!=null&&a.startsWith(y+"/"))&&o(null),fD(e.id,y).catch(()=>{}).finally(n)};if(!t)return h.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:h.jsxs("div",{className:pr,style:{padding:20},children:[h.jsx("span",{className:Pt})," Loading artifacts…"]})});const x=y=>h.jsx(kE,{entries:y,depth:0,collapsed:l,selected:a,onToggle:k,onSelect:o,onOpenFile:r,onDelete:S}),_=a?zv(t.entries,a):null;return t.entries.length===0?h.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:h.jsxs("div",{className:"files-empty-state flex-1 flex flex-col items-center justify-center gap-1.5 p-6 text-center text-muted [&_h3]:mt-1.5 [&_h3]:mx-0 [&_h3]:mb-0 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text [&_p]:m-0 [&_p]:max-w-105 [&_p]:text-md [&_p]:leading-[1.55] [&_p]:text-subtext [&_.ftree-footer]:mt-2.5 [&_.ftree-footer]:max-w-full [&_.ftree-footer]:border [&_.ftree-footer]:border-border [&_.ftree-footer]:rounded-md [&_.ftree-footer]:py-1.5 [&_.ftree-footer]:px-2.5 [&_.ftree-footer]:bg-background [&_.ftree-footer_code]:max-w-95",children:[h.jsx(r_,{size:28,strokeWidth:1.5}),h.jsx("h3",{children:"No artifacts yet"}),h.jsx("p",{children:"This is the project's durable output space for reports, figures, images, CSVs, PDFs, and other research artifacts. Ask the agent for a write-up or add your own files:"}),h.jsx(m7,{dir:t.dir,onOpenStorage:i})]})}):h.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background",children:[h.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-l border-l-border-variant border-r border-r-border-variant bg-background",ref:f,style:{width:d},children:[h.jsx("div",{className:"ftree-resizer absolute -right-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] [&:active]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)]",onPointerDown:b}),h.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-md",children:[x(t.entries),t.truncated&&h.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-xs text-muted",children:"Listing truncated — the folder has more artifacts."})]}),h.jsx(m7,{dir:t.dir,onOpenStorage:i})]}),_?h.jsx(HK,{projectId:e.id,entry:_,onDelete:S,onChanged:n},_.path):h.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-md text-muted",children:[h.jsx(FM,{size:22,strokeWidth:1.5}),h.jsx("span",{children:"Click an artifact to view it"})]})]})}const FK=20*1024*1024,Bv="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text",CE="mt-0 mx-0 mb-3 text-muted text-md leading-normal",EE="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",AE="font-mono text-sm font-medium text-text",TE="mt-0.5 mb-0 text-xs leading-relaxed text-muted";function PK(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const i=r.result;if(typeof i!="string"){n(new Error("could not read file"));return}const a=i.indexOf(",");t(a>=0?i.slice(a+1):i)},r.onerror=()=>n(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function UK(e){const t=e.toLowerCase();return t.endsWith(".md")||t.endsWith(".markdown")||t.endsWith(".zip")}function qK({skill:e,projectId:t,onDeleted:n,onError:r}){const[i,a]=R.useState(!1);return h.jsxs("div",{className:EE,children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("code",{className:AE,children:["/",e.name]}),h.jsx("p",{className:TE,children:e.description})]}),h.jsxs("div",{className:"shrink-0 text-right whitespace-nowrap pt-0.5",children:[h.jsx("div",{className:"text-2xs text-subtext",children:Lo(e.bytes)}),e.updatedAt>0&&h.jsx("div",{className:"text-2xs text-muted",children:Zs(e.updatedAt)})]}),h.jsx("button",{className:nr,"data-tip":"Delete skill","data-tip-align":"end","aria-label":`Delete skill ${e.name}`,disabled:i,onClick:()=>{window.confirm(`Delete the "${e.name}" skill?`)&&(a(!0),ND({scope:e.scope,name:e.name,projectId:e.scope==="project"?t:void 0}).then(n).catch(o=>{a(!1),r(o instanceof Error?o.message:String(o))}))},children:h.jsx(ch,{size:13})})]})}function g7({title:e,hint:t,skills:n,projectId:r,onChanged:i,onError:a}){return h.jsxs("section",{className:Bv,children:[h.jsx("h3",{children:e}),h.jsx("p",{className:CE,children:t}),n.length===0?h.jsx("div",{className:"text-muted text-sm",children:"No skills yet."}):h.jsx("div",{className:"flex flex-col",children:n.map(o=>h.jsx(qK,{skill:o,projectId:r,onDeleted:i,onError:a},o.name))})]})}function GK({skill:e,scopeLabel:t,alreadyImported:n,onImport:r}){const[i,a]=R.useState(!1);return h.jsxs("div",{className:EE,children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("code",{className:AE,children:["/",e.name]}),h.jsx("span",{className:hr,children:e.harnessName})]}),h.jsx("p",{className:TE,children:e.description})]}),h.jsxs("button",{className:rr,disabled:i,title:`Import into ${t}`,onClick:async()=>{a(!0);try{await r(e)}finally{a(!1)}},children:[i?h.jsx("span",{className:Pt}):h.jsx(nM,{size:13}),n?"Re-import":"Import"]})]})}function VK({project:e}){const[t,n]=R.useState(null),[r,i]=R.useState([]),[a,o]=R.useState("global"),[l,u]=R.useState(!1),[d,m]=R.useState(null),[f,g]=R.useState(!1),b=R.useRef(null),k=R.useCallback(()=>{AD(e==null?void 0:e.id).then(n).catch(()=>n([]))},[e==null?void 0:e.id]);R.useEffect(()=>{k()},[k]),R.useEffect(()=>{jD().then(i).catch(()=>i([]))},[]),R.useEffect(()=>{!e&&a==="project"&&o("global")},[e,a]);const S=R.useRef(!1),x=R.useCallback(async N=>{if(!S.current){if(m(null),!UK(N.name)){m("Upload a SKILL.md file or a .zip of a skill folder.");return}if(N.size>FK){m("File too large (max 20 MB).");return}S.current=!0,u(!0);try{const D=await PK(N);await TD({scope:a,projectId:a==="project"?e==null?void 0:e.id:void 0,filename:N.name,contentBase64:D}),k()}catch(D){m(D instanceof Error?D.message:String(D))}finally{S.current=!1,u(!1)}}},[a,e==null?void 0:e.id,k]),_=N=>{var z;N.preventDefault(),g(!1);const D=(z=N.dataTransfer.files)==null?void 0:z[0];D&&x(D)},w=R.useCallback(async N=>{m(null);try{await MD({harness:N.harnessId,name:N.name,scope:a,projectId:a==="project"?e==null?void 0:e.id:void 0}),k()}catch(D){m(D instanceof Error?D.message:String(D))}},[a,e==null?void 0:e.id,k]),y=(t??[]).filter(N=>N.scope==="global"),C=(t??[]).filter(N=>N.scope==="project"),T=a==="global"?"Global":(e==null?void 0:e.name)??"this project",E=new Set((t??[]).filter(N=>N.scope===a).map(N=>N.name)),j=N=>`flex-1 flex flex-col gap-0.5 py-2.5 px-3 border rounded-md text-left text-sm font-medium cursor-pointer transition-[border-color,background] duration-120 disabled:opacity-50 disabled:cursor-not-allowed ${N?"border-primary bg-surface":"border-border bg-background text-text [&:hover:not(:disabled)]:border-border-variant"}`;return h.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl",children:[h.jsx("h1",{children:"Skills"}),h.jsxs("p",{className:"mt-0 mx-0 mb-5 text-muted text-md leading-normal [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text",children:["Upload ",h.jsx("code",{children:"SKILL.md"})," skills your agent discovers automatically in every session and you can invoke with ",h.jsx("code",{children:"/name"})," in chat. Add a single ",h.jsx("code",{children:"SKILL.md"})," or a"," ",h.jsx("code",{children:".zip"})," of a skill folder (with supporting scripts and resources)."]}),h.jsxs("section",{className:Bv,children:[h.jsx("h3",{children:"Add a skill"}),h.jsxs("div",{className:"flex gap-2 mb-3.5",role:"group","aria-label":"Skill scope",children:[h.jsxs("button",{type:"button","aria-pressed":a==="global",className:j(a==="global"),onClick:()=>o("global"),children:["Global",h.jsx("span",{className:"text-2xs font-normal text-muted",children:"Every project"})]}),h.jsxs("button",{type:"button","aria-pressed":a==="project",className:j(a==="project"),disabled:!e,title:e?void 0:"Open a project to add a project skill",onClick:()=>o("project"),children:["This project",h.jsx("span",{className:"text-2xs font-normal text-muted",children:e?e.name:"No project open"})]})]}),h.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm transition-[border-color,background] duration-120 [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text ${l?"cursor-default":"cursor-pointer"} ${f?"border-primary bg-surface text-text":"border-border-variant bg-surface text-muted [&:hover]:border-primary [&:hover]:text-text"}`,onDragOver:N=>{N.preventDefault(),g(!0)},onDragLeave:()=>g(!1),onDrop:_,onClick:()=>{var N;return(N=b.current)==null?void 0:N.click()},role:"button",tabIndex:0,onKeyDown:N=>{var D;(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),(D=b.current)==null||D.click())},children:[h.jsx("input",{ref:b,type:"file",accept:".md,.markdown,.zip",hidden:!0,onChange:N=>{var z;const D=(z=N.target.files)==null?void 0:z[0];D&&x(D),N.target.value=""}}),l?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:Pt}),h.jsx("span",{children:"Uploading…"})]}):h.jsxs(h.Fragment,{children:[h.jsx(vR,{size:20,strokeWidth:1.5}),h.jsxs("span",{children:["Drop a ",h.jsx("code",{children:"SKILL.md"})," or ",h.jsx("code",{children:".zip"})," here, or click to choose"]}),h.jsxs("span",{className:"inline-flex items-center gap-1.5 text-2xs text-subtext",children:[h.jsx(lM,{size:12})," Adding to"," ",h.jsx("strong",{className:"text-text font-semibold",children:a==="global"?"Global":e==null?void 0:e.name})]})]})]}),d&&h.jsx("div",{className:"mt-2.5 text-accent-red text-sm whitespace-pre-wrap",children:d})]}),r.length>0&&h.jsxs("section",{className:Bv,children:[h.jsx("h3",{children:"Import from your agent"}),h.jsxs("p",{className:`${CE} [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text [&_strong]:text-text [&_strong]:font-semibold`,children:["Skills already installed in your coding agents. Import a copy into"," ",h.jsx("strong",{children:T})," so it's managed here and invocable with ",h.jsx("code",{children:"/name"}),"."]}),h.jsx("div",{className:"flex flex-col",children:r.map(N=>h.jsx(GK,{skill:N,scopeLabel:T,alreadyImported:E.has(N.name),onImport:w},`${N.harnessId}:${N.name}`))})]}),t===null?h.jsxs("div",{className:"flex items-center gap-2 text-subtext text-md p-3",children:[h.jsx("span",{className:Pt})," Loading skills…"]}):h.jsxs(h.Fragment,{children:[h.jsx(g7,{title:"Global skills",hint:"Available to the agent in every project.",skills:y,onChanged:k,onError:m}),e&&h.jsx(g7,{title:`${e.name} skills`,hint:"Available only in this project's sessions. Shadows a global skill of the same name.",skills:C,projectId:e.id,onChanged:k,onError:m})]})]})}const WK="italic [&_.tab-label_>_span]:pr-1 [&_.tab-label::after]:pr-1";function No({active:e,label:t,icon:n,shimmer:r=!1,preview:i=!1,onSelect:a,onPromote:o,onClose:l}){return h.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pr-0.5 [&_.tab-label]:grid [&_.tab-label]:grid-cols-[minmax(0,_1fr)] [&_.tab-label]:min-w-0 [&_.tab-label]:overflow-hidden [&_.tab-label_>_span]:[grid-area:1_/_1] [&_.tab-label_>_span]:overflow-hidden [&_.tab-label_>_span]:text-ellipsis [&_.tab-label_>_span]:whitespace-nowrap [&_.tab-label::after]:[grid-area:1_/_1] [&_.tab-label::after]:overflow-hidden [&_.tab-label::after]:text-ellipsis [&_.tab-label::after]:whitespace-nowrap [&_.tab-label::after]:content-[attr(data-label)] [&_.tab-label::after]:invisible [&_.tab-label::after]:font-medium [&_.tab-close]:inline-flex [&_.tab-close]:items-center [&_.tab-close]:justify-center [&_.tab-close]:w-3.5 [&_.tab-close]:h-3.5 [&_.tab-close]:rounded-xs [&_.tab-close]:text-muted [&_.tab-close]:shrink-0 [&_.tab-close:hover]:bg-[color-mix(in_oklab,_var(--text)_15%,_transparent)] [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap select-none min-w-24 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-left-px [&:not(.active)_+_.tab:not(.active)::before]:w-px [&:not(.active)_+_.tab:not(.active)::before]:bg-border [&.active]:border-border [&.active]:bg-background [&.active]:text-text [&.active]:font-medium [&.active::after]:content-[''] [&.active::after]:absolute [&.active::after]:right-0 [&.active::after]:-bottom-px [&.active::after]:left-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${i?WK:""}`,onClick:a,onDoubleClick:o,onKeyDown:u=>{e&&u.key==="Enter"&&(o==null||o())},title:i?`${t} (double-click or Enter to keep open)`:t,"aria-label":i?`${t} (preview)`:t,children:[n,h.jsx("span",{className:"tab-label","data-label":t,children:h.jsx("span",{className:r?"tool-running-shimmer":"",children:t})}),h.jsx("span",{role:"button",className:"tab-close",title:"Close tab",onClick:u=>{u.stopPropagation(),l()},children:h.jsx(Yr,{size:12})})]})}const b7=["files-pill inline-flex items-center gap-2 min-w-0 border border-border","rounded-md py-[7px] px-[11px] bg-background text-text","no-underline [&_code]:font-mono [&_code]:text-sm","[&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap","[&_>_svg]:shrink-0 [&_>_svg]:text-muted [a&:hover]:border-muted"].join(" ");function YK({owner:e,repo:t,branch:n}){return!e||!t?h.jsx("span",{className:b7,children:h.jsx("code",{children:n})}):h.jsxs("a",{className:b7,href:cp(e,t,n),target:"_blank",rel:"noopener noreferrer",title:`Open ${n} on GitHub`,children:[h.jsx("code",{children:n}),h.jsx(Dp,{size:12})]})}const v7=["experiment-overview-action inline-flex items-center justify-center gap-[7px]","min-h-9 py-[7px] px-3 border border-border-variant rounded-sm","bg-background text-text text-sm font-semibold","transition-[background,border-color] duration-120 ease-standard","[&:hover]:border-[color-mix(in_oklab,_var(--text)_34%,_var(--border))]","[&:hover]:bg-surface"].join(" "),sb=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-md","[&_h2]:font-semibold"].join(" "),_7=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function x7(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function y7(e,t){return Rf((e.endedAt??t)-e.createdAt)}function XK({experiment:e,parentExperiment:t,project:n,runs:r,onOpenLogs:i,onOpenCode:a}){const o=r[0]??null,l=r.some(m=>m.status==="running"||m.status==="starting"),[u,d]=R.useState(()=>Date.now());return R.useEffect(()=>{if(!l)return;d(Date.now());const m=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(m)},[l]),h.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-[22px] [&_h1]:leading-tight",children:h.jsxs("div",{className:"experiment-overview-inner w-full max-w-230 my-0 mx-auto pt-6.5 px-7 pb-10 [@media((max-width:_720px))]:pt-5 [@media((max-width:_720px))]:px-4.5 [@media((max-width:_720px))]:pb-8",children:[h.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[h.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[h.jsx("h1",{children:e.title||e.slug}),h.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted font-mono text-sm",children:e.slug})]}),h.jsx(La,{status:o?ls(o):"idle"})]}),h.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[o&&h.jsxs("button",{className:v7,onClick:()=>i(o.id),children:[h.jsx(Wc,{size:15}),"Logs"]}),h.jsxs("button",{className:v7,onClick:a,children:[h.jsx(ap,{size:15}),"Code"]})]}),e.description&&h.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-md [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[h.jsx("h2",{children:"Description"}),h.jsx(za,{text:e.description})]}),h.jsxs("section",{className:sb,children:[h.jsx("h2",{children:o?"Latest run":"Runs"}),o&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap gap-y-2.5 gap-x-4.5 text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs",children:[h.jsx(La,{status:ls(o)}),h.jsx(j2,{backend:o.backend}),h.jsxs("span",{title:"Started",children:[h.jsx(Lj,{size:13}),x7(o.createdAt)]}),h.jsxs("span",{title:"Duration",children:[h.jsx(Wj,{size:13}),y7(o,u)]}),o.commitSha&&h.jsxs("span",{title:"Commit",children:[h.jsx(_M,{size:14}),h.jsx("code",{children:o.commitSha.slice(0,7)})]}),o.exitCode!==null&&o.exitCode!==void 0&&o.exitCode!==0&&h.jsxs("span",{children:["exit ",o.exitCode]})]}),o.command&&h.jsxs("code",{className:_7,children:["$ ",o.command]}),o.resultMarkdown&&h.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${o.status==="failed"?"failed":""}`,children:h.jsx(za,{text:o.resultMarkdown})})]})]}),h.jsxs("section",{className:sb,children:[h.jsx("h2",{children:"Git"}),h.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs experiment-overview-git-meta gap-y-[9px] gap-x-3.5 [&_.files-pill]:py-[5px] [&_.files-pill]:px-2 [&_.files-pill]:rounded-sm [&_.files-pill_code]:text-xs",children:[h.jsx(YK,{owner:n.githubEnabled?n.githubOwner:"",repo:n.githubEnabled?n.githubRepo:"",branch:e.branchName}),t&&h.jsxs("span",{children:["from ",h.jsx("code",{children:t.slug})]}),h.jsxs("span",{title:x7(e.createdAt),children:["created ",Zs(e.createdAt)]})]}),e.runCommand!==(o==null?void 0:o.command)&&h.jsxs("code",{className:_7,children:["$ ",e.runCommand]})]}),r.length>0&&h.jsxs("section",{className:sb,children:[h.jsx("h2",{children:"Run history"}),h.jsx("div",{className:"experiment-run-history border-t border-t-border-variant [&_button]:w-full [&_button]:grid [&_button]:grid-cols-[minmax(72px,_0.7fr)_minmax(100px,_1fr)_minmax(70px,_0.7fr)_60px_16px] [&_button]:items-center [&_button]:gap-3.5 [&_button]:py-[11px] [&_button]:px-0.5 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-left [&_button]:text-sm [&_button:hover]:bg-surface [@media((max-width:_720px))]:[&_button]:grid-cols-[65px_1fr_60px_16px] [@media((max-width:_720px))]:[&_button_>_:nth-child(3)]:hidden",children:r.map((m,f)=>h.jsxs("button",{onClick:()=>i(m.id),children:[h.jsxs("span",{className:"experiment-run-number font-mono text-xs font-semibold",children:["Run ",r.length-f]}),h.jsx(La,{status:ls(m)}),h.jsx("span",{children:Zs(m.createdAt)}),h.jsx("span",{children:y7(m,u)}),h.jsx(Wc,{size:13})]},m.id))})]})]})})}var ab={exports:{}},w7;function KK(){return w7||(w7=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(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const a=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(a._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,a=i._renderService.dimensions;if(a.css.cell.width===0||a.css.cell.height===0)return;const o=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(l.getPropertyValue("height")),d=Math.max(0,parseInt(l.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),f=u-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),g=d-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-o;return{cols:Math.max(2,Math.floor(g/a.css.cell.width)),rows:Math.max(1,Math.floor(f/a.css.cell.height))}}}})(),n})()))})(ab)),ab.exports}var ZK=KK(),ob={exports:{}},S7;function QK(){return S7||(S7=1,(function(e,t){(function(n,r){e.exports=r()})(globalThis,(()=>(()=>{var n={4567:function(o,l,u){var d=this&&this.__decorate||function(w,y,C,T){var E,j=arguments.length,N=j<3?y:T===null?T=Object.getOwnPropertyDescriptor(y,C):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(w,y,C,T);else for(var D=w.length-1;D>=0;D--)(E=w[D])&&(N=(j<3?E(N):j>3?E(y,C,N):E(y,C))||N);return j>3&&N&&Object.defineProperty(y,C,N),N},m=this&&this.__param||function(w,y){return function(C,T){y(C,T,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const f=u(9042),g=u(9924),b=u(844),k=u(4725),S=u(2585),x=u(3656);let _=l.AccessibilityManager=class extends b.Disposable{constructor(w,y,C,T){super(),this._terminal=w,this._coreBrowserService=C,this._renderService=T,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 E=0;Ethis._handleBoundaryFocus(E,0),this._bottomBoundaryFocusListener=E=>this._handleBoundaryFocus(E,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 g.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((E=>this._handleResize(E.rows)))),this.register(this._terminal.onRender((E=>this._refreshRows(E.start,E.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((E=>this._handleChar(E)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` +`:"")+m.content]}),["",""]),n=zt(t,2),r=zt(dE(n[0],n[1]),2),i=r[0],a=r[1];if(i.length===0&&a.length===0)return[[],[]];var o=function(d){if(d&&!Ha(d))return d.lineNumber},l=o(e.find(zi)),c=o(e.find(Wo));if(l===void 0||c===void 0)throw new Error("Could not find start line number for edit");return[c7(l7(i),l),c7(l7(a),c)]}function hK(e){var t=e.reduce((function(r,i){var a=zt(r,3),o=a[0],l=a[1],c=a[2];if(!c||!zi(c)||!Wo(i))return[o,l,i];var d=zt(dE(c.content,i.content),2),m=d[0],f=d[1];return[o.concat(zv(m,c.lineNumber)),l.concat(zv(f,i.lineNumber)),i]}),[[],[],null]),n=zt(t,2);return[n[0],n[1]]}function fK(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).type,n=(t===void 0?"block":t)==="block"?dK:hK,r=X2(e.map((function(l){return l.changes})),uE).map(n).reduce((function(l,c){var d=zt(l,2),m=d[0],f=d[1],g=zt(c,2),b=g[0],k=g[1];return[m.concat(b),f.concat(k)]}),[[],[]]),i=zt(r,2),a=i[0],o=i[1];return aK(a7(a),a7(o))}var pK=["enhancers"],u7=function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.enhancers,i=r===void 0?[]:r,a=zt(GX(e,Po(n,pK)),2),o=a[0],l=a[1],c=[r7(o),r7(l)],d=(t=[c[0],c[1]],i.reduce((function(S,x){return x(S)}),t)),m=zt(d,2),f=m[0],g=m[1],b=[f.map(i7),g.map(i7)],k=b[1];return{old:b[0].map((function(S){var x;return(x=S.children)!==null&&x!==void 0?x:[]})),new:k.map((function(S){var x;return(x=S.children)!==null&&x!==void 0?x:[]}))}};const Bv=["openresearch-diff flex flex-col gap-4","[&_.openresearch-diff-file]:[--openresearch-diff-selection-background-color:color-mix(_in_oklab,_var(--surface)_76%,_var(--primary)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-gutter-selection-background-color:color-mix(_in_oklab,_var(--surface)_68%,_var(--primary)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-gutter-background-color:color-mix(_in_oklab,_var(--base)_84%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-gutter-background-color:color-mix(_in_oklab,_var(--base)_86%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-code-background-color:color-mix(_in_oklab,_var(--base)_91%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-code-background-color:color-mix(_in_oklab,_var(--base)_92%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-edit-background-color:color-mix(_in_oklab,_var(--base)_72%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-edit-background-color:color-mix(_in_oklab,_var(--base)_78%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-divider-color:var(--border)]","[&_.openresearch-diff-file]:[--openresearch-diff-omit-gutter-line-color:color-mix(in_oklab,_var(--base)_86%,_var(--text))]","[&_.openresearch-diff-file]:[--openresearch-diff-unified-gutter-text-color:color-mix(in_oklab,_var(--text)_45%,_var(--base))]","[&_.openresearch-diff-file]:[--diff-background-color:var(--base)]","[&_.openresearch-diff-file]:[--diff-text-color:var(--text)]","[&_.openresearch-diff-file]:[--diff-font-family:var(--mono)]","[&_.openresearch-diff-file]:[--diff-selection-text-color:var(--primary)]","[&_.openresearch-diff-file]:[--diff-selection-background-color:var(--openresearch-diff-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-background-color:var(--openresearch-diff-gutter-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-code-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-code-selected-background-color:var(--diff-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-insert-text-color:var(--accent-green)]","[&_.openresearch-diff-file]:[--diff-gutter-insert-background-color:var(--openresearch-diff-insert-gutter-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-text-color:var(--accent-red)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-background-color:var(--openresearch-diff-delete-gutter-background-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-background-color:var(--openresearch-diff-insert-code-background-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-background-color:var(--openresearch-diff-delete-code-background-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-background-color:var(--openresearch-diff-insert-edit-background-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-background-color:var(--openresearch-diff-delete-edit-background-color)]","[&_.openresearch-diff-file]:[--diff-omit-gutter-line-color:var(--openresearch-diff-omit-gutter-line-color)]","[&_.openresearch-diff-file]:w-full [&_.openresearch-diff-file]:text-sm","[&_.openresearch-diff-file]:leading-[1.55] [&_.openresearch-diff-file.diff-unified]:table-auto","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:first-child]:collapse","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:first-child]:w-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[1%]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:first-child]:hidden","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:sticky","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:left-0","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:z-1","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[1%]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pr-2.5 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pb-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pl-3.5","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:whitespace-nowrap","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-right","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-[var(--openresearch-diff-unified-gutter-text-color)]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-r [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-r-[var(--openresearch-diff-divider-color)]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line]:leading-[1.55]","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-[var(--openresearch-diff-insert-code-background-color)]","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-[var(--openresearch-diff-delete-code-background-color)]","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:px-4","[&_.openresearch-diff-file_.diff-code]:whitespace-pre","[&_.openresearch-diff-file_.diff-code]:break-normal","[&_.openresearch-diff-file_.diff-code]:wrap-normal","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-[var(--openresearch-diff-divider-color)]"].join(" "),mK=2e3,gK={highlight(e,t){return ot.highlight(e,t).children}};function bK(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function Z2(e){let t=0,n=0;for(const r of e.hunks)for(const i of r.changes)i.type==="insert"?t++:i.type==="delete"&&n++;return{additions:t,deletions:n}}function vK(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function Hv(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 _K(e){const t=[fK(e.hunks,{type:"line"})],n=r2(vK(e));return n&&ot.registered(n)?u7(e.hunks,{enhancers:t,highlight:!0,language:n,refractor:gK}):u7(e.hunks,{enhancers:t,highlight:!1})}function xK(e,t){if(!e.trim())return{files:[],failed:!1};try{return{files:jv(e,{nearbySequences:"zip"}),failed:!1}}catch{if(t){const n=Array.from(e.matchAll(/^diff --git /gm),i=>i.index),r=n[n.length-1];if(n.length>1&&r!==void 0)try{return{files:jv(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const yK=({change:e,side:t})=>t==="old"?null:bK(e);function d7(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/1024).toFixed(1)} KB`}function hE({bytesRead:e,byteLimit:t}){return h.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-md [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-md [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[h.jsx("h4",{children:"Diff preview truncated"}),h.jsxs("p",{children:["Showing the first ",d7(t)," (",d7(e)," read). View the complete diff locally with git."]})]})}function fE({file:e,defaultExpanded:t}){const[n,r]=R.useState(t),{additions:i,deletions:a}=R.useMemo(()=>Z2(e),[e]),o=n&&i+a<=mK,l=R.useMemo(()=>{if(o)try{return _K(e)}catch{return}},[e,o]);return h.jsxs("section",{className:`diff-file-card overflow-hidden border border-border rounded-md bg-background [&.expanded_.diff-file-header]:border-b [&.expanded_.diff-file-header]:border-b-border ${n?"expanded":""}`,children:[h.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-left py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-2xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-semibold [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-2xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":n,onClick:()=>r(c=>!c),children:[h.jsx("span",{className:"chev",children:n?h.jsx(Bl,{size:14}):h.jsx(ea,{size:14})}),h.jsx("span",{className:"path",children:h.jsx("code",{children:Hv(e)})}),h.jsxs("span",{className:"stats",children:[h.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",i]}),h.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",a]})]})]}),n&&(e.hunks.length===0?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:"No textual diff for this file."}):h.jsx("div",{className:"diff-file-body overflow-x-auto bg-background",children:h.jsx(OX,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:yK,tokens:l,viewType:"unified"})}))]})}function wK({files:e,className:t}){return h.jsx("div",{className:t?`${Bv} ${t}`:Bv,children:e.map((n,r)=>h.jsx(fE,{file:n,defaultExpanded:r===0},`${n.oldPath}→${n.newPath}#${r}`))})}function SK(e){switch(e.type){case"add":return"A";case"delete":return"D";case"rename":return"R";case"copy":return"C";case"modify":return"M"}}function pE({diff:e,partial:t=!1}){var g;const n=R.useMemo(()=>xK(e,t),[e,t]),r=n.files,i=R.useMemo(()=>r.map((b,k)=>({file:b,key:`${b.oldPath}→${b.newPath}#${k}`,changes:Z2(b)})),[r]),[a,o]=R.useState(null),[l,c]=R.useState(!1),d=l&&!t,m=i.some(b=>b.key===a)?a:((g=i[0])==null?void 0:g.key)??null,f=i.find(b=>b.key===m)??null;return n.failed?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:t?"No complete file preview was available before the cutoff.":"Unable to parse this diff."}):i.length===0?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:"No changes."}):h.jsxs("div",{className:"diff-explorer @container",children:[h.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-xs [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[h.jsx("strong",{children:t?`${i.length} ${i.length===1?"file":"files"} shown (partial)`:i.length===1?"1 changed file":`${i.length} changed files`}),!t&&h.jsx("button",{type:"button",onClick:()=>c(b=>!b),children:d?"Back to preview":"View full diff"})]}),d?h.jsx(wK,{files:r}):h.jsxs("div",{className:"diff-explorer-layout grid grid-cols-[minmax(180px,_260px)_minmax(0,_1fr)] items-start gap-3.5 [@container((max-width:_960px))]:grid-cols-1",children:[h.jsx("div",{className:"diff-explorer-files sticky top-0 max-h-[min(70vh,_720px)] overflow-auto border border-border rounded-md bg-background [&_button]:grid [&_button]:grid-cols-[18px_minmax(0,_1fr)_auto_auto] [&_button]:items-center [&_button]:gap-[7px] [&_button]:w-full [&_button]:py-2 [&_button]:px-[9px] [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-left [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-[inset_2px_0_0_var(--text)] [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":"Changed files",children:i.map(b=>h.jsxs("button",{type:"button",className:b.key===m?"active":"","aria-pressed":b.key===m,onClick:()=>o(b.key),children:[h.jsx("span",{className:`diff-file-status font-mono text-xs font-semibold text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${b.file.type}`,children:SK(b.file)}),h.jsx("code",{title:Hv(b.file),children:Hv(b.file)}),h.jsxs("span",{className:"diff-explorer-stat font-mono text-2xs diff-stat-add text-accent-green",children:["+",b.changes.additions]}),h.jsxs("span",{className:"diff-explorer-stat font-mono text-2xs diff-stat-del text-accent-red",children:["−",b.changes.deletions]})]},b.key))}),h.jsx("div",{className:`${Bv} diff-explorer-preview min-w-0`,children:f&&h.jsx(fE,{file:f.file,defaultExpanded:!0},f.key)})]})]})}function kK({experiment:e,refreshKey:t,onLoadingChange:n}){const[r,i]=R.useState(null),[a,o]=R.useState(null);return R.useEffect(()=>{let l=!1;return n(!0),o(null),i(null),HR(e.id).then(c=>{l||i(c)}).catch(c=>{l||o(c.message)}).finally(()=>{l||n(!1)}),()=>{l=!0}},[e.id,t,n]),h.jsx("div",{className:`${zc} branch-changes [&_>_.changes-note]:my-3.5 [&_>_.changes-note]:mx-4 [&_>_.openresearch-diff]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.truncated-notice]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0`,children:a?h.jsxs("div",{className:vs,children:["Failed to load changes: ",a]}):r?r.diff.trim()?h.jsxs(h.Fragment,{children:[r.truncated&&h.jsx(hE,{bytesRead:r.bytesRead,byteLimit:r.byteLimit}),h.jsx(pE,{diff:r.diff,partial:r.truncated})]}):h.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?"No committed changes from the parent branch.":"This is the baseline branch, so there is no parent comparison."}):h.jsx("div",{className:vs,children:"Loading changes…"})})}function mE({view:e,onViewChange:t,showViewToggle:n=!0,branchLabel:r,branchTitle:i,githubHref:a,githubTitle:o,refreshing:l,onRefresh:c}){return h.jsxs("div",{className:"code-tab-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant shrink-0 [&_>_.seg]:p-0.5 [&_>_.seg]:rounded-sm [&_>_.seg_button]:py-0.5 [&_>_.seg_button]:px-2 [&_>_.seg_button]:text-sm [&_>_.seg_button]:font-medium",children:[n&&h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-md [&_button]:font-semibold [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":"Code browser view",children:[h.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>t("files"),children:"Files"}),h.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>t("changes"),children:"Changes"})]}),r&&h.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-[color-mix(in_oklab,_var(--text)_8%,_transparent)] text-subtext text-xs [&_>_svg]:shrink-0",title:i,children:[h.jsx(lh,{size:12}),h.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap font-mono",children:r})]}),a&&h.jsx("a",{className:nr,href:a,target:"_blank",rel:"noopener noreferrer",title:o,"aria-label":o,children:h.jsx(Op,{size:13})}),h.jsx("span",{style:{flex:1}}),h.jsx("button",{className:nr,title:"Refresh","aria-label":"Refresh",onClick:c,children:l?h.jsx("span",{className:Pt}):h.jsx(aS,{size:13})})]})}const CK=/\.(md|mdx|markdown)$/i,EK=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,AK=/\.(csv|tsv|xlsx?|ods)$/i,TK=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,NK=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,jK=/\.pdf$/i,MK=/\.(docx?|log|rtf|txt)$/i;function RK(e){return EK.test(e)}function Q2(e){return CK.test(e)}function gE({name:e}){const t=Q2(e)?"markdown":RK(e)?"image":AK.test(e)?"spreadsheet":TK.test(e)?"code":NK.test(e)?"archive":jK.test(e)?"pdf":MK.test(e)?"document":"file";let n;return t==="markdown"?n=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),h.jsx("path",{d:"M2.6 10.5v-5h1.2l1.6 2 1.6-2h1.2v5H6.8V7.6L5.4 9.3 4 7.6v2.9H2.6Zm8.5-5v2.4h1.3L10.5 10 8.6 7.9h1.3V5.5h1.2Z",fill:"currentColor"})]}):t==="image"?n=h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),h.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),h.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):t==="spreadsheet"?n=h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),h.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):t==="code"?n=h.jsx("path",{d:"M6.2 3 1.8 8l4.4 5 1.3-1.2L4.2 8l3.3-3.8L6.2 3Zm3.6 0-1.3 1.2L11.8 8l-3.3 3.8 1.3 1.2 4.4-5-4.4-5Z",fill:"currentColor"}):t==="archive"?n=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),h.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):n=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),h.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),h.jsx("svg",{className:`file-tree-icon w-[15px] h-[15px] shrink-0 text-muted overflow-visible [&.markdown]:text-accent-blue [&.image]:text-accent-purple [&.spreadsheet]:text-accent-green [&.code]:text-accent-orange [&.archive]:text-accent-amber [&.pdf]:text-accent-red [&.document]:text-subtext ${t}`,viewBox:"0 0 16 16","aria-hidden":"true",children:n})}const bE=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-left cursor-pointer font-[inherit]","text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),h7=["file-tree-chevron text-muted shrink-0 [button&]:inline-flex","[button&]:items-center [button&]:justify-center [button&]:w-[13px]","[button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent","[button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90"].join(" ");function f7(){return{dirs:new Map,files:[]}}function vE(e){const t=f7();for(const n of e){const r=n.split("/");let i=t;for(let a=0;aa(n),title:n,children:[c?h.jsx(Bl,{size:13,className:h7}):h.jsx(ea,{size:13,className:h7}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),c&&h.jsx(J2,{node:t,parentPath:n,depth:r+1,toggled:i,onToggle:a,onOpenFile:o})]})}function J2({node:e,parentPath:t,depth:n,toggled:r,onToggle:i,onOpenFile:a}){const o=[...e.dirs.keys()].sort((c,d)=>c.localeCompare(d)),l=[...e.files].sort((c,d)=>c.localeCompare(d));return h.jsxs(h.Fragment,{children:[o.map(c=>{const d=t?`${t}/${c}`:c;return h.jsx(DK,{name:c,node:e.dirs.get(c),path:d,depth:n,toggled:r,onToggle:i,onOpenFile:a},`d:${d}`)}),l.map(c=>{const d=t?`${t}/${c}`:c;return h.jsxs("button",{type:"button",className:bE,style:{paddingLeft:8+n*14},onClick:()=>a(d),title:d,children:[h.jsx(gE,{name:c}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:c})]},`f:${d}`)})]})}function LK({projectId:e,project:t,experiment:n,view:r,toggled:i,onViewChange:a,onToggledChange:o,onOpenFile:l}){const c=n.branchName,d=`${e}:${c}`,[m,f]=R.useState(null),[g,b]=R.useState(null),[k,S]=R.useState(!1),[x,v]=R.useState(!1),[w,y]=R.useState(0),[C,N]=R.useState(void 0),E=R.useRef(0),M=R.useRef(null),T=R.useCallback(()=>{M.current=d;const F=++E.current;S(!0),Mb(e,{ref:c}).then(U=>{F===E.current&&(f(U),b(null))}).catch(U=>{F===E.current&&b(U.message)}).finally(()=>{F===E.current&&S(!1)})},[e,c,d]);R.useEffect(()=>(E.current++,M.current=null,f(null),b(null),S(!1),()=>{E.current++}),[d]),R.useEffect(()=>{r==="files"&&M.current!==d&&T()},[r,d,T]),R.useEffect(()=>{N(void 0);const F=n.chatSessionId;if(!F)return;let U=!1;return mS(F).then(V=>{!U&&V.exists&&V.branch===c&&N(F)}).catch(()=>{}),()=>{U=!0}},[n.chatSessionId,c]);const D=R.useMemo(()=>m?vE(m.entries):null,[m]),z=r==="files"?k:x,$=R.useCallback(F=>{const U=new Set(i);U.has(F)?U.delete(F):U.add(F),o(U)},[i,o]);return h.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[h.jsx(mE,{view:r,onViewChange:a,branchLabel:c,branchTitle:`Committed branch ${c}`,githubHref:t.githubEnabled?dp(t.githubOwner,t.githubRepo,c):void 0,githubTitle:`Open ${c} on GitHub`,refreshing:z,onRefresh:()=>r==="files"?T():y(F=>F+1)}),r==="changes"?h.jsx(kK,{experiment:n,refreshKey:w,onLoadingChange:v},n.id):h.jsxs(h.Fragment,{children:[(m==null?void 0:m.truncated)&&h.jsx("div",{className:vs,children:"listing truncated"}),g&&D&&h.jsxs("div",{className:vs,children:["Refresh failed: ",g]}),h.jsx("div",{className:zc,children:D?D.dirs.size===0&&D.files.length===0?h.jsx("div",{className:vs,children:"No files."}):h.jsx("div",{className:"file-tree py-1.5 px-0 text-md",children:h.jsx(J2,{node:D,parentPath:"",depth:0,toggled:i,onToggle:$,onOpenFile:F=>C?l(F,C):l(F,void 0,c)})}):h.jsx("div",{className:vs,children:g?`Failed to load: ${g}`:"Loading…"})})]})]})}const OK=5e3;function IK({sessionId:e,project:t,view:n,toggled:r,onViewChange:i,onToggledChange:a,onOpenFile:o}){var D;const l=t.id,[c,d]=R.useState(null),[m,f]=R.useState(null),[g,b]=R.useState(null),[k,S]=R.useState(!0),x=R.useRef(0),v=R.useCallback(()=>{const z=++x.current;S(!0),(async()=>{if(!e)return[null,await Mb(l,{ref:t.baselineBranch})];const F=await mS(e),U=F.exists?{sessionId:e}:{ref:t.baselineBranch};return[F,await Mb(l,U)]})().then(([F,U])=>{z===x.current&&(d(F),f(U),b(null))}).catch(F=>{z===x.current&&b(F.message)}).finally(()=>{z===x.current&&S(!1)})},[e,l,t.baselineBranch]);R.useEffect(()=>(d(null),f(null),b(null),v(),()=>{x.current++}),[v]),R.useEffect(()=>{if(!e)return;let z=!1,$=!1,F=!1,U=null;const V=()=>{U||(U=setInterval(v,OK))},X=()=>{U&&(clearInterval(U),U=null)},Y=Td(Q=>{Q.type!=="busy"||Q.sessionId!==e||($=!0,Q.busy&&!z?(z=!0,V()):!Q.busy&&z&&(z=!1,X(),v()))});return hf(l).then(Q=>{var te;F||$||z||(te=Q.find(I=>I.id===e))!=null&&te.busy&&(z=!0,V())}).catch(()=>{}),()=>{F=!0,Y(),X()}},[e,l,v]);const w=R.useMemo(()=>m?vE(m.entries):null,[m]),y=R.useCallback(z=>{const $=new Set(r);$.has(z)?$.delete(z):$.add(z),a($)},[r,a]),C=e&&(c!=null&&c.exists)?c:null,N=(C==null?void 0:C.branch)??(C!=null&&C.baselineBranch?`detached @ ${C.baselineBranch}`:"detached"),E=((D=C==null?void 0:C.files)==null?void 0:D.length)??0,M=C?`Current worktree · ${N}${E>0?"*":""}`:`Default branch · ${t.baselineBranch}`,T=C?C.branch:t.baselineBranch;return h.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[h.jsx(mE,{view:C?n:"files",onViewChange:i,showViewToggle:!!C,branchLabel:M,branchTitle:M,githubHref:t.githubEnabled&&T?dp(t.githubOwner,t.githubRepo,T):void 0,githubTitle:T?`Open ${T} on GitHub`:void 0,refreshing:k,onRefresh:v}),g&&(c||m)&&h.jsxs("div",{className:vs,children:["Refresh failed: ",g]}),!m||e&&!c?h.jsx("div",{className:zc,children:h.jsx("div",{className:vs,children:g?`Failed to load: ${g}`:"Loading…"})}):C&&n==="changes"?h.jsx("div",{className:`${zc} wt-changes pt-0 px-4 pb-6 [&_>_:first-child]:mt-3.5`,children:E===0||!C.diff?h.jsx("div",{className:"changes-note text-sm text-muted",children:"No changes yet."}):h.jsxs(h.Fragment,{children:[C.diff.truncated&&h.jsx(hE,{bytesRead:C.diff.bytesRead,byteLimit:C.diff.byteLimit}),h.jsx(pE,{diff:C.diff.diff,partial:C.diff.truncated})]})}):h.jsxs("div",{className:zc,children:[m.truncated&&h.jsx("div",{className:vs,children:"Listing truncated."}),w?w.dirs.size===0&&w.files.length===0?h.jsx("div",{className:vs,children:"No files."}):h.jsx("div",{className:"file-tree py-1.5 px-0 text-md",children:h.jsx(J2,{node:w,parentPath:"",depth:0,toggled:r,onToggle:y,onOpenFile:z=>C?o(z,e):o(z,void 0,t.baselineBranch)})}):h.jsx("div",{className:vs,children:"Loading…"})]})]})}const Xf="font-mono text-sm leading-[1.55] [tab-size:4]",_E="whitespace-pre-wrap break-words",xE="file-view-gutter text-right text-muted select-none";function yE(e){const t=String(e).length+2;return{ruleCh:t,codeCh:t+2}}function wE({text:e,path:t,highlightLine:n,scrollRequest:r,onScrollRequestHandled:i}){const a=R.useMemo(()=>{if(!e)return[];const m=e.replace(/\r\n?/g,` +`),f=Qk(m,r2(t));return m.endsWith(` +`)?f.slice(0,-1):f},[e,t]),o=n&&a.length>0?Math.min(Math.max(Math.trunc(n),1),a.length):void 0,l=R.useRef(null);R.useEffect(()=>{var m;r!==void 0&&(o?((m=l.current)==null||m.scrollIntoView({block:"center"}),i==null||i()):a.length===0&&(i==null||i()))},[a.length,i,r,o]);const{ruleCh:c}=yE(a.length),d=R.useMemo(()=>a.map((m,f)=>h.jsxs("div",{ref:f+1===o?l:void 0,className:`file-view-line flex items-stretch ${f+1===o?"file-view-line-highlight bg-[color-mix(in_srgb,_var(--primary)_16%,_transparent)] shadow-[inset_2px_0_0_var(--primary)]":""}`,children:[h.jsx("span",{"data-line":f+1,className:`${xE} before:content-[attr(data-line)] shrink-0 pr-[1ch]`,style:{width:`${c}ch`},"aria-hidden":"true"}),h.jsx("code",{className:`file-view-code flex-1 min-w-0 pl-[2ch] pr-4 ${Xf} ${_E}`,children:Jk(m)?h.jsx("br",{}):m})]},f)),[a,c,o]);return h.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${Xf}`,children:[a.length>0&&h.jsx("div",{className:"absolute left-0 top-0 bottom-0 border-r border-r-border-variant pointer-events-none",style:{width:`${c}ch`},"aria-hidden":"true"}),d]})}function SE(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function p7({url:e,name:t}){return h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["This browser can’t preview this media format."," ",h.jsxs("a",{href:e,download:t,children:["Download ",t]})]})}function kE({kind:e,url:t,name:n}){const[r,i]=R.useState(!1);if(R.useEffect(()=>i(!1),[e,t]),r)return h.jsx(p7,{url:t,name:n});let a;return e==="image"?a=h.jsx("div",{className:"fpreview-image flex min-h-0 flex-1 items-start justify-center overflow-auto p-6 [&_img]:max-w-full [&_img]:h-auto [&_img]:border [&_img]:border-border [&_img]:rounded-sm",children:h.jsx("img",{src:t,alt:n,onError:()=>i(!0)})}):e==="audio"?a=h.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:h.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:t,"aria-label":n,onError:()=>i(!0)})}):e==="video"?a=h.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:h.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:t,"aria-label":n,onError:()=>i(!0)})}):a=h.jsx("object",{className:"fpreview-pdf block min-h-0 flex-1 w-full border-0","aria-label":n,data:t,type:"application/pdf",onError:()=>i(!0),children:h.jsx(p7,{url:t,name:n})}),h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a,h.jsx("div",{className:"shrink-0 border-t border-border-variant py-1.5 px-3 text-right text-xs",children:h.jsxs("a",{href:t,download:n,children:["Download ",n]})})]})}const m7=`${nr} tip-up [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]`;function zK(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function BK(e,t,n){const r=n.indexOf("#"),i=r===-1?n:n.slice(0,r),a=r===-1?"":n.slice(r),o=i.indexOf("?"),l=o===-1?i:i.slice(0,o),c=o===-1?"":i.slice(o+1),d=l.startsWith("/")?[]:t.split("/").filter(b=>b.length>0);for(const b of l.split("/"))if(!(!b||b==="."))if(b===".."){if(d.length===0)return null;d.pop()}else d.push(b);const m=d.join("/");if(!m)return null;const f=new URLSearchParams(c);f.delete("path");const g=f.toString();return`${dh(e,m)}${g?`&${g}`:""}${a}`}function HK(e){if(!e.startsWith("---"))return e;const t=e.indexOf(` +---`,3);return t===-1?e:e.slice(t+4).replace(/^\r?\n/,"")}const CE="orx:files-tree-width",EE="orx:artifacts-collapsed:",AE=180,TE=560,$K=8,FK=280;function PK(){try{const e=Number(localStorage.getItem(CE));if(Number.isFinite(e)&&e>=AE&&e<=TE)return e}catch{}return FK}function UK(e){try{const t=localStorage.getItem(`${EE}${e}`);if(!t)return new Set;const n=JSON.parse(t);return Array.isArray(n)?new Set(n.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function $v(e,t){for(const n of e){if(n.path===t)return n;if(n.isDir&&t.startsWith(n.path+"/")){const r=$v(n.children??[],t);if(r)return r}}return null}function NE({projectId:e,folder:t,markdown:n}){const r=i=>zK(i)?i:BK(e,t,i);return h.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-[color-mix(in_oklab,_var(--border)_50%,_transparent)] [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-[0.9em] [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-[1.05em] [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-[0.9em] [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:pl-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:pl-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-md [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-left [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-left [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pr-0 [&_blockquote]:pb-0.5 [&_blockquote]:pl-2.5 [&_blockquote]:border-l-[3px] [&_blockquote]:border-l-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text artifact-md text-lg [&_h1]:text-[2em] [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-[1.5em] [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-[1.2em] [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-[1em] [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:h.jsx(JB,{remarkPlugins:[qk,[Gk,nC]],rehypePlugins:[_k],components:{a:({href:i,children:a,...o})=>{const l=!i||i.startsWith("#"),c=l?i:r(i);return c?h.jsx("a",{...o,href:c,...l?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):h.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=r(i);return o?h.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[h.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&h.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...rC},children:eC(HK(n))})})}function qK(e){return e.presentation==="text"&&Q2(e.name)?"markdown":SE(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function jE(e){return e.toLowerCase()===jf.toLowerCase()}function GK(e,t,n){const[r,i]=R.useState(null),[a,o]=R.useState(!1),[l,c]=R.useState(!1),[d,m]=R.useState(null),f=R.useRef(0),g=R.useRef(!1),b=n==="markdown"||n==="text"&&t.size<=vS;return R.useEffect(()=>{if(o(!1),c(!1),m(null),!b)return;let S=!1;const x=++f.current;return _S(e,t.path).then(w=>{if(!w)throw new Error("Artifact not found");return w}).then(w=>{S||x!==f.current||(w.binary?o(!0):(g.current=!0,i(w.content)),c(w.truncated))}).catch(w=>{!S&&x===f.current&&!g.current&&m(w instanceof Error?w.message:String(w))}),()=>{S=!0}},[e,t.path,t.modifiedAt,n,b]),{text:r,replaceText:S=>{f.current+=1,g.current=!0,i(S)},binary:a,truncated:l,error:d,wantsText:b}}function VK({projectId:e,entry:t,onDelete:n,onChanged:r}){const i=qK(t),{text:a,replaceText:o,binary:l,truncated:c,error:d,wantsText:m}=GK(e,t,i),[f,g]=R.useState(!1),[b,k]=R.useState(!1),[S,x]=R.useState(""),[v,w]=R.useState(!1),[y,C]=R.useState(null),N=i==="markdown",E=jE(t.path),M=t.path.split("/").slice(0,-1).join("/"),T=`${dh(e,t.path)}&v=${t.modifiedAt}`,D=async()=>{w(!0),C(null);try{await _D(e,S),o(S),k(!1),g(!1),r()}catch($){C($ instanceof Error?$.message:String($))}finally{w(!1)}};let z;return b?z=h.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2 p-4",children:[h.jsx("textarea",{className:"min-h-0 flex-1 resize-none font-mono text-sm leading-relaxed","aria-label":"Edit project brief",value:S,onChange:$=>x($.target.value)}),y&&h.jsxs("div",{className:"text-sm text-accent-red",children:["Could not save: ",y]})]}):i==="image"||i==="audio"||i==="video"||i==="pdf"?z=h.jsx(kE,{kind:i,url:T,name:t.name}):i==="download"||!m||l?z=h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[i==="download"||l?"Binary or unsupported file — no inline preview.":"File too large to preview inline."," ",h.jsx("a",{href:T,...i==="download"||l?{download:t.name}:{target:"_blank",rel:"noopener noreferrer"},children:i==="download"||l?"Download":"Open raw"})]}):d?z=h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["Failed to load: ",d]}):a===null?z=h.jsxs("div",{className:fr,children:[h.jsx("span",{className:Pt})," Loading…"]}):N&&!f?z=h.jsx(NE,{projectId:e,folder:M,markdown:a}):z=h.jsx(wE,{text:a,path:t.path}),h.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0",children:[h.jsxs("div",{className:"fpreview-head h-10 flex items-center gap-2 py-0 px-3.5 border-b border-b-border-variant text-subtext shrink-0",children:[h.jsx(oh,{size:13,style:{flexShrink:0}}),h.jsx("code",{className:"fpreview-path font-mono text-sm text-text flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",title:t.path,children:t.path}),h.jsxs("span",{className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:["Modified"," ",new Date(t.modifiedAt).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})]}),(i==="text"||i==="download")&&h.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:Lo(t.size)}),E&&!b&&a!==null&&!c&&h.jsxs("button",{className:rr,"data-tip":"Edit project brief","data-tip-align":"end","aria-label":"Edit project brief",onClick:()=>{x(a),C(null),k(!0)},children:[h.jsx(cp,{size:13})," Edit"]}),E&&b&&h.jsxs(h.Fragment,{children:[h.jsxs("button",{className:rr,"data-tip":"Cancel editing","data-tip-align":"end","aria-label":"Cancel editing",disabled:v,onClick:()=>{k(!1),C(null)},children:[h.jsx(Vr,{size:13})," Cancel"]}),h.jsxs("button",{className:pL,"data-tip":v?"Saving…":"Save project brief","data-tip-align":"end","aria-label":v?"Saving project brief":"Save project brief",disabled:v,onClick:()=>void D(),children:[h.jsx(Di,{size:13})," ",v?"Saving…":"Save"]})]}),N&&!b&&h.jsx("button",{className:`${nr} ${f?"active":""}`,"data-tip":f?"Rendered view":"View source","data-tip-align":"end","aria-label":f?"Rendered view":"View source",onClick:()=>g($=>!$),children:h.jsx(J8,{size:13})}),h.jsx("a",{className:nr,href:T,target:"_blank",rel:"noopener noreferrer","data-tip":"Open raw in new tab","data-tip-align":"end","aria-label":"Open raw in new tab",children:h.jsx(Ed,{size:13})}),!E&&h.jsx("button",{className:nr,"data-tip":"Delete artifact","data-tip-align":"end","aria-label":"Delete artifact",onClick:()=>{window.confirm(`Delete "${t.path}" from the artifacts directory?`)&&n(t.path)},children:h.jsx(uh,{size:13})})]}),h.jsxs("div",{className:`fpreview-body flex-1 min-h-0 overflow-auto [&.doc]:pt-4.5 [&.doc]:px-7 [&.doc]:pb-12 [&.doc_.artifact-md]:max-w-readable [&.doc_.artifact-md]:my-0 [&.doc_.artifact-md]:mx-auto ${N&&!f&&!b?"doc":""}`,children:[z,c&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:"File truncated — showing the first 512 KB."})]})]})}function ME({entries:e,depth:t,collapsed:n,selected:r,onToggle:i,onSelect:a,onOpenFile:o,onDelete:l}){return h.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(c=>{var m;const d={paddingLeft:8+Math.min(t,$K)*14};if(c.isDir){const f=!n.has(c.path);return h.jsxs("div",{className:"min-w-0 max-w-full",children:[h.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-left cursor-pointer font-[inherit] text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:d,onClick:()=>i(c.path),children:[h.jsx("button",{className:"file-tree-chevron text-muted shrink-0 [button&]:inline-flex [button&]:items-center [button&]:justify-center [button&]:w-[13px] [button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent [button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90","aria-label":f?`Collapse ${c.name}`:`Expand ${c.name}`,onClick:g=>{g.stopPropagation(),i(c.path)},children:h.jsx(ea,{size:13,className:f?"open":""})}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:c.name}),h.jsx("button",{className:`${hh} ft-row-delete w-4.5 h-4.5 opacity-35 [&:focus-visible]:opacity-100`,"data-tip":"Delete folder","data-tip-align":"end","aria-label":`Delete folder ${c.name}`,onClick:g=>{g.stopPropagation(),window.confirm(`Delete "${c.path}" from the artifacts directory?`)&&l(c.path)},children:h.jsx(uh,{size:12})})]}),f&&(((m=c.children)==null?void 0:m.length)??0)>0&&h.jsx(ME,{entries:c.children??[],depth:t+1,collapsed:n,selected:r,onToggle:i,onSelect:a,onOpenFile:o,onDelete:l})]},c.path)}return h.jsxs("button",{type:"button",className:`file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-left cursor-pointer font-[inherit] text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===c.path?"selected":""}`,style:d,title:`${c.path} — double-click or Command/Ctrl+Enter to open in a tab`,"aria-keyshortcuts":"Meta+Enter Control+Enter","aria-pressed":r===c.path,onClick:()=>a(c.path),onDoubleClick:()=>o(c.path),onKeyDown:f=>{f.key!=="Enter"||!f.metaKey&&!f.ctrlKey||(f.preventDefault(),f.stopPropagation(),a(c.path),o(c.path))},children:[h.jsx(gE,{name:c.name}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:c.name})]},c.path)})})}function g7({dir:e,onOpenStorage:t}){const[n,r]=R.useState(!1);return h.jsxs("div",{className:"ftree-footer shrink-0 flex items-center gap-0.5 py-[5px] px-2 border-t border-t-border-variant [&_code]:flex-1 [&_code]:min-w-0 [&_code]:[direction:rtl] [&_code]:text-left [&_code]:font-mono [&_code]:text-xs [&_code]:text-muted [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_.icon-btn]:w-5.5 [&_.icon-btn]:h-5.5",title:e,children:[h.jsx("code",{children:e}),h.jsx("button",{className:m7,"data-tip":n?"Copied!":"Copy path","aria-label":"Copy artifacts directory path",onClick:()=>{var i;(i=navigator.clipboard)==null||i.writeText(e),r(!0),setTimeout(()=>r(!1),1200)},children:n?h.jsx(Di,{size:12}):h.jsx(s_,{size:12})}),h.jsx("button",{className:m7,"data-tip":"Storage settings","data-tip-align":"end","aria-label":"Storage settings",onClick:t,children:h.jsx(oR,{size:12})})]})}function WK({project:e,artifacts:t,onChanged:n,onOpenFile:r,onOpenStorage:i}){var w;const[a,o]=R.useState(null),[l,c]=R.useState(()=>UK(e.id)),[d,m]=R.useState(PK),f=R.useRef(null),g=((w=t==null?void 0:t.entries.find(y=>!y.isDir&&jE(y.path)))==null?void 0:w.path)??null;R.useEffect(()=>{!a&&g&&o(g)},[a,g]),R.useEffect(()=>{try{localStorage.setItem(`${EE}${e.id}`,JSON.stringify([...l]))}catch{}},[e.id,l]);const b=y=>{var T;y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId);const C=((T=f.current)==null?void 0:T.getBoundingClientRect().left)??0,N=document.body.style.userSelect;document.body.style.userSelect="none";const E=D=>{const z=Math.round(D.clientX-C),$=Math.min(Math.max(z,AE),TE);m($);try{localStorage.setItem(CE,String($))}catch{}},M=()=>{window.removeEventListener("pointermove",E),window.removeEventListener("pointerup",M),window.removeEventListener("pointercancel",M),document.body.style.userSelect=N};window.addEventListener("pointermove",E),window.addEventListener("pointerup",M),window.addEventListener("pointercancel",M)};R.useEffect(()=>{if(!a||!t)return;const y=$v(t.entries,a);(!y||y.isDir)&&o(null)},[a,t]);const k=y=>c(C=>{const N=new Set(C);return N.has(y)?N.delete(y):N.add(y),N}),S=y=>{(a===y||a!=null&&a.startsWith(y+"/"))&&o(null),bD(e.id,y).catch(()=>{}).finally(n)};if(!t)return h.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:h.jsxs("div",{className:fr,style:{padding:20},children:[h.jsx("span",{className:Pt})," Loading artifacts…"]})});const x=y=>h.jsx(ME,{entries:y,depth:0,collapsed:l,selected:a,onToggle:k,onSelect:o,onOpenFile:r,onDelete:S}),v=a?$v(t.entries,a):null;return t.entries.length===0?h.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:h.jsxs("div",{className:"files-empty-state flex-1 flex flex-col items-center justify-center gap-1.5 p-6 text-center text-muted [&_h3]:mt-1.5 [&_h3]:mx-0 [&_h3]:mb-0 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text [&_p]:m-0 [&_p]:max-w-105 [&_p]:text-md [&_p]:leading-[1.55] [&_p]:text-subtext [&_.ftree-footer]:mt-2.5 [&_.ftree-footer]:max-w-full [&_.ftree-footer]:border [&_.ftree-footer]:border-border [&_.ftree-footer]:rounded-md [&_.ftree-footer]:py-1.5 [&_.ftree-footer]:px-2.5 [&_.ftree-footer]:bg-background [&_.ftree-footer_code]:max-w-95",children:[h.jsx(a_,{size:28,strokeWidth:1.5}),h.jsx("h3",{children:"No artifacts yet"}),h.jsx("p",{children:"This is the project's durable output space for reports, figures, images, CSVs, PDFs, and other research artifacts. Ask the agent for a write-up or add your own files:"}),h.jsx(g7,{dir:t.dir,onOpenStorage:i})]})}):h.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background",children:[h.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-l border-l-border-variant border-r border-r-border-variant bg-background",ref:f,style:{width:d},children:[h.jsx("div",{className:"ftree-resizer absolute -right-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] [&:active]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)]",onPointerDown:b}),h.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-md",children:[x(t.entries),t.truncated&&h.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-xs text-muted",children:"Listing truncated — the folder has more artifacts."})]}),h.jsx(g7,{dir:t.dir,onOpenStorage:i})]}),v?h.jsx(VK,{projectId:e.id,entry:v,onDelete:S,onChanged:n},v.path):h.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-md text-muted",children:[h.jsx(WM,{size:22,strokeWidth:1.5}),h.jsx("span",{children:"Click an artifact to view it"})]})]})}const YK=20*1024*1024,Fv="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text",RE="mt-0 mx-0 mb-3 text-muted text-md leading-normal",DE="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",LE="font-mono text-sm font-medium text-text",OE="mt-0.5 mb-0 text-xs leading-relaxed text-muted";function XK(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const i=r.result;if(typeof i!="string"){n(new Error("could not read file"));return}const a=i.indexOf(",");t(a>=0?i.slice(a+1):i)},r.onerror=()=>n(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function KK(e){const t=e.toLowerCase();return t.endsWith(".md")||t.endsWith(".markdown")||t.endsWith(".zip")}function ZK({skill:e,projectId:t,onDeleted:n,onError:r}){const[i,a]=R.useState(!1);return h.jsxs("div",{className:DE,children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("code",{className:LE,children:["/",e.name]}),h.jsx("p",{className:OE,children:e.description})]}),h.jsxs("div",{className:"shrink-0 text-right whitespace-nowrap pt-0.5",children:[h.jsx("div",{className:"text-2xs text-subtext",children:Lo(e.bytes)}),e.updatedAt>0&&h.jsx("div",{className:"text-2xs text-muted",children:Ks(e.updatedAt)})]}),h.jsx("button",{className:nr,"data-tip":"Delete skill","data-tip-align":"end","aria-label":`Delete skill ${e.name}`,disabled:i,onClick:()=>{window.confirm(`Delete the "${e.name}" skill?`)&&(a(!0),DD({scope:e.scope,name:e.name,projectId:e.scope==="project"?t:void 0}).then(n).catch(o=>{a(!1),r(o instanceof Error?o.message:String(o))}))},children:h.jsx(uh,{size:13})})]})}function b7({title:e,hint:t,skills:n,projectId:r,onChanged:i,onError:a}){return h.jsxs("section",{className:Fv,children:[h.jsx("h3",{children:e}),h.jsx("p",{className:RE,children:t}),n.length===0?h.jsx("div",{className:"text-muted text-sm",children:"No skills yet."}):h.jsx("div",{className:"flex flex-col",children:n.map(o=>h.jsx(ZK,{skill:o,projectId:r,onDeleted:i,onError:a},o.name))})]})}function QK({skill:e,scopeLabel:t,alreadyImported:n,onImport:r}){const[i,a]=R.useState(!1);return h.jsxs("div",{className:DE,children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("code",{className:LE,children:["/",e.name]}),h.jsx("span",{className:dr,children:e.harnessName})]}),h.jsx("p",{className:OE,children:e.description})]}),h.jsxs("button",{className:rr,disabled:i,title:`Import into ${t}`,onClick:async()=>{a(!0);try{await r(e)}finally{a(!1)}},children:[i?h.jsx("span",{className:Pt}):h.jsx(lM,{size:13}),n?"Re-import":"Import"]})]})}function JK({project:e}){const[t,n]=R.useState(null),[r,i]=R.useState([]),[a,o]=R.useState("global"),[l,c]=R.useState(!1),[d,m]=R.useState(null),[f,g]=R.useState(!1),b=R.useRef(null),k=R.useCallback(()=>{MD(e==null?void 0:e.id).then(n).catch(()=>n([]))},[e==null?void 0:e.id]);R.useEffect(()=>{k()},[k]),R.useEffect(()=>{LD().then(i).catch(()=>i([]))},[]),R.useEffect(()=>{!e&&a==="project"&&o("global")},[e,a]);const S=R.useRef(!1),x=R.useCallback(async T=>{if(!S.current){if(m(null),!KK(T.name)){m("Upload a SKILL.md file or a .zip of a skill folder.");return}if(T.size>YK){m("File too large (max 20 MB).");return}S.current=!0,c(!0);try{const D=await XK(T);await RD({scope:a,projectId:a==="project"?e==null?void 0:e.id:void 0,filename:T.name,contentBase64:D}),k()}catch(D){m(D instanceof Error?D.message:String(D))}finally{S.current=!1,c(!1)}}},[a,e==null?void 0:e.id,k]),v=T=>{var z;T.preventDefault(),g(!1);const D=(z=T.dataTransfer.files)==null?void 0:z[0];D&&x(D)},w=R.useCallback(async T=>{m(null);try{await OD({harness:T.harnessId,name:T.name,scope:a,projectId:a==="project"?e==null?void 0:e.id:void 0}),k()}catch(D){m(D instanceof Error?D.message:String(D))}},[a,e==null?void 0:e.id,k]),y=(t??[]).filter(T=>T.scope==="global"),C=(t??[]).filter(T=>T.scope==="project"),N=a==="global"?"Global":(e==null?void 0:e.name)??"this project",E=new Set((t??[]).filter(T=>T.scope===a).map(T=>T.name)),M=T=>`flex-1 flex flex-col gap-0.5 py-2.5 px-3 border rounded-md text-left text-sm font-medium cursor-pointer transition-[border-color,background] duration-120 disabled:opacity-50 disabled:cursor-not-allowed ${T?"border-primary bg-surface":"border-border bg-background text-text [&:hover:not(:disabled)]:border-border-variant"}`;return h.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl",children:[h.jsx("h1",{children:"Skills"}),h.jsxs("p",{className:"mt-0 mx-0 mb-5 text-muted text-md leading-normal [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text",children:["Upload ",h.jsx("code",{children:"SKILL.md"})," skills your agent discovers automatically in every session and you can invoke with ",h.jsx("code",{children:"/name"})," in chat. Add a single ",h.jsx("code",{children:"SKILL.md"})," or a"," ",h.jsx("code",{children:".zip"})," of a skill folder (with supporting scripts and resources)."]}),h.jsxs("section",{className:Fv,children:[h.jsx("h3",{children:"Add a skill"}),h.jsxs("div",{className:"flex gap-2 mb-3.5",role:"group","aria-label":"Skill scope",children:[h.jsxs("button",{type:"button","aria-pressed":a==="global",className:M(a==="global"),onClick:()=>o("global"),children:["Global",h.jsx("span",{className:"text-2xs font-normal text-muted",children:"Every project"})]}),h.jsxs("button",{type:"button","aria-pressed":a==="project",className:M(a==="project"),disabled:!e,title:e?void 0:"Open a project to add a project skill",onClick:()=>o("project"),children:["This project",h.jsx("span",{className:"text-2xs font-normal text-muted",children:e?e.name:"No project open"})]})]}),h.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm transition-[border-color,background] duration-120 [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text ${l?"cursor-default":"cursor-pointer"} ${f?"border-primary bg-surface text-text":"border-border-variant bg-surface text-muted [&:hover]:border-primary [&:hover]:text-text"}`,onDragOver:T=>{T.preventDefault(),g(!0)},onDragLeave:()=>g(!1),onDrop:v,onClick:()=>{var T;return(T=b.current)==null?void 0:T.click()},role:"button",tabIndex:0,onKeyDown:T=>{var D;(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),(D=b.current)==null||D.click())},children:[h.jsx("input",{ref:b,type:"file",accept:".md,.markdown,.zip",hidden:!0,onChange:T=>{var z;const D=(z=T.target.files)==null?void 0:z[0];D&&x(D),T.target.value=""}}),l?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:Pt}),h.jsx("span",{children:"Uploading…"})]}):h.jsxs(h.Fragment,{children:[h.jsx(wR,{size:20,strokeWidth:1.5}),h.jsxs("span",{children:["Drop a ",h.jsx("code",{children:"SKILL.md"})," or ",h.jsx("code",{children:".zip"})," here, or click to choose"]}),h.jsxs("span",{className:"inline-flex items-center gap-1.5 text-2xs text-subtext",children:[h.jsx(pM,{size:12})," Adding to"," ",h.jsx("strong",{className:"text-text font-semibold",children:a==="global"?"Global":e==null?void 0:e.name})]})]})]}),d&&h.jsx("div",{className:"mt-2.5 text-accent-red text-sm whitespace-pre-wrap",children:d})]}),r.length>0&&h.jsxs("section",{className:Fv,children:[h.jsx("h3",{children:"Import from your agent"}),h.jsxs("p",{className:`${RE} [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text [&_strong]:text-text [&_strong]:font-semibold`,children:["Skills already installed in your coding agents. Import a copy into"," ",h.jsx("strong",{children:N})," so it's managed here and invocable with ",h.jsx("code",{children:"/name"}),"."]}),h.jsx("div",{className:"flex flex-col",children:r.map(T=>h.jsx(QK,{skill:T,scopeLabel:N,alreadyImported:E.has(T.name),onImport:w},`${T.harnessId}:${T.name}`))})]}),t===null?h.jsxs("div",{className:"flex items-center gap-2 text-subtext text-md p-3",children:[h.jsx("span",{className:Pt})," Loading skills…"]}):h.jsxs(h.Fragment,{children:[h.jsx(b7,{title:"Global skills",hint:"Available to the agent in every project.",skills:y,onChanged:k,onError:m}),e&&h.jsx(b7,{title:`${e.name} skills`,hint:"Available only in this project's sessions. Shadows a global skill of the same name.",skills:C,projectId:e.id,onChanged:k,onError:m})]})]})}const eZ="italic [&_.tab-label_>_span]:pr-1 [&_.tab-label::after]:pr-1";function No({active:e,label:t,icon:n,shimmer:r=!1,preview:i=!1,onSelect:a,onPromote:o,onClose:l}){return h.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pr-0.5 [&_.tab-label]:grid [&_.tab-label]:grid-cols-[minmax(0,_1fr)] [&_.tab-label]:min-w-0 [&_.tab-label]:overflow-hidden [&_.tab-label_>_span]:[grid-area:1_/_1] [&_.tab-label_>_span]:overflow-hidden [&_.tab-label_>_span]:text-ellipsis [&_.tab-label_>_span]:whitespace-nowrap [&_.tab-label::after]:[grid-area:1_/_1] [&_.tab-label::after]:overflow-hidden [&_.tab-label::after]:text-ellipsis [&_.tab-label::after]:whitespace-nowrap [&_.tab-label::after]:content-[attr(data-label)] [&_.tab-label::after]:invisible [&_.tab-label::after]:font-medium [&_.tab-close]:inline-flex [&_.tab-close]:items-center [&_.tab-close]:justify-center [&_.tab-close]:w-3.5 [&_.tab-close]:h-3.5 [&_.tab-close]:rounded-xs [&_.tab-close]:text-muted [&_.tab-close]:shrink-0 [&_.tab-close:hover]:bg-[color-mix(in_oklab,_var(--text)_15%,_transparent)] [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap select-none min-w-24 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-left-px [&:not(.active)_+_.tab:not(.active)::before]:w-px [&:not(.active)_+_.tab:not(.active)::before]:bg-border [&.active]:border-border [&.active]:bg-background [&.active]:text-text [&.active]:font-medium [&.active::after]:content-[''] [&.active::after]:absolute [&.active::after]:right-0 [&.active::after]:-bottom-px [&.active::after]:left-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${i?eZ:""}`,onClick:a,onDoubleClick:o,onKeyDown:c=>{e&&c.key==="Enter"&&(o==null||o())},title:i?`${t} (double-click or Enter to keep open)`:t,"aria-label":i?`${t} (preview)`:t,children:[n,h.jsx("span",{className:"tab-label","data-label":t,children:h.jsx("span",{className:r?"tool-running-shimmer":"",children:t})}),h.jsx("span",{role:"button",className:"tab-close",title:"Close tab",onClick:c=>{c.stopPropagation(),l()},children:h.jsx(Vr,{size:12})})]})}const v7=["files-pill inline-flex items-center gap-2 min-w-0 border border-border","rounded-md py-[7px] px-[11px] bg-background text-text","no-underline [&_code]:font-mono [&_code]:text-sm","[&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap","[&_>_svg]:shrink-0 [&_>_svg]:text-muted [a&:hover]:border-muted"].join(" ");function tZ({owner:e,repo:t,branch:n}){return!e||!t?h.jsx("span",{className:v7,children:h.jsx("code",{children:n})}):h.jsxs("a",{className:v7,href:dp(e,t,n),target:"_blank",rel:"noopener noreferrer",title:`Open ${n} on GitHub`,children:[h.jsx("code",{children:n}),h.jsx(Op,{size:12})]})}const _7=["experiment-overview-action inline-flex items-center justify-center gap-[7px]","min-h-9 py-[7px] px-3 border border-border-variant rounded-sm","bg-background text-text text-sm font-semibold","transition-[background,border-color] duration-120 ease-standard","[&:hover]:border-[color-mix(in_oklab,_var(--text)_34%,_var(--border))]","[&:hover]:bg-surface"].join(" "),lb=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-md","[&_h2]:font-semibold"].join(" "),x7=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function y7(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function w7(e,t){return Df((e.endedAt??t)-e.createdAt)}function nZ({experiment:e,parentExperiment:t,project:n,runs:r,onOpenLogs:i,onOpenCode:a}){const o=r[0]??null,l=r.some(m=>m.status==="running"||m.status==="starting"),[c,d]=R.useState(()=>Date.now());return R.useEffect(()=>{if(!l)return;d(Date.now());const m=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(m)},[l]),h.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-[22px] [&_h1]:leading-tight",children:h.jsxs("div",{className:"experiment-overview-inner w-full max-w-230 my-0 mx-auto pt-6.5 px-7 pb-10 [@media((max-width:_720px))]:pt-5 [@media((max-width:_720px))]:px-4.5 [@media((max-width:_720px))]:pb-8",children:[h.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[h.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[h.jsx("h1",{children:e.title||e.slug}),h.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted font-mono text-sm",children:e.slug})]}),h.jsx(La,{status:o?as(o):"idle"})]}),h.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[o&&h.jsxs("button",{className:_7,onClick:()=>i(o.id),children:[h.jsx(Wc,{size:15}),"Logs"]}),h.jsxs("button",{className:_7,onClick:a,children:[h.jsx(lp,{size:15}),"Code"]})]}),e.description&&h.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-md [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[h.jsx("h2",{children:"Description"}),h.jsx(za,{text:e.description})]}),h.jsxs("section",{className:lb,children:[h.jsx("h2",{children:o?"Latest run":"Runs"}),o&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap gap-y-2.5 gap-x-4.5 text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs",children:[h.jsx(La,{status:as(o)}),h.jsx(D2,{backend:o.backend}),h.jsxs("span",{title:"Started",children:[h.jsx($j,{size:13}),y7(o.createdAt)]}),h.jsxs("span",{title:"Duration",children:[h.jsx(Jj,{size:13}),w7(o,c)]}),o.commitSha&&h.jsxs("span",{title:"Commit",children:[h.jsx(CM,{size:14}),h.jsx("code",{children:o.commitSha.slice(0,7)})]}),o.exitCode!==null&&o.exitCode!==void 0&&o.exitCode!==0&&h.jsxs("span",{children:["exit ",o.exitCode]})]}),o.command&&h.jsxs("code",{className:x7,children:["$ ",o.command]}),o.resultMarkdown&&h.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${o.status==="failed"?"failed":""}`,children:h.jsx(za,{text:o.resultMarkdown})})]})]}),h.jsxs("section",{className:lb,children:[h.jsx("h2",{children:"Git"}),h.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs experiment-overview-git-meta gap-y-[9px] gap-x-3.5 [&_.files-pill]:py-[5px] [&_.files-pill]:px-2 [&_.files-pill]:rounded-sm [&_.files-pill_code]:text-xs",children:[h.jsx(tZ,{owner:n.githubEnabled?n.githubOwner:"",repo:n.githubEnabled?n.githubRepo:"",branch:e.branchName}),t&&h.jsxs("span",{children:["from ",h.jsx("code",{children:t.slug})]}),h.jsxs("span",{title:y7(e.createdAt),children:["created ",Ks(e.createdAt)]})]}),e.runCommand!==(o==null?void 0:o.command)&&h.jsxs("code",{className:x7,children:["$ ",e.runCommand]})]}),r.length>0&&h.jsxs("section",{className:lb,children:[h.jsx("h2",{children:"Run history"}),h.jsx("div",{className:"experiment-run-history border-t border-t-border-variant [&_button]:w-full [&_button]:grid [&_button]:grid-cols-[minmax(72px,_0.7fr)_minmax(100px,_1fr)_minmax(70px,_0.7fr)_60px_16px] [&_button]:items-center [&_button]:gap-3.5 [&_button]:py-[11px] [&_button]:px-0.5 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-left [&_button]:text-sm [&_button:hover]:bg-surface [@media((max-width:_720px))]:[&_button]:grid-cols-[65px_1fr_60px_16px] [@media((max-width:_720px))]:[&_button_>_:nth-child(3)]:hidden",children:r.map((m,f)=>h.jsxs("button",{onClick:()=>i(m.id),children:[h.jsxs("span",{className:"experiment-run-number font-mono text-xs font-semibold",children:["Run ",r.length-f]}),h.jsx(La,{status:as(m)}),h.jsx("span",{children:Ks(m.createdAt)}),h.jsx("span",{children:w7(m,c)}),h.jsx(Wc,{size:13})]},m.id))})]})]})})}var cb={exports:{}},S7;function rZ(){return S7||(S7=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(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const a=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(a._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,a=i._renderService.dimensions;if(a.css.cell.width===0||a.css.cell.height===0)return;const o=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),d=Math.max(0,parseInt(l.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),f=c-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),g=d-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-o;return{cols:Math.max(2,Math.floor(g/a.css.cell.width)),rows:Math.max(1,Math.floor(f/a.css.cell.height))}}}})(),n})()))})(cb)),cb.exports}var iZ=rZ(),ub={exports:{}},k7;function sZ(){return k7||(k7=1,(function(e,t){(function(n,r){e.exports=r()})(globalThis,(()=>(()=>{var n={4567:function(o,l,c){var d=this&&this.__decorate||function(w,y,C,N){var E,M=arguments.length,T=M<3?y:N===null?N=Object.getOwnPropertyDescriptor(y,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,C,N);else for(var D=w.length-1;D>=0;D--)(E=w[D])&&(T=(M<3?E(T):M>3?E(y,C,T):E(y,C))||T);return M>3&&T&&Object.defineProperty(y,C,T),T},m=this&&this.__param||function(w,y){return function(C,N){y(C,N,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const f=c(9042),g=c(9924),b=c(844),k=c(4725),S=c(2585),x=c(3656);let v=l.AccessibilityManager=class extends b.Disposable{constructor(w,y,C,N){super(),this._terminal=w,this._coreBrowserService=C,this._renderService=N,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 E=0;Ethis._handleBoundaryFocus(E,0),this._bottomBoundaryFocusListener=E=>this._handleBoundaryFocus(E,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 g.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((E=>this._handleResize(E.rows)))),this.register(this._terminal.onRender((E=>this._refreshRows(E.start,E.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((E=>this._handleChar(E)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` `)))),this.register(this._terminal.onA11yTab((E=>this._handleTab(E)))),this.register(this._terminal.onKey((E=>this._handleKey(E.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,x.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(w){for(let y=0;y0?this._charsToConsume.shift()!==w&&(this._charsToAnnounce+=w):this._charsToAnnounce+=w,w===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(w){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(w)||this._charsToConsume.push(w)}_refreshRows(w,y){this._liveRegionDebouncer.refresh(w,y,this._terminal.rows)}_renderRows(w,y){const C=this._terminal.buffer,T=C.lines.length.toString();for(let E=w;E<=y;E++){const j=C.lines.get(C.ydisp+E),N=[],D=(j==null?void 0:j.translateToString(!0,void 0,void 0,N))||"",z=(C.ydisp+E+1).toString(),$=this._rowElements[E];$&&(D.length===0?($.innerText=" ",this._rowColumns.set($,[0,1])):($.textContent=D,this._rowColumns.set($,N)),$.setAttribute("aria-posinset",z),$.setAttribute("aria-setsize",T))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(w,y){const C=w.target,T=this._rowElements[y===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||w.relatedTarget!==T)return;let E,j;if(y===0?(E=C,j=this._rowElements.pop(),this._rowContainer.removeChild(j)):(E=this._rowElements.shift(),j=C,this._rowContainer.removeChild(E)),E.removeEventListener("focus",this._topBoundaryFocusListener),j.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const N=this._createAccessibilityTreeNode();this._rowElements.unshift(N),this._rowContainer.insertAdjacentElement("afterbegin",N)}else{const N=this._createAccessibilityTreeNode();this._rowElements.push(N),this._rowContainer.appendChild(N)}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(),w.preventDefault(),w.stopImmediatePropagation()}_handleSelectionChange(){var D;if(this._rowElements.length===0)return;const w=document.getSelection();if(!w)return;if(w.isCollapsed)return void(this._rowContainer.contains(w.anchorNode)&&this._terminal.clearSelection());if(!w.anchorNode||!w.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:w.anchorNode,offset:w.anchorOffset},C={node:w.focusNode,offset:w.focusOffset};if((y.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===C.node&&y.offset>C.offset)&&([y,C]=[C,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 T=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(T)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:T,offset:((D=T.textContent)==null?void 0:D.length)??0}),!this._rowContainer.contains(C.node))return;const E=({node:z,offset:$})=>{const F=z instanceof Text?z.parentNode:z;let U=parseInt(F==null?void 0:F.getAttribute("aria-posinset"),10)-1;if(isNaN(U))return console.warn("row is invalid. Race condition?"),null;const V=this._rowColumns.get(F);if(!V)return console.warn("columns is null. Race condition?"),null;let X=$=this._terminal.cols&&(++U,X=0),{row:U,column:X}},j=E(y),N=E(C);if(j&&N){if(j.row>N.row||j.row===N.row&&j.column>=N.column)throw new Error("invalid range");this._terminal.select(j.column,j.row,(N.row-j.row)*this._terminal.cols-j.column+N.column)}}_handleResize(w){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;yw;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const w=this._coreBrowserService.mainDocument.createElement("div");return w.setAttribute("role","listitem"),w.tabIndex=-1,this._refreshRowDimensions(w),w}_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 w=0;w{function u(g){return g.replace(/\r?\n/g,"\r")}function d(g,b){return b?"\x1B[200~"+g+"\x1B[201~":g}function m(g,b,k,S){g=d(g=u(g),k.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(g,!0),b.value=""}function f(g,b,k){const S=k.getBoundingClientRect(),x=g.clientX-S.left-10,_=g.clientY-S.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${x}px`,b.style.top=`${_}px`,b.style.zIndex="1000",b.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=u,l.bracketTextForPaste=d,l.copyHandler=function(g,b){g.clipboardData&&g.clipboardData.setData("text/plain",b.selectionText),g.preventDefault()},l.handlePasteEvent=function(g,b,k,S){g.stopPropagation(),g.clipboardData&&m(g.clipboardData.getData("text/plain"),b,k,S)},l.paste=m,l.moveTextAreaUnderMouseCursor=f,l.rightClickHandler=function(g,b,k,S,x){f(g,b,k),x&&S.rightClickSelect(g),b.value=S.selectionText,b.select()}},7239:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const d=u(1505);l.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(m,f,g){this._css.set(m,f,g)}getCss(m,f){return this._css.get(m,f)}setColor(m,f,g){this._color.set(m,f,g)}getColor(m,f){return this._color.get(m,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(u,d,m,f){u.addEventListener(d,m,f);let g=!1;return{dispose:()=>{g||(g=!0,u.removeEventListener(d,m,f))}}}},3551:function(o,l,u){var d=this&&this.__decorate||function(_,w,y,C){var T,E=arguments.length,j=E<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(_,w,y,C);else for(var N=_.length-1;N>=0;N--)(T=_[N])&&(j=(E<3?T(j):E>3?T(w,y,j):T(w,y))||j);return E>3&&j&&Object.defineProperty(w,y,j),j},m=this&&this.__param||function(_,w){return function(y,C){w(y,C,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const f=u(3656),g=u(8460),b=u(844),k=u(2585),S=u(4725);let x=l.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(_,w,y,C,T){super(),this._element=_,this._mouseService=w,this._renderService=y,this._bufferService=C,this._linkProviderService=T,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{var E;this._lastMouseEvent=void 0,(E=this._activeProviderReplies)==null||E.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(_){this._lastMouseEvent=_;const w=this._positionFromMouseEvent(_,this._element,this._mouseService);if(!w)return;this._isMouseOut=!1;const y=_.composedPath();for(let C=0;C{E==null||E.forEach((j=>{j.link.dispose&&j.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=_.y);let y=!1;for(const[E,j]of this._linkProviderService.linkProviders.entries())w?(T=this._activeProviderReplies)!=null&&T.get(E)&&(y=this._checkLinkProviderResult(E,_,y)):j.provideLinks(_.y,(N=>{var z,$;if(this._isMouseOut)return;const D=N==null?void 0:N.map((F=>({link:F})));(z=this._activeProviderReplies)==null||z.set(E,D),y=this._checkLinkProviderResult(E,_,y),(($=this._activeProviderReplies)==null?void 0:$.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(_.y,this._activeProviderReplies)}))}_removeIntersectingLinks(_,w){const y=new Set;for(let C=0;C_?this._bufferService.cols:j.link.range.end.x;for(let z=N;z<=D;z++){if(y.has(z)){T.splice(E--,1);break}y.add(z)}}}}_checkLinkProviderResult(_,w,y){var E;if(!this._activeProviderReplies)return y;const C=this._activeProviderReplies.get(_);let T=!1;for(let j=0;j<_;j++)this._activeProviderReplies.has(j)&&!this._activeProviderReplies.get(j)||(T=!0);if(!T&&C){const j=C.find((N=>this._linkAtPosition(N.link,w)));j&&(y=!0,this._handleNewLink(j))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let j=0;jthis._linkAtPosition(D.link,w)));if(N){y=!0,this._handleNewLink(N);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(_){if(!this._currentLink)return;const w=this._positionFromMouseEvent(_,this._element,this._mouseService);w&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,w)&&this._currentLink.link.activate(_,this._currentLink.link.text)}_clearCurrentLink(_,w){this._currentLink&&this._lastMouseEvent&&(!_||!w||this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=w)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(_){if(!this._lastMouseEvent)return;const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._linkAtPosition(_.link,w)&&(this._currentLink=_,this._currentLink.state={decorations:{underline:_.link.decorations===void 0||_.link.decorations.underline,pointerCursor:_.link.decorations===void 0||_.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,_.link,this._lastMouseEvent),_.link.decorations={},Object.defineProperties(_.link.decorations,{pointerCursor:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.pointerCursor},set:y=>{var C;(C=this._currentLink)!=null&&C.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,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.underline},set:y=>{var C,T,E;(C=this._currentLink)!=null&&C.state&&((E=(T=this._currentLink)==null?void 0:T.state)==null?void 0:E.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(_.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const C=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,T=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=T&&(this._clearCurrentLink(C,T),this._lastMouseEvent)){const E=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);E&&this._askForLink(E,!1)}}))))}_linkHover(_,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!0),this._currentLink.state.decorations.pointerCursor&&_.classList.add("xterm-cursor-pointer")),w.hover&&w.hover(y,w.text)}_fireUnderlineEvent(_,w){const y=_.range,C=this._bufferService.buffer.ydisp,T=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-C-1,y.end.x,y.end.y-C-1,void 0);(w?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(T)}_linkLeave(_,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!1),this._currentLink.state.decorations.pointerCursor&&_.classList.remove("xterm-cursor-pointer")),w.leave&&w.leave(y,w.text)}_linkAtPosition(_,w){const y=_.range.start.y*this._bufferService.cols+_.range.start.x,C=_.range.end.y*this._bufferService.cols+_.range.end.x,T=w.y*this._bufferService.cols+w.x;return y<=T&&T<=C}_positionFromMouseEvent(_,w,y){const C=y.getCoords(_,w,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(_,w,y,C,T){return{x1:_,y1:w,x2:y,y2:C,cols:this._bufferService.cols,fg:T}}};l.Linkifier=x=d([m(1,S.IMouseService),m(2,S.IRenderService),m(3,k.IBufferService),m(4,S.ILinkProviderService)],x)},9042:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(o,l,u){var d=this&&this.__decorate||function(S,x,_,w){var y,C=arguments.length,T=C<3?x:w===null?w=Object.getOwnPropertyDescriptor(x,_):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(S,x,_,w);else for(var E=S.length-1;E>=0;E--)(y=S[E])&&(T=(C<3?y(T):C>3?y(x,_,T):y(x,_))||T);return C>3&&T&&Object.defineProperty(x,_,T),T},m=this&&this.__param||function(S,x){return function(_,w){x(_,w,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const f=u(511),g=u(2585);let b=l.OscLinkProvider=class{constructor(S,x,_){this._bufferService=S,this._optionsService=x,this._oscLinkService=_}provideLinks(S,x){var D;const _=this._bufferService.buffer.lines.get(S-1);if(!_)return void x(void 0);const w=[],y=this._optionsService.rawOptions.linkHandler,C=new f.CellData,T=_.getTrimmedLength();let E=-1,j=-1,N=!1;for(let z=0;zy?y.activate(V,X,F):k(0,X),hover:(V,X)=>{var Y;return(Y=y==null?void 0:y.hover)==null?void 0:Y.call(y,V,X,F)},leave:(V,X)=>{var Y;return(Y=y==null?void 0:y.leave)==null?void 0:Y.call(y,V,X,F)}})}N=!1,C.hasExtendedAttrs()&&C.extended.urlId?(j=z,E=C.extended.urlId):(j=-1,E=-1)}}x(w)}};function k(S,x){if(confirm(`Do you want to navigate to ${x}? +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(w){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(w)||this._charsToConsume.push(w)}_refreshRows(w,y){this._liveRegionDebouncer.refresh(w,y,this._terminal.rows)}_renderRows(w,y){const C=this._terminal.buffer,N=C.lines.length.toString();for(let E=w;E<=y;E++){const M=C.lines.get(C.ydisp+E),T=[],D=(M==null?void 0:M.translateToString(!0,void 0,void 0,T))||"",z=(C.ydisp+E+1).toString(),$=this._rowElements[E];$&&(D.length===0?($.innerText=" ",this._rowColumns.set($,[0,1])):($.textContent=D,this._rowColumns.set($,T)),$.setAttribute("aria-posinset",z),$.setAttribute("aria-setsize",N))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(w,y){const C=w.target,N=this._rowElements[y===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||w.relatedTarget!==N)return;let E,M;if(y===0?(E=C,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(E=this._rowElements.shift(),M=C,this._rowContainer.removeChild(E)),E.removeEventListener("focus",this._topBoundaryFocusListener),M.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(),w.preventDefault(),w.stopImmediatePropagation()}_handleSelectionChange(){var D;if(this._rowElements.length===0)return;const w=document.getSelection();if(!w)return;if(w.isCollapsed)return void(this._rowContainer.contains(w.anchorNode)&&this._terminal.clearSelection());if(!w.anchorNode||!w.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:w.anchorNode,offset:w.anchorOffset},C={node:w.focusNode,offset:w.focusOffset};if((y.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===C.node&&y.offset>C.offset)&&([y,C]=[C,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 N=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(N)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:N,offset:((D=N.textContent)==null?void 0:D.length)??0}),!this._rowContainer.contains(C.node))return;const E=({node:z,offset:$})=>{const F=z instanceof Text?z.parentNode:z;let U=parseInt(F==null?void 0:F.getAttribute("aria-posinset"),10)-1;if(isNaN(U))return console.warn("row is invalid. Race condition?"),null;const V=this._rowColumns.get(F);if(!V)return console.warn("columns is null. Race condition?"),null;let X=$=this._terminal.cols&&(++U,X=0),{row:U,column:X}},M=E(y),T=E(C);if(M&&T){if(M.row>T.row||M.row===T.row&&M.column>=T.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(T.row-M.row)*this._terminal.cols-M.column+T.column)}}_handleResize(w){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;yw;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const w=this._coreBrowserService.mainDocument.createElement("div");return w.setAttribute("role","listitem"),w.tabIndex=-1,this._refreshRowDimensions(w),w}_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 w=0;w{function c(g){return g.replace(/\r?\n/g,"\r")}function d(g,b){return b?"\x1B[200~"+g+"\x1B[201~":g}function m(g,b,k,S){g=d(g=c(g),k.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(g,!0),b.value=""}function f(g,b,k){const S=k.getBoundingClientRect(),x=g.clientX-S.left-10,v=g.clientY-S.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${x}px`,b.style.top=`${v}px`,b.style.zIndex="1000",b.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=c,l.bracketTextForPaste=d,l.copyHandler=function(g,b){g.clipboardData&&g.clipboardData.setData("text/plain",b.selectionText),g.preventDefault()},l.handlePasteEvent=function(g,b,k,S){g.stopPropagation(),g.clipboardData&&m(g.clipboardData.getData("text/plain"),b,k,S)},l.paste=m,l.moveTextAreaUnderMouseCursor=f,l.rightClickHandler=function(g,b,k,S,x){f(g,b,k),x&&S.rightClickSelect(g),b.value=S.selectionText,b.select()}},7239:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const d=c(1505);l.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(m,f,g){this._css.set(m,f,g)}getCss(m,f){return this._css.get(m,f)}setColor(m,f,g){this._color.set(m,f,g)}getColor(m,f){return this._color.get(m,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(c,d,m,f){c.addEventListener(d,m,f);let g=!1;return{dispose:()=>{g||(g=!0,c.removeEventListener(d,m,f))}}}},3551:function(o,l,c){var d=this&&this.__decorate||function(v,w,y,C){var N,E=arguments.length,M=E<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,w,y,C);else for(var T=v.length-1;T>=0;T--)(N=v[T])&&(M=(E<3?N(M):E>3?N(w,y,M):N(w,y))||M);return E>3&&M&&Object.defineProperty(w,y,M),M},m=this&&this.__param||function(v,w){return function(y,C){w(y,C,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const f=c(3656),g=c(8460),b=c(844),k=c(2585),S=c(4725);let x=l.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(v,w,y,C,N){super(),this._element=v,this._mouseService=w,this._renderService=y,this._bufferService=C,this._linkProviderService=N,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{var E;this._lastMouseEvent=void 0,(E=this._activeProviderReplies)==null||E.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(v){this._lastMouseEvent=v;const w=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!w)return;this._isMouseOut=!1;const y=v.composedPath();for(let C=0;C{E==null||E.forEach((M=>{M.link.dispose&&M.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=v.y);let y=!1;for(const[E,M]of this._linkProviderService.linkProviders.entries())w?(N=this._activeProviderReplies)!=null&&N.get(E)&&(y=this._checkLinkProviderResult(E,v,y)):M.provideLinks(v.y,(T=>{var z,$;if(this._isMouseOut)return;const D=T==null?void 0:T.map((F=>({link:F})));(z=this._activeProviderReplies)==null||z.set(E,D),y=this._checkLinkProviderResult(E,v,y),(($=this._activeProviderReplies)==null?void 0:$.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(v.y,this._activeProviderReplies)}))}_removeIntersectingLinks(v,w){const y=new Set;for(let C=0;Cv?this._bufferService.cols:M.link.range.end.x;for(let z=T;z<=D;z++){if(y.has(z)){N.splice(E--,1);break}y.add(z)}}}}_checkLinkProviderResult(v,w,y){var E;if(!this._activeProviderReplies)return y;const C=this._activeProviderReplies.get(v);let N=!1;for(let M=0;Mthis._linkAtPosition(T.link,w)));M&&(y=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let M=0;Mthis._linkAtPosition(D.link,w)));if(T){y=!0,this._handleNewLink(T);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const w=this._positionFromMouseEvent(v,this._element,this._mouseService);w&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,w)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,w){this._currentLink&&this._lastMouseEvent&&(!v||!w||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=w)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(v){if(!this._lastMouseEvent)return;const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._linkAtPosition(v.link,w)&&(this._currentLink=v,this._currentLink.state={decorations:{underline:v.link.decorations===void 0||v.link.decorations.underline,pointerCursor:v.link.decorations===void 0||v.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,v.link,this._lastMouseEvent),v.link.decorations={},Object.defineProperties(v.link.decorations,{pointerCursor:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.pointerCursor},set:y=>{var C;(C=this._currentLink)!=null&&C.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,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.underline},set:y=>{var C,N,E;(C=this._currentLink)!=null&&C.state&&((E=(N=this._currentLink)==null?void 0:N.state)==null?void 0:E.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(v.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const C=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,N=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=N&&(this._clearCurrentLink(C,N),this._lastMouseEvent)){const E=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);E&&this._askForLink(E,!1)}}))))}_linkHover(v,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!0),this._currentLink.state.decorations.pointerCursor&&v.classList.add("xterm-cursor-pointer")),w.hover&&w.hover(y,w.text)}_fireUnderlineEvent(v,w){const y=v.range,C=this._bufferService.buffer.ydisp,N=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-C-1,y.end.x,y.end.y-C-1,void 0);(w?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(N)}_linkLeave(v,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!1),this._currentLink.state.decorations.pointerCursor&&v.classList.remove("xterm-cursor-pointer")),w.leave&&w.leave(y,w.text)}_linkAtPosition(v,w){const y=v.range.start.y*this._bufferService.cols+v.range.start.x,C=v.range.end.y*this._bufferService.cols+v.range.end.x,N=w.y*this._bufferService.cols+w.x;return y<=N&&N<=C}_positionFromMouseEvent(v,w,y){const C=y.getCoords(v,w,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,w,y,C,N){return{x1:v,y1:w,x2:y,y2:C,cols:this._bufferService.cols,fg:N}}};l.Linkifier=x=d([m(1,S.IMouseService),m(2,S.IRenderService),m(3,k.IBufferService),m(4,S.ILinkProviderService)],x)},9042:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(o,l,c){var d=this&&this.__decorate||function(S,x,v,w){var y,C=arguments.length,N=C<3?x:w===null?w=Object.getOwnPropertyDescriptor(x,v):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,x,v,w);else for(var E=S.length-1;E>=0;E--)(y=S[E])&&(N=(C<3?y(N):C>3?y(x,v,N):y(x,v))||N);return C>3&&N&&Object.defineProperty(x,v,N),N},m=this&&this.__param||function(S,x){return function(v,w){x(v,w,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const f=c(511),g=c(2585);let b=l.OscLinkProvider=class{constructor(S,x,v){this._bufferService=S,this._optionsService=x,this._oscLinkService=v}provideLinks(S,x){var D;const v=this._bufferService.buffer.lines.get(S-1);if(!v)return void x(void 0);const w=[],y=this._optionsService.rawOptions.linkHandler,C=new f.CellData,N=v.getTrimmedLength();let E=-1,M=-1,T=!1;for(let z=0;zy?y.activate(V,X,F):k(0,X),hover:(V,X)=>{var Y;return(Y=y==null?void 0:y.hover)==null?void 0:Y.call(y,V,X,F)},leave:(V,X)=>{var Y;return(Y=y==null?void 0:y.leave)==null?void 0:Y.call(y,V,X,F)}})}T=!1,C.hasExtendedAttrs()&&C.extended.urlId?(M=z,E=C.extended.urlId):(M=-1,E=-1)}}x(w)}};function k(S,x){if(confirm(`Do you want to navigate to ${x}? -WARNING: This link could potentially be dangerous`)){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=x}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=b=d([m(0,g.IBufferService),m(1,g.IOptionsService),m(2,g.IOscLinkService)],b)},6193:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,d,m){this._rowCount=m,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,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 u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const d=u(3614),m=u(3656),f=u(3551),g=u(9042),b=u(3730),k=u(1680),S=u(3107),x=u(5744),_=u(2950),w=u(1296),y=u(428),C=u(4269),T=u(5114),E=u(8934),j=u(3230),N=u(9312),D=u(4725),z=u(6731),$=u(8055),F=u(8969),U=u(8460),V=u(844),X=u(6114),Y=u(8437),Q=u(2584),te=u(7399),I=u(5941),O=u(9074),H=u(2585),G=u(5435),W=u(4567),re=u(779);class ce extends F.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(ne={}){super(ne),this.browser=X,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new V.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(O.DecorationService),this._instantiationService.setService(H.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(re.LinkProviderService),this._instantiationService.setService(D.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((B,se)=>this.refresh(B,se)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((B=>this._reportWindowsOptions(B)))),this.register(this._inputHandler.onColor((B=>this._handleColorEvent(B)))),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((B=>this._afterResize(B.cols,B.rows)))),this.register((0,V.toDisposable)((()=>{var B,se;this._customKeyEventHandler=void 0,(se=(B=this.element)==null?void 0:B.parentNode)==null||se.removeChild(this.element)})))}_handleColorEvent(ne){if(this._themeService)for(const B of ne){let se,oe="";switch(B.index){case 256:se="foreground",oe="10";break;case 257:se="background",oe="11";break;case 258:se="cursor",oe="12";break;default:se="ansi",oe="4;"+B.index}switch(B.type){case 0:const _e=$.color.toColorRGB(se==="ansi"?this._themeService.colors.ansi[B.index]:this._themeService.colors[se]);this.coreService.triggerDataEvent(`${Q.C0.ESC}]${oe};${(0,I.toRgbString)(_e)}${Q.C1_ESCAPED.ST}`);break;case 1:if(se==="ansi")this._themeService.modifyColors((be=>be.ansi[B.index]=$.channels.toColor(...B.color)));else{const be=se;this._themeService.modifyColors((Ce=>Ce[be]=$.channels.toColor(...B.color)))}break;case 2:this._themeService.restoreColor(B.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(ne){ne?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(ne){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var ne;return(ne=this.textarea)==null?void 0:ne.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.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 ne=this.buffer.ybase+this.buffer.y,B=this.buffer.lines.get(ne);if(!B)return;const se=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,_e=B.getWidth(se),be=this._renderService.dimensions.css.cell.width*_e,Ce=this.buffer.y*this._renderService.dimensions.css.cell.height,Le=se*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Le+"px",this.textarea.style.top=Ce+"px",this.textarea.style.width=be+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(B=>{this.hasSelection()&&(0,d.copyHandler)(B,this._selectionService)})));const ne=B=>(0,d.handlePasteEvent)(B,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",ne)),this.register((0,m.addDisposableDomListener)(this.element,"paste",ne)),X.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(B=>{B.button===2&&(0,d.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(B=>{(0,d.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),X.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(B=>{B.button===1&&(0,d.moveTextAreaUnderMouseCursor)(B,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(ne=>this._keyUp(ne)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(ne=>this._keyDown(ne)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(ne=>this._keyPress(ne)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(ne=>this._compositionHelper.compositionupdate(ne)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(ne=>this._inputEvent(ne)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(ne){var se;if(!ne)throw new Error("Terminal requires a parent element.");if(ne.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((se=this.element)==null?void 0:se.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=ne.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"),ne.appendChild(this.element);const B=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),B.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,m.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),B.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),X.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(T.CoreBrowserService,this.textarea,ne.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(D.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,m.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(D.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(z.ThemeService),this._instantiationService.setService(D.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(D.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(j.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(D.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(_.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(E.MouseService),this._instantiationService.setService(D.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(B);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(k.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.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(N.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(D.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),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(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(x.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(x.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(w.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const ne=this,B=this.element;function se(be){const Ce=ne._mouseService.getMouseReportCoords(be,ne.screenElement);if(!Ce)return!1;let Le,Fe;switch(be.overrideType||be.type){case"mousemove":Fe=32,be.buttons===void 0?(Le=3,be.button!==void 0&&(Le=be.button<3?be.button:3)):Le=1&be.buttons?0:4&be.buttons?1:2&be.buttons?2:3;break;case"mouseup":Fe=0,Le=be.button<3?be.button:3;break;case"mousedown":Fe=1,Le=be.button<3?be.button:3;break;case"wheel":if(ne._customWheelEventHandler&&ne._customWheelEventHandler(be)===!1||ne.viewport.getLinesScrolled(be)===0)return!1;Fe=be.deltaY<0?0:1,Le=4;break;default:return!1}return!(Fe===void 0||Le===void 0||Le>4)&&ne.coreMouseService.triggerMouseEvent({col:Ce.col,row:Ce.row,x:Ce.x,y:Ce.y,button:Le,action:Fe,ctrl:be.ctrlKey,alt:be.altKey,shift:be.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},_e={mouseup:be=>(se(be),be.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(be)),wheel:be=>(se(be),this.cancel(be,!0)),mousedrag:be=>{be.buttons&&se(be)},mousemove:be=>{be.buttons||se(be)}};this.register(this.coreMouseService.onProtocolChange((be=>{be?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(be)),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&be?oe.mousemove||(B.addEventListener("mousemove",_e.mousemove),oe.mousemove=_e.mousemove):(B.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&be?oe.wheel||(B.addEventListener("wheel",_e.wheel,{passive:!1}),oe.wheel=_e.wheel):(B.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&be?oe.mouseup||(oe.mouseup=_e.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&be?oe.mousedrag||(oe.mousedrag=_e.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(B,"mousedown",(be=>{if(be.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(be))return se(be),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(be)}))),this.register((0,m.addDisposableDomListener)(B,"wheel",(be=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(be)===!1)return!1;if(!this.buffer.hasScrollback){const Ce=this.viewport.getLinesScrolled(be);if(Ce===0)return;const Le=Q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(be.deltaY<0?"A":"B");let Fe="";for(let Ve=0;Ve{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(be),this.cancel(be)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(B,"touchmove",(be=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(be)?void 0:this.cancel(be)}),{passive:!1}))}refresh(ne,B){var se;(se=this._renderService)==null||se.refreshRows(ne,B)}updateCursorStyle(ne){var B;(B=this._selectionService)!=null&&B.shouldColumnSelect(ne)?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(ne,B,se=0){var oe;se===1?(super.scrollLines(ne,B,se),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(ne)}paste(ne){(0,d.paste)(ne,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(ne){this._customKeyEventHandler=ne}attachCustomWheelEventHandler(ne){this._customWheelEventHandler=ne}registerLinkProvider(ne){return this._linkProviderService.registerLinkProvider(ne)}registerCharacterJoiner(ne){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const B=this._characterJoinerService.register(ne);return this.refresh(0,this.rows-1),B}deregisterCharacterJoiner(ne){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(ne)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(ne){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+ne)}registerDecoration(ne){return this._decorationService.registerDecoration(ne)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(ne,B,se){this._selectionService.setSelection(ne,B,se)}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 ne;(ne=this._selectionService)==null||ne.clearSelection()}selectAll(){var ne;(ne=this._selectionService)==null||ne.selectAll()}selectLines(ne,B){var se;(se=this._selectionService)==null||se.selectLines(ne,B)}_keyDown(ne){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1)return!1;const B=this.browser.isMac&&this.options.macOptionIsMeta&&ne.altKey;if(!B&&!this._compositionHelper.keydown(ne))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;B||ne.key!=="Dead"&&ne.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const se=(0,te.evaluateKeyboardEvent)(ne,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(ne),se.type===3||se.type===2){const oe=this.rows-1;return this.scrollLines(se.type===2?-oe:oe),this.cancel(ne,!0)}return se.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,ne)||(se.cancel&&this.cancel(ne,!0),!se.key||!!(ne.key&&!ne.ctrlKey&&!ne.altKey&&!ne.metaKey&&ne.key.length===1&&ne.key.charCodeAt(0)>=65&&ne.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(se.key!==Q.C0.ETX&&se.key!==Q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:se.key,domEvent:ne}),this._showCursor(),this.coreService.triggerDataEvent(se.key,!0),!this.optionsService.rawOptions.screenReaderMode||ne.altKey||ne.ctrlKey?this.cancel(ne,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(ne,B){const se=ne.isMac&&!this.options.macOptionIsMeta&&B.altKey&&!B.ctrlKey&&!B.metaKey||ne.isWindows&&B.altKey&&B.ctrlKey&&!B.metaKey||ne.isWindows&&B.getModifierState("AltGraph");return B.type==="keypress"?se:se&&(!B.keyCode||B.keyCode>47)}_keyUp(ne){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1||((function(B){return B.keyCode===16||B.keyCode===17||B.keyCode===18})(ne)||this.focus(),this.updateCursorStyle(ne),this._keyPressHandled=!1)}_keyPress(ne){let B;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1)return!1;if(this.cancel(ne),ne.charCode)B=ne.charCode;else if(ne.which===null||ne.which===void 0)B=ne.keyCode;else{if(ne.which===0||ne.charCode===0)return!1;B=ne.which}return!(!B||(ne.altKey||ne.ctrlKey||ne.metaKey)&&!this._isThirdLevelShift(this.browser,ne)||(B=String.fromCharCode(B),this._onKey.fire({key:B,domEvent:ne}),this._showCursor(),this.coreService.triggerDataEvent(B,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(ne){if(ne.data&&ne.inputType==="insertText"&&(!ne.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const B=ne.data;return this.coreService.triggerDataEvent(B,!0),this.cancel(ne),!0}return!1}resize(ne,B){ne!==this.cols||B!==this.rows?super.resize(ne,B):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(ne,B){var se,oe;(se=this._charSizeService)==null||se.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var ne;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 B=1;B{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,m){this._rowCount=m,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=f-this._lastRefreshMs,b=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(o,l,u){var d=this&&this.__decorate||function(_,w,y,C){var T,E=arguments.length,j=E<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(_,w,y,C);else for(var N=_.length-1;N>=0;N--)(T=_[N])&&(j=(E<3?T(j):E>3?T(w,y,j):T(w,y))||j);return E>3&&j&&Object.defineProperty(w,y,j),j},m=this&&this.__param||function(_,w){return function(y,C){w(y,C,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const f=u(3656),g=u(4725),b=u(8460),k=u(844),S=u(2585);let x=l.Viewport=class extends k.Disposable{constructor(_,w,y,C,T,E,j,N){super(),this._viewportElement=_,this._scrollArea=w,this._bufferService=y,this._optionsService=C,this._charSizeService=T,this._renderService=E,this._coreBrowserService=j,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 b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((D=>this._renderDimensions=D))),this._handleThemeChange(N.colors),this.register(N.onChangeColors((D=>this._handleThemeChange(D)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(_){this._viewportElement.style.backgroundColor=_.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(_){if(_)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 w=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==w&&(this._lastRecordedBufferHeight=w,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const _=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==_&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=_),this._refreshAnimationFrame=null}syncScrollArea(_=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(_);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(_)}_handleScroll(_){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 w=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:w,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const _=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(_*(this._smoothScrollState.target-this._smoothScrollState.origin)),_<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(_,w){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(w<0&&this._viewportElement.scrollTop!==0||w>0&&y0&&(y=F),C=""}}return{bufferElements:T,cursorElement:y}}getLinesScrolled(_){if(_.deltaY===0||_.shiftKey)return 0;let w=this._applyScrollModifier(_.deltaY,_);return _.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(w/=this._currentRowHeight+0,this._wheelPartialScroll+=w,w=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):_.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(w*=this._bufferService.rows),w}_applyScrollModifier(_,w){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&w.altKey||y==="ctrl"&&w.ctrlKey||y==="shift"&&w.shiftKey?_*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:_*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(_){this._lastTouchY=_.touches[0].pageY}handleTouchMove(_){const w=this._lastTouchY-_.touches[0].pageY;return this._lastTouchY=_.touches[0].pageY,w!==0&&(this._viewportElement.scrollTop+=w,this._bubbleScroll(_,w))}};l.Viewport=x=d([m(2,S.IBufferService),m(3,S.IOptionsService),m(4,g.ICharSizeService),m(5,g.IRenderService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],x)},3107:function(o,l,u){var d=this&&this.__decorate||function(S,x,_,w){var y,C=arguments.length,T=C<3?x:w===null?w=Object.getOwnPropertyDescriptor(x,_):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(S,x,_,w);else for(var E=S.length-1;E>=0;E--)(y=S[E])&&(T=(C<3?y(T):C>3?y(x,_,T):y(x,_))||T);return C>3&&T&&Object.defineProperty(x,_,T),T},m=this&&this.__param||function(S,x){return function(_,w){x(_,w,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const f=u(4725),g=u(844),b=u(2585);let k=l.BufferDecorationRenderer=class extends g.Disposable{constructor(S,x,_,w,y){super(),this._screenElement=S,this._bufferService=x,this._coreBrowserService=_,this._decorationService=w,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((C=>this._removeDecoration(C)))),this.register((0,g.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 S of this._decorationService.decorations)this._renderDecoration(S);this._dimensionsChanged=!1}_renderDecoration(S){this._refreshStyle(S),this._dimensionsChanged&&this._refreshXPosition(S)}_createElement(S){var w;const x=this._coreBrowserService.mainDocument.createElement("div");x.classList.add("xterm-decoration"),x.classList.toggle("xterm-decoration-top-layer",((w=S==null?void 0:S.options)==null?void 0:w.layer)==="top"),x.style.width=`${Math.round((S.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,x.style.height=(S.options.height||1)*this._renderService.dimensions.css.cell.height+"px",x.style.top=(S.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",x.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const _=S.options.x??0;return _&&_>this._bufferService.cols&&(x.style.display="none"),this._refreshXPosition(S,x),x}_refreshStyle(S){const x=S.marker.line-this._bufferService.buffers.active.ydisp;if(x<0||x>=this._bufferService.rows)S.element&&(S.element.style.display="none",S.onRenderEmitter.fire(S.element));else{let _=this._decorationElements.get(S);_||(_=this._createElement(S),S.element=_,this._decorationElements.set(S,_),this._container.appendChild(_),S.onDispose((()=>{this._decorationElements.delete(S),_.remove()}))),_.style.top=x*this._renderService.dimensions.css.cell.height+"px",_.style.display=this._altBufferIsActive?"none":"block",S.onRenderEmitter.fire(_)}}_refreshXPosition(S,x=S.element){if(!x)return;const _=S.options.x??0;(S.options.anchor||"left")==="right"?x.style.right=_?_*this._renderService.dimensions.css.cell.width+"px":"":x.style.left=_?_*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(S){var x;(x=this._decorationElements.get(S))==null||x.remove(),this._decorationElements.delete(S),S.dispose()}};l.BufferDecorationRenderer=k=d([m(1,b.IBufferService),m(2,f.ICoreBrowserService),m(3,b.IDecorationService),m(4,f.IRenderService)],k)},5871:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.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(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,m){return d>=u.startBufferLine-this._linePadding[m||"full"]&&d<=u.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(o,l,u){var d=this&&this.__decorate||function(y,C,T,E){var j,N=arguments.length,D=N<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,T):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,C,T,E);else for(var z=y.length-1;z>=0;z--)(j=y[z])&&(D=(N<3?j(D):N>3?j(C,T,D):j(C,T))||D);return N>3&&D&&Object.defineProperty(C,T,D),D},m=this&&this.__param||function(y,C){return function(T,E){C(T,E,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const f=u(5871),g=u(4725),b=u(844),k=u(2585),S={full:0,left:0,center:0,right:0},x={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0};let w=l.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,C,T,E,j,N,D){var $;super(),this._viewportElement=y,this._screenElement=C,this._bufferService=T,this._decorationService=E,this._renderService=j,this._optionsService=N,this._coreBrowserService=D,this._colorZoneStore=new f.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(),($=this._viewportElement.parentElement)==null||$.insertBefore(this._canvas,this._viewportElement);const z=this._canvas.getContext("2d");if(!z)throw new Error("Ctx cannot be null");this._ctx=z,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{var F;(F=this._canvas)==null||F.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),C=Math.ceil(this._canvas.width/3);x.full=this._canvas.width,x.left=y,x.center=C,x.right=y,this._refreshDrawHeightConstants(),_.full=0,_.left=0,_.center=x.left,_.right=x.left+x.center}_refreshDrawHeightConstants(){S.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,C=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);S.left=C,S.center=C,S.right=C}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.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 C of this._decorationService.decorations)this._colorZoneStore.addDecoration(C);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const C of y)C.position!=="full"&&this._renderColorZone(C);for(const C of y)C.position==="full"&&this._renderColorZone(C);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(_[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-S[y.position||"full"]/2),x[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+S[y.position||"full"]))}_queueRefresh(y,C){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=C||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=w=d([m(2,k.IBufferService),m(3,k.IDecorationService),m(4,g.IRenderService),m(5,k.IOptionsService),m(6,g.ICoreBrowserService)],w)},2950:function(o,l,u){var d=this&&this.__decorate||function(S,x,_,w){var y,C=arguments.length,T=C<3?x:w===null?w=Object.getOwnPropertyDescriptor(x,_):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(S,x,_,w);else for(var E=S.length-1;E>=0;E--)(y=S[E])&&(T=(C<3?y(T):C>3?y(x,_,T):y(x,_))||T);return C>3&&T&&Object.defineProperty(x,_,T),T},m=this&&this.__param||function(S,x){return function(_,w){x(_,w,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const f=u(4725),g=u(2585),b=u(2584);let k=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,x,_,w,y,C){this._textarea=S,this._compositionView=x,this._bufferService=_,this._optionsService=w,this._coreService=y,this._renderService=C,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(S){this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(S){if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){const x={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let _;this._isSendingComposition=!1,x.start+=this._dataAlreadySent.length,_=this._isComposing?this._textarea.value.substring(x.start,x.end):this._textarea.value.substring(x.start),_.length>0&&this._coreService.triggerDataEvent(_,!0)}}),0)}else{this._isSendingComposition=!1;const x=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(x,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const x=this._textarea.value,_=x.replace(S,"");this._dataAlreadySent=_,x.length>S.length?this._coreService.triggerDataEvent(_,!0):x.lengththis.updateCompositionElements(!0)),0)}}};l.CompositionHelper=k=d([m(2,g.IBufferService),m(3,g.IOptionsService),m(4,g.ICoreService),m(5,f.IRenderService)],k)},9806:(o,l)=>{function u(d,m,f){const g=f.getBoundingClientRect(),b=d.getComputedStyle(f),k=parseInt(b.getPropertyValue("padding-left")),S=parseInt(b.getPropertyValue("padding-top"));return[m.clientX-g.left-k,m.clientY-g.top-S]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=u,l.getCoords=function(d,m,f,g,b,k,S,x,_){if(!k)return;const w=u(d,m,f);return w?(w[0]=Math.ceil((w[0]+(_?S/2:0))/S),w[1]=Math.ceil(w[1]/x),w[0]=Math.min(Math.max(w[0],1),g+(_?1:0)),w[1]=Math.min(Math.max(w[1],1),b),w):void 0}},9504:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const d=u(2584);function m(x,_,w,y){const C=x-f(x,w),T=_-f(_,w),E=Math.abs(C-T)-(function(j,N,D){let z=0;const $=j-f(j,D),F=N-f(N,D);for(let U=0;U=0&&x<_.rows;)w++,y=_.buffer.lines.get(--x),C=y==null?void 0:y.isWrapped;return w}function g(x,_){return x>_?"A":"B"}function b(x,_,w,y,C,T){let E=x,j=_,N="";for(;E!==w||j!==y;)E+=C?1:-1,C&&E>T.cols-1?(N+=T.buffer.translateBufferLineToString(j,!1,x,E),E=0,x=0,j++):!C&&E<0&&(N+=T.buffer.translateBufferLineToString(j,!1,0,x+1),E=T.cols-1,x=E,j--);return N+T.buffer.translateBufferLineToString(j,!1,x,E)}function k(x,_){const w=_?"O":"[";return d.C0.ESC+w+x}function S(x,_){x=Math.floor(x);let w="";for(let y=0;y0?$-f($,F):D;const X=$,Y=(function(Q,te,I,O,H,G){let W;return W=m(I,O,H,G).length>0?O-f(O,H):te,Q=I&&Wx?"D":"C",S(Math.abs(C-x),k(E,y));E=T>_?"D":"C";const j=Math.abs(T-_);return S((function(N,D){return D.cols-N})(T>_?x:C,w)+(j-1)*w.cols+1+((T>_?C:x)-1),k(E,y))}},1296:function(o,l,u){var d=this&&this.__decorate||function(U,V,X,Y){var Q,te=arguments.length,I=te<3?V:Y===null?Y=Object.getOwnPropertyDescriptor(V,X):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(U,V,X,Y);else for(var O=U.length-1;O>=0;O--)(Q=U[O])&&(I=(te<3?Q(I):te>3?Q(V,X,I):Q(V,X))||I);return te>3&&I&&Object.defineProperty(V,X,I),I},m=this&&this.__param||function(U,V){return function(X,Y){V(X,Y,U)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const f=u(3787),g=u(2550),b=u(2223),k=u(6171),S=u(6052),x=u(4725),_=u(8055),w=u(8460),y=u(844),C=u(2585),T="xterm-dom-renderer-owner-",E="xterm-rows",j="xterm-fg-",N="xterm-bg-",D="xterm-focus",z="xterm-selection";let $=1,F=l.DomRenderer=class extends y.Disposable{constructor(U,V,X,Y,Q,te,I,O,H,G,W,re,ce){super(),this._terminal=U,this._document=V,this._element=X,this._screenElement=Y,this._viewportElement=Q,this._helperContainer=te,this._linkifier2=I,this._charSizeService=H,this._optionsService=G,this._bufferService=W,this._coreBrowserService=re,this._themeService=ce,this._terminalClass=$++,this._rowElements=[],this._selectionRenderModel=(0,S.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new w.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(E),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(z),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((pe=>this._injectCss(pe)))),this._injectCss(this._themeService.colors),this._rowFactory=O.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(T+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((pe=>this._handleLinkHover(pe)))),this.register(this._linkifier2.onHideLinkUnderline((pe=>this._handleLinkLeave(pe)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(T+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new g.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 X of this._rowElements)X.style.width=`${this.dimensions.css.canvas.width}px`,X.style.height=`${this.dimensions.css.cell.height}px`,X.style.lineHeight=`${this.dimensions.css.cell.height}px`,X.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const V=`${this._terminalSelector} .${E} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=V,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 V=`${this._terminalSelector} .${E} { color: ${U.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;V+=`${this._terminalSelector} .${E} .xterm-dim { color: ${_.color.multiplyOpacity(U.foreground,.5).css};}`,V+=`${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 X=`blink_underline_${this._terminalClass}`,Y=`blink_bar_${this._terminalClass}`,Q=`blink_block_${this._terminalClass}`;V+=`@keyframes ${X} { 50% { border-bottom-style: hidden; }}`,V+=`@keyframes ${Y} { 50% { box-shadow: none; }}`,V+=`@keyframes ${Q} { 0% { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css}; } 50% { background-color: inherit; color: ${U.cursor.css}; }}`,V+=`${this._terminalSelector} .${E}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${E}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${E}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Q} 1s step-end infinite;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css};}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${U.cursor.css} !important; color: ${U.cursorAccent.css} !important;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${U.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${U.cursor.css} inset;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${U.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,V+=`${this._terminalSelector} .${z} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${z} div { position: absolute; background-color: ${U.selectionBackgroundOpaque.css};}${this._terminalSelector} .${z} div { position: absolute; background-color: ${U.selectionInactiveBackgroundOpaque.css};}`;for(const[te,I]of U.ansi.entries())V+=`${this._terminalSelector} .${j}${te} { color: ${I.css}; }${this._terminalSelector} .${j}${te}.xterm-dim { color: ${_.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${N}${te} { background-color: ${I.css}; }`;V+=`${this._terminalSelector} .${j}${b.INVERTED_DEFAULT_COLOR} { color: ${_.color.opaque(U.background).css}; }${this._terminalSelector} .${j}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${_.color.multiplyOpacity(_.color.opaque(U.background),.5).css}; }${this._terminalSelector} .${N}${b.INVERTED_DEFAULT_COLOR} { background-color: ${U.foreground.css}; }`,this._themeStyleElement.textContent=V}_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,V){for(let X=this._rowElements.length;X<=V;X++){const Y=this._document.createElement("div");this._rowContainer.appendChild(Y),this._rowElements.push(Y)}for(;this._rowElements.length>V;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(U,V){this._refreshRowElements(U,V),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(D),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(D),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(U,V,X){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(U,V,X),this.renderRows(0,this._bufferService.rows-1),!U||!V)return;this._selectionRenderModel.update(this._terminal,U,V,X);const Y=this._selectionRenderModel.viewportStartRow,Q=this._selectionRenderModel.viewportEndRow,te=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(te>=this._bufferService.rows||I<0)return;const O=this._document.createDocumentFragment();if(X){const H=U[0]>V[0];O.appendChild(this._createSelectionElement(te,H?V[0]:U[0],H?U[0]:V[0],I-te+1))}else{const H=Y===te?U[0]:0,G=te===Q?V[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(te,H,G));const W=I-te-1;if(O.appendChild(this._createSelectionElement(te+1,0,this._bufferService.cols,W)),te!==I){const re=Q===I?V[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(I,0,re))}}this._selectionContainer.appendChild(O)}_createSelectionElement(U,V,X,Y=1){const Q=this._document.createElement("div"),te=V*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(X-V);return te+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-te),Q.style.height=Y*this.dimensions.css.cell.height+"px",Q.style.top=U*this.dimensions.css.cell.height+"px",Q.style.left=`${te}px`,Q.style.width=`${I}px`,Q}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,V){const X=this._bufferService.buffer,Y=X.ybase+X.y,Q=Math.min(X.x,this._bufferService.cols-1),te=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let H=U;H<=V;H++){const G=H+X.ydisp,W=this._rowElements[H],re=X.lines.get(G);if(!W||!re)break;W.replaceChildren(...this._rowFactory.createRow(re,G,G===Y,I,O,Q,te,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${T}${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,V,X,Y,Q,te){X<0&&(U=0),Y<0&&(V=0);const I=this._bufferService.rows-1;X=Math.max(Math.min(X,I),0),Y=Math.max(Math.min(Y,I),0),Q=Math.min(Q,this._bufferService.cols);const O=this._bufferService.buffer,H=O.ybase+O.y,G=Math.min(O.x,Q-1),W=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let pe=X;pe<=Y;++pe){const ne=pe+O.ydisp,B=this._rowElements[pe],se=O.lines.get(ne);if(!B||!se)break;B.replaceChildren(...this._rowFactory.createRow(se,ne,ne===H,re,ce,G,W,this.dimensions.css.cell.width,this._widthCache,te?pe===X?U:0:-1,te?(pe===Y?V:Q)-1:-1))}}};l.DomRenderer=F=d([m(7,C.IInstantiationService),m(8,x.ICharSizeService),m(9,C.IOptionsService),m(10,C.IBufferService),m(11,x.ICoreBrowserService),m(12,x.IThemeService)],F)},3787:function(o,l,u){var d=this&&this.__decorate||function(E,j,N,D){var z,$=arguments.length,F=$<3?j:D===null?D=Object.getOwnPropertyDescriptor(j,N):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(E,j,N,D);else for(var U=E.length-1;U>=0;U--)(z=E[U])&&(F=($<3?z(F):$>3?z(j,N,F):z(j,N))||F);return $>3&&F&&Object.defineProperty(j,N,F),F},m=this&&this.__param||function(E,j){return function(N,D){j(N,D,E)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const f=u(2223),g=u(643),b=u(511),k=u(2585),S=u(8055),x=u(4725),_=u(4269),w=u(6171),y=u(3734);let C=l.DomRendererRowFactory=class{constructor(E,j,N,D,z,$,F){this._document=E,this._characterJoinerService=j,this._optionsService=N,this._coreBrowserService=D,this._coreService=z,this._decorationService=$,this._themeService=F,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(E,j,N){this._selectionStart=E,this._selectionEnd=j,this._columnSelectMode=N}createRow(E,j,N,D,z,$,F,U,V,X,Y){const Q=[],te=this._characterJoinerService.getJoinedCharacters(j),I=this._themeService.colors;let O,H=E.getNoBgTrimmedLength();N&&H<$+1&&(H=$+1);let G=0,W="",re=0,ce=0,pe=0,ne=!1,B=0,se=!1,oe=0;const _e=[],be=X!==-1&&Y!==-1;for(let Ce=0;Ce0&&Ce===te[0][0]){Fe=!0;const it=te.shift();Pe=new _.JoinedCellData(this._workCell,E.translateToString(!0,it[0],it[1]),it[1]-it[0]),Ve=it[1]-1,Le=Pe.getWidth()}const dt=this._isCellInSelection(Ce,j),Qe=N&&Ce===$,qe=be&&Ce>=X&&Ce<=Y;let ut=!1;this._decorationService.forEachDecorationAtCell(Ce,j,void 0,(it=>{ut=!0}));let Zt=Pe.getChars()||g.WHITESPACE_CELL_CHAR;if(Zt===" "&&(Pe.isUnderline()||Pe.isOverline())&&(Zt=" "),oe=Le*U-V.get(Zt,Pe.isBold(),Pe.isItalic()),O){if(G&&(dt&&se||!dt&&!se&&Pe.bg===re)&&(dt&&se&&I.selectionForeground||Pe.fg===ce)&&Pe.extended.ext===pe&&qe===ne&&oe===B&&!Qe&&!Fe&&!ut){Pe.isInvisible()?W+=g.WHITESPACE_CELL_CHAR:W+=Zt,G++;continue}G&&(O.textContent=W),O=this._document.createElement("span"),G=0,W=""}else O=this._document.createElement("span");if(re=Pe.bg,ce=Pe.fg,pe=Pe.extended.ext,ne=qe,B=oe,se=dt,Fe&&$>=Ce&&$<=Ve&&($=Ce),!this._coreService.isCursorHidden&&Qe&&this._coreService.isCursorInitialized){if(_e.push("xterm-cursor"),this._coreBrowserService.isFocused)F&&_e.push("xterm-cursor-blink"),_e.push(D==="bar"?"xterm-cursor-bar":D==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(z)switch(z){case"outline":_e.push("xterm-cursor-outline");break;case"block":_e.push("xterm-cursor-block");break;case"bar":_e.push("xterm-cursor-bar");break;case"underline":_e.push("xterm-cursor-underline")}}if(Pe.isBold()&&_e.push("xterm-bold"),Pe.isItalic()&&_e.push("xterm-italic"),Pe.isDim()&&_e.push("xterm-dim"),W=Pe.isInvisible()?g.WHITESPACE_CELL_CHAR:Pe.getChars()||g.WHITESPACE_CELL_CHAR,Pe.isUnderline()&&(_e.push(`xterm-underline-${Pe.extended.underlineStyle}`),W===" "&&(W=" "),!Pe.isUnderlineColorDefault()))if(Pe.isUnderlineColorRGB())O.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Pe.getUnderlineColor()).join(",")})`;else{let it=Pe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Pe.isBold()&&it<8&&(it+=8),O.style.textDecorationColor=I.ansi[it].css}Pe.isOverline()&&(_e.push("xterm-overline"),W===" "&&(W=" ")),Pe.isStrikethrough()&&_e.push("xterm-strikethrough"),qe&&(O.style.textDecoration="underline");let Dt=Pe.getFgColor(),Ge=Pe.getFgColorMode(),rt=Pe.getBgColor(),ve=Pe.getBgColorMode();const je=!!Pe.isInverse();if(je){const it=Dt;Dt=rt,rt=it;const Tt=Ge;Ge=ve,ve=Tt}let Ue,Je,De,tt=!1;switch(this._decorationService.forEachDecorationAtCell(Ce,j,void 0,(it=>{it.options.layer!=="top"&&tt||(it.backgroundColorRGB&&(ve=50331648,rt=it.backgroundColorRGB.rgba>>8&16777215,Ue=it.backgroundColorRGB),it.foregroundColorRGB&&(Ge=50331648,Dt=it.foregroundColorRGB.rgba>>8&16777215,Je=it.foregroundColorRGB),tt=it.options.layer==="top")})),!tt&&dt&&(Ue=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,rt=Ue.rgba>>8&16777215,ve=50331648,tt=!0,I.selectionForeground&&(Ge=50331648,Dt=I.selectionForeground.rgba>>8&16777215,Je=I.selectionForeground)),tt&&_e.push("xterm-decoration-top"),ve){case 16777216:case 33554432:De=I.ansi[rt],_e.push(`xterm-bg-${rt}`);break;case 50331648:De=S.channels.toColor(rt>>16,rt>>8&255,255&rt),this._addStyle(O,`background-color:#${T((rt>>>0).toString(16),"0",6)}`);break;default:je?(De=I.foreground,_e.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):De=I.background}switch(Ue||Pe.isDim()&&(Ue=S.color.multiplyOpacity(De,.5)),Ge){case 16777216:case 33554432:Pe.isBold()&&Dt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Dt+=8),this._applyMinimumContrast(O,De,I.ansi[Dt],Pe,Ue,void 0)||_e.push(`xterm-fg-${Dt}`);break;case 50331648:const it=S.channels.toColor(Dt>>16&255,Dt>>8&255,255&Dt);this._applyMinimumContrast(O,De,it,Pe,Ue,Je)||this._addStyle(O,`color:#${T(Dt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(O,De,I.foreground,Pe,Ue,Je)||je&&_e.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}_e.length&&(O.className=_e.join(" "),_e.length=0),Qe||Fe||ut?O.textContent=W:G++,oe!==this.defaultSpacing&&(O.style.letterSpacing=`${oe}px`),Q.push(O),Ce=Ve}return O&&G&&(O.textContent=W),Q}_applyMinimumContrast(E,j,N,D,z,$){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,w.treatGlyphAsBackgroundColor)(D.getCode()))return!1;const F=this._getContrastCache(D);let U;if(z||$||(U=F.getColor(j.rgba,N.rgba)),U===void 0){const V=this._optionsService.rawOptions.minimumContrastRatio/(D.isDim()?2:1);U=S.color.ensureContrastRatio(z||j,$||N,V),F.setColor((z||j).rgba,($||N).rgba,U??null)}return!!U&&(this._addStyle(E,`color:${U.css}`),!0)}_getContrastCache(E){return E.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(E,j){E.setAttribute("style",`${E.getAttribute("style")||""}${j};`)}_isCellInSelection(E,j){const N=this._selectionStart,D=this._selectionEnd;return!(!N||!D)&&(this._columnSelectMode?N[0]<=D[0]?E>=N[0]&&j>=N[1]&&E=N[1]&&E>=D[0]&&j<=D[1]:j>N[1]&&j=N[0]&&E=N[0])}};function T(E,j,N){for(;E.length{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(u,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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 m=u.createElement("span");m.classList.add("xterm-char-measure-element");const f=u.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const g=u.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const b=u.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[m,f,g,b],this._container.appendChild(m),this._container.appendChild(f),this._container.appendChild(g),this._container.appendChild(b),d.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(u,d,m,f){u===this._font&&d===this._fontSize&&m===this._weight&&f===this._weightBold||(this._font=u,this._fontSize=d,this._weight=m,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(u,d,m){let f=0;if(!d&&!m&&u.length===1&&(f=u.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const k=this._measure(u,0);return k>0&&(this._flat[f]=k),k}let g=u;d&&(g+="B"),m&&(g+="I");let b=this._holey.get(g);if(b===void 0){let k=0;d&&(k|=1),m&&(k|=2),b=this._measure(u,k),b>0&&this._holey.set(g,b)}return b}_measure(u,d){const m=this._measureElements[d];return m.textContent=u.repeat(32),m.offsetWidth/32}}},2223:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(o,l)=>{function u(m){return 57508<=m&&m<=57558}function d(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},l.isPowerlineGlyph=u,l.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},l.isEmoji=d,l.allowRescaling=function(m,f,g,b){return f===1&&g>Math.ceil(1.5*b)&&m!==void 0&&m>255&&!d(m)&&!u(m)&&!(function(k){return 57344<=k&&k<=63743})(m)},l.treatGlyphAsBackgroundColor=function(m){return u(m)||(function(f){return 9472<=f&&f<=9631})(m)},l.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}}}},l.computeNextVariantOffset=function(m,f,g=0){return(m-(2*Math.round(f)-g))%(2*Math.round(f))}},6052:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createSelectionRenderModel=void 0;class u{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(m,f,g,b=!1){if(this.selectionStart=f,this.selectionEnd=g,!f||!g||f[0]===g[0]&&f[1]===g[1])return void this.clear();const k=m.buffers.active.ydisp,S=f[1]-k,x=g[1]-k,_=Math.max(S,0),w=Math.min(x,m.rows-1);_>=m.rows||w<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=S,this.viewportEndRow=x,this.viewportCappedStartRow=_,this.viewportCappedEndRow=w,this.startCol=f[0],this.endCol=g[0])}isCellSelected(m,f,g){return!!this.hasSelection&&(g-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&g>=this.viewportCappedStartRow&&f=this.viewportCappedStartRow&&f>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g=this.startCol&&f=this.startCol)}}l.createSelectionRenderModel=function(){return new u}},456:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(u){this._bufferService=u,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 u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(o,l,u){var d=this&&this.__decorate||function(w,y,C,T){var E,j=arguments.length,N=j<3?y:T===null?T=Object.getOwnPropertyDescriptor(y,C):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(w,y,C,T);else for(var D=w.length-1;D>=0;D--)(E=w[D])&&(N=(j<3?E(N):j>3?E(y,C,N):E(y,C))||N);return j>3&&N&&Object.defineProperty(y,C,N),N},m=this&&this.__param||function(w,y){return function(C,T){y(C,T,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const f=u(2585),g=u(8460),b=u(844);let k=l.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(w,y,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new _(this._optionsService))}catch{this._measureStrategy=this.register(new x(w,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const w=this._measureStrategy.measure();w.width===this.width&&w.height===this.height||(this.width=w.width,this.height=w.height,this._onCharSizeChange.fire())}};l.CharSizeService=k=d([m(2,f.IOptionsService)],k);class S extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,C){y!==void 0&&y>0&&C!==void 0&&C>0&&(this._result.width=y,this._result.height=C)}}class x extends S{constructor(y,C,T){super(),this._document=y,this._parentElement=C,this._optionsService=T,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 _ extends S{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const C=this._ctx.measureText("W");if(!("width"in C&&"fontBoundingBoxAscent"in C&&"fontBoundingBoxDescent"in C))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(o,l,u){var d=this&&this.__decorate||function(_,w,y,C){var T,E=arguments.length,j=E<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(_,w,y,C);else for(var N=_.length-1;N>=0;N--)(T=_[N])&&(j=(E<3?T(j):E>3?T(w,y,j):T(w,y))||j);return E>3&&j&&Object.defineProperty(w,y,j),j},m=this&&this.__param||function(_,w){return function(y,C){w(y,C,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const f=u(3734),g=u(643),b=u(511),k=u(2585);class S extends f.AttributeData{constructor(w,y,C){super(),this.content=0,this.combinedData="",this.fg=w.fg,this.bg=w.bg,this.combinedData=y,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(w){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=S;let x=l.CharacterJoinerService=class NE{constructor(w){this._bufferService=w,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(w){const y={id:this._nextCharacterJoinerId++,handler:w};return this._characterJoiners.push(y),y.id}deregister(w){for(let y=0;y1){const F=this._getJoinedRanges(T,N,j,y,E);for(let U=0;U1){const $=this._getJoinedRanges(T,N,j,y,E);for(let F=0;F<$.length;F++)C.push($[F])}return C}_getJoinedRanges(w,y,C,T,E){const j=w.substring(y,C);let N=[];try{N=this._characterJoiners[0].handler(j)}catch(D){console.error(D)}for(let D=1;D{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const d=u(844),m=u(8460),f=u(3656);class g extends d.Disposable{constructor(S,x,_){super(),this._textarea=S,this._window=x,this.mainDocument=_,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((w=>this._screenDprMonitor.setWindow(w)))),this.register((0,m.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(S){this._window!==S&&(this._window=S,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}}l.CoreBrowserService=g;class b extends d.Disposable{constructor(S){super(),this._parentWindow=S,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(S){this._parentWindow=S,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var S;this._outerListener&&((S=this._resolutionMediaMatchList)==null||S.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:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const d=u(844);class m extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const b=this.linkProviders.indexOf(g);b!==-1&&this.linkProviders.splice(b,1)}}}}l.LinkProviderService=m},8934:function(o,l,u){var d=this&&this.__decorate||function(k,S,x,_){var w,y=arguments.length,C=y<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,x):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(k,S,x,_);else for(var T=k.length-1;T>=0;T--)(w=k[T])&&(C=(y<3?w(C):y>3?w(S,x,C):w(S,x))||C);return y>3&&C&&Object.defineProperty(S,x,C),C},m=this&&this.__param||function(k,S){return function(x,_){S(x,_,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const f=u(4725),g=u(9806);let b=l.MouseService=class{constructor(k,S){this._renderService=k,this._charSizeService=S}getCoords(k,S,x,_,w){return(0,g.getCoords)(window,k,S,x,_,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,w)}getMouseReportCoords(k,S){const x=(0,g.getCoordsRelativeToElement)(window,k,S);if(this._charSizeService.hasValidSize)return x[0]=Math.min(Math.max(x[0],0),this._renderService.dimensions.css.canvas.width-1),x[1]=Math.min(Math.max(x[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(x[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(x[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(x[0]),y:Math.floor(x[1])}}};l.MouseService=b=d([m(0,f.IRenderService),m(1,f.ICharSizeService)],b)},3230:function(o,l,u){var d=this&&this.__decorate||function(w,y,C,T){var E,j=arguments.length,N=j<3?y:T===null?T=Object.getOwnPropertyDescriptor(y,C):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(w,y,C,T);else for(var D=w.length-1;D>=0;D--)(E=w[D])&&(N=(j<3?E(N):j>3?E(y,C,N):E(y,C))||N);return j>3&&N&&Object.defineProperty(y,C,N),N},m=this&&this.__param||function(w,y){return function(C,T){y(C,T,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const f=u(6193),g=u(4725),b=u(8460),k=u(844),S=u(7226),x=u(2585);let _=l.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(w,y,C,T,E,j,N,D){super(),this._rowCount=w,this._charSizeService=T,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new S.DebouncedIdleTask,this._observerDisposable=this.register(new k.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 b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((z,$)=>this._renderRows(z,$)),N),this.register(this._renderDebouncer),this.register(N.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(j.onResize((()=>this._fullRefresh()))),this.register(j.buffers.onBufferActivate((()=>{var z;return(z=this._renderer.value)==null?void 0:z.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(E.onDecorationRegistered((()=>this._fullRefresh()))),this.register(E.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(j.cols,j.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(j.buffer.y,j.buffer.y,!0)))),this.register(D.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(N.window,y),this.register(N.onWindowChange((z=>this._registerIntersectionObserver(z,y))))}_registerIntersectionObserver(w,y){if("IntersectionObserver"in w){const C=new w.IntersectionObserver((T=>this._handleIntersectionChange(T[T.length-1])),{threshold:0});C.observe(y),this._observerDisposable.value=(0,k.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(w){this._isPaused=w.isIntersecting===void 0?w.intersectionRatio===0:!w.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(w,y,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(w,y,this._rowCount))}_renderRows(w,y){this._renderer.value&&(w=Math.min(w,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(w,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:w,end:y}),this._onRender.fire({start:w,end:y}),this._isNextRenderRedrawOnly=!0)}resize(w,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(w){this._renderer.value=w,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(w){return this._renderDebouncer.addRefreshCallback(w)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var w,y;this._renderer.value&&((y=(w=this._renderer.value).clearTextureAtlas)==null||y.call(w),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(w,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(w,y)})):this._renderer.value.handleResize(w,y),this._fullRefresh())}handleCharSizeChanged(){var w;(w=this._renderer.value)==null||w.handleCharSizeChanged()}handleBlur(){var w;(w=this._renderer.value)==null||w.handleBlur()}handleFocus(){var w;(w=this._renderer.value)==null||w.handleFocus()}handleSelectionChanged(w,y,C){var T;this._selectionState.start=w,this._selectionState.end=y,this._selectionState.columnSelectMode=C,(T=this._renderer.value)==null||T.handleSelectionChanged(w,y,C)}handleCursorMove(){var w;(w=this._renderer.value)==null||w.handleCursorMove()}clear(){var w;(w=this._renderer.value)==null||w.clear()}};l.RenderService=_=d([m(2,x.IOptionsService),m(3,g.ICharSizeService),m(4,x.IDecorationService),m(5,x.IBufferService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],_)},9312:function(o,l,u){var d=this&&this.__decorate||function(N,D,z,$){var F,U=arguments.length,V=U<3?D:$===null?$=Object.getOwnPropertyDescriptor(D,z):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(N,D,z,$);else for(var X=N.length-1;X>=0;X--)(F=N[X])&&(V=(U<3?F(V):U>3?F(D,z,V):F(D,z))||V);return U>3&&V&&Object.defineProperty(D,z,V),V},m=this&&this.__param||function(N,D){return function(z,$){D(z,$,N)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const f=u(9806),g=u(9504),b=u(456),k=u(4725),S=u(8460),x=u(844),_=u(6114),w=u(4841),y=u(511),C=u(2585),T=" ",E=new RegExp(T,"g");let j=l.SelectionService=class extends x.Disposable{constructor(N,D,z,$,F,U,V,X,Y){super(),this._element=N,this._screenElement=D,this._linkifier=z,this._bufferService=$,this._coreService=F,this._mouseService=U,this._optionsService=V,this._renderService=X,this._coreBrowserService=Y,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 S.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new S.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new S.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Q=>this._handleMouseMove(Q),this._mouseUpListener=Q=>this._handleMouseUp(Q),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Q=>this._handleTrim(Q))),this.register(this._bufferService.buffers.onBufferActivate((Q=>this._handleBufferActivate(Q)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,x.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 N=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!(!N||!D||N[0]===D[0]&&N[1]===D[1])}get selectionText(){const N=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;if(!N||!D)return"";const z=this._bufferService.buffer,$=[];if(this._activeSelectionMode===3){if(N[0]===D[0])return"";const F=N[0]F.replace(E," "))).join(_.isWindows?`\r +WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=x}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=b=d([m(0,g.IBufferService),m(1,g.IOptionsService),m(2,g.IOscLinkService)],b)},6193:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(c,d){this._renderCallback=c,this._coreBrowserService=d,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,d,m){this._rowCount=m,c=c!==void 0?c:0,d=d!==void 0?d: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,d):d,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),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const d=c(3614),m=c(3656),f=c(3551),g=c(9042),b=c(3730),k=c(1680),S=c(3107),x=c(5744),v=c(2950),w=c(1296),y=c(428),C=c(4269),N=c(5114),E=c(8934),M=c(3230),T=c(9312),D=c(4725),z=c(6731),$=c(8055),F=c(8969),U=c(8460),V=c(844),X=c(6114),Y=c(8437),Q=c(2584),te=c(7399),I=c(5941),O=c(9074),H=c(2585),G=c(5435),W=c(4567),re=c(779);class ce extends F.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(ne={}){super(ne),this.browser=X,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new V.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(O.DecorationService),this._instantiationService.setService(H.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(re.LinkProviderService),this._instantiationService.setService(D.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((B,se)=>this.refresh(B,se)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((B=>this._reportWindowsOptions(B)))),this.register(this._inputHandler.onColor((B=>this._handleColorEvent(B)))),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((B=>this._afterResize(B.cols,B.rows)))),this.register((0,V.toDisposable)((()=>{var B,se;this._customKeyEventHandler=void 0,(se=(B=this.element)==null?void 0:B.parentNode)==null||se.removeChild(this.element)})))}_handleColorEvent(ne){if(this._themeService)for(const B of ne){let se,le="";switch(B.index){case 256:se="foreground",le="10";break;case 257:se="background",le="11";break;case 258:se="cursor",le="12";break;default:se="ansi",le="4;"+B.index}switch(B.type){case 0:const _e=$.color.toColorRGB(se==="ansi"?this._themeService.colors.ansi[B.index]:this._themeService.colors[se]);this.coreService.triggerDataEvent(`${Q.C0.ESC}]${le};${(0,I.toRgbString)(_e)}${Q.C1_ESCAPED.ST}`);break;case 1:if(se==="ansi")this._themeService.modifyColors((be=>be.ansi[B.index]=$.channels.toColor(...B.color)));else{const be=se;this._themeService.modifyColors((Ce=>Ce[be]=$.channels.toColor(...B.color)))}break;case 2:this._themeService.restoreColor(B.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(ne){ne?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(ne){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var ne;return(ne=this.textarea)==null?void 0:ne.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.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 ne=this.buffer.ybase+this.buffer.y,B=this.buffer.lines.get(ne);if(!B)return;const se=Math.min(this.buffer.x,this.cols-1),le=this._renderService.dimensions.css.cell.height,_e=B.getWidth(se),be=this._renderService.dimensions.css.cell.width*_e,Ce=this.buffer.y*this._renderService.dimensions.css.cell.height,Le=se*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Le+"px",this.textarea.style.top=Ce+"px",this.textarea.style.width=be+"px",this.textarea.style.height=le+"px",this.textarea.style.lineHeight=le+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(B=>{this.hasSelection()&&(0,d.copyHandler)(B,this._selectionService)})));const ne=B=>(0,d.handlePasteEvent)(B,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",ne)),this.register((0,m.addDisposableDomListener)(this.element,"paste",ne)),X.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(B=>{B.button===2&&(0,d.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(B=>{(0,d.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),X.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(B=>{B.button===1&&(0,d.moveTextAreaUnderMouseCursor)(B,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(ne=>this._keyUp(ne)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(ne=>this._keyDown(ne)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(ne=>this._keyPress(ne)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(ne=>this._compositionHelper.compositionupdate(ne)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(ne=>this._inputEvent(ne)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(ne){var se;if(!ne)throw new Error("Terminal requires a parent element.");if(ne.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((se=this.element)==null?void 0:se.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=ne.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"),ne.appendChild(this.element);const B=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),B.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,m.addDisposableDomListener)(this.screenElement,"mousemove",(le=>this.updateCursorStyle(le)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),B.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),X.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(N.CoreBrowserService,this.textarea,ne.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(D.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(le=>this._handleTextAreaFocus(le)))),this.register((0,m.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(D.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(z.ThemeService),this._instantiationService.setService(D.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(D.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(D.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((le=>this._onRender.fire(le)))),this.onResize((le=>this._renderService.resize(le.cols,le.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(v.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(E.MouseService),this._instantiationService.setService(D.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(B);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(k.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((le=>this.scrollLines(le.amount,le.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(D.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((le=>this.scrollLines(le.amount,le.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((le=>this._renderService.handleSelectionChanged(le.start,le.end,le.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((le=>{this.textarea.value=le,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((le=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(le=>this._selectionService.handleMouseDown(le)))),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(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(le=>this._handleScreenReaderModeOptionChange(le)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(x.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(le=>{!this._overviewRulerRenderer&&le&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(x.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(w.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const ne=this,B=this.element;function se(be){const Ce=ne._mouseService.getMouseReportCoords(be,ne.screenElement);if(!Ce)return!1;let Le,$e;switch(be.overrideType||be.type){case"mousemove":$e=32,be.buttons===void 0?(Le=3,be.button!==void 0&&(Le=be.button<3?be.button:3)):Le=1&be.buttons?0:4&be.buttons?1:2&be.buttons?2:3;break;case"mouseup":$e=0,Le=be.button<3?be.button:3;break;case"mousedown":$e=1,Le=be.button<3?be.button:3;break;case"wheel":if(ne._customWheelEventHandler&&ne._customWheelEventHandler(be)===!1||ne.viewport.getLinesScrolled(be)===0)return!1;$e=be.deltaY<0?0:1,Le=4;break;default:return!1}return!($e===void 0||Le===void 0||Le>4)&&ne.coreMouseService.triggerMouseEvent({col:Ce.col,row:Ce.row,x:Ce.x,y:Ce.y,button:Le,action:$e,ctrl:be.ctrlKey,alt:be.altKey,shift:be.shiftKey})}const le={mouseup:null,wheel:null,mousedrag:null,mousemove:null},_e={mouseup:be=>(se(be),be.buttons||(this._document.removeEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.removeEventListener("mousemove",le.mousedrag)),this.cancel(be)),wheel:be=>(se(be),this.cancel(be,!0)),mousedrag:be=>{be.buttons&&se(be)},mousemove:be=>{be.buttons||se(be)}};this.register(this.coreMouseService.onProtocolChange((be=>{be?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(be)),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&be?le.mousemove||(B.addEventListener("mousemove",_e.mousemove),le.mousemove=_e.mousemove):(B.removeEventListener("mousemove",le.mousemove),le.mousemove=null),16&be?le.wheel||(B.addEventListener("wheel",_e.wheel,{passive:!1}),le.wheel=_e.wheel):(B.removeEventListener("wheel",le.wheel),le.wheel=null),2&be?le.mouseup||(le.mouseup=_e.mouseup):(this._document.removeEventListener("mouseup",le.mouseup),le.mouseup=null),4&be?le.mousedrag||(le.mousedrag=_e.mousedrag):(this._document.removeEventListener("mousemove",le.mousedrag),le.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(B,"mousedown",(be=>{if(be.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(be))return se(be),le.mouseup&&this._document.addEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.addEventListener("mousemove",le.mousedrag),this.cancel(be)}))),this.register((0,m.addDisposableDomListener)(B,"wheel",(be=>{if(!le.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(be)===!1)return!1;if(!this.buffer.hasScrollback){const Ce=this.viewport.getLinesScrolled(be);if(Ce===0)return;const Le=Q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(be.deltaY<0?"A":"B");let $e="";for(let Ge=0;Ge{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(be),this.cancel(be)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(B,"touchmove",(be=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(be)?void 0:this.cancel(be)}),{passive:!1}))}refresh(ne,B){var se;(se=this._renderService)==null||se.refreshRows(ne,B)}updateCursorStyle(ne){var B;(B=this._selectionService)!=null&&B.shouldColumnSelect(ne)?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(ne,B,se=0){var le;se===1?(super.scrollLines(ne,B,se),this.refresh(0,this.rows-1)):(le=this.viewport)==null||le.scrollLines(ne)}paste(ne){(0,d.paste)(ne,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(ne){this._customKeyEventHandler=ne}attachCustomWheelEventHandler(ne){this._customWheelEventHandler=ne}registerLinkProvider(ne){return this._linkProviderService.registerLinkProvider(ne)}registerCharacterJoiner(ne){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const B=this._characterJoinerService.register(ne);return this.refresh(0,this.rows-1),B}deregisterCharacterJoiner(ne){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(ne)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(ne){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+ne)}registerDecoration(ne){return this._decorationService.registerDecoration(ne)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(ne,B,se){this._selectionService.setSelection(ne,B,se)}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 ne;(ne=this._selectionService)==null||ne.clearSelection()}selectAll(){var ne;(ne=this._selectionService)==null||ne.selectAll()}selectLines(ne,B){var se;(se=this._selectionService)==null||se.selectLines(ne,B)}_keyDown(ne){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1)return!1;const B=this.browser.isMac&&this.options.macOptionIsMeta&&ne.altKey;if(!B&&!this._compositionHelper.keydown(ne))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;B||ne.key!=="Dead"&&ne.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const se=(0,te.evaluateKeyboardEvent)(ne,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(ne),se.type===3||se.type===2){const le=this.rows-1;return this.scrollLines(se.type===2?-le:le),this.cancel(ne,!0)}return se.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,ne)||(se.cancel&&this.cancel(ne,!0),!se.key||!!(ne.key&&!ne.ctrlKey&&!ne.altKey&&!ne.metaKey&&ne.key.length===1&&ne.key.charCodeAt(0)>=65&&ne.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(se.key!==Q.C0.ETX&&se.key!==Q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:se.key,domEvent:ne}),this._showCursor(),this.coreService.triggerDataEvent(se.key,!0),!this.optionsService.rawOptions.screenReaderMode||ne.altKey||ne.ctrlKey?this.cancel(ne,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(ne,B){const se=ne.isMac&&!this.options.macOptionIsMeta&&B.altKey&&!B.ctrlKey&&!B.metaKey||ne.isWindows&&B.altKey&&B.ctrlKey&&!B.metaKey||ne.isWindows&&B.getModifierState("AltGraph");return B.type==="keypress"?se:se&&(!B.keyCode||B.keyCode>47)}_keyUp(ne){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1||((function(B){return B.keyCode===16||B.keyCode===17||B.keyCode===18})(ne)||this.focus(),this.updateCursorStyle(ne),this._keyPressHandled=!1)}_keyPress(ne){let B;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1)return!1;if(this.cancel(ne),ne.charCode)B=ne.charCode;else if(ne.which===null||ne.which===void 0)B=ne.keyCode;else{if(ne.which===0||ne.charCode===0)return!1;B=ne.which}return!(!B||(ne.altKey||ne.ctrlKey||ne.metaKey)&&!this._isThirdLevelShift(this.browser,ne)||(B=String.fromCharCode(B),this._onKey.fire({key:B,domEvent:ne}),this._showCursor(),this.coreService.triggerDataEvent(B,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(ne){if(ne.data&&ne.inputType==="insertText"&&(!ne.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const B=ne.data;return this.coreService.triggerDataEvent(B,!0),this.cancel(ne),!0}return!1}resize(ne,B){ne!==this.cols||B!==this.rows?super.resize(ne,B):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(ne,B){var se,le;(se=this._charSizeService)==null||se.measure(),(le=this.viewport)==null||le.syncScrollArea(!0)}clear(){var ne;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 B=1;B{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(c,d=1e3){this._renderCallback=c,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,d,m){this._rowCount=m,c=c!==void 0?c:0,d=d!==void 0?d: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,d):d;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=f-this._lastRefreshMs,b=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d)}}},1680:function(o,l,c){var d=this&&this.__decorate||function(v,w,y,C){var N,E=arguments.length,M=E<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,w,y,C);else for(var T=v.length-1;T>=0;T--)(N=v[T])&&(M=(E<3?N(M):E>3?N(w,y,M):N(w,y))||M);return E>3&&M&&Object.defineProperty(w,y,M),M},m=this&&this.__param||function(v,w){return function(y,C){w(y,C,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const f=c(3656),g=c(4725),b=c(8460),k=c(844),S=c(2585);let x=l.Viewport=class extends k.Disposable{constructor(v,w,y,C,N,E,M,T){super(),this._viewportElement=v,this._scrollArea=w,this._bufferService=y,this._optionsService=C,this._charSizeService=N,this._renderService=E,this._coreBrowserService=M,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 b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((D=>this._renderDimensions=D))),this._handleThemeChange(T.colors),this.register(T.onChangeColors((D=>this._handleThemeChange(D)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(v){this._viewportElement.style.backgroundColor=v.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(v){if(v)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 w=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==w&&(this._lastRecordedBufferHeight=w,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const v=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==v&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=v),this._refreshAnimationFrame=null}syncScrollArea(v=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(v);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(v)}_handleScroll(v){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 w=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:w,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const v=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(v*(this._smoothScrollState.target-this._smoothScrollState.origin)),v<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(v,w){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(w<0&&this._viewportElement.scrollTop!==0||w>0&&y0&&(y=F),C=""}}return{bufferElements:N,cursorElement:y}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let w=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(w/=this._currentRowHeight+0,this._wheelPartialScroll+=w,w=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(w*=this._bufferService.rows),w}_applyScrollModifier(v,w){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&w.altKey||y==="ctrl"&&w.ctrlKey||y==="shift"&&w.shiftKey?v*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:v*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(v){this._lastTouchY=v.touches[0].pageY}handleTouchMove(v){const w=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,w!==0&&(this._viewportElement.scrollTop+=w,this._bubbleScroll(v,w))}};l.Viewport=x=d([m(2,S.IBufferService),m(3,S.IOptionsService),m(4,g.ICharSizeService),m(5,g.IRenderService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],x)},3107:function(o,l,c){var d=this&&this.__decorate||function(S,x,v,w){var y,C=arguments.length,N=C<3?x:w===null?w=Object.getOwnPropertyDescriptor(x,v):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,x,v,w);else for(var E=S.length-1;E>=0;E--)(y=S[E])&&(N=(C<3?y(N):C>3?y(x,v,N):y(x,v))||N);return C>3&&N&&Object.defineProperty(x,v,N),N},m=this&&this.__param||function(S,x){return function(v,w){x(v,w,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const f=c(4725),g=c(844),b=c(2585);let k=l.BufferDecorationRenderer=class extends g.Disposable{constructor(S,x,v,w,y){super(),this._screenElement=S,this._bufferService=x,this._coreBrowserService=v,this._decorationService=w,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((C=>this._removeDecoration(C)))),this.register((0,g.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 S of this._decorationService.decorations)this._renderDecoration(S);this._dimensionsChanged=!1}_renderDecoration(S){this._refreshStyle(S),this._dimensionsChanged&&this._refreshXPosition(S)}_createElement(S){var w;const x=this._coreBrowserService.mainDocument.createElement("div");x.classList.add("xterm-decoration"),x.classList.toggle("xterm-decoration-top-layer",((w=S==null?void 0:S.options)==null?void 0:w.layer)==="top"),x.style.width=`${Math.round((S.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,x.style.height=(S.options.height||1)*this._renderService.dimensions.css.cell.height+"px",x.style.top=(S.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",x.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const v=S.options.x??0;return v&&v>this._bufferService.cols&&(x.style.display="none"),this._refreshXPosition(S,x),x}_refreshStyle(S){const x=S.marker.line-this._bufferService.buffers.active.ydisp;if(x<0||x>=this._bufferService.rows)S.element&&(S.element.style.display="none",S.onRenderEmitter.fire(S.element));else{let v=this._decorationElements.get(S);v||(v=this._createElement(S),S.element=v,this._decorationElements.set(S,v),this._container.appendChild(v),S.onDispose((()=>{this._decorationElements.delete(S),v.remove()}))),v.style.top=x*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",S.onRenderEmitter.fire(v)}}_refreshXPosition(S,x=S.element){if(!x)return;const v=S.options.x??0;(S.options.anchor||"left")==="right"?x.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":x.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(S){var x;(x=this._decorationElements.get(S))==null||x.remove(),this._decorationElements.delete(S),S.dispose()}};l.BufferDecorationRenderer=k=d([m(1,b.IBufferService),m(2,f.ICoreBrowserService),m(3,b.IDecorationService),m(4,f.IRenderService)],k)},5871:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.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 d of this._zones)if(d.color===c.options.overviewRulerOptions.color&&d.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,c.marker.line))return;if(this._lineAdjacentToZone(d,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(d,c.marker.line)}if(this._zonePoolIndex=c.startBufferLine&&d<=c.endBufferLine}_lineAdjacentToZone(c,d,m){return d>=c.startBufferLine-this._linePadding[m||"full"]&&d<=c.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(c,d){c.startBufferLine=Math.min(c.startBufferLine,d),c.endBufferLine=Math.max(c.endBufferLine,d)}}},5744:function(o,l,c){var d=this&&this.__decorate||function(y,C,N,E){var M,T=arguments.length,D=T<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,N):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,C,N,E);else for(var z=y.length-1;z>=0;z--)(M=y[z])&&(D=(T<3?M(D):T>3?M(C,N,D):M(C,N))||D);return T>3&&D&&Object.defineProperty(C,N,D),D},m=this&&this.__param||function(y,C){return function(N,E){C(N,E,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const f=c(5871),g=c(4725),b=c(844),k=c(2585),S={full:0,left:0,center:0,right:0},x={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let w=l.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,C,N,E,M,T,D){var $;super(),this._viewportElement=y,this._screenElement=C,this._bufferService=N,this._decorationService=E,this._renderService=M,this._optionsService=T,this._coreBrowserService=D,this._colorZoneStore=new f.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(),($=this._viewportElement.parentElement)==null||$.insertBefore(this._canvas,this._viewportElement);const z=this._canvas.getContext("2d");if(!z)throw new Error("Ctx cannot be null");this._ctx=z,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{var F;(F=this._canvas)==null||F.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),C=Math.ceil(this._canvas.width/3);x.full=this._canvas.width,x.left=y,x.center=C,x.right=y,this._refreshDrawHeightConstants(),v.full=0,v.left=0,v.center=x.left,v.right=x.left+x.center}_refreshDrawHeightConstants(){S.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,C=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);S.left=C,S.center=C,S.right=C}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.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 C of this._decorationService.decorations)this._colorZoneStore.addDecoration(C);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const C of y)C.position!=="full"&&this._renderColorZone(C);for(const C of y)C.position==="full"&&this._renderColorZone(C);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(v[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-S[y.position||"full"]/2),x[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+S[y.position||"full"]))}_queueRefresh(y,C){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=C||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=w=d([m(2,k.IBufferService),m(3,k.IDecorationService),m(4,g.IRenderService),m(5,k.IOptionsService),m(6,g.ICoreBrowserService)],w)},2950:function(o,l,c){var d=this&&this.__decorate||function(S,x,v,w){var y,C=arguments.length,N=C<3?x:w===null?w=Object.getOwnPropertyDescriptor(x,v):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,x,v,w);else for(var E=S.length-1;E>=0;E--)(y=S[E])&&(N=(C<3?y(N):C>3?y(x,v,N):y(x,v))||N);return C>3&&N&&Object.defineProperty(x,v,N),N},m=this&&this.__param||function(S,x){return function(v,w){x(v,w,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const f=c(4725),g=c(2585),b=c(2584);let k=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,x,v,w,y,C){this._textarea=S,this._compositionView=x,this._bufferService=v,this._optionsService=w,this._coreService=y,this._renderService=C,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(S){this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(S){if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){const x={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,x.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(x.start,x.end):this._textarea.value.substring(x.start),v.length>0&&this._coreService.triggerDataEvent(v,!0)}}),0)}else{this._isSendingComposition=!1;const x=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(x,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const x=this._textarea.value,v=x.replace(S,"");this._dataAlreadySent=v,x.length>S.length?this._coreService.triggerDataEvent(v,!0):x.lengththis.updateCompositionElements(!0)),0)}}};l.CompositionHelper=k=d([m(2,g.IBufferService),m(3,g.IOptionsService),m(4,g.ICoreService),m(5,f.IRenderService)],k)},9806:(o,l)=>{function c(d,m,f){const g=f.getBoundingClientRect(),b=d.getComputedStyle(f),k=parseInt(b.getPropertyValue("padding-left")),S=parseInt(b.getPropertyValue("padding-top"));return[m.clientX-g.left-k,m.clientY-g.top-S]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=c,l.getCoords=function(d,m,f,g,b,k,S,x,v){if(!k)return;const w=c(d,m,f);return w?(w[0]=Math.ceil((w[0]+(v?S/2:0))/S),w[1]=Math.ceil(w[1]/x),w[0]=Math.min(Math.max(w[0],1),g+(v?1:0)),w[1]=Math.min(Math.max(w[1],1),b),w):void 0}},9504:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const d=c(2584);function m(x,v,w,y){const C=x-f(x,w),N=v-f(v,w),E=Math.abs(C-N)-(function(M,T,D){let z=0;const $=M-f(M,D),F=T-f(T,D);for(let U=0;U=0&&xv?"A":"B"}function b(x,v,w,y,C,N){let E=x,M=v,T="";for(;E!==w||M!==y;)E+=C?1:-1,C&&E>N.cols-1?(T+=N.buffer.translateBufferLineToString(M,!1,x,E),E=0,x=0,M++):!C&&E<0&&(T+=N.buffer.translateBufferLineToString(M,!1,0,x+1),E=N.cols-1,x=E,M--);return T+N.buffer.translateBufferLineToString(M,!1,x,E)}function k(x,v){const w=v?"O":"[";return d.C0.ESC+w+x}function S(x,v){x=Math.floor(x);let w="";for(let y=0;y0?$-f($,F):D;const X=$,Y=(function(Q,te,I,O,H,G){let W;return W=m(I,O,H,G).length>0?O-f(O,H):te,Q=I&&Wx?"D":"C",S(Math.abs(C-x),k(E,y));E=N>v?"D":"C";const M=Math.abs(N-v);return S((function(T,D){return D.cols-T})(N>v?x:C,w)+(M-1)*w.cols+1+((N>v?C:x)-1),k(E,y))}},1296:function(o,l,c){var d=this&&this.__decorate||function(U,V,X,Y){var Q,te=arguments.length,I=te<3?V:Y===null?Y=Object.getOwnPropertyDescriptor(V,X):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(U,V,X,Y);else for(var O=U.length-1;O>=0;O--)(Q=U[O])&&(I=(te<3?Q(I):te>3?Q(V,X,I):Q(V,X))||I);return te>3&&I&&Object.defineProperty(V,X,I),I},m=this&&this.__param||function(U,V){return function(X,Y){V(X,Y,U)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const f=c(3787),g=c(2550),b=c(2223),k=c(6171),S=c(6052),x=c(4725),v=c(8055),w=c(8460),y=c(844),C=c(2585),N="xterm-dom-renderer-owner-",E="xterm-rows",M="xterm-fg-",T="xterm-bg-",D="xterm-focus",z="xterm-selection";let $=1,F=l.DomRenderer=class extends y.Disposable{constructor(U,V,X,Y,Q,te,I,O,H,G,W,re,ce){super(),this._terminal=U,this._document=V,this._element=X,this._screenElement=Y,this._viewportElement=Q,this._helperContainer=te,this._linkifier2=I,this._charSizeService=H,this._optionsService=G,this._bufferService=W,this._coreBrowserService=re,this._themeService=ce,this._terminalClass=$++,this._rowElements=[],this._selectionRenderModel=(0,S.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new w.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(E),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(z),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((me=>this._injectCss(me)))),this._injectCss(this._themeService.colors),this._rowFactory=O.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(N+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((me=>this._handleLinkHover(me)))),this.register(this._linkifier2.onHideLinkUnderline((me=>this._handleLinkLeave(me)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(N+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new g.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 X of this._rowElements)X.style.width=`${this.dimensions.css.canvas.width}px`,X.style.height=`${this.dimensions.css.cell.height}px`,X.style.lineHeight=`${this.dimensions.css.cell.height}px`,X.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const V=`${this._terminalSelector} .${E} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=V,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 V=`${this._terminalSelector} .${E} { color: ${U.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;V+=`${this._terminalSelector} .${E} .xterm-dim { color: ${v.color.multiplyOpacity(U.foreground,.5).css};}`,V+=`${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 X=`blink_underline_${this._terminalClass}`,Y=`blink_bar_${this._terminalClass}`,Q=`blink_block_${this._terminalClass}`;V+=`@keyframes ${X} { 50% { border-bottom-style: hidden; }}`,V+=`@keyframes ${Y} { 50% { box-shadow: none; }}`,V+=`@keyframes ${Q} { 0% { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css}; } 50% { background-color: inherit; color: ${U.cursor.css}; }}`,V+=`${this._terminalSelector} .${E}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${E}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${E}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Q} 1s step-end infinite;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css};}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${U.cursor.css} !important; color: ${U.cursorAccent.css} !important;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${U.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${U.cursor.css} inset;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${U.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,V+=`${this._terminalSelector} .${z} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${z} div { position: absolute; background-color: ${U.selectionBackgroundOpaque.css};}${this._terminalSelector} .${z} div { position: absolute; background-color: ${U.selectionInactiveBackgroundOpaque.css};}`;for(const[te,I]of U.ansi.entries())V+=`${this._terminalSelector} .${M}${te} { color: ${I.css}; }${this._terminalSelector} .${M}${te}.xterm-dim { color: ${v.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${T}${te} { background-color: ${I.css}; }`;V+=`${this._terminalSelector} .${M}${b.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque(U.background).css}; }${this._terminalSelector} .${M}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque(U.background),.5).css}; }${this._terminalSelector} .${T}${b.INVERTED_DEFAULT_COLOR} { background-color: ${U.foreground.css}; }`,this._themeStyleElement.textContent=V}_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,V){for(let X=this._rowElements.length;X<=V;X++){const Y=this._document.createElement("div");this._rowContainer.appendChild(Y),this._rowElements.push(Y)}for(;this._rowElements.length>V;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(U,V){this._refreshRowElements(U,V),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(D),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(D),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(U,V,X){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(U,V,X),this.renderRows(0,this._bufferService.rows-1),!U||!V)return;this._selectionRenderModel.update(this._terminal,U,V,X);const Y=this._selectionRenderModel.viewportStartRow,Q=this._selectionRenderModel.viewportEndRow,te=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(te>=this._bufferService.rows||I<0)return;const O=this._document.createDocumentFragment();if(X){const H=U[0]>V[0];O.appendChild(this._createSelectionElement(te,H?V[0]:U[0],H?U[0]:V[0],I-te+1))}else{const H=Y===te?U[0]:0,G=te===Q?V[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(te,H,G));const W=I-te-1;if(O.appendChild(this._createSelectionElement(te+1,0,this._bufferService.cols,W)),te!==I){const re=Q===I?V[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(I,0,re))}}this._selectionContainer.appendChild(O)}_createSelectionElement(U,V,X,Y=1){const Q=this._document.createElement("div"),te=V*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(X-V);return te+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-te),Q.style.height=Y*this.dimensions.css.cell.height+"px",Q.style.top=U*this.dimensions.css.cell.height+"px",Q.style.left=`${te}px`,Q.style.width=`${I}px`,Q}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,V){const X=this._bufferService.buffer,Y=X.ybase+X.y,Q=Math.min(X.x,this._bufferService.cols-1),te=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let H=U;H<=V;H++){const G=H+X.ydisp,W=this._rowElements[H],re=X.lines.get(G);if(!W||!re)break;W.replaceChildren(...this._rowFactory.createRow(re,G,G===Y,I,O,Q,te,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${N}${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,V,X,Y,Q,te){X<0&&(U=0),Y<0&&(V=0);const I=this._bufferService.rows-1;X=Math.max(Math.min(X,I),0),Y=Math.max(Math.min(Y,I),0),Q=Math.min(Q,this._bufferService.cols);const O=this._bufferService.buffer,H=O.ybase+O.y,G=Math.min(O.x,Q-1),W=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let me=X;me<=Y;++me){const ne=me+O.ydisp,B=this._rowElements[me],se=O.lines.get(ne);if(!B||!se)break;B.replaceChildren(...this._rowFactory.createRow(se,ne,ne===H,re,ce,G,W,this.dimensions.css.cell.width,this._widthCache,te?me===X?U:0:-1,te?(me===Y?V:Q)-1:-1))}}};l.DomRenderer=F=d([m(7,C.IInstantiationService),m(8,x.ICharSizeService),m(9,C.IOptionsService),m(10,C.IBufferService),m(11,x.ICoreBrowserService),m(12,x.IThemeService)],F)},3787:function(o,l,c){var d=this&&this.__decorate||function(E,M,T,D){var z,$=arguments.length,F=$<3?M:D===null?D=Object.getOwnPropertyDescriptor(M,T):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(E,M,T,D);else for(var U=E.length-1;U>=0;U--)(z=E[U])&&(F=($<3?z(F):$>3?z(M,T,F):z(M,T))||F);return $>3&&F&&Object.defineProperty(M,T,F),F},m=this&&this.__param||function(E,M){return function(T,D){M(T,D,E)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const f=c(2223),g=c(643),b=c(511),k=c(2585),S=c(8055),x=c(4725),v=c(4269),w=c(6171),y=c(3734);let C=l.DomRendererRowFactory=class{constructor(E,M,T,D,z,$,F){this._document=E,this._characterJoinerService=M,this._optionsService=T,this._coreBrowserService=D,this._coreService=z,this._decorationService=$,this._themeService=F,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(E,M,T){this._selectionStart=E,this._selectionEnd=M,this._columnSelectMode=T}createRow(E,M,T,D,z,$,F,U,V,X,Y){const Q=[],te=this._characterJoinerService.getJoinedCharacters(M),I=this._themeService.colors;let O,H=E.getNoBgTrimmedLength();T&&H<$+1&&(H=$+1);let G=0,W="",re=0,ce=0,me=0,ne=!1,B=0,se=!1,le=0;const _e=[],be=X!==-1&&Y!==-1;for(let Ce=0;Ce0&&Ce===te[0][0]){$e=!0;const rt=te.shift();Fe=new v.JoinedCellData(this._workCell,E.translateToString(!0,rt[0],rt[1]),rt[1]-rt[0]),Ge=rt[1]-1,Le=Fe.getWidth()}const ut=this._isCellInSelection(Ce,M),Ke=T&&Ce===$,Ue=be&&Ce>=X&&Ce<=Y;let ct=!1;this._decorationService.forEachDecorationAtCell(Ce,M,void 0,(rt=>{ct=!0}));let Kt=Fe.getChars()||g.WHITESPACE_CELL_CHAR;if(Kt===" "&&(Fe.isUnderline()||Fe.isOverline())&&(Kt=" "),le=Le*U-V.get(Kt,Fe.isBold(),Fe.isItalic()),O){if(G&&(ut&&se||!ut&&!se&&Fe.bg===re)&&(ut&&se&&I.selectionForeground||Fe.fg===ce)&&Fe.extended.ext===me&&Ue===ne&&le===B&&!Ke&&!$e&&!ct){Fe.isInvisible()?W+=g.WHITESPACE_CELL_CHAR:W+=Kt,G++;continue}G&&(O.textContent=W),O=this._document.createElement("span"),G=0,W=""}else O=this._document.createElement("span");if(re=Fe.bg,ce=Fe.fg,me=Fe.extended.ext,ne=Ue,B=le,se=ut,$e&&$>=Ce&&$<=Ge&&($=Ce),!this._coreService.isCursorHidden&&Ke&&this._coreService.isCursorInitialized){if(_e.push("xterm-cursor"),this._coreBrowserService.isFocused)F&&_e.push("xterm-cursor-blink"),_e.push(D==="bar"?"xterm-cursor-bar":D==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(z)switch(z){case"outline":_e.push("xterm-cursor-outline");break;case"block":_e.push("xterm-cursor-block");break;case"bar":_e.push("xterm-cursor-bar");break;case"underline":_e.push("xterm-cursor-underline")}}if(Fe.isBold()&&_e.push("xterm-bold"),Fe.isItalic()&&_e.push("xterm-italic"),Fe.isDim()&&_e.push("xterm-dim"),W=Fe.isInvisible()?g.WHITESPACE_CELL_CHAR:Fe.getChars()||g.WHITESPACE_CELL_CHAR,Fe.isUnderline()&&(_e.push(`xterm-underline-${Fe.extended.underlineStyle}`),W===" "&&(W=" "),!Fe.isUnderlineColorDefault()))if(Fe.isUnderlineColorRGB())O.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Fe.getUnderlineColor()).join(",")})`;else{let rt=Fe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Fe.isBold()&&rt<8&&(rt+=8),O.style.textDecorationColor=I.ansi[rt].css}Fe.isOverline()&&(_e.push("xterm-overline"),W===" "&&(W=" ")),Fe.isStrikethrough()&&_e.push("xterm-strikethrough"),Ue&&(O.style.textDecoration="underline");let Rt=Fe.getFgColor(),qe=Fe.getFgColorMode(),nt=Fe.getBgColor(),ve=Fe.getBgColorMode();const je=!!Fe.isInverse();if(je){const rt=Rt;Rt=nt,nt=rt;const At=qe;qe=ve,ve=At}let Pe,Ze,De,et=!1;switch(this._decorationService.forEachDecorationAtCell(Ce,M,void 0,(rt=>{rt.options.layer!=="top"&&et||(rt.backgroundColorRGB&&(ve=50331648,nt=rt.backgroundColorRGB.rgba>>8&16777215,Pe=rt.backgroundColorRGB),rt.foregroundColorRGB&&(qe=50331648,Rt=rt.foregroundColorRGB.rgba>>8&16777215,Ze=rt.foregroundColorRGB),et=rt.options.layer==="top")})),!et&&ut&&(Pe=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,nt=Pe.rgba>>8&16777215,ve=50331648,et=!0,I.selectionForeground&&(qe=50331648,Rt=I.selectionForeground.rgba>>8&16777215,Ze=I.selectionForeground)),et&&_e.push("xterm-decoration-top"),ve){case 16777216:case 33554432:De=I.ansi[nt],_e.push(`xterm-bg-${nt}`);break;case 50331648:De=S.channels.toColor(nt>>16,nt>>8&255,255&nt),this._addStyle(O,`background-color:#${N((nt>>>0).toString(16),"0",6)}`);break;default:je?(De=I.foreground,_e.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):De=I.background}switch(Pe||Fe.isDim()&&(Pe=S.color.multiplyOpacity(De,.5)),qe){case 16777216:case 33554432:Fe.isBold()&&Rt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Rt+=8),this._applyMinimumContrast(O,De,I.ansi[Rt],Fe,Pe,void 0)||_e.push(`xterm-fg-${Rt}`);break;case 50331648:const rt=S.channels.toColor(Rt>>16&255,Rt>>8&255,255&Rt);this._applyMinimumContrast(O,De,rt,Fe,Pe,Ze)||this._addStyle(O,`color:#${N(Rt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(O,De,I.foreground,Fe,Pe,Ze)||je&&_e.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}_e.length&&(O.className=_e.join(" "),_e.length=0),Ke||$e||ct?O.textContent=W:G++,le!==this.defaultSpacing&&(O.style.letterSpacing=`${le}px`),Q.push(O),Ce=Ge}return O&&G&&(O.textContent=W),Q}_applyMinimumContrast(E,M,T,D,z,$){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,w.treatGlyphAsBackgroundColor)(D.getCode()))return!1;const F=this._getContrastCache(D);let U;if(z||$||(U=F.getColor(M.rgba,T.rgba)),U===void 0){const V=this._optionsService.rawOptions.minimumContrastRatio/(D.isDim()?2:1);U=S.color.ensureContrastRatio(z||M,$||T,V),F.setColor((z||M).rgba,($||T).rgba,U??null)}return!!U&&(this._addStyle(E,`color:${U.css}`),!0)}_getContrastCache(E){return E.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(E,M){E.setAttribute("style",`${E.getAttribute("style")||""}${M};`)}_isCellInSelection(E,M){const T=this._selectionStart,D=this._selectionEnd;return!(!T||!D)&&(this._columnSelectMode?T[0]<=D[0]?E>=T[0]&&M>=T[1]&&E=T[1]&&E>=D[0]&&M<=D[1]:M>T[1]&&M=T[0]&&E=T[0])}};function N(E,M,T){for(;E.length{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(c,d){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 m=c.createElement("span");m.classList.add("xterm-char-measure-element");const f=c.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const g=c.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const b=c.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[m,f,g,b],this._container.appendChild(m),this._container.appendChild(f),this._container.appendChild(g),this._container.appendChild(b),d.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,d,m,f){c===this._font&&d===this._fontSize&&m===this._weight&&f===this._weightBold||(this._font=c,this._fontSize=d,this._weight=m,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(c,d,m){let f=0;if(!d&&!m&&c.length===1&&(f=c.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const k=this._measure(c,0);return k>0&&(this._flat[f]=k),k}let g=c;d&&(g+="B"),m&&(g+="I");let b=this._holey.get(g);if(b===void 0){let k=0;d&&(k|=1),m&&(k|=2),b=this._measure(c,k),b>0&&this._holey.set(g,b)}return b}_measure(c,d){const m=this._measureElements[d];return m.textContent=c.repeat(32),m.offsetWidth/32}}},2223:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const d=c(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(o,l)=>{function c(m){return 57508<=m&&m<=57558}function d(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},l.isPowerlineGlyph=c,l.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},l.isEmoji=d,l.allowRescaling=function(m,f,g,b){return f===1&&g>Math.ceil(1.5*b)&&m!==void 0&&m>255&&!d(m)&&!c(m)&&!(function(k){return 57344<=k&&k<=63743})(m)},l.treatGlyphAsBackgroundColor=function(m){return c(m)||(function(f){return 9472<=f&&f<=9631})(m)},l.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}}}},l.computeNextVariantOffset=function(m,f,g=0){return(m-(2*Math.round(f)-g))%(2*Math.round(f))}},6052:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.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(m,f,g,b=!1){if(this.selectionStart=f,this.selectionEnd=g,!f||!g||f[0]===g[0]&&f[1]===g[1])return void this.clear();const k=m.buffers.active.ydisp,S=f[1]-k,x=g[1]-k,v=Math.max(S,0),w=Math.min(x,m.rows-1);v>=m.rows||w<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=S,this.viewportEndRow=x,this.viewportCappedStartRow=v,this.viewportCappedEndRow=w,this.startCol=f[0],this.endCol=g[0])}isCellSelected(m,f,g){return!!this.hasSelection&&(g-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&g>=this.viewportCappedStartRow&&f=this.viewportCappedStartRow&&f>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g=this.startCol&&f=this.startCol)}}l.createSelectionRenderModel=function(){return new c}},456:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.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,d=this.selectionEnd;return!(!c||!d)&&(c[1]>d[1]||c[1]===d[1]&&c[0]>d[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(o,l,c){var d=this&&this.__decorate||function(w,y,C,N){var E,M=arguments.length,T=M<3?y:N===null?N=Object.getOwnPropertyDescriptor(y,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,C,N);else for(var D=w.length-1;D>=0;D--)(E=w[D])&&(T=(M<3?E(T):M>3?E(y,C,T):E(y,C))||T);return M>3&&T&&Object.defineProperty(y,C,T),T},m=this&&this.__param||function(w,y){return function(C,N){y(C,N,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const f=c(2585),g=c(8460),b=c(844);let k=l.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(w,y,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new v(this._optionsService))}catch{this._measureStrategy=this.register(new x(w,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const w=this._measureStrategy.measure();w.width===this.width&&w.height===this.height||(this.width=w.width,this.height=w.height,this._onCharSizeChange.fire())}};l.CharSizeService=k=d([m(2,f.IOptionsService)],k);class S extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,C){y!==void 0&&y>0&&C!==void 0&&C>0&&(this._result.width=y,this._result.height=C)}}class x extends S{constructor(y,C,N){super(),this._document=y,this._parentElement=C,this._optionsService=N,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 v extends S{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const C=this._ctx.measureText("W");if(!("width"in C&&"fontBoundingBoxAscent"in C&&"fontBoundingBoxDescent"in C))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(o,l,c){var d=this&&this.__decorate||function(v,w,y,C){var N,E=arguments.length,M=E<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,w,y,C);else for(var T=v.length-1;T>=0;T--)(N=v[T])&&(M=(E<3?N(M):E>3?N(w,y,M):N(w,y))||M);return E>3&&M&&Object.defineProperty(w,y,M),M},m=this&&this.__param||function(v,w){return function(y,C){w(y,C,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const f=c(3734),g=c(643),b=c(511),k=c(2585);class S extends f.AttributeData{constructor(w,y,C){super(),this.content=0,this.combinedData="",this.fg=w.fg,this.bg=w.bg,this.combinedData=y,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(w){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=S;let x=l.CharacterJoinerService=class IE{constructor(w){this._bufferService=w,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(w){const y={id:this._nextCharacterJoinerId++,handler:w};return this._characterJoiners.push(y),y.id}deregister(w){for(let y=0;y1){const F=this._getJoinedRanges(N,T,M,y,E);for(let U=0;U1){const $=this._getJoinedRanges(N,T,M,y,E);for(let F=0;F<$.length;F++)C.push($[F])}return C}_getJoinedRanges(w,y,C,N,E){const M=w.substring(y,C);let T=[];try{T=this._characterJoiners[0].handler(M)}catch(D){console.error(D)}for(let D=1;D{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const d=c(844),m=c(8460),f=c(3656);class g extends d.Disposable{constructor(S,x,v){super(),this._textarea=S,this._window=x,this.mainDocument=v,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((w=>this._screenDprMonitor.setWindow(w)))),this.register((0,m.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(S){this._window!==S&&(this._window=S,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}}l.CoreBrowserService=g;class b extends d.Disposable{constructor(S){super(),this._parentWindow=S,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(S){this._parentWindow=S,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var S;this._outerListener&&((S=this._resolutionMediaMatchList)==null||S.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:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const d=c(844);class m extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const b=this.linkProviders.indexOf(g);b!==-1&&this.linkProviders.splice(b,1)}}}}l.LinkProviderService=m},8934:function(o,l,c){var d=this&&this.__decorate||function(k,S,x,v){var w,y=arguments.length,C=y<3?S:v===null?v=Object.getOwnPropertyDescriptor(S,x):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(k,S,x,v);else for(var N=k.length-1;N>=0;N--)(w=k[N])&&(C=(y<3?w(C):y>3?w(S,x,C):w(S,x))||C);return y>3&&C&&Object.defineProperty(S,x,C),C},m=this&&this.__param||function(k,S){return function(x,v){S(x,v,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const f=c(4725),g=c(9806);let b=l.MouseService=class{constructor(k,S){this._renderService=k,this._charSizeService=S}getCoords(k,S,x,v,w){return(0,g.getCoords)(window,k,S,x,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,w)}getMouseReportCoords(k,S){const x=(0,g.getCoordsRelativeToElement)(window,k,S);if(this._charSizeService.hasValidSize)return x[0]=Math.min(Math.max(x[0],0),this._renderService.dimensions.css.canvas.width-1),x[1]=Math.min(Math.max(x[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(x[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(x[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(x[0]),y:Math.floor(x[1])}}};l.MouseService=b=d([m(0,f.IRenderService),m(1,f.ICharSizeService)],b)},3230:function(o,l,c){var d=this&&this.__decorate||function(w,y,C,N){var E,M=arguments.length,T=M<3?y:N===null?N=Object.getOwnPropertyDescriptor(y,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,C,N);else for(var D=w.length-1;D>=0;D--)(E=w[D])&&(T=(M<3?E(T):M>3?E(y,C,T):E(y,C))||T);return M>3&&T&&Object.defineProperty(y,C,T),T},m=this&&this.__param||function(w,y){return function(C,N){y(C,N,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const f=c(6193),g=c(4725),b=c(8460),k=c(844),S=c(7226),x=c(2585);let v=l.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(w,y,C,N,E,M,T,D){super(),this._rowCount=w,this._charSizeService=N,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new S.DebouncedIdleTask,this._observerDisposable=this.register(new k.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 b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((z,$)=>this._renderRows(z,$)),T),this.register(this._renderDebouncer),this.register(T.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>{var z;return(z=this._renderer.value)==null?void 0:z.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(E.onDecorationRegistered((()=>this._fullRefresh()))),this.register(E.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(D.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(T.window,y),this.register(T.onWindowChange((z=>this._registerIntersectionObserver(z,y))))}_registerIntersectionObserver(w,y){if("IntersectionObserver"in w){const C=new w.IntersectionObserver((N=>this._handleIntersectionChange(N[N.length-1])),{threshold:0});C.observe(y),this._observerDisposable.value=(0,k.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(w){this._isPaused=w.isIntersecting===void 0?w.intersectionRatio===0:!w.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(w,y,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(w,y,this._rowCount))}_renderRows(w,y){this._renderer.value&&(w=Math.min(w,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(w,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:w,end:y}),this._onRender.fire({start:w,end:y}),this._isNextRenderRedrawOnly=!0)}resize(w,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(w){this._renderer.value=w,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(w){return this._renderDebouncer.addRefreshCallback(w)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var w,y;this._renderer.value&&((y=(w=this._renderer.value).clearTextureAtlas)==null||y.call(w),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(w,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(w,y)})):this._renderer.value.handleResize(w,y),this._fullRefresh())}handleCharSizeChanged(){var w;(w=this._renderer.value)==null||w.handleCharSizeChanged()}handleBlur(){var w;(w=this._renderer.value)==null||w.handleBlur()}handleFocus(){var w;(w=this._renderer.value)==null||w.handleFocus()}handleSelectionChanged(w,y,C){var N;this._selectionState.start=w,this._selectionState.end=y,this._selectionState.columnSelectMode=C,(N=this._renderer.value)==null||N.handleSelectionChanged(w,y,C)}handleCursorMove(){var w;(w=this._renderer.value)==null||w.handleCursorMove()}clear(){var w;(w=this._renderer.value)==null||w.clear()}};l.RenderService=v=d([m(2,x.IOptionsService),m(3,g.ICharSizeService),m(4,x.IDecorationService),m(5,x.IBufferService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],v)},9312:function(o,l,c){var d=this&&this.__decorate||function(T,D,z,$){var F,U=arguments.length,V=U<3?D:$===null?$=Object.getOwnPropertyDescriptor(D,z):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(T,D,z,$);else for(var X=T.length-1;X>=0;X--)(F=T[X])&&(V=(U<3?F(V):U>3?F(D,z,V):F(D,z))||V);return U>3&&V&&Object.defineProperty(D,z,V),V},m=this&&this.__param||function(T,D){return function(z,$){D(z,$,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const f=c(9806),g=c(9504),b=c(456),k=c(4725),S=c(8460),x=c(844),v=c(6114),w=c(4841),y=c(511),C=c(2585),N=" ",E=new RegExp(N,"g");let M=l.SelectionService=class extends x.Disposable{constructor(T,D,z,$,F,U,V,X,Y){super(),this._element=T,this._screenElement=D,this._linkifier=z,this._bufferService=$,this._coreService=F,this._mouseService=U,this._optionsService=V,this._renderService=X,this._coreBrowserService=Y,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 S.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new S.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new S.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Q=>this._handleMouseMove(Q),this._mouseUpListener=Q=>this._handleMouseUp(Q),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Q=>this._handleTrim(Q))),this.register(this._bufferService.buffers.onBufferActivate((Q=>this._handleBufferActivate(Q)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,x.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,D=this._model.finalSelectionEnd;return!(!T||!D||T[0]===D[0]&&T[1]===D[1])}get selectionText(){const T=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;if(!T||!D)return"";const z=this._bufferService.buffer,$=[];if(this._activeSelectionMode===3){if(T[0]===D[0])return"";const F=T[0]F.replace(E," "))).join(v.isWindows?`\r `:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(N){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),_.isLinux&&N&&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(N){const D=this._getMouseBufferCoords(N),z=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!!(z&&$&&D)&&this._areCoordsInSelection(D,z,$)}isCellInSelection(N,D){const z=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!(!z||!$)&&this._areCoordsInSelection([N,D],z,$)}_areCoordsInSelection(N,D,z){return N[1]>D[1]&&N[1]=D[0]&&N[0]=D[0]}_selectWordAtCursor(N,D){var F,U;const z=(U=(F=this._linkifier.currentLink)==null?void 0:F.link)==null?void 0:U.range;if(z)return this._model.selectionStart=[z.start.x-1,z.start.y-1],this._model.selectionStartLength=(0,w.getRangeLength)(z,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const $=this._getMouseBufferCoords(N);return!!$&&(this._selectWordAt($,D),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(N,D){this._model.clearSelection(),N=Math.max(N,0),D=Math.min(D,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,N],this._model.selectionEnd=[this._bufferService.cols,D],this.refresh(),this._onSelectionChange.fire()}_handleTrim(N){this._model.handleTrim(N)&&this.refresh()}_getMouseBufferCoords(N){const D=this._mouseService.getCoords(N,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(D)return D[0]--,D[1]--,D[1]+=this._bufferService.buffer.ydisp,D}_getMouseEventScrollAmount(N){let D=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,N,this._screenElement)[1];const z=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=z?0:(D>z&&(D-=z),D=Math.min(Math.max(D,-50),50),D/=50,D/Math.abs(D)+Math.round(14*D))}shouldForceSelection(N){return _.isMac?N.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:N.shiftKey}handleMouseDown(N){if(this._mouseDownTimeStamp=N.timeStamp,(N.button!==2||!this.hasSelection)&&N.button===0){if(!this._enabled){if(!this.shouldForceSelection(N))return;N.stopPropagation()}N.preventDefault(),this._dragScrollAmount=0,this._enabled&&N.shiftKey?this._handleIncrementalClick(N):N.detail===1?this._handleSingleClick(N):N.detail===2?this._handleDoubleClick(N):N.detail===3&&this._handleTripleClick(N),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(N){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(N))}_handleSingleClick(N){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(N)?3:0,this._model.selectionStart=this._getMouseBufferCoords(N),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const D=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);D&&D.length!==this._model.selectionStart[0]&&D.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(N){this._selectWordAtCursor(N,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(N){const D=this._getMouseBufferCoords(N);D&&(this._activeSelectionMode=2,this._selectLineAt(D[1]))}shouldColumnSelect(N){return N.altKey&&!(_.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(N){if(N.stopImmediatePropagation(),!this._model.selectionStart)return;const D=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(N),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const z=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(N.ydisp+this._bufferService.rows,N.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=N.ydisp),this.refresh()}}_handleMouseUp(N){const D=N.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&D<500&&N.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const z=this._mouseService.getCoords(N,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(z&&z[0]!==void 0&&z[1]!==void 0){const $=(0,g.moveToCellSequence)(z[0]-1,z[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent($,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const N=this._model.finalSelectionStart,D=this._model.finalSelectionEnd,z=!(!N||!D||N[0]===D[0]&&N[1]===D[1]);z?N&&D&&(this._oldSelectionStart&&this._oldSelectionEnd&&N[0]===this._oldSelectionStart[0]&&N[1]===this._oldSelectionStart[1]&&D[0]===this._oldSelectionEnd[0]&&D[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(N,D,z)):this._oldHasSelection&&this._fireOnSelectionChange(N,D,z)}_fireOnSelectionChange(N,D,z){this._oldSelectionStart=N,this._oldSelectionEnd=D,this._oldHasSelection=z,this._onSelectionChange.fire()}_handleBufferActivate(N){this.clearSelection(),this._trimListener.dispose(),this._trimListener=N.activeBuffer.lines.onTrim((D=>this._handleTrim(D)))}_convertViewportColToCharacterIndex(N,D){let z=D;for(let $=0;D>=$;$++){const F=N.loadCell($,this._workCell).getChars().length;this._workCell.getWidth()===0?z--:F>1&&D!==$&&(z+=F-1)}return z}setSelection(N,D,z){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[N,D],this._model.selectionStartLength=z,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(N){this._isClickInSelection(N)||(this._selectWordAtCursor(N,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(N,D,z=!0,$=!0){if(N[0]>=this._bufferService.cols)return;const F=this._bufferService.buffer,U=F.lines.get(N[1]);if(!U)return;const V=F.translateBufferLineToString(N[1],!1);let X=this._convertViewportColToCharacterIndex(U,N[0]),Y=X;const Q=N[0]-X;let te=0,I=0,O=0,H=0;if(V.charAt(X)===" "){for(;X>0&&V.charAt(X-1)===" ";)X--;for(;Y1&&(H+=pe-1,Y+=pe-1);re>0&&X>0&&!this._isCharWordSeparator(U.loadCell(re-1,this._workCell));){U.loadCell(re-1,this._workCell);const ne=this._workCell.getChars().length;this._workCell.getWidth()===0?(te++,re--):ne>1&&(O+=ne-1,X-=ne-1),X--,re--}for(;ce1&&(H+=ne-1,Y+=ne-1),Y++,ce++}}Y++;let G=X+Q-te+O,W=Math.min(this._bufferService.cols,Y-X+te+I-O-H);if(D||V.slice(X,Y).trim()!==""){if(z&&G===0&&U.getCodePoint(0)!==32){const re=F.lines.get(N[1]-1);if(re&&U.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,N[1]-1],!1,!0,!1);if(ce){const pe=this._bufferService.cols-ce.start;G-=pe,W+=pe}}}if($&&G+W===this._bufferService.cols&&U.getCodePoint(this._bufferService.cols-1)!==32){const re=F.lines.get(N[1]+1);if(re!=null&&re.isWrapped&&re.getCodePoint(0)!==32){const ce=this._getWordAt([0,N[1]+1],!1,!1,!0);ce&&(W+=ce.length)}}return{start:G,length:W}}}_selectWordAt(N,D){const z=this._getWordAt(N,D);if(z){for(;z.start<0;)z.start+=this._bufferService.cols,N[1]--;this._model.selectionStart=[z.start,N[1]],this._model.selectionStartLength=z.length}}_selectToWordAt(N){const D=this._getWordAt(N,!0);if(D){let z=N[1];for(;D.start<0;)D.start+=this._bufferService.cols,z--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,z++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,z]}}_isCharWordSeparator(N){return N.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(N.getChars())>=0}_selectLineAt(N){const D=this._bufferService.buffer.getWrappedRangeForLine(N),z={start:{x:0,y:D.first},end:{x:this._bufferService.cols-1,y:D.last}};this._model.selectionStart=[0,D.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,w.getRangeLength)(z,this._bufferService.cols)}};l.SelectionService=j=d([m(3,C.IBufferService),m(4,C.ICoreService),m(5,k.IMouseService),m(6,C.IOptionsService),m(7,k.IRenderService),m(8,k.ICoreBrowserService)],j)},4725:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const d=u(8343);l.ICharSizeService=(0,d.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),l.IMouseService=(0,d.createDecorator)("MouseService"),l.IRenderService=(0,d.createDecorator)("RenderService"),l.ISelectionService=(0,d.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,d.createDecorator)("ThemeService"),l.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(o,l,u){var d=this&&this.__decorate||function(j,N,D,z){var $,F=arguments.length,U=F<3?N:z===null?z=Object.getOwnPropertyDescriptor(N,D):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(j,N,D,z);else for(var V=j.length-1;V>=0;V--)($=j[V])&&(U=(F<3?$(U):F>3?$(N,D,U):$(N,D))||U);return F>3&&U&&Object.defineProperty(N,D,U),U},m=this&&this.__param||function(j,N){return function(D,z){N(D,z,j)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const f=u(7239),g=u(8055),b=u(8460),k=u(844),S=u(2585),x=g.css.toColor("#ffffff"),_=g.css.toColor("#000000"),w=g.css.toColor("#ffffff"),y=g.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const j=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],N=[0,95,135,175,215,255];for(let D=0;D<216;D++){const z=N[D/36%6|0],$=N[D/6%6|0],F=N[D%6];j.push({css:g.channels.toCss(z,$,F),rgba:g.channels.toRgba(z,$,F)})}for(let D=0;D<24;D++){const z=8+10*D;j.push({css:g.channels.toCss(z,z,z),rgba:g.channels.toRgba(z,z,z)})}return j})());let T=l.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(j){super(),this._optionsService=j,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:x,background:_,cursor:w,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:g.color.blend(_,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:g.color.blend(_,C),ansi:l.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(j={}){const N=this._colors;if(N.foreground=E(j.foreground,x),N.background=E(j.background,_),N.cursor=E(j.cursor,w),N.cursorAccent=E(j.cursorAccent,y),N.selectionBackgroundTransparent=E(j.selectionBackground,C),N.selectionBackgroundOpaque=g.color.blend(N.background,N.selectionBackgroundTransparent),N.selectionInactiveBackgroundTransparent=E(j.selectionInactiveBackground,N.selectionBackgroundTransparent),N.selectionInactiveBackgroundOpaque=g.color.blend(N.background,N.selectionInactiveBackgroundTransparent),N.selectionForeground=j.selectionForeground?E(j.selectionForeground,g.NULL_COLOR):void 0,N.selectionForeground===g.NULL_COLOR&&(N.selectionForeground=void 0),g.color.isOpaque(N.selectionBackgroundTransparent)&&(N.selectionBackgroundTransparent=g.color.opacity(N.selectionBackgroundTransparent,.3)),g.color.isOpaque(N.selectionInactiveBackgroundTransparent)&&(N.selectionInactiveBackgroundTransparent=g.color.opacity(N.selectionInactiveBackgroundTransparent,.3)),N.ansi=l.DEFAULT_ANSI_COLORS.slice(),N.ansi[0]=E(j.black,l.DEFAULT_ANSI_COLORS[0]),N.ansi[1]=E(j.red,l.DEFAULT_ANSI_COLORS[1]),N.ansi[2]=E(j.green,l.DEFAULT_ANSI_COLORS[2]),N.ansi[3]=E(j.yellow,l.DEFAULT_ANSI_COLORS[3]),N.ansi[4]=E(j.blue,l.DEFAULT_ANSI_COLORS[4]),N.ansi[5]=E(j.magenta,l.DEFAULT_ANSI_COLORS[5]),N.ansi[6]=E(j.cyan,l.DEFAULT_ANSI_COLORS[6]),N.ansi[7]=E(j.white,l.DEFAULT_ANSI_COLORS[7]),N.ansi[8]=E(j.brightBlack,l.DEFAULT_ANSI_COLORS[8]),N.ansi[9]=E(j.brightRed,l.DEFAULT_ANSI_COLORS[9]),N.ansi[10]=E(j.brightGreen,l.DEFAULT_ANSI_COLORS[10]),N.ansi[11]=E(j.brightYellow,l.DEFAULT_ANSI_COLORS[11]),N.ansi[12]=E(j.brightBlue,l.DEFAULT_ANSI_COLORS[12]),N.ansi[13]=E(j.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),N.ansi[14]=E(j.brightCyan,l.DEFAULT_ANSI_COLORS[14]),N.ansi[15]=E(j.brightWhite,l.DEFAULT_ANSI_COLORS[15]),j.extendedAnsi){const D=Math.min(N.ansi.length-16,j.extendedAnsi.length);for(let z=0;z{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const d=u(8460),m=u(844);class f extends m.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.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(b){if(this._maxLength===b)return;const k=new Array(b);for(let S=0;Sthis._length)for(let k=this._length;k=b;x--)this._array[this._getCyclicIndex(x+S.length)]=this._array[this._getCyclicIndex(x)];for(let x=0;xthis._maxLength){const x=this._length+S.length-this._maxLength;this._startIndex+=x,this._length=this._maxLength,this.onTrimEmitter.fire(x)}else this._length+=S.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,k,S){if(!(k<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let _=k-1;_>=0;_--)this.set(b+_+S,this.get(b+_));const x=b+k+S-this._length;if(x>0)for(this._length+=x;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let x=0;x{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function u(d,m=5){if(typeof d!="object")return d;const f=Array.isArray(d)?[]:{};for(const g in d)f[g]=m<=1?d[g]:d[g]&&u(d[g],m-1);return f}},8055:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let u=0,d=0,m=0,f=0;var g,b,k,S,x;function _(y){const C=y.toString(16);return C.length<2?"0"+C:C}function w(y,C){return y>>0},y.toColor=function(C,T,E,j){return{css:y.toCss(C,T,E,j),rgba:y.toRgba(C,T,E,j)}}})(g||(l.channels=g={})),(function(y){function C(T,E){return f=Math.round(255*E),[u,d,m]=x.toChannels(T.rgba),{css:g.toCss(u,d,m,f),rgba:g.toRgba(u,d,m,f)}}y.blend=function(T,E){if(f=(255&E.rgba)/255,f===1)return{css:E.css,rgba:E.rgba};const j=E.rgba>>24&255,N=E.rgba>>16&255,D=E.rgba>>8&255,z=T.rgba>>24&255,$=T.rgba>>16&255,F=T.rgba>>8&255;return u=z+Math.round((j-z)*f),d=$+Math.round((N-$)*f),m=F+Math.round((D-F)*f),{css:g.toCss(u,d,m),rgba:g.toRgba(u,d,m)}},y.isOpaque=function(T){return(255&T.rgba)==255},y.ensureContrastRatio=function(T,E,j){const N=x.ensureContrastRatio(T.rgba,E.rgba,j);if(N)return g.toColor(N>>24&255,N>>16&255,N>>8&255)},y.opaque=function(T){const E=(255|T.rgba)>>>0;return[u,d,m]=x.toChannels(E),{css:g.toCss(u,d,m),rgba:E}},y.opacity=C,y.multiplyOpacity=function(T,E){return f=255&T.rgba,C(T,f*E/255)},y.toColorRGB=function(T){return[T.rgba>>24&255,T.rgba>>16&255,T.rgba>>8&255]}})(b||(l.color=b={})),(function(y){let C,T;try{const E=document.createElement("canvas");E.width=1,E.height=1;const j=E.getContext("2d",{willReadFrequently:!0});j&&(C=j,C.globalCompositeOperation="copy",T=C.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(E){if(E.match(/#[\da-f]{3,8}/i))switch(E.length){case 4:return u=parseInt(E.slice(1,2).repeat(2),16),d=parseInt(E.slice(2,3).repeat(2),16),m=parseInt(E.slice(3,4).repeat(2),16),g.toColor(u,d,m);case 5:return u=parseInt(E.slice(1,2).repeat(2),16),d=parseInt(E.slice(2,3).repeat(2),16),m=parseInt(E.slice(3,4).repeat(2),16),f=parseInt(E.slice(4,5).repeat(2),16),g.toColor(u,d,m,f);case 7:return{css:E,rgba:(parseInt(E.slice(1),16)<<8|255)>>>0};case 9:return{css:E,rgba:parseInt(E.slice(1),16)>>>0}}const j=E.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(j)return u=parseInt(j[1]),d=parseInt(j[2]),m=parseInt(j[3]),f=Math.round(255*(j[5]===void 0?1:parseFloat(j[5]))),g.toColor(u,d,m,f);if(!C||!T)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=T,C.fillStyle=E,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[u,d,m,f]=C.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(u,d,m,f),css:E}}})(k||(l.css=k={})),(function(y){function C(T,E,j){const N=T/255,D=E/255,z=j/255;return .2126*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.7152*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.0722*(z<=.03928?z/12.92:Math.pow((z+.055)/1.055,2.4))}y.relativeLuminance=function(T){return C(T>>16&255,T>>8&255,255&T)},y.relativeLuminance2=C})(S||(l.rgb=S={})),(function(y){function C(E,j,N){const D=E>>24&255,z=E>>16&255,$=E>>8&255;let F=j>>24&255,U=j>>16&255,V=j>>8&255,X=w(S.relativeLuminance2(F,U,V),S.relativeLuminance2(D,z,$));for(;X0||U>0||V>0);)F-=Math.max(0,Math.ceil(.1*F)),U-=Math.max(0,Math.ceil(.1*U)),V-=Math.max(0,Math.ceil(.1*V)),X=w(S.relativeLuminance2(F,U,V),S.relativeLuminance2(D,z,$));return(F<<24|U<<16|V<<8|255)>>>0}function T(E,j,N){const D=E>>24&255,z=E>>16&255,$=E>>8&255;let F=j>>24&255,U=j>>16&255,V=j>>8&255,X=w(S.relativeLuminance2(F,U,V),S.relativeLuminance2(D,z,$));for(;X>>0}y.blend=function(E,j){if(f=(255&j)/255,f===1)return j;const N=j>>24&255,D=j>>16&255,z=j>>8&255,$=E>>24&255,F=E>>16&255,U=E>>8&255;return u=$+Math.round((N-$)*f),d=F+Math.round((D-F)*f),m=U+Math.round((z-U)*f),g.toRgba(u,d,m)},y.ensureContrastRatio=function(E,j,N){const D=S.relativeLuminance(E>>8),z=S.relativeLuminance(j>>8);if(w(D,z)>8));if(Vw(D,S.relativeLuminance(X>>8))?U:X}return U}const $=T(E,j,N),F=w(D,S.relativeLuminance($>>8));if(Fw(D,S.relativeLuminance(U>>8))?$:U}return $}},y.reduceLuminance=C,y.increaseLuminance=T,y.toChannels=function(E){return[E>>24&255,E>>16&255,E>>8&255,255&E]}})(x||(l.rgba=x={})),l.toPaddedHex=_,l.contrastRatio=w},8969:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const d=u(844),m=u(2585),f=u(4348),g=u(7866),b=u(744),k=u(7302),S=u(6975),x=u(8460),_=u(1753),w=u(1480),y=u(7994),C=u(9282),T=u(5435),E=u(5981),j=u(2660);let N=!1;class D extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new x.EventEmitter),this._onScroll.event(($=>{var F;(F=this._onScrollApi)==null||F.fire($.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($){for(const F in $)this.optionsService.options[F]=$[F]}constructor($){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new x.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new x.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new x.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new x.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new x.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new x.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new k.OptionsService($)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(_.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(w.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(j.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new T.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,x.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,x.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,x.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,x.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((F=>{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((F=>{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 E.WriteBuffer(((F,U)=>this._inputHandler.parse(F,U)))),this.register((0,x.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write($,F){this._writeBuffer.write($,F)}writeSync($,F){this._logService.logLevel<=m.LogLevelEnum.WARN&&!N&&(this._logService.warn("writeSync is unreliable and will be removed soon."),N=!0),this._writeBuffer.writeSync($,F)}input($,F=!0){this.coreService.triggerDataEvent($,F)}resize($,F){isNaN($)||isNaN(F)||($=Math.max($,b.MINIMUM_COLS),F=Math.max(F,b.MINIMUM_ROWS),this._bufferService.resize($,F))}scroll($,F=!1){this._bufferService.scroll($,F)}scrollLines($,F,U){this._bufferService.scrollLines($,F,U)}scrollPages($){this.scrollLines($*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine($){const F=$-this._bufferService.buffer.ydisp;F!==0&&this.scrollLines(F)}registerEscHandler($,F){return this._inputHandler.registerEscHandler($,F)}registerDcsHandler($,F){return this._inputHandler.registerDcsHandler($,F)}registerCsiHandler($,F){return this._inputHandler.registerCsiHandler($,F)}registerOscHandler($,F){return this._inputHandler.registerOscHandler($,F)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let $=!1;const F=this.optionsService.rawOptions.windowsPty;F&&F.buildNumber!==void 0&&F.buildNumber!==void 0?$=F.backend==="conpty"&&F.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&($=!0),$?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const $=[];$.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),$.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const F of $)F.dispose()}))}}}l.CoreTerminal=D},8460:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;dd.fire(m)))},l.runAndSubscribe=function(u,d){return d(void 0),u((m=>d(m)))}},5435:function(o,l,u){var d=this&&this.__decorate||function(te,I,O,H){var G,W=arguments.length,re=W<3?I:H===null?H=Object.getOwnPropertyDescriptor(I,O):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(te,I,O,H);else for(var ce=te.length-1;ce>=0;ce--)(G=te[ce])&&(re=(W<3?G(re):W>3?G(I,O,re):G(I,O))||re);return W>3&&re&&Object.defineProperty(I,O,re),re},m=this&&this.__param||function(te,I){return function(O,H){I(O,H,te)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const f=u(2584),g=u(7116),b=u(2015),k=u(844),S=u(482),x=u(8437),_=u(8460),w=u(643),y=u(511),C=u(3734),T=u(2585),E=u(1480),j=u(6242),N=u(6351),D=u(5941),z={"(":0,")":1,"*":2,"+":3,"-":1,".":2},$=131072;function F(te,I){if(te>24)return I.setWinLines||!1;switch(te){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var U;(function(te){te[te.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",te[te.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(U||(l.WindowsOptionsReportType=U={}));let V=0;class X extends k.Disposable{getAttrData(){return this._curAttrData}constructor(I,O,H,G,W,re,ce,pe,ne=new b.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=O,this._coreService=H,this._logService=G,this._optionsService=W,this._oscLinkService=re,this._coreMouseService=ce,this._unicodeService=pe,this._parser=ne,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=x.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=x.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new _.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new _.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new _.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new _.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new _.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new _.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new _.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new _.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new _.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new _.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new _.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new _.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 Y(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._parser.setCsiHandlerFallback(((B,se)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(B),params:se.toArray()})})),this._parser.setEscHandlerFallback((B=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(B)})})),this._parser.setExecuteHandlerFallback((B=>{this._logService.debug("Unknown EXECUTE code: ",{code:B})})),this._parser.setOscHandlerFallback(((B,se,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:B,action:se,data:oe})})),this._parser.setDcsHandlerFallback(((B,se,oe)=>{se==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(B),action:se,payload:oe})})),this._parser.setPrintHandler(((B,se,oe)=>this.print(B,se,oe))),this._parser.registerCsiHandler({final:"@"},(B=>this.insertChars(B))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(B=>this.scrollLeft(B))),this._parser.registerCsiHandler({final:"A"},(B=>this.cursorUp(B))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(B=>this.scrollRight(B))),this._parser.registerCsiHandler({final:"B"},(B=>this.cursorDown(B))),this._parser.registerCsiHandler({final:"C"},(B=>this.cursorForward(B))),this._parser.registerCsiHandler({final:"D"},(B=>this.cursorBackward(B))),this._parser.registerCsiHandler({final:"E"},(B=>this.cursorNextLine(B))),this._parser.registerCsiHandler({final:"F"},(B=>this.cursorPrecedingLine(B))),this._parser.registerCsiHandler({final:"G"},(B=>this.cursorCharAbsolute(B))),this._parser.registerCsiHandler({final:"H"},(B=>this.cursorPosition(B))),this._parser.registerCsiHandler({final:"I"},(B=>this.cursorForwardTab(B))),this._parser.registerCsiHandler({final:"J"},(B=>this.eraseInDisplay(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(B=>this.eraseInDisplay(B,!0))),this._parser.registerCsiHandler({final:"K"},(B=>this.eraseInLine(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(B=>this.eraseInLine(B,!0))),this._parser.registerCsiHandler({final:"L"},(B=>this.insertLines(B))),this._parser.registerCsiHandler({final:"M"},(B=>this.deleteLines(B))),this._parser.registerCsiHandler({final:"P"},(B=>this.deleteChars(B))),this._parser.registerCsiHandler({final:"S"},(B=>this.scrollUp(B))),this._parser.registerCsiHandler({final:"T"},(B=>this.scrollDown(B))),this._parser.registerCsiHandler({final:"X"},(B=>this.eraseChars(B))),this._parser.registerCsiHandler({final:"Z"},(B=>this.cursorBackwardTab(B))),this._parser.registerCsiHandler({final:"`"},(B=>this.charPosAbsolute(B))),this._parser.registerCsiHandler({final:"a"},(B=>this.hPositionRelative(B))),this._parser.registerCsiHandler({final:"b"},(B=>this.repeatPrecedingCharacter(B))),this._parser.registerCsiHandler({final:"c"},(B=>this.sendDeviceAttributesPrimary(B))),this._parser.registerCsiHandler({prefix:">",final:"c"},(B=>this.sendDeviceAttributesSecondary(B))),this._parser.registerCsiHandler({final:"d"},(B=>this.linePosAbsolute(B))),this._parser.registerCsiHandler({final:"e"},(B=>this.vPositionRelative(B))),this._parser.registerCsiHandler({final:"f"},(B=>this.hVPosition(B))),this._parser.registerCsiHandler({final:"g"},(B=>this.tabClear(B))),this._parser.registerCsiHandler({final:"h"},(B=>this.setMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(B=>this.setModePrivate(B))),this._parser.registerCsiHandler({final:"l"},(B=>this.resetMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(B=>this.resetModePrivate(B))),this._parser.registerCsiHandler({final:"m"},(B=>this.charAttributes(B))),this._parser.registerCsiHandler({final:"n"},(B=>this.deviceStatus(B))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(B=>this.deviceStatusPrivate(B))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(B=>this.softReset(B))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(B=>this.setCursorStyle(B))),this._parser.registerCsiHandler({final:"r"},(B=>this.setScrollRegion(B))),this._parser.registerCsiHandler({final:"s"},(B=>this.saveCursor(B))),this._parser.registerCsiHandler({final:"t"},(B=>this.windowOptions(B))),this._parser.registerCsiHandler({final:"u"},(B=>this.restoreCursor(B))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(B=>this.insertColumns(B))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(B=>this.deleteColumns(B))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(B=>this.selectProtected(B))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(B=>this.requestMode(B,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(B=>this.requestMode(B,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new j.OscHandler((B=>(this.setTitle(B),this.setIconName(B),!0)))),this._parser.registerOscHandler(1,new j.OscHandler((B=>this.setIconName(B)))),this._parser.registerOscHandler(2,new j.OscHandler((B=>this.setTitle(B)))),this._parser.registerOscHandler(4,new j.OscHandler((B=>this.setOrReportIndexedColor(B)))),this._parser.registerOscHandler(8,new j.OscHandler((B=>this.setHyperlink(B)))),this._parser.registerOscHandler(10,new j.OscHandler((B=>this.setOrReportFgColor(B)))),this._parser.registerOscHandler(11,new j.OscHandler((B=>this.setOrReportBgColor(B)))),this._parser.registerOscHandler(12,new j.OscHandler((B=>this.setOrReportCursorColor(B)))),this._parser.registerOscHandler(104,new j.OscHandler((B=>this.restoreIndexedColor(B)))),this._parser.registerOscHandler(110,new j.OscHandler((B=>this.restoreFgColor(B)))),this._parser.registerOscHandler(111,new j.OscHandler((B=>this.restoreBgColor(B)))),this._parser.registerOscHandler(112,new j.OscHandler((B=>this.restoreCursorColor(B)))),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 B in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:B},(()=>this.selectCharset("("+B))),this._parser.registerEscHandler({intermediates:")",final:B},(()=>this.selectCharset(")"+B))),this._parser.registerEscHandler({intermediates:"*",final:B},(()=>this.selectCharset("*"+B))),this._parser.registerEscHandler({intermediates:"+",final:B},(()=>this.selectCharset("+"+B))),this._parser.registerEscHandler({intermediates:"-",final:B},(()=>this.selectCharset("-"+B))),this._parser.registerEscHandler({intermediates:".",final:B},(()=>this.selectCharset("."+B))),this._parser.registerEscHandler({intermediates:"/",final:B},(()=>this.selectCharset("/"+B)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((B=>(this._logService.error("Parsing error: ",B),B))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new N.DcsHandler(((B,se)=>this.requestStatusString(B,se))))}_preserveStack(I,O,H,G){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=O,this._parseStack.decodedLength=H,this._parseStack.position=G}_logSlowResolvingAsync(I){this._logService.logLevel<=T.LogLevelEnum.WARN&&Promise.race([I,new Promise(((O,H)=>setTimeout((()=>H("#SLOW_TIMEOUT")),5e3)))]).catch((O=>{if(O!=="#SLOW_TIMEOUT")throw O;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,O){let H,G=this._activeBuffer.x,W=this._activeBuffer.y,re=0;const ce=this._parseStack.paused;if(ce){if(H=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,O))return this._logSlowResolvingAsync(H),H;G=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>$&&(re=this._parseStack.position+$)}if(this._logService.logLevel<=T.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(B=>String.fromCharCode(B))).join("")}"`),typeof I=="string"?I.split("").map((B=>B.charCodeAt(0))):I),this._parseBuffer.length$)for(let B=re;B0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,se);let _e=this._parser.precedingJoinState;for(let be=O;bepe){if(ne){const Ve=oe;let Pe=this._activeBuffer.x-Fe;for(this._activeBuffer.x=Fe,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),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Fe>0&&oe instanceof x.BufferLine&&oe.copyCellsFrom(Ve,Pe,0,Fe,!1);Pe=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}else if(B&&(oe.insertCells(this._activeBuffer.x,W-Fe,this._activeBuffer.getNullCell(se)),oe.getWidth(pe-1)===2&&oe.setCellFromCodepoint(pe-1,w.NULL_CELL_CODE,w.NULL_CELL_WIDTH,se)),oe.setCellFromCodepoint(this._activeBuffer.x++,G,W,se),W>0)for(;--W;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}this._parser.precedingJoinState=_e,this._activeBuffer.x0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,se),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,O){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,O):this._parser.registerCsiHandler(I,(H=>!F(H.params[0],this._optionsService.rawOptions.windowOptions)||O(H)))}registerDcsHandler(I,O){return this._parser.registerDcsHandler(I,new N.DcsHandler(O))}registerEscHandler(I,O){return this._parser.registerEscHandler(I,O)}registerOscHandler(I,O){return this._parser.registerOscHandler(I,new j.OscHandler(O))}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 I;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&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);O.hasWidth(this._activeBuffer.x)&&!O.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,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(I,O){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+O):(this._activeBuffer.x=I,this._activeBuffer.y=O),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,O){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+O)}cursorUp(I){const O=this._activeBuffer.y-this._activeBuffer.scrollTop;return O>=0?this._moveCursor(0,-Math.min(O,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const O=this._activeBuffer.scrollBottom-this._activeBuffer.y;return O>=0?this._moveCursor(0,Math.min(O,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const O=I.params[0];return O===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:O===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=I.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=I.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const O=I.params[0];return O===1&&(this._curAttrData.bg|=536870912),O!==2&&O!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,O,H,G=!1,W=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);re.replaceCells(O,H,this._activeBuffer.getNullCell(this._eraseAttrData()),W),G&&(re.isWrapped=!1)}_resetBufferLine(I,O=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);H&&(H.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),O),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),H.isWrapped=!1)}eraseInDisplay(I,O=!1){let H;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(H=this._activeBuffer.y,this._dirtyRowTracker.markDirty(H),this._eraseInBufferLine(H++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);H=this._bufferService.cols&&(this._activeBuffer.lines.get(H+1).isWrapped=!1);H--;)this._resetBufferLine(H,O);this._dirtyRowTracker.markDirty(0);break;case 2:for(H=this._bufferService.rows,this._dirtyRowTracker.markDirty(H-1);H--;)this._resetBufferLine(H,O);this._dirtyRowTracker.markDirty(0);break;case 3:const G=this._activeBuffer.lines.length-this._bufferService.rows;G>0&&(this._activeBuffer.lines.trimStart(G),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-G,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-G,0),this._onScroll.fire(0))}return!0}eraseInLine(I,O=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,O);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,O)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let O=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let ne=pe;for(let B=1;B0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let O=0;OLe?1:2,_e=I.params[0];return be=_e,Ce=O?_e===2?4:_e===4?oe(re.modes.insertMode):_e===12?3:_e===20?oe(se.convertEol):0:_e===1?oe(H.applicationCursorKeys):_e===3?se.windowOptions.setWinLines?pe===80?2:pe===132?1:0:0:_e===6?oe(H.origin):_e===7?oe(H.wraparound):_e===8?3:_e===9?oe(G==="X10"):_e===12?oe(se.cursorBlink):_e===25?oe(!re.isCursorHidden):_e===45?oe(H.reverseWraparound):_e===66?oe(H.applicationKeypad):_e===67?4:_e===1e3?oe(G==="VT200"):_e===1002?oe(G==="DRAG"):_e===1003?oe(G==="ANY"):_e===1004?oe(H.sendFocus):_e===1005?4:_e===1006?oe(W==="SGR"):_e===1015?4:_e===1016?oe(W==="SGR_PIXELS"):_e===1048?1:_e===47||_e===1047||_e===1049?oe(ne===B):_e===2004?oe(H.bracketedPasteMode):0,re.triggerDataEvent(`${f.C0.ESC}[${O?"":"?"}${be};${Ce}$y`),!0;var be,Ce}_updateAttrColor(I,O,H,G,W){return O===2?(I|=50331648,I&=-16777216,I|=C.AttributeData.fromColorRGB([H,G,W])):O===5&&(I&=-50331904,I|=33554432|255&H),I}_extractColor(I,O,H){const G=[0,0,-1,0,0,0];let W=0,re=0;do{if(G[re+W]=I.params[O+re],I.hasSubParams(O+re)){const ce=I.getSubParams(O+re);let pe=0;do G[1]===5&&(W=1),G[re+pe+1+W]=ce[pe];while(++pe=2||G[1]===2&&re+W>=5)break;G[1]&&(W=1)}while(++re+O5)&&(I=1),O.extended.underlineStyle=I,O.fg|=268435456,I===0&&(O.fg&=-268435457),O.updateExtended()}_processSGR0(I){I.fg=x.DEFAULT_ATTR_DATA.fg,I.bg=x.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const O=I.length;let H;const G=this._curAttrData;for(let W=0;W=30&&H<=37?(G.fg&=-50331904,G.fg|=16777216|H-30):H>=40&&H<=47?(G.bg&=-50331904,G.bg|=16777216|H-40):H>=90&&H<=97?(G.fg&=-50331904,G.fg|=16777224|H-90):H>=100&&H<=107?(G.bg&=-50331904,G.bg|=16777224|H-100):H===0?this._processSGR0(G):H===1?G.fg|=134217728:H===3?G.bg|=67108864:H===4?(G.fg|=268435456,this._processUnderline(I.hasSubParams(W)?I.getSubParams(W)[0]:1,G)):H===5?G.fg|=536870912:H===7?G.fg|=67108864:H===8?G.fg|=1073741824:H===9?G.fg|=2147483648:H===2?G.bg|=134217728:H===21?this._processUnderline(2,G):H===22?(G.fg&=-134217729,G.bg&=-134217729):H===23?G.bg&=-67108865:H===24?(G.fg&=-268435457,this._processUnderline(0,G)):H===25?G.fg&=-536870913:H===27?G.fg&=-67108865:H===28?G.fg&=-1073741825:H===29?G.fg&=2147483647:H===39?(G.fg&=-67108864,G.fg|=16777215&x.DEFAULT_ATTR_DATA.fg):H===49?(G.bg&=-67108864,G.bg|=16777215&x.DEFAULT_ATTR_DATA.bg):H===38||H===48||H===58?W+=this._extractColor(I,W,G):H===53?G.bg|=1073741824:H===55?G.bg&=-1073741825:H===59?(G.extended=G.extended.clone(),G.extended.underlineColor=-1,G.updateExtended()):H===100?(G.fg&=-67108864,G.fg|=16777215&x.DEFAULT_ATTR_DATA.fg,G.bg&=-67108864,G.bg|=16777215&x.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",H);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const O=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${O};${H}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const O=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${O};${H}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=x.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(I){const O=I.params[0]||1;switch(O){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 H=O%2==1;return this._optionsService.options.cursorBlink=H,!0}setScrollRegion(I){const O=I.params[0]||1;let H;return(I.length<2||(H=I.params[1])>this._bufferService.rows||H===0)&&(H=this._bufferService.rows),H>O&&(this._activeBuffer.scrollTop=O-1,this._activeBuffer.scrollBottom=H-1,this._setCursor(0,0)),!0}windowOptions(I){if(!F(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const O=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:O!==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(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:O!==0&&O!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),O!==0&&O!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:O!==0&&O!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),O!==0&&O!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){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(I){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(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const O=[],H=I.split(";");for(;H.length>1;){const G=H.shift(),W=H.shift();if(/^\d+$/.exec(G)){const re=parseInt(G);if(Q(re))if(W==="?")O.push({type:0,index:re});else{const ce=(0,D.parseColor)(W);ce&&O.push({type:1,index:re,color:ce})}}}return O.length&&this._onColor.fire(O),!0}setHyperlink(I){const O=I.split(";");return!(O.length<2)&&(O[1]?this._createHyperlink(O[0],O[1]):!O[0]&&this._finishHyperlink())}_createHyperlink(I,O){this._getCurrentLinkId()&&this._finishHyperlink();const H=I.split(":");let G;const W=H.findIndex((re=>re.startsWith("id=")));return W!==-1&&(G=H[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:G,uri:O}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,O){const H=I.split(";");for(let G=0;G=this._specialColors.length);++G,++O)if(H[G]==="?")this._onColor.fire([{type:0,index:this._specialColors[O]}]);else{const W=(0,D.parseColor)(H[G]);W&&this._onColor.fire([{type:1,index:this._specialColors[O],color:W}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const O=[],H=I.split(";");for(let G=0;G=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 I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,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=x.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=x.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new y.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let O=0;O(this._coreService.triggerDataEvent(`${f.C0.ESC}${W}${f.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${H.scrollTop+1};${H.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[G.cursorStyle]-(G.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,O){this._dirtyRowTracker.markRangeDirty(I,O)}}l.InputHandler=X;let Y=class{constructor(te){this._bufferService=te,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(te){tethis.end&&(this.end=te)}markRangeDirty(te,I){te>I&&(V=te,te=I,I=V),tethis.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Q(te){return 0<=te&&te<256}Y=d([m(0,T.IBufferService)],Y)},844:(o,l)=>{function u(d){for(const m of d)m.dispose();d.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const m=this._disposables.indexOf(d);m!==-1&&this._disposables.splice(m,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var m;this._isDisposed||d===this._value||((m=this._value)==null||m.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},l.toDisposable=function(d){return{dispose:d}},l.disposeArray=u,l.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(m,f,g){this._data[m]||(this._data[m]={}),this._data[m][f]=g}get(m,f){return this._data[m]?this._data[m][f]:void 0}clear(){this._data={}}}l.TwoKeyMap=u,l.FourKeyMap=class{constructor(){this._data=new u}set(d,m,f,g,b){this._data.get(d,m)||this._data.set(d,m,new u),this._data.get(d,m).set(f,g,b)}get(d,m,f,g){var b;return(b=this._data.get(d,m))==null?void 0:b.get(f,g)}clear(){this._data.clear()}}},6114:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const u=l.isNode?"node":navigator.userAgent,d=l.isNode?"node":navigator.platform;l.isFirefox=u.includes("Firefox"),l.isLegacyEdge=u.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(u),l.getSafariVersion=function(){if(!l.isSafari)return 0;const m=u.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),l.isIpad=d==="iPad",l.isIphone=d==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),l.isLinux=d.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(u)},6106:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let u=0;l.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const m=this._getKey(d);if(m===void 0||(u=this._search(m),u===-1)||this._getKey(this._array[u])!==m)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u=this._array.length)&&this._getKey(this._array[u])===d))do m(this._array[u]);while(++u=m;){let g=m+f>>1;const b=this._getKey(this._array[g]);if(b>d)f=g-1;else{if(!(b0&&this._getKey(this._array[g-1])===d;)g--;return g}m=g+1}}return m}}},7226:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const d=u(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),this._start()}flush(){for(;this._i_)return x-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(x-k))}ms`),void this._start();x=_}this.clear()}}class f extends m{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const k=Date.now()+b;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}l.PriorityTaskQueue=f,l.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:f,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const d=u(643);l.updateWindowsModeWrappedState=function(m){const f=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),g=f==null?void 0:f.get(m.cols-1),b=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);b&&g&&(b.isWrapped=g[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&g[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new u;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}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}}l.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,g=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=g}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=d},9092:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const d=u(6349),m=u(7226),f=u(3734),g=u(8437),b=u(4634),k=u(511),S=u(643),x=u(4863),_=u(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(w,y,C){this._hasScrollback=w,this._optionsService=y,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=_.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(w){return w?(this._nullCell.fg=w.fg,this._nullCell.bg=w.bg,this._nullCell.extended=w.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(w){return w?(this._whitespaceCell.fg=w.fg,this._whitespaceCell.bg=w.bg,this._whitespaceCell.extended=w.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(w,y){return new g.BufferLine(this._bufferService.cols,this.getNullCell(w),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const w=this.ybase+this.y-this.ydisp;return w>=0&&wl.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:y}fillViewportRows(w){if(this.lines.length===0){w===void 0&&(w=g.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(w))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(w,y){const C=this.getNullCell(g.DEFAULT_ATTR_DATA);let T=0;const E=this._getCorrectBufferLength(y);if(E>this.lines.maxLength&&(this.lines.maxLength=E),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+j+1?(this.ybase--,j++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(w,C)));else for(let N=this._rows;N>y;N--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(E0&&(this.lines.trimStart(N),this.ybase=Math.max(this.ybase-N,0),this.ydisp=Math.max(this.ydisp-N,0),this.savedY=Math.max(this.savedY-N,0)),this.lines.maxLength=E}this.x=Math.min(this.x,w-1),this.y=Math.min(this.y,y-1),j&&(this.y+=j),this.savedX=Math.min(this.savedX,w-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(w,y),this._cols>w))for(let j=0;j.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let w=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,w=!1);let y=0;for(;this._memoryCleanupPosition100)return!0;return w}get _isReflowEnabled(){const w=this._optionsService.rawOptions.windowsPty;return w&&w.buildNumber?this._hasScrollback&&w.backend==="conpty"&&w.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(w,y){this._cols!==w&&(w>this._cols?this._reflowLarger(w,y):this._reflowSmaller(w,y))}_reflowLarger(w,y){const C=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,w,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(C.length>0){const T=(0,b.reflowLargerCreateNewLayout)(this.lines,C);(0,b.reflowLargerApplyNewLayout)(this.lines,T.layout),this._reflowLargerAdjustViewport(w,y,T.countRemoved)}}_reflowLargerAdjustViewport(w,y,C){const T=this.getNullCell(g.DEFAULT_ATTR_DATA);let E=C;for(;E-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;j--){let N=this.lines.get(j);if(!N||!N.isWrapped&&N.getTrimmedLength()<=w)continue;const D=[N];for(;N.isWrapped&&j>0;)N=this.lines.get(--j),D.unshift(N);const z=this.ybase+this.y;if(z>=j&&z0&&(T.push({start:j+D.length+E,newLines:X}),E+=X.length),D.push(...X);let Y=F.length-1,Q=F[Y];Q===0&&(Y--,Q=F[Y]);let te=D.length-U-1,I=$;for(;te>=0;){const H=Math.min(I,Q);if(D[Y]===void 0)break;if(D[Y].copyCellsFrom(D[te],I-H,Q-H,H,!0),Q-=H,Q===0&&(Y--,Q=F[Y]),I-=H,I===0){te--;const G=Math.max(te,0);I=(0,b.getWrappedLineTrimmedLength)(D,G,this._cols)}}for(let H=0;H0;)this.ybase===0?this.y0){const j=[],N=[];for(let Y=0;Y=0;Y--)if(F&&F.start>z+U){for(let Q=F.newLines.length-1;Q>=0;Q--)this.lines.set(Y--,F.newLines[Q]);Y++,j.push({index:z+1,amount:F.newLines.length}),U+=F.newLines.length,F=T[++$]}else this.lines.set(Y,N[z--]);let V=0;for(let Y=j.length-1;Y>=0;Y--)j[Y].index+=V,this.lines.onInsertEmitter.fire(j[Y]),V+=j[Y].amount;const X=Math.max(0,D+E-this.lines.maxLength);X>0&&this.lines.onTrimEmitter.fire(X)}}translateBufferLineToString(w,y,C=0,T){const E=this.lines.get(w);return E?E.translateToString(y,C,T):""}getWrappedRangeForLine(w){let y=w,C=w;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;C+10;);return w>=this._cols?this._cols-1:w<0?0:w}nextStop(w){for(w==null&&(w=this.x);!this.tabs[++w]&&w=this._cols?this._cols-1:w<0?0:w}clearMarkers(w){this._isClearing=!0;for(let y=0;y{y.line-=C,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((C=>{y.line>=C.index&&(y.line+=C.amount)}))),y.register(this.lines.onDelete((C=>{y.line>=C.index&&y.lineC.index&&(y.line-=C.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(w){this._isClearing||this.markers.splice(this.markers.indexOf(w),1)}}},8437:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const d=u(3734),m=u(511),f=u(643),g=u(482);l.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let b=0;class k{constructor(x,_,w=!1){this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*x);const y=_||m.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let C=0;C>22,2097152&_?this._combined[x].charCodeAt(this._combined[x].length-1):w]}set(x,_){this._data[3*x+1]=_[f.CHAR_DATA_ATTR_INDEX],_[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[x]=_[1],this._data[3*x+0]=2097152|x|_[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*x+0]=_[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(x){return this._data[3*x+0]>>22}hasWidth(x){return 12582912&this._data[3*x+0]}getFg(x){return this._data[3*x+1]}getBg(x){return this._data[3*x+2]}hasContent(x){return 4194303&this._data[3*x+0]}getCodePoint(x){const _=this._data[3*x+0];return 2097152&_?this._combined[x].charCodeAt(this._combined[x].length-1):2097151&_}isCombined(x){return 2097152&this._data[3*x+0]}getString(x){const _=this._data[3*x+0];return 2097152&_?this._combined[x]:2097151&_?(0,g.stringFromCodePoint)(2097151&_):""}isProtected(x){return 536870912&this._data[3*x+2]}loadCell(x,_){return b=3*x,_.content=this._data[b+0],_.fg=this._data[b+1],_.bg=this._data[b+2],2097152&_.content&&(_.combinedData=this._combined[x]),268435456&_.bg&&(_.extended=this._extendedAttrs[x]),_}setCell(x,_){2097152&_.content&&(this._combined[x]=_.combinedData),268435456&_.bg&&(this._extendedAttrs[x]=_.extended),this._data[3*x+0]=_.content,this._data[3*x+1]=_.fg,this._data[3*x+2]=_.bg}setCellFromCodepoint(x,_,w,y){268435456&y.bg&&(this._extendedAttrs[x]=y.extended),this._data[3*x+0]=_|w<<22,this._data[3*x+1]=y.fg,this._data[3*x+2]=y.bg}addCodepointToCell(x,_,w){let y=this._data[3*x+0];2097152&y?this._combined[x]+=(0,g.stringFromCodePoint)(_):2097151&y?(this._combined[x]=(0,g.stringFromCodePoint)(2097151&y)+(0,g.stringFromCodePoint)(_),y&=-2097152,y|=2097152):y=_|4194304,w&&(y&=-12582913,y|=w<<22),this._data[3*x+0]=y}insertCells(x,_,w){if((x%=this.length)&&this.getWidth(x-1)===2&&this.setCellFromCodepoint(x-1,0,1,w),_=0;--C)this.setCell(x+_+C,this.loadCell(x+C,y));for(let C=0;C<_;++C)this.setCell(x+C,w)}else for(let y=x;ythis.length){if(this._data.buffer.byteLength>=4*w)this._data=new Uint32Array(this._data.buffer,0,w);else{const y=new Uint32Array(w);y.set(this._data),this._data=y}for(let y=this.length;y=x&&delete this._combined[E]}const C=Object.keys(this._extendedAttrs);for(let T=0;T=x&&delete this._extendedAttrs[E]}}return this.length=x,4*w*2=0;--x)if(4194303&this._data[3*x+0])return x+(this._data[3*x+0]>>22);return 0}getNoBgTrimmedLength(){for(let x=this.length-1;x>=0;--x)if(4194303&this._data[3*x+0]||50331648&this._data[3*x+2])return x+(this._data[3*x+0]>>22);return 0}copyCellsFrom(x,_,w,y,C){const T=x._data;if(C)for(let j=y-1;j>=0;j--){for(let N=0;N<3;N++)this._data[3*(w+j)+N]=T[3*(_+j)+N];268435456&T[3*(_+j)+2]&&(this._extendedAttrs[w+j]=x._extendedAttrs[_+j])}else for(let j=0;j=_&&(this._combined[N-_+w]=x._combined[N])}}translateToString(x,_,w,y){_=_??0,w=w??this.length,x&&(w=Math.min(w,this.getTrimmedLength())),y&&(y.length=0);let C="";for(;_>22||1}return y&&y.push(_),C}}l.BufferLine=k},4841:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(o,l)=>{function u(d,m,f){if(m===d.length-1)return d[m].getTrimmedLength();const g=!d[m].hasContent(f-1)&&d[m].getWidth(f-1)===1,b=d[m+1].getWidth(0)===2;return g&&b?f-1:f}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(d,m,f,g,b){const k=[];for(let S=0;S=S&&g0&&(N>y||w[N].getTrimmedLength()===0);N--)j++;j>0&&(k.push(S+w.length-j),k.push(j)),S+=w.length-1}return k},l.reflowLargerCreateNewLayout=function(d,m){const f=[];let g=0,b=m[g],k=0;for(let S=0;Su(d,w,m))).reduce(((_,w)=>_+w));let k=0,S=0,x=0;for(;x_&&(k-=_,S++);const w=d[S].getWidth(k-1)===2;w&&k--;const y=w?f-1:f;g.push(y),x+=y}return g},l.getWrappedLineTrimmedLength=u},5295:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const d=u(8460),m=u(844),f=u(9092);class g extends m.Disposable{constructor(k,S){super(),this._optionsService=k,this._bufferService=S,this._onBufferActivate=this.register(new d.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 f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.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(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,S){this._normal.resize(k,S),this._alt.resize(k,S),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}l.BufferSet=g},511:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const d=u(482),m=u(643),f=u(3734);class g extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const S=new g;return S.setFromCharData(k),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(k[m.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(k[m.CHAR_DATA_CHAR_INDEX].length===2){const x=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=x&&x<=56319){const _=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=_&&_<=57343?this.content=1024*(x-55296)+_-56320+65536|k[m.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[m.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=k[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=g},643:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const d=u(8460),m=u(844);class f{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}l.Marker=f,f._nextId=1},7116:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.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:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(o,l)=>{var u,d,m;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=` -`,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(u||(l.C0=u={})),(function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"})(d||(l.C1=d={})),(function(f){f.ST=`${u.ESC}\\`})(m||(l.C1_ESCAPED=m={}))},7399:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const d=u(2584),m={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:["'",'"']};l.evaluateKeyboardEvent=function(f,g,b,k){const S={type:0,cancel:!1,key:void 0},x=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?S.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?S.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?S.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(S.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:S.key=f.ctrlKey?"\b":d.C0.DEL,f.altKey&&(S.key=d.C0.ESC+S.key);break;case 9:if(f.shiftKey){S.key=d.C0.ESC+"[Z";break}S.key=d.C0.HT,S.cancel=!0;break;case 13:S.key=f.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,S.cancel=!0;break;case 27:S.key=d.C0.ESC,f.altKey&&(S.key=d.C0.ESC+d.C0.ESC),S.cancel=!0;break;case 37:if(f.metaKey)break;x?(S.key=d.C0.ESC+"[1;"+(x+1)+"D",S.key===d.C0.ESC+"[1;3D"&&(S.key=d.C0.ESC+(b?"b":"[1;5D"))):S.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(f.metaKey)break;x?(S.key=d.C0.ESC+"[1;"+(x+1)+"C",S.key===d.C0.ESC+"[1;3C"&&(S.key=d.C0.ESC+(b?"f":"[1;5C"))):S.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(f.metaKey)break;x?(S.key=d.C0.ESC+"[1;"+(x+1)+"A",b||S.key!==d.C0.ESC+"[1;3A"||(S.key=d.C0.ESC+"[1;5A")):S.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(f.metaKey)break;x?(S.key=d.C0.ESC+"[1;"+(x+1)+"B",b||S.key!==d.C0.ESC+"[1;3B"||(S.key=d.C0.ESC+"[1;5B")):S.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(S.key=d.C0.ESC+"[2~");break;case 46:S.key=x?d.C0.ESC+"[3;"+(x+1)+"~":d.C0.ESC+"[3~";break;case 36:S.key=x?d.C0.ESC+"[1;"+(x+1)+"H":g?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:S.key=x?d.C0.ESC+"[1;"+(x+1)+"F":g?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:f.shiftKey?S.type=2:f.ctrlKey?S.key=d.C0.ESC+"[5;"+(x+1)+"~":S.key=d.C0.ESC+"[5~";break;case 34:f.shiftKey?S.type=3:f.ctrlKey?S.key=d.C0.ESC+"[6;"+(x+1)+"~":S.key=d.C0.ESC+"[6~";break;case 112:S.key=x?d.C0.ESC+"[1;"+(x+1)+"P":d.C0.ESC+"OP";break;case 113:S.key=x?d.C0.ESC+"[1;"+(x+1)+"Q":d.C0.ESC+"OQ";break;case 114:S.key=x?d.C0.ESC+"[1;"+(x+1)+"R":d.C0.ESC+"OR";break;case 115:S.key=x?d.C0.ESC+"[1;"+(x+1)+"S":d.C0.ESC+"OS";break;case 116:S.key=x?d.C0.ESC+"[15;"+(x+1)+"~":d.C0.ESC+"[15~";break;case 117:S.key=x?d.C0.ESC+"[17;"+(x+1)+"~":d.C0.ESC+"[17~";break;case 118:S.key=x?d.C0.ESC+"[18;"+(x+1)+"~":d.C0.ESC+"[18~";break;case 119:S.key=x?d.C0.ESC+"[19;"+(x+1)+"~":d.C0.ESC+"[19~";break;case 120:S.key=x?d.C0.ESC+"[20;"+(x+1)+"~":d.C0.ESC+"[20~";break;case 121:S.key=x?d.C0.ESC+"[21;"+(x+1)+"~":d.C0.ESC+"[21~";break;case 122:S.key=x?d.C0.ESC+"[23;"+(x+1)+"~":d.C0.ESC+"[23~";break;case 123:S.key=x?d.C0.ESC+"[24;"+(x+1)+"~":d.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(b&&!k||!f.altKey||f.metaKey)!b||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?S.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(S.key=d.C0.US),f.key==="@"&&(S.key=d.C0.NUL)):f.keyCode===65&&(S.type=1);else{const _=m[f.keyCode],w=_==null?void 0:_[f.shiftKey?1:0];if(w)S.key=d.C0.ESC+w;else if(f.keyCode>=65&&f.keyCode<=90){const y=f.ctrlKey?f.keyCode-64:f.keyCode+32;let C=String.fromCharCode(y);f.shiftKey&&(C=C.toUpperCase()),S.key=d.C0.ESC+C}else if(f.keyCode===32)S.key=d.C0.ESC+(f.ctrlKey?d.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let y=f.code.slice(3,4);f.shiftKey||(y=y.toLowerCase()),S.key=d.C0.ESC+y,S.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?S.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?S.key=d.C0.NUL:f.keyCode>=51&&f.keyCode<=55?S.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?S.key=d.C0.DEL:f.keyCode===219?S.key=d.C0.ESC:f.keyCode===220?S.key=d.C0.FS:f.keyCode===221&&(S.key=d.C0.GS)}return S}},482:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},l.utf32ToString=function(u,d=0,m=u.length){let f="";for(let g=d;g65535?(b-=65536,f+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):f+=String.fromCharCode(b)}return f},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const m=u.length;if(!m)return 0;let f=0,g=0;if(this._interim){const b=u.charCodeAt(g++);56320<=b&&b<=57343?d[f++]=1024*(this._interim-55296)+b-56320+65536:(d[f++]=this._interim,d[f++]=b),this._interim=0}for(let b=g;b=m)return this._interim=k,f;const S=u.charCodeAt(b);56320<=S&&S<=57343?d[f++]=1024*(k-55296)+S-56320+65536:(d[f++]=k,d[f++]=S)}else k!==65279&&(d[f++]=k)}return f}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const m=u.length;if(!m)return 0;let f,g,b,k,S=0,x=0,_=0;if(this.interim[0]){let C=!1,T=this.interim[0];T&=(224&T)==192?31:(240&T)==224?15:7;let E,j=0;for(;(E=63&this.interim[++j])&&j<4;)T<<=6,T|=E;const N=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,D=N-j;for(;_=m)return 0;if(E=u[_++],(192&E)!=128){_--,C=!0;break}this.interim[j++]=E,T<<=6,T|=63&E}C||(N===2?T<128?_--:d[S++]=T:N===3?T<2048||T>=55296&&T<=57343||T===65279||(d[S++]=T):T<65536||T>1114111||(d[S++]=T)),this.interim.fill(0)}const w=m-4;let y=_;for(;y=m)return this.interim[0]=f,S;if(g=u[y++],(192&g)!=128){y--;continue}if(x=(31&f)<<6|63&g,x<128){y--;continue}d[S++]=x}else if((240&f)==224){if(y>=m)return this.interim[0]=f,S;if(g=u[y++],(192&g)!=128){y--;continue}if(y>=m)return this.interim[0]=f,this.interim[1]=g,S;if(b=u[y++],(192&b)!=128){y--;continue}if(x=(15&f)<<12|(63&g)<<6|63&b,x<2048||x>=55296&&x<=57343||x===65279)continue;d[S++]=x}else if((248&f)==240){if(y>=m)return this.interim[0]=f,S;if(g=u[y++],(192&g)!=128){y--;continue}if(y>=m)return this.interim[0]=f,this.interim[1]=g,S;if(b=u[y++],(192&b)!=128){y--;continue}if(y>=m)return this.interim[0]=f,this.interim[1]=g,this.interim[2]=b,S;if(k=u[y++],(192&k)!=128){y--;continue}if(x=(7&f)<<18|(63&g)<<12|(63&b)<<6|63&k,x<65536||x>1114111)continue;d[S++]=x}}return S}}},225:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const d=u(1480),m=[[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]],f=[[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 g;l.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let b=0;bS[w][1])return!1;for(;w>=_;)if(x=_+w>>1,k>S[x][1])_=x+1;else{if(!(k=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,k){let S=this.wcwidth(b),x=S===0&&k!==0;if(x){const _=d.UnicodeService.extractWidth(k);_===0?x=!1:_>S&&(S=_)}return d.UnicodeService.createPropertyValue(0,S,x)}}},5981:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const d=u(8460),m=u(844);class f extends m.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const x=this._callbacks.shift();x&&x()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,k){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+=b.length,this._writeBuffer.push(b),this._callbacks.push(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(k)}_innerWrite(b=0,k=!0){const S=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const x=this._writeBuffer[this._bufferOffset],_=this._action(x,k);if(_){const y=C=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(S,C);return void _.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(y)}const w=this._callbacks[this._bufferOffset];if(w&&w(),this._bufferOffset++,this._pendingData-=x.length,Date.now()-S>=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()}}l.WriteBuffer=f},5941:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const u=/^([\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})$/,d=/^[\da-f]+$/;function m(f,g){const b=f.toString(16),k=b.length<2?"0"+b:b;switch(g){case 4:return b[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}l.parseColor=function(f){if(!f)return;let g=f.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const b=u.exec(g);if(b){const k=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/k*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/k*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/k*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),d.exec(g)&&[3,6,9,12].includes(g.length))){const b=g.length/3,k=[0,0,0];for(let S=0;S<3;++S){const x=parseInt(g.slice(b*S,b*S+b),16);k[S]=b===1?x<<4:b===2?x:b===3?x>>4:x>>8}return k}},l.toRgbString=function(f,g=16){const[b,k,S]=f;return`rgb:${m(b,g)}/${m(k,g)}/${m(S,g)}`}},5770:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const d=u(482),m=u(8742),f=u(5770),g=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(k,S){this._handlers[k]===void 0&&(this._handlers[k]=[]);const x=this._handlers[k];return x.push(S),{dispose:()=>{const _=x.indexOf(S);_!==-1&&x.splice(_,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(k,S){if(this.reset(),this._ident=k,this._active=this._handlers[k]||g,this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(k,S,x){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(k,S,x);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(k,S,x))}unhook(k,S=!0){if(this._active.length){let x=!1,_=this._active.length-1,w=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,x=S,w=this._stack.fallThrough,this._stack.paused=!1),!w&&x===!1){for(;_>=0&&(x=this._active[_].unhook(k),x!==!0);_--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,x;_--}for(;_>=0;_--)if(x=this._active[_].unhook(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,x}else this._handlerFb(this._ident,"UNHOOK",k);this._active=g,this._ident=0}};const b=new m.Params;b.addParam(0),l.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=b,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():b,this._data="",this._hitLimit=!1}put(k,S,x){this._hitLimit||(this._data+=(0,d.utf32ToString)(k,S,x),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let S=!1;if(this._hitLimit)S=!1;else if(k&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((x=>(this._params=b,this._data="",this._hitLimit=!1,x)));return this._params=b,this._data="",this._hitLimit=!1,S}}},2015:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const d=u(844),m=u(8742),f=u(6242),g=u(6351);class b{constructor(_){this.table=new Uint8Array(_)}setDefault(_,w){this.table.fill(_<<4|w)}add(_,w,y,C){this.table[w<<8|_]=y<<4|C}addMany(_,w,y,C){for(let T=0;T<_.length;T++)this.table[w<<8|_[T]]=y<<4|C}}l.TransitionTable=b;const k=160;l.VT500_TRANSITION_TABLE=(function(){const x=new b(4095),_=Array.apply(null,Array(256)).map(((j,N)=>N)),w=(j,N)=>_.slice(j,N),y=w(32,127),C=w(0,24);C.push(25),C.push.apply(C,w(28,32));const T=w(0,14);let E;for(E in x.setDefault(1,0),x.addMany(y,0,2,0),T)x.addMany([24,26,153,154],E,3,0),x.addMany(w(128,144),E,3,0),x.addMany(w(144,152),E,3,0),x.add(156,E,0,0),x.add(27,E,11,1),x.add(157,E,4,8),x.addMany([152,158,159],E,0,7),x.add(155,E,11,3),x.add(144,E,11,9);return x.addMany(C,0,3,0),x.addMany(C,1,3,1),x.add(127,1,0,1),x.addMany(C,8,0,8),x.addMany(C,3,3,3),x.add(127,3,0,3),x.addMany(C,4,3,4),x.add(127,4,0,4),x.addMany(C,6,3,6),x.addMany(C,5,3,5),x.add(127,5,0,5),x.addMany(C,2,3,2),x.add(127,2,0,2),x.add(93,1,4,8),x.addMany(y,8,5,8),x.add(127,8,5,8),x.addMany([156,27,24,26,7],8,6,0),x.addMany(w(28,32),8,0,8),x.addMany([88,94,95],1,0,7),x.addMany(y,7,0,7),x.addMany(C,7,0,7),x.add(156,7,0,0),x.add(127,7,0,7),x.add(91,1,11,3),x.addMany(w(64,127),3,7,0),x.addMany(w(48,60),3,8,4),x.addMany([60,61,62,63],3,9,4),x.addMany(w(48,60),4,8,4),x.addMany(w(64,127),4,7,0),x.addMany([60,61,62,63],4,0,6),x.addMany(w(32,64),6,0,6),x.add(127,6,0,6),x.addMany(w(64,127),6,0,0),x.addMany(w(32,48),3,9,5),x.addMany(w(32,48),5,9,5),x.addMany(w(48,64),5,0,6),x.addMany(w(64,127),5,7,0),x.addMany(w(32,48),4,9,5),x.addMany(w(32,48),1,9,2),x.addMany(w(32,48),2,9,2),x.addMany(w(48,127),2,10,0),x.addMany(w(48,80),1,10,0),x.addMany(w(81,88),1,10,0),x.addMany([89,90,92],1,10,0),x.addMany(w(96,127),1,10,0),x.add(80,1,11,9),x.addMany(C,9,0,9),x.add(127,9,0,9),x.addMany(w(28,32),9,0,9),x.addMany(w(32,48),9,9,12),x.addMany(w(48,60),9,8,10),x.addMany([60,61,62,63],9,9,10),x.addMany(C,11,0,11),x.addMany(w(32,128),11,0,11),x.addMany(w(28,32),11,0,11),x.addMany(C,10,0,10),x.add(127,10,0,10),x.addMany(w(28,32),10,0,10),x.addMany(w(48,60),10,8,10),x.addMany([60,61,62,63],10,0,11),x.addMany(w(32,48),10,9,12),x.addMany(C,12,0,12),x.add(127,12,0,12),x.addMany(w(28,32),12,0,12),x.addMany(w(32,48),12,9,12),x.addMany(w(48,64),12,0,11),x.addMany(w(64,127),12,12,13),x.addMany(w(64,127),10,12,13),x.addMany(w(64,127),9,12,13),x.addMany(C,13,13,13),x.addMany(y,13,13,13),x.add(127,13,0,13),x.addMany([27,156,24,26],13,14,0),x.add(k,0,2,0),x.add(k,8,5,8),x.add(k,6,0,6),x.add(k,11,0,11),x.add(k,13,13,13),x})();class S extends d.Disposable{constructor(_=l.VT500_TRANSITION_TABLE){super(),this._transitions=_,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(w,y,C)=>{},this._executeHandlerFb=w=>{},this._csiHandlerFb=(w,y)=>{},this._escHandlerFb=w=>{},this._errorHandlerFb=w=>w,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(_,w=[64,126]){let y=0;if(_.prefix){if(_.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=_.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(_.intermediates){if(_.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let T=0;T<_.intermediates.length;++T){const E=_.intermediates.charCodeAt(T);if(32>E||E>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=E}}if(_.final.length!==1)throw new Error("final must be a single byte");const C=_.final.charCodeAt(0);if(w[0]>C||C>w[1])throw new Error(`final must be in range ${w[0]} .. ${w[1]}`);return y<<=8,y|=C,y}identToString(_){const w=[];for(;_;)w.push(String.fromCharCode(255&_)),_>>=8;return w.reverse().join("")}setPrintHandler(_){this._printHandler=_}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(_,w){const y=this._identifier(_,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const C=this._escHandlers[y];return C.push(w),{dispose:()=>{const T=C.indexOf(w);T!==-1&&C.splice(T,1)}}}clearEscHandler(_){this._escHandlers[this._identifier(_,[48,126])]&&delete this._escHandlers[this._identifier(_,[48,126])]}setEscHandlerFallback(_){this._escHandlerFb=_}setExecuteHandler(_,w){this._executeHandlers[_.charCodeAt(0)]=w}clearExecuteHandler(_){this._executeHandlers[_.charCodeAt(0)]&&delete this._executeHandlers[_.charCodeAt(0)]}setExecuteHandlerFallback(_){this._executeHandlerFb=_}registerCsiHandler(_,w){const y=this._identifier(_);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const C=this._csiHandlers[y];return C.push(w),{dispose:()=>{const T=C.indexOf(w);T!==-1&&C.splice(T,1)}}}clearCsiHandler(_){this._csiHandlers[this._identifier(_)]&&delete this._csiHandlers[this._identifier(_)]}setCsiHandlerFallback(_){this._csiHandlerFb=_}registerDcsHandler(_,w){return this._dcsParser.registerHandler(this._identifier(_),w)}clearDcsHandler(_){this._dcsParser.clearHandler(this._identifier(_))}setDcsHandlerFallback(_){this._dcsParser.setHandlerFallback(_)}registerOscHandler(_,w){return this._oscParser.registerHandler(_,w)}clearOscHandler(_){this._oscParser.clearHandler(_)}setOscHandlerFallback(_){this._oscParser.setHandlerFallback(_)}setErrorHandler(_){this._errorHandler=_}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(_,w,y,C,T){this._parseStack.state=_,this._parseStack.handlers=w,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=T}parse(_,w,y){let C,T=0,E=0,j=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,j=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 N=this._parseStack.handlers;let D=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&D>-1){for(;D>=0&&(C=N[D](this._params),C!==!0);D--)if(C instanceof Promise)return this._parseStack.handlerPos=D,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&D>-1){for(;D>=0&&(C=N[D](),C!==!0);D--)if(C instanceof Promise)return this._parseStack.handlerPos=D,C}this._parseStack.handlers=[];break;case 6:if(T=_[this._parseStack.chunkPos],C=this._dcsParser.unhook(T!==24&&T!==26,y),C)return C;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(T=_[this._parseStack.chunkPos],C=this._oscParser.end(T!==24&&T!==26,y),C)return C;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,j=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let N=j;N>4){case 2:for(let U=N+1;;++U){if(U>=w||(T=_[U])<32||T>126&&T=w||(T=_[U])<32||T>126&&T=w||(T=_[U])<32||T>126&&T=w||(T=_[U])<32||T>126&&T=0&&(C=D[z](this._params),C!==!0);z--)if(C instanceof Promise)return this._preserveStack(3,D,z,E,N),C;z<0&&this._csiHandlerFb(this._collect<<8|T,this._params),this.precedingJoinState=0;break;case 8:do switch(T){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(T-48)}while(++N47&&T<60);N--;break;case 9:this._collect<<=8,this._collect|=T;break;case 10:const $=this._escHandlers[this._collect<<8|T];let F=$?$.length-1:-1;for(;F>=0&&(C=$[F](),C!==!0);F--)if(C instanceof Promise)return this._preserveStack(4,$,F,E,N),C;F<0&&this._escHandlerFb(this._collect<<8|T),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|T,this._params);break;case 13:for(let U=N+1;;++U)if(U>=w||(T=_[U])===24||T===26||T===27||T>127&&T=w||(T=_[U])<32||T>127&&T{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const d=u(5770),m=u(482),f=[];l.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,b){this._handlers[g]===void 0&&(this._handlers[g]=[]);const k=this._handlers[g];return k.push(b),{dispose:()=>{const S=k.indexOf(b);S!==-1&&k.splice(S,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,b,k){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(g,b,k);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(g,b,k))}start(){this.reset(),this._state=1}put(g,b,k){if(this._state!==3){if(this._state===1)for(;b0&&this._put(g,b,k)}}end(g,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,S=this._active.length-1,x=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,k=b,x=this._stack.fallThrough,this._stack.paused=!1),!x&&k===!1){for(;S>=0&&(k=this._active[S].end(g),k!==!0);S--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,k;S--}for(;S>=0;S--)if(k=this._active[S].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",g);this._active=f,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,b,k){this._hitLimit||(this._data+=(0,m.utf32ToString)(g,b,k),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let b=!1;if(this._hitLimit)b=!1;else if(g&&(b=this._handler(this._data),b instanceof Promise))return b.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,b}}},8742:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const u=2147483647;class d{static fromArray(f){const g=new d;if(!f.length)return g;for(let b=Array.isArray(f[0])?1:0;b256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new d(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let g=0;g>8,k=255&this._subParamsIdx[g];k-b>0&&f.push(Array.prototype.slice.call(this._subParams,b,k))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>u?u:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>u?u:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const g=this._subParamsIdx[f]>>8,b=255&this._subParamsIdx[f];return b-g>0?this._subParams.subarray(g,b):null}getSubParamsAll(){const f={};for(let g=0;g>8,k=255&this._subParamsIdx[g];k-b>0&&(f[g]=this._subParams.slice(b,k))}return f}addDigit(f){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,k=b[g-1];b[g-1]=~k?Math.min(10*k+f,u):f}}l.Params=d},5741:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const m={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(m),d.dispose=()=>this._wrappedAddonDispose(m),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let m=0;m{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const d=u(3785),m=u(511);l.BufferApiView=class{constructor(f,g){this._buffer=f,this.type=g}init(f){return this._buffer=f,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(f){const g=this._buffer.lines.get(f);if(g)return new d.BufferLineApiView(g)}getNullCell(){return new m.CellData}}},3785:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const d=u(511);l.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,f){if(!(m<0||m>=this._line.length))return f?(this._line.loadCell(m,f),f):this._line.loadCell(m,new d.CellData)}translateToString(m,f,g){return this._line.translateToString(m,f,g)}}},8285:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const d=u(8771),m=u(8460),f=u(844);class g extends f.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.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)}}l.BufferNamespaceApi=g},7975:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,(m=>d(m.toArray())))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,((m,f)=>d(m,f.toArray())))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(o,l,u){var d=this&&this.__decorate||function(x,_,w,y){var C,T=arguments.length,E=T<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(x,_,w,y);else for(var j=x.length-1;j>=0;j--)(C=x[j])&&(E=(T<3?C(E):T>3?C(_,w,E):C(_,w))||E);return T>3&&E&&Object.defineProperty(_,w,E),E},m=this&&this.__param||function(x,_){return function(w,y){_(w,y,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const f=u(8460),g=u(844),b=u(5295),k=u(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let S=l.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(x){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(x.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(x.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(x,this))}resize(x,_){this.cols=x,this.rows=_,this.buffers.resize(x,_),this._onResize.fire({cols:x,rows:_})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(x,_=!1){const w=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===x.fg&&y.getBg(0)===x.bg||(y=w.getBlankLine(x,_),this._cachedBlankLine=y),y.isWrapped=_;const C=w.ybase+w.scrollTop,T=w.ybase+w.scrollBottom;if(w.scrollTop===0){const E=w.lines.isFull;T===w.lines.length-1?E?w.lines.recycle().copyFrom(y):w.lines.push(y.clone()):w.lines.splice(T+1,0,y.clone()),E?this.isUserScrolling&&(w.ydisp=Math.max(w.ydisp-1,0)):(w.ybase++,this.isUserScrolling||w.ydisp++)}else{const E=T-C+1;w.lines.shiftElements(C+1,E-1,-1),w.lines.set(T,y.clone())}this.isUserScrolling||(w.ydisp=w.ybase),this._onScroll.fire(w.ydisp)}scrollLines(x,_,w){const y=this.buffer;if(x<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else x+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const C=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+x,y.ybase),0),C!==y.ydisp&&(_||this._onScroll.fire(y.ydisp))}};l.BufferService=S=d([m(0,k.IOptionsService)],S)},7994:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(o,l,u){var d=this&&this.__decorate||function(y,C,T,E){var j,N=arguments.length,D=N<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,T):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,C,T,E);else for(var z=y.length-1;z>=0;z--)(j=y[z])&&(D=(N<3?j(D):N>3?j(C,T,D):j(C,T))||D);return N>3&&D&&Object.defineProperty(C,T,D),D},m=this&&this.__param||function(y,C){return function(T,E){C(T,E,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const f=u(2585),g=u(8460),b=u(844),k={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 S(y,C){let T=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(T|=64,T|=y.action):(T|=3&y.button,4&y.button&&(T|=64),8&y.button&&(T|=128),y.action===32?T|=32:y.action!==0||C||(T|=3)),T}const x=String.fromCharCode,_={DEFAULT:y=>{const C=[S(y,!1)+32,y.col+32,y.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${x(C[0])}${x(C[1])}${x(C[2])}`},SGR:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.col};${y.row}${C}`},SGR_PIXELS:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.x};${y.y}${C}`}};let w=l.CoreMouseService=class extends b.Disposable{constructor(y,C){super(),this._bufferService=y,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const T of Object.keys(k))this.addProtocol(T,k[T]);for(const T of Object.keys(_))this.addEncoding(T,_[T]);this.reset()}addProtocol(y,C){this._protocols[y]=C}addEncoding(y,C){this._encodings[y]=C}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 C=this._encodings[this._activeEncoding](y);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!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,C,T){if(T){if(y.x!==C.x||y.y!==C.y)return!1}else if(y.col!==C.col||y.row!==C.row)return!1;return y.button===C.button&&y.action===C.action&&y.ctrl===C.ctrl&&y.alt===C.alt&&y.shift===C.shift}};l.CoreMouseService=w=d([m(0,f.IBufferService),m(1,f.ICoreService)],w)},6975:function(o,l,u){var d=this&&this.__decorate||function(w,y,C,T){var E,j=arguments.length,N=j<3?y:T===null?T=Object.getOwnPropertyDescriptor(y,C):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(w,y,C,T);else for(var D=w.length-1;D>=0;D--)(E=w[D])&&(N=(j<3?E(N):j>3?E(y,C,N):E(y,C))||N);return j>3&&N&&Object.defineProperty(y,C,N),N},m=this&&this.__param||function(w,y){return function(C,T){y(C,T,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const f=u(1439),g=u(8460),b=u(844),k=u(2585),S=Object.freeze({insertMode:!1}),x=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let _=l.CoreService=class extends b.Disposable{constructor(w,y,C){super(),this._bufferService=w,this._logService=y,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(S),this.decPrivateModes=(0,f.clone)(x)}reset(){this.modes=(0,f.clone)(S),this.decPrivateModes=(0,f.clone)(x)}triggerDataEvent(w,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${w}"`,(()=>w.split("").map((T=>T.charCodeAt(0))))),this._onData.fire(w)}triggerBinaryEvent(w){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${w}"`,(()=>w.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(w))}};l.CoreService=_=d([m(0,k.IBufferService),m(1,k.ILogService),m(2,k.IOptionsService)],_)},9074:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const d=u(8055),m=u(8460),f=u(844),g=u(6106);let b=0,k=0;class S extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((w=>w==null?void 0:w.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(w){if(w.marker.isDisposed)return;const y=new x(w);if(y){const C=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),C.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const w of this._decorations.values())w.dispose();this._decorations.clear()}*getDecorationsAtCell(w,y,C){let T=0,E=0;for(const j of this._decorations.getKeyIterator(y))T=j.options.x??0,E=T+(j.options.width??1),w>=T&&w{b=E.options.x??0,k=b+(E.options.width??1),w>=b&&w{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const d=u(2585),m=u(8343);class f{constructor(...b){this._entries=new Map;for(const[k,S]of b)this.set(k,S)}set(b,k){const S=this._entries.get(b);return this._entries.set(b,k),S}forEach(b){for(const[k,S]of this._entries.entries())b(k,S)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}l.ServiceCollection=f,l.InstantiationService=class{constructor(){this._services=new f,this._services.set(d.IInstantiationService,this)}setService(g,b){this._services.set(g,b)}getService(g){return this._services.get(g)}createInstance(g,...b){const k=(0,m.getServiceDependencies)(g).sort(((_,w)=>_.index-w.index)),S=[];for(const _ of k){const w=this._services.get(_.id);if(!w)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${_.id}.`);S.push(w)}const x=k.length>0?k[0].index:b.length;if(b.length!==x)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${x+1} conflicts with ${b.length} static arguments`);return new g(...b,...S)}}},7866:function(o,l,u){var d=this&&this.__decorate||function(x,_,w,y){var C,T=arguments.length,E=T<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(x,_,w,y);else for(var j=x.length-1;j>=0;j--)(C=x[j])&&(E=(T<3?C(E):T>3?C(_,w,E):C(_,w))||E);return T>3&&E&&Object.defineProperty(_,w,E),E},m=this&&this.__param||function(x,_){return function(w,y){_(w,y,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const f=u(844),g=u(2585),b={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let k,S=l.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(x){super(),this._optionsService=x,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(x){for(let _=0;_JSON.stringify(E))).join(", ")})`);const T=y.apply(this,C);return k.trace(`GlyphRenderer#${y.name} return`,T),T}}},7302:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const d=u(8460),m=u(844),f=u(6114);l.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:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends m.Disposable{constructor(S){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const x={...l.DEFAULT_OPTIONS};for(const _ in S)if(_ in x)try{const w=S[_];x[_]=this._sanitizeAndValidateOption(_,w)}catch(w){console.error(w)}this.rawOptions=x,this.options={...x},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(S,x){return this.onOptionChange((_=>{_===S&&x(this.rawOptions[S])}))}onMultipleOptionChange(S,x){return this.onOptionChange((_=>{S.indexOf(_)!==-1&&x()}))}_setupOptions(){const S=_=>{if(!(_ in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);return this.rawOptions[_]},x=(_,w)=>{if(!(_ in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);w=this._sanitizeAndValidateOption(_,w),this.rawOptions[_]!==w&&(this.rawOptions[_]=w,this._onOptionChange.fire(_))};for(const _ in this.rawOptions){const w={get:S.bind(this,_),set:x.bind(this,_)};Object.defineProperty(this.options,_,w)}}_sanitizeAndValidateOption(S,x){switch(S){case"cursorStyle":if(x||(x=l.DEFAULT_OPTIONS[S]),!(function(_){return _==="block"||_==="underline"||_==="bar"})(x))throw new Error(`"${x}" is not a valid value for ${S}`);break;case"wordSeparator":x||(x=l.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof x=="number"&&1<=x&&x<=1e3)break;x=g.includes(x)?x:l.DEFAULT_OPTIONS[S];break;case"cursorWidth":x=Math.floor(x);case"lineHeight":case"tabStopWidth":if(x<1)throw new Error(`${S} cannot be less than 1, value: ${x}`);break;case"minimumContrastRatio":x=Math.max(1,Math.min(21,Math.round(10*x)/10));break;case"scrollback":if((x=Math.min(x,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${x}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(x<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${x}`);break;case"rows":case"cols":if(!x&&x!==0)throw new Error(`${S} must be numeric, value: ${x}`);break;case"windowsPty":x=x??{}}return x}}l.OptionsService=b},2660:function(o,l,u){var d=this&&this.__decorate||function(b,k,S,x){var _,w=arguments.length,y=w<3?k:x===null?x=Object.getOwnPropertyDescriptor(k,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(b,k,S,x);else for(var C=b.length-1;C>=0;C--)(_=b[C])&&(y=(w<3?_(y):w>3?_(k,S,y):_(k,S))||y);return w>3&&y&&Object.defineProperty(k,S,y),y},m=this&&this.__param||function(b,k){return function(S,x){k(S,x,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const f=u(2585);let g=l.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const k=this._bufferService.buffer;if(b.id===void 0){const C=k.addMarker(k.ybase+k.y),T={data:b,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(T,C))),this._dataByLinkId.set(T.id,T),T.id}const S=b,x=this._getEntryIdKey(S),_=this._entriesWithId.get(x);if(_)return this.addLineToLink(_.id,k.ybase+k.y),_.id;const w=k.addMarker(k.ybase+k.y),y={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(y,w))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(b,k){const S=this._dataByLinkId.get(b);if(S&&S.lines.every((x=>x.line!==k))){const x=this._bufferService.buffer.addMarker(k);S.lines.push(x),x.onDispose((()=>this._removeMarkerFromLink(S,x)))}}getLinkData(b){var k;return(k=this._dataByLinkId.get(b))==null?void 0:k.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,k){const S=b.lines.indexOf(k);S!==-1&&(b.lines.splice(S,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};l.OscLinkService=g=d([m(0,f.IBufferService)],g)},8343:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const u="di$target",d="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(m){return m[d]||[]},l.createDecorator=function(m){if(l.serviceRegistry.has(m))return l.serviceRegistry.get(m);const f=function(g,b,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,x,_){x[u]===x?x[d].push({id:S,index:_}):(x[d]=[{id:S,index:_}],x[u]=x)})(f,g,k)};return f.toString=()=>m,l.serviceRegistry.set(m,f),f}},2585:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const d=u(8343);var m;l.IBufferService=(0,d.createDecorator)("BufferService"),l.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),l.ICoreService=(0,d.createDecorator)("CoreService"),l.ICharsetService=(0,d.createDecorator)("CharsetService"),l.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(m||(l.LogLevelEnum=m={})),l.ILogService=(0,d.createDecorator)("LogService"),l.IOptionsService=(0,d.createDecorator)("OptionsService"),l.IOscLinkService=(0,d.createDecorator)("OscLinkService"),l.IUnicodeService=(0,d.createDecorator)("UnicodeService"),l.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const d=u(8460),m=u(225);class f{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,k,S=!1){return(16777215&b)<<3|(3&k)<<1|(S?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const b=new m.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let k=0,S=0;const x=b.length;for(let _=0;_=x)return k+this.wcwidth(w);const T=b.charCodeAt(_);56320<=T&&T<=57343?w=1024*(w-55296)+T-56320+65536:k+=this.wcwidth(T)}const y=this.charProperties(w,S);let C=f.extractWidth(y);f.extractShouldJoin(y)&&(C-=f.extractWidth(S)),k+=C,S=y}return k}charProperties(b,k){return this._activeProvider.charProperties(b,k)}}l.UnicodeService=f}},r={};function i(o){var l=r[o];if(l!==void 0)return l.exports;var u=r[o]={exports:{}};return n[o].call(u.exports,u,u.exports,i),u.exports}var a={};return(()=>{var o=a;Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const l=i(9042),u=i(3236),d=i(844),m=i(5741),f=i(8285),g=i(7975),b=i(7090),k=["cols","rows"];class S extends d.Disposable{constructor(_){super(),this._core=this.register(new u.Terminal(_)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const w=C=>this._core.options[C],y=(C,T)=>{this._checkReadonlyOptions(C),this._core.options[C]=T};for(const C in this._core.options){const T={get:w.bind(this,C),set:y.bind(this,C)};Object.defineProperty(this._publicOptions,C,T)}}_checkReadonlyOptions(_){if(k.includes(_))throw new Error(`Option "${_}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.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 f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const _=this._core.coreService.decPrivateModes;let w="none";switch(this._core.coreMouseService.activeProtocol){case"X10":w="x10";break;case"VT200":w="vt200";break;case"DRAG":w="drag";break;case"ANY":w="any"}return{applicationCursorKeysMode:_.applicationCursorKeys,applicationKeypadMode:_.applicationKeypad,bracketedPasteMode:_.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:w,originMode:_.origin,reverseWraparoundMode:_.reverseWraparound,sendFocusMode:_.sendFocus,wraparoundMode:_.wraparound}}get options(){return this._publicOptions}set options(_){for(const w in _)this._publicOptions[w]=_[w]}blur(){this._core.blur()}focus(){this._core.focus()}input(_,w=!0){this._core.input(_,w)}resize(_,w){this._verifyIntegers(_,w),this._core.resize(_,w)}open(_){this._core.open(_)}attachCustomKeyEventHandler(_){this._core.attachCustomKeyEventHandler(_)}attachCustomWheelEventHandler(_){this._core.attachCustomWheelEventHandler(_)}registerLinkProvider(_){return this._core.registerLinkProvider(_)}registerCharacterJoiner(_){return this._checkProposedApi(),this._core.registerCharacterJoiner(_)}deregisterCharacterJoiner(_){this._checkProposedApi(),this._core.deregisterCharacterJoiner(_)}registerMarker(_=0){return this._verifyIntegers(_),this._core.registerMarker(_)}registerDecoration(_){return this._checkProposedApi(),this._verifyPositiveIntegers(_.x??0,_.width??0,_.height??0),this._core.registerDecoration(_)}hasSelection(){return this._core.hasSelection()}select(_,w,y){this._verifyIntegers(_,w,y),this._core.select(_,w,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(_,w){this._verifyIntegers(_,w),this._core.selectLines(_,w)}dispose(){super.dispose()}scrollLines(_){this._verifyIntegers(_),this._core.scrollLines(_)}scrollPages(_){this._verifyIntegers(_),this._core.scrollPages(_)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(_){this._verifyIntegers(_),this._core.scrollToLine(_)}clear(){this._core.clear()}write(_,w){this._core.write(_,w)}writeln(_,w){this._core.write(_),this._core.write(`\r -`,w)}paste(_){this._core.paste(_)}refresh(_,w){this._verifyIntegers(_,w),this._core.refresh(_,w)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(_){this._addonManager.loadAddon(this,_)}static get strings(){return l}_verifyIntegers(..._){for(const w of _)if(w===1/0||isNaN(w)||w%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(..._){for(const w of _)if(w&&(w===1/0||isNaN(w)||w%1!=0||w<0))throw new Error("This API only accepts positive integers")}}o.Terminal=S})(),a})()))})(ob)),ob.exports}var JK=QK();function k7(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r{const n=t.current;if(!n)return;const r=new JK.Terminal({convertEol:!0,disableStdin:!0,fontSize:12,fontFamily:getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:"#1a1a1a",foreground:"#e6e1e0",cursor:"#1a1a1a",selectionBackground:"#2c3441"}}),i=new ZK.FitAddon;r.loadAddon(i),r.open(n);try{i.fit()}catch{}const a=new ResizeObserver(()=>{try{i.fit()}catch{}});a.observe(n);let o=!1,l=0,u=!1,d=!1;async function m(){if(u){d=!0;return}u=!0;try{for(;;){const g=await DR(e,l);if(o)return;if(g.dataBase64&&r.write(k7(g.dataBase64)),l=g.nextOffset,g.eof)break}}catch{}finally{u=!1,d&&!o&&(d=!1,m())}}const f=XD(e,g=>{if(o)return;const b=k7(g.dataBase64);!u&&g.offset===l?(r.write(b),l+=b.length):g.offset+b.length>l&&m()});return m(),()=>{o=!0,f(),a.disconnect(),r.dispose()}},[e]),h.jsx("div",{ref:t,style:{width:"100%",height:"100%"}})}function tZ({experiment:e,project:t,view:n,runs:r,selectedRunId:i,onSelectRun:a,parentExperiment:o,onOpenView:l,onOpenCode:u}){const d=r.filter(m=>m.experimentId===e.id).sort((m,f)=>f.createdAt-m.createdAt);return n==="overview"?h.jsx(XK,{experiment:e,parentExperiment:o,project:t,runs:d,onOpenLogs:m=>l("terminal",m),onOpenCode:()=>u("files")}):h.jsx(nZ,{experiment:e,expRuns:d,selectedRunId:i,onSelectRun:a})}function nZ({experiment:e,expRuns:t,selectedRunId:n,onSelectRun:r}){const[i,a]=R.useState(null),[o,l]=R.useState(null),[u,d]=R.useState(!1),m=R.useRef(null),f=n&&t.find(_=>_.id===n)||t[0]||null,g=(f==null?void 0:f.status)==="running"||(f==null?void 0:f.status)==="starting",b=!!(f&&g&&(f.cancelRequested||o===f.id)),k=_=>{const w=t.findIndex(y=>y.id===_);return w===-1?t.length:t.length-w},S=R.useRef(null);R.useEffect(()=>{if(S.current===null){S.current=new Set(t.map(w=>w.id));return}const _=t.find(w=>!S.current.has(w.id));for(const w of t)S.current.add(w.id);_&&r(_.id)},[t,r]),R.useEffect(()=>{if(!u)return;const _=w=>{var y;(y=m.current)!=null&&y.contains(w.target)||d(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[u]);async function x(){if(f){a(null),l(f.id);try{await pS(f.id)}catch(_){l(null),a(_ instanceof Error?_.message:String(_))}}}return h.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[h.jsxs("div",{className:"term-bar flex items-center gap-2 h-10 py-0 px-2.5 border-b border-b-border shrink-0 [&_.error]:text-sm [&_.error]:text-accent-red [&_.btn]:inline-flex [&_.btn]:items-center [&_.btn]:gap-[5px]",children:[h.jsx("div",{className:"term-title min-w-0 text-md font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),h.jsx("span",{style:{flex:1}}),i&&h.jsx("span",{className:"error",role:"alert",children:i}),g&&h.jsxs("button",{className:`${rr} ghost`,disabled:b,onClick:()=>void x(),children:[h.jsx(K8,{size:13}),b?"Cancelling…":"Stop"]}),t.length>0&&f&&h.jsxs("div",{className:"run-history relative shrink-0",ref:m,children:[h.jsxs("button",{className:"run-picker inline-flex items-center gap-2 pt-1 pr-1.5 pb-1 pl-2.5 border border-border rounded-md bg-background text-text [&:hover]:bg-surface [&_.run-label]:text-sm [&_.run-label]:font-semibold",title:"Switch run",onClick:()=>d(_=>!_),children:[h.jsxs("span",{className:"run-label",children:["Run ",k(f.id)]}),h.jsx(La,{status:b?"cancelling":ls(f)}),h.jsx(zl,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),u&&h.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] right-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] p-[5px] z-50",children:t.map(_=>h.jsxs("button",{className:`history-item flex items-center gap-2 w-full text-left py-1.5 px-2 text-sm rounded-sm [&:hover]:bg-surface [&.active]:bg-surface [&_.run-label]:font-semibold [&_.when]:ml-auto [&_.when]:text-xs [&_.when]:text-muted ${_.id===(f==null?void 0:f.id)?"active":""}`,onClick:()=>{r(_.id),d(!1)},children:[h.jsxs("span",{className:"run-label",children:["Run ",k(_.id)]}),h.jsx(La,{status:ls(_)}),h.jsx("span",{className:"when",children:Zs(_.createdAt)})]},_.id))})]})]}),h.jsx("div",{className:"term-fill flex-1 min-h-0 bg-[var(--term-bg)] pt-1 pr-0 pb-1 pl-1.5",children:f?h.jsx(eZ,{runId:f.id},f.id):h.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-md text-muted",children:"No runs yet — ask the agent to launch one."})})]})}function rZ({value:e,onChange:t,onSave:n,onBlur:r,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:l}){const u=R.useMemo(()=>T2(e,J_(i)),[e,i]),d=e?e.split(` -`).length:1,m=R.useRef(null),f=R.useRef(null),g=R.useRef(null),b=()=>{const S=m.current;S&&(f.current&&(f.current.scrollTop=S.scrollTop,f.current.scrollLeft=S.scrollLeft),g.current&&(g.current.scrollTop=S.scrollTop))};R.useLayoutEffect(b,[e]),R.useLayoutEffect(()=>{const S=m.current;if(!S||!a)return;const x=getComputedStyle(S),_=Number.parseFloat(x.paddingTop)||0,w=Number.parseFloat(x.lineHeight)||0,y=Math.min(Math.max(Math.trunc(a),1),d),C=e.split(` -`);let T=0;for(let E=0;E{if((S.metaKey||S.ctrlKey)&&S.key.toLowerCase()==="s"){S.preventDefault(),n();return}if(S.key==="Tab"){S.preventDefault();const x=S.currentTarget,{selectionStart:_,selectionEnd:w}=x,y=e.slice(0,_)+" "+e.slice(w);t(y),requestAnimationFrame(()=>{x.selectionStart=x.selectionEnd=_+1})}};return h.jsxs("div",{className:"file-view-editwrap flex items-stretch h-full min-h-0 relative",children:[h.jsx("pre",{ref:g,className:"file-view-gutter m-0 pt-3.5 pb-3.5 font-mono text-sm leading-[1.55] pl-3.5 pr-2.5 text-right text-muted select-none bg-background border-r border-r-border-variant shrink-0 overflow-hidden","aria-hidden":"true",children:Array.from({length:d},(S,x)=>x+1).join(` -`)}),h.jsxs("div",{className:"relative flex-1 min-w-0",children:[h.jsx("pre",{ref:f,className:"file-view-code absolute inset-0 m-0 pt-3.5 pb-3.5 font-mono text-sm leading-[1.55] pl-4 pr-4 [tab-size:4] whitespace-pre overflow-hidden pointer-events-none","aria-hidden":"true",children:h.jsx("code",{children:u})}),h.jsx("textarea",{ref:m,className:"file-view-editarea absolute inset-0 m-0 pt-3.5 pb-3.5 font-mono text-sm leading-[1.55] pl-4 pr-4 [tab-size:4] whitespace-pre overflow-auto resize-none border-0 bg-transparent text-transparent caret-[var(--text)] outline-none",value:e,onChange:S=>t(S.target.value),onScroll:b,onKeyDown:k,onBlur:r,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",wrap:"off"})]})]})}function iZ({projectId:e,path:t,source:n="repo",sessionId:r,gitRef:i,line:a,branchLabel:o,onOpenFile:l,scrollPosition:u,onScrollPositionChange:d,lineScrollRequest:m,onLineScrollRequestHandled:f,onEdit:g}){const[b,k]=R.useState(null),[S,x]=R.useState(null),[_,w]=R.useState(!0),[y,C]=R.useState(0),T=n==="artifacts",E=n==="abs",j=X2(t),N=t.split("/").slice(0,-1).join("/"),[D,z]=R.useState(!1),[$,F]=R.useState(""),[U,V]=R.useState(!1),[X,Y]=R.useState(null),Q=R.useRef(null),te=R.useRef(u),I=(b==null?void 0:b.file)??null,O=(b==null?void 0:b.source)==="checkout"?b.file.path:t,H=gE(I==null?void 0:I.presentation),G=(b==null?void 0:b.source)==="artifact"&&!T,W=T&&(b==null?void 0:b.source)==="checkout",re=(b==null?void 0:b.source)==="artifact",ce=!i&&(b==null?void 0:b.source)==="checkout"&&I!=null&&!I.notFound,pe=ce&&I!=null&&!I.binary&&!I.truncated&&!H&&!(r!=null&&(b==null?void 0:b.source)==="checkout"&&b.file.root==="clone"),ne=pe&&!(j&&!D),B=R.useMemo(()=>((I==null?void 0:I.content)??"").replace(/\r\n/g,` -`),[I==null?void 0:I.content]),se=pe&&$!==B,oe=R.useRef(null);R.useEffect(()=>{const qe=(I==null?void 0:I.content)??"";if(oe.current!==null&&qe===oe.current){oe.current=null;return}F(qe.replace(/\r\n/g,` -`)),Y(null)},[I==null?void 0:I.content,t]);const _e=async()=>{if(!pe||I==null||!se||U)return;const qe=I.content.includes(`\r +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(T){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.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 D=this._getMouseBufferCoords(T),z=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!!(z&&$&&D)&&this._areCoordsInSelection(D,z,$)}isCellInSelection(T,D){const z=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!(!z||!$)&&this._areCoordsInSelection([T,D],z,$)}_areCoordsInSelection(T,D,z){return T[1]>D[1]&&T[1]=D[0]&&T[0]=D[0]}_selectWordAtCursor(T,D){var F,U;const z=(U=(F=this._linkifier.currentLink)==null?void 0:F.link)==null?void 0:U.range;if(z)return this._model.selectionStart=[z.start.x-1,z.start.y-1],this._model.selectionStartLength=(0,w.getRangeLength)(z,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const $=this._getMouseBufferCoords(T);return!!$&&(this._selectWordAt($,D),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,D){this._model.clearSelection(),T=Math.max(T,0),D=Math.min(D,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,D],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const D=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(D)return D[0]--,D[1]--,D[1]+=this._bufferService.buffer.ydisp,D}_getMouseEventScrollAmount(T){let D=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const z=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=z?0:(D>z&&(D-=z),D=Math.min(Math.max(D,-50),50),D/=50,D/Math.abs(D)+Math.round(14*D))}shouldForceSelection(T){return v.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 D=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);D&&D.length!==this._model.selectionStart[0]&&D.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const D=this._getMouseBufferCoords(T);D&&(this._activeSelectionMode=2,this._selectLineAt(D[1]))}shouldColumnSelect(T){return T.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.stopImmediatePropagation(),!this._model.selectionStart)return;const D=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]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const z=this._bufferService.buffer;if(this._model.selectionEnd[1]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 D=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&D<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const z=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(z&&z[0]!==void 0&&z[1]!==void 0){const $=(0,g.moveToCellSequence)(z[0]-1,z[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent($,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,D=this._model.finalSelectionEnd,z=!(!T||!D||T[0]===D[0]&&T[1]===D[1]);z?T&&D&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&D[0]===this._oldSelectionEnd[0]&&D[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,D,z)):this._oldHasSelection&&this._fireOnSelectionChange(T,D,z)}_fireOnSelectionChange(T,D,z){this._oldSelectionStart=T,this._oldSelectionEnd=D,this._oldHasSelection=z,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((D=>this._handleTrim(D)))}_convertViewportColToCharacterIndex(T,D){let z=D;for(let $=0;D>=$;$++){const F=T.loadCell($,this._workCell).getChars().length;this._workCell.getWidth()===0?z--:F>1&&D!==$&&(z+=F-1)}return z}setSelection(T,D,z){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,D],this._model.selectionStartLength=z,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,D,z=!0,$=!0){if(T[0]>=this._bufferService.cols)return;const F=this._bufferService.buffer,U=F.lines.get(T[1]);if(!U)return;const V=F.translateBufferLineToString(T[1],!1);let X=this._convertViewportColToCharacterIndex(U,T[0]),Y=X;const Q=T[0]-X;let te=0,I=0,O=0,H=0;if(V.charAt(X)===" "){for(;X>0&&V.charAt(X-1)===" ";)X--;for(;Y1&&(H+=me-1,Y+=me-1);re>0&&X>0&&!this._isCharWordSeparator(U.loadCell(re-1,this._workCell));){U.loadCell(re-1,this._workCell);const ne=this._workCell.getChars().length;this._workCell.getWidth()===0?(te++,re--):ne>1&&(O+=ne-1,X-=ne-1),X--,re--}for(;ce1&&(H+=ne-1,Y+=ne-1),Y++,ce++}}Y++;let G=X+Q-te+O,W=Math.min(this._bufferService.cols,Y-X+te+I-O-H);if(D||V.slice(X,Y).trim()!==""){if(z&&G===0&&U.getCodePoint(0)!==32){const re=F.lines.get(T[1]-1);if(re&&U.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(ce){const me=this._bufferService.cols-ce.start;G-=me,W+=me}}}if($&&G+W===this._bufferService.cols&&U.getCodePoint(this._bufferService.cols-1)!==32){const re=F.lines.get(T[1]+1);if(re!=null&&re.isWrapped&&re.getCodePoint(0)!==32){const ce=this._getWordAt([0,T[1]+1],!1,!1,!0);ce&&(W+=ce.length)}}return{start:G,length:W}}}_selectWordAt(T,D){const z=this._getWordAt(T,D);if(z){for(;z.start<0;)z.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[z.start,T[1]],this._model.selectionStartLength=z.length}}_selectToWordAt(T){const D=this._getWordAt(T,!0);if(D){let z=T[1];for(;D.start<0;)D.start+=this._bufferService.cols,z--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,z++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,z]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const D=this._bufferService.buffer.getWrappedRangeForLine(T),z={start:{x:0,y:D.first},end:{x:this._bufferService.cols-1,y:D.last}};this._model.selectionStart=[0,D.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,w.getRangeLength)(z,this._bufferService.cols)}};l.SelectionService=M=d([m(3,C.IBufferService),m(4,C.ICoreService),m(5,k.IMouseService),m(6,C.IOptionsService),m(7,k.IRenderService),m(8,k.ICoreBrowserService)],M)},4725:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const d=c(8343);l.ICharSizeService=(0,d.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),l.IMouseService=(0,d.createDecorator)("MouseService"),l.IRenderService=(0,d.createDecorator)("RenderService"),l.ISelectionService=(0,d.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,d.createDecorator)("ThemeService"),l.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(o,l,c){var d=this&&this.__decorate||function(M,T,D,z){var $,F=arguments.length,U=F<3?T:z===null?z=Object.getOwnPropertyDescriptor(T,D):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(M,T,D,z);else for(var V=M.length-1;V>=0;V--)($=M[V])&&(U=(F<3?$(U):F>3?$(T,D,U):$(T,D))||U);return F>3&&U&&Object.defineProperty(T,D,U),U},m=this&&this.__param||function(M,T){return function(D,z){T(D,z,M)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const f=c(7239),g=c(8055),b=c(8460),k=c(844),S=c(2585),x=g.css.toColor("#ffffff"),v=g.css.toColor("#000000"),w=g.css.toColor("#ffffff"),y=g.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],T=[0,95,135,175,215,255];for(let D=0;D<216;D++){const z=T[D/36%6|0],$=T[D/6%6|0],F=T[D%6];M.push({css:g.channels.toCss(z,$,F),rgba:g.channels.toRgba(z,$,F)})}for(let D=0;D<24;D++){const z=8+10*D;M.push({css:g.channels.toCss(z,z,z),rgba:g.channels.toRgba(z,z,z)})}return M})());let N=l.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:x,background:v,cursor:w,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:g.color.blend(v,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:g.color.blend(v,C),ansi:l.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(M={}){const T=this._colors;if(T.foreground=E(M.foreground,x),T.background=E(M.background,v),T.cursor=E(M.cursor,w),T.cursorAccent=E(M.cursorAccent,y),T.selectionBackgroundTransparent=E(M.selectionBackground,C),T.selectionBackgroundOpaque=g.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=E(M.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=g.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=M.selectionForeground?E(M.selectionForeground,g.NULL_COLOR):void 0,T.selectionForeground===g.NULL_COLOR&&(T.selectionForeground=void 0),g.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=g.color.opacity(T.selectionBackgroundTransparent,.3)),g.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=g.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=l.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=E(M.black,l.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=E(M.red,l.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=E(M.green,l.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=E(M.yellow,l.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=E(M.blue,l.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=E(M.magenta,l.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=E(M.cyan,l.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=E(M.white,l.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=E(M.brightBlack,l.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=E(M.brightRed,l.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=E(M.brightGreen,l.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=E(M.brightYellow,l.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=E(M.brightBlue,l.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=E(M.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=E(M.brightCyan,l.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=E(M.brightWhite,l.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const D=Math.min(T.ansi.length-16,M.extendedAnsi.length);for(let z=0;z{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const d=c(8460),m=c(844);class f extends m.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.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(b){if(this._maxLength===b)return;const k=new Array(b);for(let S=0;Sthis._length)for(let k=this._length;k=b;x--)this._array[this._getCyclicIndex(x+S.length)]=this._array[this._getCyclicIndex(x)];for(let x=0;xthis._maxLength){const x=this._length+S.length-this._maxLength;this._startIndex+=x,this._length=this._maxLength,this.onTrimEmitter.fire(x)}else this._length+=S.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,k,S){if(!(k<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let v=k-1;v>=0;v--)this.set(b+v+S,this.get(b+v));const x=b+k+S-this._length;if(x>0)for(this._length+=x;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let x=0;x{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function c(d,m=5){if(typeof d!="object")return d;const f=Array.isArray(d)?[]:{};for(const g in d)f[g]=m<=1?d[g]:d[g]&&c(d[g],m-1);return f}},8055:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let c=0,d=0,m=0,f=0;var g,b,k,S,x;function v(y){const C=y.toString(16);return C.length<2?"0"+C:C}function w(y,C){return y>>0},y.toColor=function(C,N,E,M){return{css:y.toCss(C,N,E,M),rgba:y.toRgba(C,N,E,M)}}})(g||(l.channels=g={})),(function(y){function C(N,E){return f=Math.round(255*E),[c,d,m]=x.toChannels(N.rgba),{css:g.toCss(c,d,m,f),rgba:g.toRgba(c,d,m,f)}}y.blend=function(N,E){if(f=(255&E.rgba)/255,f===1)return{css:E.css,rgba:E.rgba};const M=E.rgba>>24&255,T=E.rgba>>16&255,D=E.rgba>>8&255,z=N.rgba>>24&255,$=N.rgba>>16&255,F=N.rgba>>8&255;return c=z+Math.round((M-z)*f),d=$+Math.round((T-$)*f),m=F+Math.round((D-F)*f),{css:g.toCss(c,d,m),rgba:g.toRgba(c,d,m)}},y.isOpaque=function(N){return(255&N.rgba)==255},y.ensureContrastRatio=function(N,E,M){const T=x.ensureContrastRatio(N.rgba,E.rgba,M);if(T)return g.toColor(T>>24&255,T>>16&255,T>>8&255)},y.opaque=function(N){const E=(255|N.rgba)>>>0;return[c,d,m]=x.toChannels(E),{css:g.toCss(c,d,m),rgba:E}},y.opacity=C,y.multiplyOpacity=function(N,E){return f=255&N.rgba,C(N,f*E/255)},y.toColorRGB=function(N){return[N.rgba>>24&255,N.rgba>>16&255,N.rgba>>8&255]}})(b||(l.color=b={})),(function(y){let C,N;try{const E=document.createElement("canvas");E.width=1,E.height=1;const M=E.getContext("2d",{willReadFrequently:!0});M&&(C=M,C.globalCompositeOperation="copy",N=C.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(E){if(E.match(/#[\da-f]{3,8}/i))switch(E.length){case 4:return c=parseInt(E.slice(1,2).repeat(2),16),d=parseInt(E.slice(2,3).repeat(2),16),m=parseInt(E.slice(3,4).repeat(2),16),g.toColor(c,d,m);case 5:return c=parseInt(E.slice(1,2).repeat(2),16),d=parseInt(E.slice(2,3).repeat(2),16),m=parseInt(E.slice(3,4).repeat(2),16),f=parseInt(E.slice(4,5).repeat(2),16),g.toColor(c,d,m,f);case 7:return{css:E,rgba:(parseInt(E.slice(1),16)<<8|255)>>>0};case 9:return{css:E,rgba:parseInt(E.slice(1),16)>>>0}}const M=E.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return c=parseInt(M[1]),d=parseInt(M[2]),m=parseInt(M[3]),f=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),g.toColor(c,d,m,f);if(!C||!N)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=N,C.fillStyle=E,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[c,d,m,f]=C.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(c,d,m,f),css:E}}})(k||(l.css=k={})),(function(y){function C(N,E,M){const T=N/255,D=E/255,z=M/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.0722*(z<=.03928?z/12.92:Math.pow((z+.055)/1.055,2.4))}y.relativeLuminance=function(N){return C(N>>16&255,N>>8&255,255&N)},y.relativeLuminance2=C})(S||(l.rgb=S={})),(function(y){function C(E,M,T){const D=E>>24&255,z=E>>16&255,$=E>>8&255;let F=M>>24&255,U=M>>16&255,V=M>>8&255,X=w(S.relativeLuminance2(F,U,V),S.relativeLuminance2(D,z,$));for(;X0||U>0||V>0);)F-=Math.max(0,Math.ceil(.1*F)),U-=Math.max(0,Math.ceil(.1*U)),V-=Math.max(0,Math.ceil(.1*V)),X=w(S.relativeLuminance2(F,U,V),S.relativeLuminance2(D,z,$));return(F<<24|U<<16|V<<8|255)>>>0}function N(E,M,T){const D=E>>24&255,z=E>>16&255,$=E>>8&255;let F=M>>24&255,U=M>>16&255,V=M>>8&255,X=w(S.relativeLuminance2(F,U,V),S.relativeLuminance2(D,z,$));for(;X>>0}y.blend=function(E,M){if(f=(255&M)/255,f===1)return M;const T=M>>24&255,D=M>>16&255,z=M>>8&255,$=E>>24&255,F=E>>16&255,U=E>>8&255;return c=$+Math.round((T-$)*f),d=F+Math.round((D-F)*f),m=U+Math.round((z-U)*f),g.toRgba(c,d,m)},y.ensureContrastRatio=function(E,M,T){const D=S.relativeLuminance(E>>8),z=S.relativeLuminance(M>>8);if(w(D,z)>8));if(Vw(D,S.relativeLuminance(X>>8))?U:X}return U}const $=N(E,M,T),F=w(D,S.relativeLuminance($>>8));if(Fw(D,S.relativeLuminance(U>>8))?$:U}return $}},y.reduceLuminance=C,y.increaseLuminance=N,y.toChannels=function(E){return[E>>24&255,E>>16&255,E>>8&255,255&E]}})(x||(l.rgba=x={})),l.toPaddedHex=v,l.contrastRatio=w},8969:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const d=c(844),m=c(2585),f=c(4348),g=c(7866),b=c(744),k=c(7302),S=c(6975),x=c(8460),v=c(1753),w=c(1480),y=c(7994),C=c(9282),N=c(5435),E=c(5981),M=c(2660);let T=!1;class D extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new x.EventEmitter),this._onScroll.event(($=>{var F;(F=this._onScrollApi)==null||F.fire($.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($){for(const F in $)this.optionsService.options[F]=$[F]}constructor($){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new x.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new x.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new x.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new x.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new x.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new x.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new k.OptionsService($)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(w.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new N.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,x.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,x.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,x.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,x.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((F=>{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((F=>{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 E.WriteBuffer(((F,U)=>this._inputHandler.parse(F,U)))),this.register((0,x.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write($,F){this._writeBuffer.write($,F)}writeSync($,F){this._logService.logLevel<=m.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync($,F)}input($,F=!0){this.coreService.triggerDataEvent($,F)}resize($,F){isNaN($)||isNaN(F)||($=Math.max($,b.MINIMUM_COLS),F=Math.max(F,b.MINIMUM_ROWS),this._bufferService.resize($,F))}scroll($,F=!1){this._bufferService.scroll($,F)}scrollLines($,F,U){this._bufferService.scrollLines($,F,U)}scrollPages($){this.scrollLines($*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine($){const F=$-this._bufferService.buffer.ydisp;F!==0&&this.scrollLines(F)}registerEscHandler($,F){return this._inputHandler.registerEscHandler($,F)}registerDcsHandler($,F){return this._inputHandler.registerDcsHandler($,F)}registerCsiHandler($,F){return this._inputHandler.registerCsiHandler($,F)}registerOscHandler($,F){return this._inputHandler.registerOscHandler($,F)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let $=!1;const F=this.optionsService.rawOptions.windowsPty;F&&F.buildNumber!==void 0&&F.buildNumber!==void 0?$=F.backend==="conpty"&&F.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&($=!0),$?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const $=[];$.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),$.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const F of $)F.dispose()}))}}}l.CoreTerminal=D},8460:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.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 d=0;dd.fire(m)))},l.runAndSubscribe=function(c,d){return d(void 0),c((m=>d(m)))}},5435:function(o,l,c){var d=this&&this.__decorate||function(te,I,O,H){var G,W=arguments.length,re=W<3?I:H===null?H=Object.getOwnPropertyDescriptor(I,O):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(te,I,O,H);else for(var ce=te.length-1;ce>=0;ce--)(G=te[ce])&&(re=(W<3?G(re):W>3?G(I,O,re):G(I,O))||re);return W>3&&re&&Object.defineProperty(I,O,re),re},m=this&&this.__param||function(te,I){return function(O,H){I(O,H,te)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const f=c(2584),g=c(7116),b=c(2015),k=c(844),S=c(482),x=c(8437),v=c(8460),w=c(643),y=c(511),C=c(3734),N=c(2585),E=c(1480),M=c(6242),T=c(6351),D=c(5941),z={"(":0,")":1,"*":2,"+":3,"-":1,".":2},$=131072;function F(te,I){if(te>24)return I.setWinLines||!1;switch(te){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var U;(function(te){te[te.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",te[te.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(U||(l.WindowsOptionsReportType=U={}));let V=0;class X extends k.Disposable{getAttrData(){return this._curAttrData}constructor(I,O,H,G,W,re,ce,me,ne=new b.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=O,this._coreService=H,this._logService=G,this._optionsService=W,this._oscLinkService=re,this._coreMouseService=ce,this._unicodeService=me,this._parser=ne,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=x.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=x.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new v.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new v.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new v.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new v.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new v.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new v.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new v.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new v.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new v.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new v.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 Y(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._parser.setCsiHandlerFallback(((B,se)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(B),params:se.toArray()})})),this._parser.setEscHandlerFallback((B=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(B)})})),this._parser.setExecuteHandlerFallback((B=>{this._logService.debug("Unknown EXECUTE code: ",{code:B})})),this._parser.setOscHandlerFallback(((B,se,le)=>{this._logService.debug("Unknown OSC code: ",{identifier:B,action:se,data:le})})),this._parser.setDcsHandlerFallback(((B,se,le)=>{se==="HOOK"&&(le=le.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(B),action:se,payload:le})})),this._parser.setPrintHandler(((B,se,le)=>this.print(B,se,le))),this._parser.registerCsiHandler({final:"@"},(B=>this.insertChars(B))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(B=>this.scrollLeft(B))),this._parser.registerCsiHandler({final:"A"},(B=>this.cursorUp(B))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(B=>this.scrollRight(B))),this._parser.registerCsiHandler({final:"B"},(B=>this.cursorDown(B))),this._parser.registerCsiHandler({final:"C"},(B=>this.cursorForward(B))),this._parser.registerCsiHandler({final:"D"},(B=>this.cursorBackward(B))),this._parser.registerCsiHandler({final:"E"},(B=>this.cursorNextLine(B))),this._parser.registerCsiHandler({final:"F"},(B=>this.cursorPrecedingLine(B))),this._parser.registerCsiHandler({final:"G"},(B=>this.cursorCharAbsolute(B))),this._parser.registerCsiHandler({final:"H"},(B=>this.cursorPosition(B))),this._parser.registerCsiHandler({final:"I"},(B=>this.cursorForwardTab(B))),this._parser.registerCsiHandler({final:"J"},(B=>this.eraseInDisplay(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(B=>this.eraseInDisplay(B,!0))),this._parser.registerCsiHandler({final:"K"},(B=>this.eraseInLine(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(B=>this.eraseInLine(B,!0))),this._parser.registerCsiHandler({final:"L"},(B=>this.insertLines(B))),this._parser.registerCsiHandler({final:"M"},(B=>this.deleteLines(B))),this._parser.registerCsiHandler({final:"P"},(B=>this.deleteChars(B))),this._parser.registerCsiHandler({final:"S"},(B=>this.scrollUp(B))),this._parser.registerCsiHandler({final:"T"},(B=>this.scrollDown(B))),this._parser.registerCsiHandler({final:"X"},(B=>this.eraseChars(B))),this._parser.registerCsiHandler({final:"Z"},(B=>this.cursorBackwardTab(B))),this._parser.registerCsiHandler({final:"`"},(B=>this.charPosAbsolute(B))),this._parser.registerCsiHandler({final:"a"},(B=>this.hPositionRelative(B))),this._parser.registerCsiHandler({final:"b"},(B=>this.repeatPrecedingCharacter(B))),this._parser.registerCsiHandler({final:"c"},(B=>this.sendDeviceAttributesPrimary(B))),this._parser.registerCsiHandler({prefix:">",final:"c"},(B=>this.sendDeviceAttributesSecondary(B))),this._parser.registerCsiHandler({final:"d"},(B=>this.linePosAbsolute(B))),this._parser.registerCsiHandler({final:"e"},(B=>this.vPositionRelative(B))),this._parser.registerCsiHandler({final:"f"},(B=>this.hVPosition(B))),this._parser.registerCsiHandler({final:"g"},(B=>this.tabClear(B))),this._parser.registerCsiHandler({final:"h"},(B=>this.setMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(B=>this.setModePrivate(B))),this._parser.registerCsiHandler({final:"l"},(B=>this.resetMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(B=>this.resetModePrivate(B))),this._parser.registerCsiHandler({final:"m"},(B=>this.charAttributes(B))),this._parser.registerCsiHandler({final:"n"},(B=>this.deviceStatus(B))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(B=>this.deviceStatusPrivate(B))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(B=>this.softReset(B))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(B=>this.setCursorStyle(B))),this._parser.registerCsiHandler({final:"r"},(B=>this.setScrollRegion(B))),this._parser.registerCsiHandler({final:"s"},(B=>this.saveCursor(B))),this._parser.registerCsiHandler({final:"t"},(B=>this.windowOptions(B))),this._parser.registerCsiHandler({final:"u"},(B=>this.restoreCursor(B))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(B=>this.insertColumns(B))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(B=>this.deleteColumns(B))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(B=>this.selectProtected(B))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(B=>this.requestMode(B,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(B=>this.requestMode(B,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler((B=>(this.setTitle(B),this.setIconName(B),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((B=>this.setIconName(B)))),this._parser.registerOscHandler(2,new M.OscHandler((B=>this.setTitle(B)))),this._parser.registerOscHandler(4,new M.OscHandler((B=>this.setOrReportIndexedColor(B)))),this._parser.registerOscHandler(8,new M.OscHandler((B=>this.setHyperlink(B)))),this._parser.registerOscHandler(10,new M.OscHandler((B=>this.setOrReportFgColor(B)))),this._parser.registerOscHandler(11,new M.OscHandler((B=>this.setOrReportBgColor(B)))),this._parser.registerOscHandler(12,new M.OscHandler((B=>this.setOrReportCursorColor(B)))),this._parser.registerOscHandler(104,new M.OscHandler((B=>this.restoreIndexedColor(B)))),this._parser.registerOscHandler(110,new M.OscHandler((B=>this.restoreFgColor(B)))),this._parser.registerOscHandler(111,new M.OscHandler((B=>this.restoreBgColor(B)))),this._parser.registerOscHandler(112,new M.OscHandler((B=>this.restoreCursorColor(B)))),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 B in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:B},(()=>this.selectCharset("("+B))),this._parser.registerEscHandler({intermediates:")",final:B},(()=>this.selectCharset(")"+B))),this._parser.registerEscHandler({intermediates:"*",final:B},(()=>this.selectCharset("*"+B))),this._parser.registerEscHandler({intermediates:"+",final:B},(()=>this.selectCharset("+"+B))),this._parser.registerEscHandler({intermediates:"-",final:B},(()=>this.selectCharset("-"+B))),this._parser.registerEscHandler({intermediates:".",final:B},(()=>this.selectCharset("."+B))),this._parser.registerEscHandler({intermediates:"/",final:B},(()=>this.selectCharset("/"+B)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((B=>(this._logService.error("Parsing error: ",B),B))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler(((B,se)=>this.requestStatusString(B,se))))}_preserveStack(I,O,H,G){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=O,this._parseStack.decodedLength=H,this._parseStack.position=G}_logSlowResolvingAsync(I){this._logService.logLevel<=N.LogLevelEnum.WARN&&Promise.race([I,new Promise(((O,H)=>setTimeout((()=>H("#SLOW_TIMEOUT")),5e3)))]).catch((O=>{if(O!=="#SLOW_TIMEOUT")throw O;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,O){let H,G=this._activeBuffer.x,W=this._activeBuffer.y,re=0;const ce=this._parseStack.paused;if(ce){if(H=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,O))return this._logSlowResolvingAsync(H),H;G=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>$&&(re=this._parseStack.position+$)}if(this._logService.logLevel<=N.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(B=>String.fromCharCode(B))).join("")}"`),typeof I=="string"?I.split("").map((B=>B.charCodeAt(0))):I),this._parseBuffer.length$)for(let B=re;B0&&le.getWidth(this._activeBuffer.x-1)===2&&le.setCellFromCodepoint(this._activeBuffer.x-1,0,1,se);let _e=this._parser.precedingJoinState;for(let be=O;beme){if(ne){const Ge=le;let Fe=this._activeBuffer.x-$e;for(this._activeBuffer.x=$e,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),le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),$e>0&&le instanceof x.BufferLine&&le.copyCellsFrom(Ge,Fe,0,$e,!1);Fe=0;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}else if(B&&(le.insertCells(this._activeBuffer.x,W-$e,this._activeBuffer.getNullCell(se)),le.getWidth(me-1)===2&&le.setCellFromCodepoint(me-1,w.NULL_CELL_CODE,w.NULL_CELL_WIDTH,se)),le.setCellFromCodepoint(this._activeBuffer.x++,G,W,se),W>0)for(;--W;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}this._parser.precedingJoinState=_e,this._activeBuffer.x0&&le.getWidth(this._activeBuffer.x)===0&&!le.hasContent(this._activeBuffer.x)&&le.setCellFromCodepoint(this._activeBuffer.x,0,1,se),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,O){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,O):this._parser.registerCsiHandler(I,(H=>!F(H.params[0],this._optionsService.rawOptions.windowOptions)||O(H)))}registerDcsHandler(I,O){return this._parser.registerDcsHandler(I,new T.DcsHandler(O))}registerEscHandler(I,O){return this._parser.registerEscHandler(I,O)}registerOscHandler(I,O){return this._parser.registerOscHandler(I,new M.OscHandler(O))}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 I;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&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);O.hasWidth(this._activeBuffer.x)&&!O.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,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(I,O){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+O):(this._activeBuffer.x=I,this._activeBuffer.y=O),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,O){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+O)}cursorUp(I){const O=this._activeBuffer.y-this._activeBuffer.scrollTop;return O>=0?this._moveCursor(0,-Math.min(O,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const O=this._activeBuffer.scrollBottom-this._activeBuffer.y;return O>=0?this._moveCursor(0,Math.min(O,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const O=I.params[0];return O===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:O===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=I.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=I.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const O=I.params[0];return O===1&&(this._curAttrData.bg|=536870912),O!==2&&O!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,O,H,G=!1,W=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);re.replaceCells(O,H,this._activeBuffer.getNullCell(this._eraseAttrData()),W),G&&(re.isWrapped=!1)}_resetBufferLine(I,O=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);H&&(H.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),O),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),H.isWrapped=!1)}eraseInDisplay(I,O=!1){let H;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(H=this._activeBuffer.y,this._dirtyRowTracker.markDirty(H),this._eraseInBufferLine(H++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);H=this._bufferService.cols&&(this._activeBuffer.lines.get(H+1).isWrapped=!1);H--;)this._resetBufferLine(H,O);this._dirtyRowTracker.markDirty(0);break;case 2:for(H=this._bufferService.rows,this._dirtyRowTracker.markDirty(H-1);H--;)this._resetBufferLine(H,O);this._dirtyRowTracker.markDirty(0);break;case 3:const G=this._activeBuffer.lines.length-this._bufferService.rows;G>0&&(this._activeBuffer.lines.trimStart(G),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-G,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-G,0),this._onScroll.fire(0))}return!0}eraseInLine(I,O=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,O);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,O)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let O=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let ne=me;for(let B=1;B0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let O=0;OLe?1:2,_e=I.params[0];return be=_e,Ce=O?_e===2?4:_e===4?le(re.modes.insertMode):_e===12?3:_e===20?le(se.convertEol):0:_e===1?le(H.applicationCursorKeys):_e===3?se.windowOptions.setWinLines?me===80?2:me===132?1:0:0:_e===6?le(H.origin):_e===7?le(H.wraparound):_e===8?3:_e===9?le(G==="X10"):_e===12?le(se.cursorBlink):_e===25?le(!re.isCursorHidden):_e===45?le(H.reverseWraparound):_e===66?le(H.applicationKeypad):_e===67?4:_e===1e3?le(G==="VT200"):_e===1002?le(G==="DRAG"):_e===1003?le(G==="ANY"):_e===1004?le(H.sendFocus):_e===1005?4:_e===1006?le(W==="SGR"):_e===1015?4:_e===1016?le(W==="SGR_PIXELS"):_e===1048?1:_e===47||_e===1047||_e===1049?le(ne===B):_e===2004?le(H.bracketedPasteMode):0,re.triggerDataEvent(`${f.C0.ESC}[${O?"":"?"}${be};${Ce}$y`),!0;var be,Ce}_updateAttrColor(I,O,H,G,W){return O===2?(I|=50331648,I&=-16777216,I|=C.AttributeData.fromColorRGB([H,G,W])):O===5&&(I&=-50331904,I|=33554432|255&H),I}_extractColor(I,O,H){const G=[0,0,-1,0,0,0];let W=0,re=0;do{if(G[re+W]=I.params[O+re],I.hasSubParams(O+re)){const ce=I.getSubParams(O+re);let me=0;do G[1]===5&&(W=1),G[re+me+1+W]=ce[me];while(++me=2||G[1]===2&&re+W>=5)break;G[1]&&(W=1)}while(++re+O5)&&(I=1),O.extended.underlineStyle=I,O.fg|=268435456,I===0&&(O.fg&=-268435457),O.updateExtended()}_processSGR0(I){I.fg=x.DEFAULT_ATTR_DATA.fg,I.bg=x.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const O=I.length;let H;const G=this._curAttrData;for(let W=0;W=30&&H<=37?(G.fg&=-50331904,G.fg|=16777216|H-30):H>=40&&H<=47?(G.bg&=-50331904,G.bg|=16777216|H-40):H>=90&&H<=97?(G.fg&=-50331904,G.fg|=16777224|H-90):H>=100&&H<=107?(G.bg&=-50331904,G.bg|=16777224|H-100):H===0?this._processSGR0(G):H===1?G.fg|=134217728:H===3?G.bg|=67108864:H===4?(G.fg|=268435456,this._processUnderline(I.hasSubParams(W)?I.getSubParams(W)[0]:1,G)):H===5?G.fg|=536870912:H===7?G.fg|=67108864:H===8?G.fg|=1073741824:H===9?G.fg|=2147483648:H===2?G.bg|=134217728:H===21?this._processUnderline(2,G):H===22?(G.fg&=-134217729,G.bg&=-134217729):H===23?G.bg&=-67108865:H===24?(G.fg&=-268435457,this._processUnderline(0,G)):H===25?G.fg&=-536870913:H===27?G.fg&=-67108865:H===28?G.fg&=-1073741825:H===29?G.fg&=2147483647:H===39?(G.fg&=-67108864,G.fg|=16777215&x.DEFAULT_ATTR_DATA.fg):H===49?(G.bg&=-67108864,G.bg|=16777215&x.DEFAULT_ATTR_DATA.bg):H===38||H===48||H===58?W+=this._extractColor(I,W,G):H===53?G.bg|=1073741824:H===55?G.bg&=-1073741825:H===59?(G.extended=G.extended.clone(),G.extended.underlineColor=-1,G.updateExtended()):H===100?(G.fg&=-67108864,G.fg|=16777215&x.DEFAULT_ATTR_DATA.fg,G.bg&=-67108864,G.bg|=16777215&x.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",H);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const O=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${O};${H}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const O=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${O};${H}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=x.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(I){const O=I.params[0]||1;switch(O){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 H=O%2==1;return this._optionsService.options.cursorBlink=H,!0}setScrollRegion(I){const O=I.params[0]||1;let H;return(I.length<2||(H=I.params[1])>this._bufferService.rows||H===0)&&(H=this._bufferService.rows),H>O&&(this._activeBuffer.scrollTop=O-1,this._activeBuffer.scrollBottom=H-1,this._setCursor(0,0)),!0}windowOptions(I){if(!F(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const O=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:O!==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(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:O!==0&&O!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),O!==0&&O!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:O!==0&&O!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),O!==0&&O!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){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(I){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(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const O=[],H=I.split(";");for(;H.length>1;){const G=H.shift(),W=H.shift();if(/^\d+$/.exec(G)){const re=parseInt(G);if(Q(re))if(W==="?")O.push({type:0,index:re});else{const ce=(0,D.parseColor)(W);ce&&O.push({type:1,index:re,color:ce})}}}return O.length&&this._onColor.fire(O),!0}setHyperlink(I){const O=I.split(";");return!(O.length<2)&&(O[1]?this._createHyperlink(O[0],O[1]):!O[0]&&this._finishHyperlink())}_createHyperlink(I,O){this._getCurrentLinkId()&&this._finishHyperlink();const H=I.split(":");let G;const W=H.findIndex((re=>re.startsWith("id=")));return W!==-1&&(G=H[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:G,uri:O}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,O){const H=I.split(";");for(let G=0;G=this._specialColors.length);++G,++O)if(H[G]==="?")this._onColor.fire([{type:0,index:this._specialColors[O]}]);else{const W=(0,D.parseColor)(H[G]);W&&this._onColor.fire([{type:1,index:this._specialColors[O],color:W}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const O=[],H=I.split(";");for(let G=0;G=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 I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,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=x.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=x.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new y.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let O=0;O(this._coreService.triggerDataEvent(`${f.C0.ESC}${W}${f.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${H.scrollTop+1};${H.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[G.cursorStyle]-(G.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,O){this._dirtyRowTracker.markRangeDirty(I,O)}}l.InputHandler=X;let Y=class{constructor(te){this._bufferService=te,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(te){tethis.end&&(this.end=te)}markRangeDirty(te,I){te>I&&(V=te,te=I,I=V),tethis.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Q(te){return 0<=te&&te<256}Y=d([m(0,N.IBufferService)],Y)},844:(o,l)=>{function c(d){for(const m of d)m.dispose();d.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const m=this._disposables.indexOf(d);m!==-1&&this._disposables.splice(m,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var m;this._isDisposed||d===this._value||((m=this._value)==null||m.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},l.toDisposable=function(d){return{dispose:d}},l.disposeArray=c,l.getDisposeArrayDisposable=function(d){return{dispose:()=>c(d)}}},1505:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(m,f,g){this._data[m]||(this._data[m]={}),this._data[m][f]=g}get(m,f){return this._data[m]?this._data[m][f]:void 0}clear(){this._data={}}}l.TwoKeyMap=c,l.FourKeyMap=class{constructor(){this._data=new c}set(d,m,f,g,b){this._data.get(d,m)||this._data.set(d,m,new c),this._data.get(d,m).set(f,g,b)}get(d,m,f,g){var b;return(b=this._data.get(d,m))==null?void 0:b.get(f,g)}clear(){this._data.clear()}}},6114:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const c=l.isNode?"node":navigator.userAgent,d=l.isNode?"node":navigator.platform;l.isFirefox=c.includes("Firefox"),l.isLegacyEdge=c.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(c),l.getSafariVersion=function(){if(!l.isSafari)return 0;const m=c.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),l.isIpad=d==="iPad",l.isIphone=d==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),l.isLinux=d.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(c)},6106:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let c=0;l.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(c=this._search(this._getKey(d)),this._array.splice(c,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const m=this._getKey(d);if(m===void 0||(c=this._search(m),c===-1)||this._getKey(this._array[c])!==m)return!1;do if(this._array[c]===d)return this._array.splice(c,1),!0;while(++c=this._array.length)&&this._getKey(this._array[c])===d))do yield this._array[c];while(++c=this._array.length)&&this._getKey(this._array[c])===d))do m(this._array[c]);while(++c=m;){let g=m+f>>1;const b=this._getKey(this._array[g]);if(b>d)f=g-1;else{if(!(b0&&this._getKey(this._array[g-1])===d;)g--;return g}m=g+1}}return m}}},7226:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const d=c(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),this._start()}flush(){for(;this._iv)return x-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(x-k))}ms`),void this._start();x=v}this.clear()}}class f extends m{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const k=Date.now()+b;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}l.PriorityTaskQueue=f,l.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:f,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const d=c(643);l.updateWindowsModeWrappedState=function(m){const f=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),g=f==null?void 0:f.get(m.cols-1),b=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);b&&g&&(b.isWrapped=g[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&g[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new c;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}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}}l.AttributeData=c;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,g=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=g}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=d},9092:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const d=c(6349),m=c(7226),f=c(3734),g=c(8437),b=c(4634),k=c(511),S=c(643),x=c(4863),v=c(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(w,y,C){this._hasScrollback=w,this._optionsService=y,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(w){return w?(this._nullCell.fg=w.fg,this._nullCell.bg=w.bg,this._nullCell.extended=w.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(w){return w?(this._whitespaceCell.fg=w.fg,this._whitespaceCell.bg=w.bg,this._whitespaceCell.extended=w.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(w,y){return new g.BufferLine(this._bufferService.cols,this.getNullCell(w),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const w=this.ybase+this.y-this.ydisp;return w>=0&&wl.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:y}fillViewportRows(w){if(this.lines.length===0){w===void 0&&(w=g.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(w))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(w,y){const C=this.getNullCell(g.DEFAULT_ATTR_DATA);let N=0;const E=this._getCorrectBufferLength(y);if(E>this.lines.maxLength&&(this.lines.maxLength=E),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(w,C)));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(E0&&(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=E}this.x=Math.min(this.x,w-1),this.y=Math.min(this.y,y-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,w-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(w,y),this._cols>w))for(let M=0;M.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let w=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,w=!1);let y=0;for(;this._memoryCleanupPosition100)return!0;return w}get _isReflowEnabled(){const w=this._optionsService.rawOptions.windowsPty;return w&&w.buildNumber?this._hasScrollback&&w.backend==="conpty"&&w.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(w,y){this._cols!==w&&(w>this._cols?this._reflowLarger(w,y):this._reflowSmaller(w,y))}_reflowLarger(w,y){const C=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,w,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(C.length>0){const N=(0,b.reflowLargerCreateNewLayout)(this.lines,C);(0,b.reflowLargerApplyNewLayout)(this.lines,N.layout),this._reflowLargerAdjustViewport(w,y,N.countRemoved)}}_reflowLargerAdjustViewport(w,y,C){const N=this.getNullCell(g.DEFAULT_ATTR_DATA);let E=C;for(;E-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;M--){let T=this.lines.get(M);if(!T||!T.isWrapped&&T.getTrimmedLength()<=w)continue;const D=[T];for(;T.isWrapped&&M>0;)T=this.lines.get(--M),D.unshift(T);const z=this.ybase+this.y;if(z>=M&&z0&&(N.push({start:M+D.length+E,newLines:X}),E+=X.length),D.push(...X);let Y=F.length-1,Q=F[Y];Q===0&&(Y--,Q=F[Y]);let te=D.length-U-1,I=$;for(;te>=0;){const H=Math.min(I,Q);if(D[Y]===void 0)break;if(D[Y].copyCellsFrom(D[te],I-H,Q-H,H,!0),Q-=H,Q===0&&(Y--,Q=F[Y]),I-=H,I===0){te--;const G=Math.max(te,0);I=(0,b.getWrappedLineTrimmedLength)(D,G,this._cols)}}for(let H=0;H0;)this.ybase===0?this.y0){const M=[],T=[];for(let Y=0;Y=0;Y--)if(F&&F.start>z+U){for(let Q=F.newLines.length-1;Q>=0;Q--)this.lines.set(Y--,F.newLines[Q]);Y++,M.push({index:z+1,amount:F.newLines.length}),U+=F.newLines.length,F=N[++$]}else this.lines.set(Y,T[z--]);let V=0;for(let Y=M.length-1;Y>=0;Y--)M[Y].index+=V,this.lines.onInsertEmitter.fire(M[Y]),V+=M[Y].amount;const X=Math.max(0,D+E-this.lines.maxLength);X>0&&this.lines.onTrimEmitter.fire(X)}}translateBufferLineToString(w,y,C=0,N){const E=this.lines.get(w);return E?E.translateToString(y,C,N):""}getWrappedRangeForLine(w){let y=w,C=w;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;C+10;);return w>=this._cols?this._cols-1:w<0?0:w}nextStop(w){for(w==null&&(w=this.x);!this.tabs[++w]&&w=this._cols?this._cols-1:w<0?0:w}clearMarkers(w){this._isClearing=!0;for(let y=0;y{y.line-=C,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((C=>{y.line>=C.index&&(y.line+=C.amount)}))),y.register(this.lines.onDelete((C=>{y.line>=C.index&&y.lineC.index&&(y.line-=C.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(w){this._isClearing||this.markers.splice(this.markers.indexOf(w),1)}}},8437:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const d=c(3734),m=c(511),f=c(643),g=c(482);l.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let b=0;class k{constructor(x,v,w=!1){this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*x);const y=v||m.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let C=0;C>22,2097152&v?this._combined[x].charCodeAt(this._combined[x].length-1):w]}set(x,v){this._data[3*x+1]=v[f.CHAR_DATA_ATTR_INDEX],v[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[x]=v[1],this._data[3*x+0]=2097152|x|v[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*x+0]=v[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(x){return this._data[3*x+0]>>22}hasWidth(x){return 12582912&this._data[3*x+0]}getFg(x){return this._data[3*x+1]}getBg(x){return this._data[3*x+2]}hasContent(x){return 4194303&this._data[3*x+0]}getCodePoint(x){const v=this._data[3*x+0];return 2097152&v?this._combined[x].charCodeAt(this._combined[x].length-1):2097151&v}isCombined(x){return 2097152&this._data[3*x+0]}getString(x){const v=this._data[3*x+0];return 2097152&v?this._combined[x]:2097151&v?(0,g.stringFromCodePoint)(2097151&v):""}isProtected(x){return 536870912&this._data[3*x+2]}loadCell(x,v){return b=3*x,v.content=this._data[b+0],v.fg=this._data[b+1],v.bg=this._data[b+2],2097152&v.content&&(v.combinedData=this._combined[x]),268435456&v.bg&&(v.extended=this._extendedAttrs[x]),v}setCell(x,v){2097152&v.content&&(this._combined[x]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[x]=v.extended),this._data[3*x+0]=v.content,this._data[3*x+1]=v.fg,this._data[3*x+2]=v.bg}setCellFromCodepoint(x,v,w,y){268435456&y.bg&&(this._extendedAttrs[x]=y.extended),this._data[3*x+0]=v|w<<22,this._data[3*x+1]=y.fg,this._data[3*x+2]=y.bg}addCodepointToCell(x,v,w){let y=this._data[3*x+0];2097152&y?this._combined[x]+=(0,g.stringFromCodePoint)(v):2097151&y?(this._combined[x]=(0,g.stringFromCodePoint)(2097151&y)+(0,g.stringFromCodePoint)(v),y&=-2097152,y|=2097152):y=v|4194304,w&&(y&=-12582913,y|=w<<22),this._data[3*x+0]=y}insertCells(x,v,w){if((x%=this.length)&&this.getWidth(x-1)===2&&this.setCellFromCodepoint(x-1,0,1,w),v=0;--C)this.setCell(x+v+C,this.loadCell(x+C,y));for(let C=0;Cthis.length){if(this._data.buffer.byteLength>=4*w)this._data=new Uint32Array(this._data.buffer,0,w);else{const y=new Uint32Array(w);y.set(this._data),this._data=y}for(let y=this.length;y=x&&delete this._combined[E]}const C=Object.keys(this._extendedAttrs);for(let N=0;N=x&&delete this._extendedAttrs[E]}}return this.length=x,4*w*2=0;--x)if(4194303&this._data[3*x+0])return x+(this._data[3*x+0]>>22);return 0}getNoBgTrimmedLength(){for(let x=this.length-1;x>=0;--x)if(4194303&this._data[3*x+0]||50331648&this._data[3*x+2])return x+(this._data[3*x+0]>>22);return 0}copyCellsFrom(x,v,w,y,C){const N=x._data;if(C)for(let M=y-1;M>=0;M--){for(let T=0;T<3;T++)this._data[3*(w+M)+T]=N[3*(v+M)+T];268435456&N[3*(v+M)+2]&&(this._extendedAttrs[w+M]=x._extendedAttrs[v+M])}else for(let M=0;M=v&&(this._combined[T-v+w]=x._combined[T])}}translateToString(x,v,w,y){v=v??0,w=w??this.length,x&&(w=Math.min(w,this.getTrimmedLength())),y&&(y.length=0);let C="";for(;v>22||1}return y&&y.push(v),C}}l.BufferLine=k},4841:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(c,d){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 d*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(o,l)=>{function c(d,m,f){if(m===d.length-1)return d[m].getTrimmedLength();const g=!d[m].hasContent(f-1)&&d[m].getWidth(f-1)===1,b=d[m+1].getWidth(0)===2;return g&&b?f-1:f}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(d,m,f,g,b){const k=[];for(let S=0;S=S&&g0&&(T>y||w[T].getTrimmedLength()===0);T--)M++;M>0&&(k.push(S+w.length-M),k.push(M)),S+=w.length-1}return k},l.reflowLargerCreateNewLayout=function(d,m){const f=[];let g=0,b=m[g],k=0;for(let S=0;Sc(d,w,m))).reduce(((v,w)=>v+w));let k=0,S=0,x=0;for(;xv&&(k-=v,S++);const w=d[S].getWidth(k-1)===2;w&&k--;const y=w?f-1:f;g.push(y),x+=y}return g},l.getWrappedLineTrimmedLength=c},5295:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const d=c(8460),m=c(844),f=c(9092);class g extends m.Disposable{constructor(k,S){super(),this._optionsService=k,this._bufferService=S,this._onBufferActivate=this.register(new d.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 f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.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(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,S){this._normal.resize(k,S),this._alt.resize(k,S),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}l.BufferSet=g},511:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const d=c(482),m=c(643),f=c(3734);class g extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const S=new g;return S.setFromCharData(k),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(k[m.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(k[m.CHAR_DATA_CHAR_INDEX].length===2){const x=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=x&&x<=56319){const v=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(x-55296)+v-56320+65536|k[m.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[m.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=k[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=g},643:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const d=c(8460),m=c(844);class f{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}l.Marker=f,f._nextId=1},7116:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.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:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(o,l)=>{var c,d,m;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=` +`,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(c||(l.C0=c={})),(function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"})(d||(l.C1=d={})),(function(f){f.ST=`${c.ESC}\\`})(m||(l.C1_ESCAPED=m={}))},7399:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const d=c(2584),m={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:["'",'"']};l.evaluateKeyboardEvent=function(f,g,b,k){const S={type:0,cancel:!1,key:void 0},x=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?S.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?S.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?S.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(S.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:S.key=f.ctrlKey?"\b":d.C0.DEL,f.altKey&&(S.key=d.C0.ESC+S.key);break;case 9:if(f.shiftKey){S.key=d.C0.ESC+"[Z";break}S.key=d.C0.HT,S.cancel=!0;break;case 13:S.key=f.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,S.cancel=!0;break;case 27:S.key=d.C0.ESC,f.altKey&&(S.key=d.C0.ESC+d.C0.ESC),S.cancel=!0;break;case 37:if(f.metaKey)break;x?(S.key=d.C0.ESC+"[1;"+(x+1)+"D",S.key===d.C0.ESC+"[1;3D"&&(S.key=d.C0.ESC+(b?"b":"[1;5D"))):S.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(f.metaKey)break;x?(S.key=d.C0.ESC+"[1;"+(x+1)+"C",S.key===d.C0.ESC+"[1;3C"&&(S.key=d.C0.ESC+(b?"f":"[1;5C"))):S.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(f.metaKey)break;x?(S.key=d.C0.ESC+"[1;"+(x+1)+"A",b||S.key!==d.C0.ESC+"[1;3A"||(S.key=d.C0.ESC+"[1;5A")):S.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(f.metaKey)break;x?(S.key=d.C0.ESC+"[1;"+(x+1)+"B",b||S.key!==d.C0.ESC+"[1;3B"||(S.key=d.C0.ESC+"[1;5B")):S.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(S.key=d.C0.ESC+"[2~");break;case 46:S.key=x?d.C0.ESC+"[3;"+(x+1)+"~":d.C0.ESC+"[3~";break;case 36:S.key=x?d.C0.ESC+"[1;"+(x+1)+"H":g?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:S.key=x?d.C0.ESC+"[1;"+(x+1)+"F":g?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:f.shiftKey?S.type=2:f.ctrlKey?S.key=d.C0.ESC+"[5;"+(x+1)+"~":S.key=d.C0.ESC+"[5~";break;case 34:f.shiftKey?S.type=3:f.ctrlKey?S.key=d.C0.ESC+"[6;"+(x+1)+"~":S.key=d.C0.ESC+"[6~";break;case 112:S.key=x?d.C0.ESC+"[1;"+(x+1)+"P":d.C0.ESC+"OP";break;case 113:S.key=x?d.C0.ESC+"[1;"+(x+1)+"Q":d.C0.ESC+"OQ";break;case 114:S.key=x?d.C0.ESC+"[1;"+(x+1)+"R":d.C0.ESC+"OR";break;case 115:S.key=x?d.C0.ESC+"[1;"+(x+1)+"S":d.C0.ESC+"OS";break;case 116:S.key=x?d.C0.ESC+"[15;"+(x+1)+"~":d.C0.ESC+"[15~";break;case 117:S.key=x?d.C0.ESC+"[17;"+(x+1)+"~":d.C0.ESC+"[17~";break;case 118:S.key=x?d.C0.ESC+"[18;"+(x+1)+"~":d.C0.ESC+"[18~";break;case 119:S.key=x?d.C0.ESC+"[19;"+(x+1)+"~":d.C0.ESC+"[19~";break;case 120:S.key=x?d.C0.ESC+"[20;"+(x+1)+"~":d.C0.ESC+"[20~";break;case 121:S.key=x?d.C0.ESC+"[21;"+(x+1)+"~":d.C0.ESC+"[21~";break;case 122:S.key=x?d.C0.ESC+"[23;"+(x+1)+"~":d.C0.ESC+"[23~";break;case 123:S.key=x?d.C0.ESC+"[24;"+(x+1)+"~":d.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(b&&!k||!f.altKey||f.metaKey)!b||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?S.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(S.key=d.C0.US),f.key==="@"&&(S.key=d.C0.NUL)):f.keyCode===65&&(S.type=1);else{const v=m[f.keyCode],w=v==null?void 0:v[f.shiftKey?1:0];if(w)S.key=d.C0.ESC+w;else if(f.keyCode>=65&&f.keyCode<=90){const y=f.ctrlKey?f.keyCode-64:f.keyCode+32;let C=String.fromCharCode(y);f.shiftKey&&(C=C.toUpperCase()),S.key=d.C0.ESC+C}else if(f.keyCode===32)S.key=d.C0.ESC+(f.ctrlKey?d.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let y=f.code.slice(3,4);f.shiftKey||(y=y.toLowerCase()),S.key=d.C0.ESC+y,S.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?S.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?S.key=d.C0.NUL:f.keyCode>=51&&f.keyCode<=55?S.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?S.key=d.C0.DEL:f.keyCode===219?S.key=d.C0.ESC:f.keyCode===220?S.key=d.C0.FS:f.keyCode===221&&(S.key=d.C0.GS)}return S}},482:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},l.utf32ToString=function(c,d=0,m=c.length){let f="";for(let g=d;g65535?(b-=65536,f+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):f+=String.fromCharCode(b)}return f},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,d){const m=c.length;if(!m)return 0;let f=0,g=0;if(this._interim){const b=c.charCodeAt(g++);56320<=b&&b<=57343?d[f++]=1024*(this._interim-55296)+b-56320+65536:(d[f++]=this._interim,d[f++]=b),this._interim=0}for(let b=g;b=m)return this._interim=k,f;const S=c.charCodeAt(b);56320<=S&&S<=57343?d[f++]=1024*(k-55296)+S-56320+65536:(d[f++]=k,d[f++]=S)}else k!==65279&&(d[f++]=k)}return f}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,d){const m=c.length;if(!m)return 0;let f,g,b,k,S=0,x=0,v=0;if(this.interim[0]){let C=!1,N=this.interim[0];N&=(224&N)==192?31:(240&N)==224?15:7;let E,M=0;for(;(E=63&this.interim[++M])&&M<4;)N<<=6,N|=E;const T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,D=T-M;for(;v=m)return 0;if(E=c[v++],(192&E)!=128){v--,C=!0;break}this.interim[M++]=E,N<<=6,N|=63&E}C||(T===2?N<128?v--:d[S++]=N:T===3?N<2048||N>=55296&&N<=57343||N===65279||(d[S++]=N):N<65536||N>1114111||(d[S++]=N)),this.interim.fill(0)}const w=m-4;let y=v;for(;y=m)return this.interim[0]=f,S;if(g=c[y++],(192&g)!=128){y--;continue}if(x=(31&f)<<6|63&g,x<128){y--;continue}d[S++]=x}else if((240&f)==224){if(y>=m)return this.interim[0]=f,S;if(g=c[y++],(192&g)!=128){y--;continue}if(y>=m)return this.interim[0]=f,this.interim[1]=g,S;if(b=c[y++],(192&b)!=128){y--;continue}if(x=(15&f)<<12|(63&g)<<6|63&b,x<2048||x>=55296&&x<=57343||x===65279)continue;d[S++]=x}else if((248&f)==240){if(y>=m)return this.interim[0]=f,S;if(g=c[y++],(192&g)!=128){y--;continue}if(y>=m)return this.interim[0]=f,this.interim[1]=g,S;if(b=c[y++],(192&b)!=128){y--;continue}if(y>=m)return this.interim[0]=f,this.interim[1]=g,this.interim[2]=b,S;if(k=c[y++],(192&k)!=128){y--;continue}if(x=(7&f)<<18|(63&g)<<12|(63&b)<<6|63&k,x<65536||x>1114111)continue;d[S++]=x}}return S}}},225:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const d=c(1480),m=[[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]],f=[[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 g;l.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let b=0;bS[w][1])return!1;for(;w>=v;)if(x=v+w>>1,k>S[x][1])v=x+1;else{if(!(k=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,k){let S=this.wcwidth(b),x=S===0&&k!==0;if(x){const v=d.UnicodeService.extractWidth(k);v===0?x=!1:v>S&&(S=v)}return d.UnicodeService.createPropertyValue(0,S,x)}}},5981:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const d=c(8460),m=c(844);class f extends m.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const x=this._callbacks.shift();x&&x()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,k){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+=b.length,this._writeBuffer.push(b),this._callbacks.push(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(k)}_innerWrite(b=0,k=!0){const S=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const x=this._writeBuffer[this._bufferOffset],v=this._action(x,k);if(v){const y=C=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(S,C);return void v.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(y)}const w=this._callbacks[this._bufferOffset];if(w&&w(),this._bufferOffset++,this._pendingData-=x.length,Date.now()-S>=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()}}l.WriteBuffer=f},5941:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.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})$/,d=/^[\da-f]+$/;function m(f,g){const b=f.toString(16),k=b.length<2?"0"+b:b;switch(g){case 4:return b[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}l.parseColor=function(f){if(!f)return;let g=f.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const b=c.exec(g);if(b){const k=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/k*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/k*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/k*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),d.exec(g)&&[3,6,9,12].includes(g.length))){const b=g.length/3,k=[0,0,0];for(let S=0;S<3;++S){const x=parseInt(g.slice(b*S,b*S+b),16);k[S]=b===1?x<<4:b===2?x:b===3?x>>4:x>>8}return k}},l.toRgbString=function(f,g=16){const[b,k,S]=f;return`rgb:${m(b,g)}/${m(k,g)}/${m(S,g)}`}},5770:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const d=c(482),m=c(8742),f=c(5770),g=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(k,S){this._handlers[k]===void 0&&(this._handlers[k]=[]);const x=this._handlers[k];return x.push(S),{dispose:()=>{const v=x.indexOf(S);v!==-1&&x.splice(v,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(k,S){if(this.reset(),this._ident=k,this._active=this._handlers[k]||g,this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(k,S,x){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(k,S,x);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(k,S,x))}unhook(k,S=!0){if(this._active.length){let x=!1,v=this._active.length-1,w=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,x=S,w=this._stack.fallThrough,this._stack.paused=!1),!w&&x===!1){for(;v>=0&&(x=this._active[v].unhook(k),x!==!0);v--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,x;v--}for(;v>=0;v--)if(x=this._active[v].unhook(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,x}else this._handlerFb(this._ident,"UNHOOK",k);this._active=g,this._ident=0}};const b=new m.Params;b.addParam(0),l.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=b,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():b,this._data="",this._hitLimit=!1}put(k,S,x){this._hitLimit||(this._data+=(0,d.utf32ToString)(k,S,x),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let S=!1;if(this._hitLimit)S=!1;else if(k&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((x=>(this._params=b,this._data="",this._hitLimit=!1,x)));return this._params=b,this._data="",this._hitLimit=!1,S}}},2015:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const d=c(844),m=c(8742),f=c(6242),g=c(6351);class b{constructor(v){this.table=new Uint8Array(v)}setDefault(v,w){this.table.fill(v<<4|w)}add(v,w,y,C){this.table[w<<8|v]=y<<4|C}addMany(v,w,y,C){for(let N=0;NT)),w=(M,T)=>v.slice(M,T),y=w(32,127),C=w(0,24);C.push(25),C.push.apply(C,w(28,32));const N=w(0,14);let E;for(E in x.setDefault(1,0),x.addMany(y,0,2,0),N)x.addMany([24,26,153,154],E,3,0),x.addMany(w(128,144),E,3,0),x.addMany(w(144,152),E,3,0),x.add(156,E,0,0),x.add(27,E,11,1),x.add(157,E,4,8),x.addMany([152,158,159],E,0,7),x.add(155,E,11,3),x.add(144,E,11,9);return x.addMany(C,0,3,0),x.addMany(C,1,3,1),x.add(127,1,0,1),x.addMany(C,8,0,8),x.addMany(C,3,3,3),x.add(127,3,0,3),x.addMany(C,4,3,4),x.add(127,4,0,4),x.addMany(C,6,3,6),x.addMany(C,5,3,5),x.add(127,5,0,5),x.addMany(C,2,3,2),x.add(127,2,0,2),x.add(93,1,4,8),x.addMany(y,8,5,8),x.add(127,8,5,8),x.addMany([156,27,24,26,7],8,6,0),x.addMany(w(28,32),8,0,8),x.addMany([88,94,95],1,0,7),x.addMany(y,7,0,7),x.addMany(C,7,0,7),x.add(156,7,0,0),x.add(127,7,0,7),x.add(91,1,11,3),x.addMany(w(64,127),3,7,0),x.addMany(w(48,60),3,8,4),x.addMany([60,61,62,63],3,9,4),x.addMany(w(48,60),4,8,4),x.addMany(w(64,127),4,7,0),x.addMany([60,61,62,63],4,0,6),x.addMany(w(32,64),6,0,6),x.add(127,6,0,6),x.addMany(w(64,127),6,0,0),x.addMany(w(32,48),3,9,5),x.addMany(w(32,48),5,9,5),x.addMany(w(48,64),5,0,6),x.addMany(w(64,127),5,7,0),x.addMany(w(32,48),4,9,5),x.addMany(w(32,48),1,9,2),x.addMany(w(32,48),2,9,2),x.addMany(w(48,127),2,10,0),x.addMany(w(48,80),1,10,0),x.addMany(w(81,88),1,10,0),x.addMany([89,90,92],1,10,0),x.addMany(w(96,127),1,10,0),x.add(80,1,11,9),x.addMany(C,9,0,9),x.add(127,9,0,9),x.addMany(w(28,32),9,0,9),x.addMany(w(32,48),9,9,12),x.addMany(w(48,60),9,8,10),x.addMany([60,61,62,63],9,9,10),x.addMany(C,11,0,11),x.addMany(w(32,128),11,0,11),x.addMany(w(28,32),11,0,11),x.addMany(C,10,0,10),x.add(127,10,0,10),x.addMany(w(28,32),10,0,10),x.addMany(w(48,60),10,8,10),x.addMany([60,61,62,63],10,0,11),x.addMany(w(32,48),10,9,12),x.addMany(C,12,0,12),x.add(127,12,0,12),x.addMany(w(28,32),12,0,12),x.addMany(w(32,48),12,9,12),x.addMany(w(48,64),12,0,11),x.addMany(w(64,127),12,12,13),x.addMany(w(64,127),10,12,13),x.addMany(w(64,127),9,12,13),x.addMany(C,13,13,13),x.addMany(y,13,13,13),x.add(127,13,0,13),x.addMany([27,156,24,26],13,14,0),x.add(k,0,2,0),x.add(k,8,5,8),x.add(k,6,0,6),x.add(k,11,0,11),x.add(k,13,13,13),x})();class S extends d.Disposable{constructor(v=l.VT500_TRANSITION_TABLE){super(),this._transitions=v,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(w,y,C)=>{},this._executeHandlerFb=w=>{},this._csiHandlerFb=(w,y)=>{},this._escHandlerFb=w=>{},this._errorHandlerFb=w=>w,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,w=[64,126]){let y=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=v.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(v.intermediates){if(v.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let N=0;NE||E>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=E}}if(v.final.length!==1)throw new Error("final must be a single byte");const C=v.final.charCodeAt(0);if(w[0]>C||C>w[1])throw new Error(`final must be in range ${w[0]} .. ${w[1]}`);return y<<=8,y|=C,y}identToString(v){const w=[];for(;v;)w.push(String.fromCharCode(255&v)),v>>=8;return w.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,w){const y=this._identifier(v,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const C=this._escHandlers[y];return C.push(w),{dispose:()=>{const N=C.indexOf(w);N!==-1&&C.splice(N,1)}}}clearEscHandler(v){this._escHandlers[this._identifier(v,[48,126])]&&delete this._escHandlers[this._identifier(v,[48,126])]}setEscHandlerFallback(v){this._escHandlerFb=v}setExecuteHandler(v,w){this._executeHandlers[v.charCodeAt(0)]=w}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,w){const y=this._identifier(v);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const C=this._csiHandlers[y];return C.push(w),{dispose:()=>{const N=C.indexOf(w);N!==-1&&C.splice(N,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,w){return this._dcsParser.registerHandler(this._identifier(v),w)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,w){return this._oscParser.registerHandler(v,w)}clearOscHandler(v){this._oscParser.clearHandler(v)}setOscHandlerFallback(v){this._oscParser.setHandlerFallback(v)}setErrorHandler(v){this._errorHandler=v}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(v,w,y,C,N){this._parseStack.state=v,this._parseStack.handlers=w,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=N}parse(v,w,y){let C,N=0,E=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=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 D=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&D>-1){for(;D>=0&&(C=T[D](this._params),C!==!0);D--)if(C instanceof Promise)return this._parseStack.handlerPos=D,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&D>-1){for(;D>=0&&(C=T[D](),C!==!0);D--)if(C instanceof Promise)return this._parseStack.handlerPos=D,C}this._parseStack.handlers=[];break;case 6:if(N=v[this._parseStack.chunkPos],C=this._dcsParser.unhook(N!==24&&N!==26,y),C)return C;N===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(N=v[this._parseStack.chunkPos],C=this._oscParser.end(N!==24&&N!==26,y),C)return C;N===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let T=M;T>4){case 2:for(let U=T+1;;++U){if(U>=w||(N=v[U])<32||N>126&&N=w||(N=v[U])<32||N>126&&N=w||(N=v[U])<32||N>126&&N=w||(N=v[U])<32||N>126&&N=0&&(C=D[z](this._params),C!==!0);z--)if(C instanceof Promise)return this._preserveStack(3,D,z,E,T),C;z<0&&this._csiHandlerFb(this._collect<<8|N,this._params),this.precedingJoinState=0;break;case 8:do switch(N){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(N-48)}while(++T47&&N<60);T--;break;case 9:this._collect<<=8,this._collect|=N;break;case 10:const $=this._escHandlers[this._collect<<8|N];let F=$?$.length-1:-1;for(;F>=0&&(C=$[F](),C!==!0);F--)if(C instanceof Promise)return this._preserveStack(4,$,F,E,T),C;F<0&&this._escHandlerFb(this._collect<<8|N),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|N,this._params);break;case 13:for(let U=T+1;;++U)if(U>=w||(N=v[U])===24||N===26||N===27||N>127&&N=w||(N=v[U])<32||N>127&&N{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const d=c(5770),m=c(482),f=[];l.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,b){this._handlers[g]===void 0&&(this._handlers[g]=[]);const k=this._handlers[g];return k.push(b),{dispose:()=>{const S=k.indexOf(b);S!==-1&&k.splice(S,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,b,k){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(g,b,k);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(g,b,k))}start(){this.reset(),this._state=1}put(g,b,k){if(this._state!==3){if(this._state===1)for(;b0&&this._put(g,b,k)}}end(g,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,S=this._active.length-1,x=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,k=b,x=this._stack.fallThrough,this._stack.paused=!1),!x&&k===!1){for(;S>=0&&(k=this._active[S].end(g),k!==!0);S--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,k;S--}for(;S>=0;S--)if(k=this._active[S].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",g);this._active=f,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,b,k){this._hitLimit||(this._data+=(0,m.utf32ToString)(g,b,k),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let b=!1;if(this._hitLimit)b=!1;else if(g&&(b=this._handler(this._data),b instanceof Promise))return b.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,b}}},8742:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const c=2147483647;class d{static fromArray(f){const g=new d;if(!f.length)return g;for(let b=Array.isArray(f[0])?1:0;b256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new d(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let g=0;g>8,k=255&this._subParamsIdx[g];k-b>0&&f.push(Array.prototype.slice.call(this._subParams,b,k))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>c?c:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>c?c:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const g=this._subParamsIdx[f]>>8,b=255&this._subParamsIdx[f];return b-g>0?this._subParams.subarray(g,b):null}getSubParamsAll(){const f={};for(let g=0;g>8,k=255&this._subParamsIdx[g];k-b>0&&(f[g]=this._subParams.slice(b,k))}return f}addDigit(f){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,k=b[g-1];b[g-1]=~k?Math.min(10*k+f,c):f}}l.Params=d},5741:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,d){const m={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(m),d.dispose=()=>this._wrappedAddonDispose(m),d.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let d=-1;for(let m=0;m{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const d=c(3785),m=c(511);l.BufferApiView=class{constructor(f,g){this._buffer=f,this.type=g}init(f){return this._buffer=f,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(f){const g=this._buffer.lines.get(f);if(g)return new d.BufferLineApiView(g)}getNullCell(){return new m.CellData}}},3785:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const d=c(511);l.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,f){if(!(m<0||m>=this._line.length))return f?(this._line.loadCell(m,f),f):this._line.loadCell(m,new d.CellData)}translateToString(m,f,g){return this._line.translateToString(m,f,g)}}},8285:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const d=c(8771),m=c(8460),f=c(844);class g extends f.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.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)}}l.BufferNamespaceApi=g},7975:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,d){return this._core.registerCsiHandler(c,(m=>d(m.toArray())))}addCsiHandler(c,d){return this.registerCsiHandler(c,d)}registerDcsHandler(c,d){return this._core.registerDcsHandler(c,((m,f)=>d(m,f.toArray())))}addDcsHandler(c,d){return this.registerDcsHandler(c,d)}registerEscHandler(c,d){return this._core.registerEscHandler(c,d)}addEscHandler(c,d){return this.registerEscHandler(c,d)}registerOscHandler(c,d){return this._core.registerOscHandler(c,d)}addOscHandler(c,d){return this.registerOscHandler(c,d)}}},7090:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.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(o,l,c){var d=this&&this.__decorate||function(x,v,w,y){var C,N=arguments.length,E=N<3?v:y===null?y=Object.getOwnPropertyDescriptor(v,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(x,v,w,y);else for(var M=x.length-1;M>=0;M--)(C=x[M])&&(E=(N<3?C(E):N>3?C(v,w,E):C(v,w))||E);return N>3&&E&&Object.defineProperty(v,w,E),E},m=this&&this.__param||function(x,v){return function(w,y){v(w,y,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const f=c(8460),g=c(844),b=c(5295),k=c(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let S=l.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(x){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(x.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(x.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(x,this))}resize(x,v){this.cols=x,this.rows=v,this.buffers.resize(x,v),this._onResize.fire({cols:x,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(x,v=!1){const w=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===x.fg&&y.getBg(0)===x.bg||(y=w.getBlankLine(x,v),this._cachedBlankLine=y),y.isWrapped=v;const C=w.ybase+w.scrollTop,N=w.ybase+w.scrollBottom;if(w.scrollTop===0){const E=w.lines.isFull;N===w.lines.length-1?E?w.lines.recycle().copyFrom(y):w.lines.push(y.clone()):w.lines.splice(N+1,0,y.clone()),E?this.isUserScrolling&&(w.ydisp=Math.max(w.ydisp-1,0)):(w.ybase++,this.isUserScrolling||w.ydisp++)}else{const E=N-C+1;w.lines.shiftElements(C+1,E-1,-1),w.lines.set(N,y.clone())}this.isUserScrolling||(w.ydisp=w.ybase),this._onScroll.fire(w.ydisp)}scrollLines(x,v,w){const y=this.buffer;if(x<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else x+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const C=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+x,y.ybase),0),C!==y.ydisp&&(v||this._onScroll.fire(y.ydisp))}};l.BufferService=S=d([m(0,k.IOptionsService)],S)},7994:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.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,d){this._charsets[c]=d,this.glevel===c&&(this.charset=d)}}},1753:function(o,l,c){var d=this&&this.__decorate||function(y,C,N,E){var M,T=arguments.length,D=T<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,N):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,C,N,E);else for(var z=y.length-1;z>=0;z--)(M=y[z])&&(D=(T<3?M(D):T>3?M(C,N,D):M(C,N))||D);return T>3&&D&&Object.defineProperty(C,N,D),D},m=this&&this.__param||function(y,C){return function(N,E){C(N,E,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const f=c(2585),g=c(8460),b=c(844),k={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 S(y,C){let N=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(N|=64,N|=y.action):(N|=3&y.button,4&y.button&&(N|=64),8&y.button&&(N|=128),y.action===32?N|=32:y.action!==0||C||(N|=3)),N}const x=String.fromCharCode,v={DEFAULT:y=>{const C=[S(y,!1)+32,y.col+32,y.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${x(C[0])}${x(C[1])}${x(C[2])}`},SGR:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.col};${y.row}${C}`},SGR_PIXELS:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.x};${y.y}${C}`}};let w=l.CoreMouseService=class extends b.Disposable{constructor(y,C){super(),this._bufferService=y,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const N of Object.keys(k))this.addProtocol(N,k[N]);for(const N of Object.keys(v))this.addEncoding(N,v[N]);this.reset()}addProtocol(y,C){this._protocols[y]=C}addEncoding(y,C){this._encodings[y]=C}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 C=this._encodings[this._activeEncoding](y);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!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,C,N){if(N){if(y.x!==C.x||y.y!==C.y)return!1}else if(y.col!==C.col||y.row!==C.row)return!1;return y.button===C.button&&y.action===C.action&&y.ctrl===C.ctrl&&y.alt===C.alt&&y.shift===C.shift}};l.CoreMouseService=w=d([m(0,f.IBufferService),m(1,f.ICoreService)],w)},6975:function(o,l,c){var d=this&&this.__decorate||function(w,y,C,N){var E,M=arguments.length,T=M<3?y:N===null?N=Object.getOwnPropertyDescriptor(y,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,C,N);else for(var D=w.length-1;D>=0;D--)(E=w[D])&&(T=(M<3?E(T):M>3?E(y,C,T):E(y,C))||T);return M>3&&T&&Object.defineProperty(y,C,T),T},m=this&&this.__param||function(w,y){return function(C,N){y(C,N,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const f=c(1439),g=c(8460),b=c(844),k=c(2585),S=Object.freeze({insertMode:!1}),x=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=l.CoreService=class extends b.Disposable{constructor(w,y,C){super(),this._bufferService=w,this._logService=y,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(S),this.decPrivateModes=(0,f.clone)(x)}reset(){this.modes=(0,f.clone)(S),this.decPrivateModes=(0,f.clone)(x)}triggerDataEvent(w,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${w}"`,(()=>w.split("").map((N=>N.charCodeAt(0))))),this._onData.fire(w)}triggerBinaryEvent(w){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${w}"`,(()=>w.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(w))}};l.CoreService=v=d([m(0,k.IBufferService),m(1,k.ILogService),m(2,k.IOptionsService)],v)},9074:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const d=c(8055),m=c(8460),f=c(844),g=c(6106);let b=0,k=0;class S extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((w=>w==null?void 0:w.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(w){if(w.marker.isDisposed)return;const y=new x(w);if(y){const C=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),C.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const w of this._decorations.values())w.dispose();this._decorations.clear()}*getDecorationsAtCell(w,y,C){let N=0,E=0;for(const M of this._decorations.getKeyIterator(y))N=M.options.x??0,E=N+(M.options.width??1),w>=N&&w{b=E.options.x??0,k=b+(E.options.width??1),w>=b&&w{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const d=c(2585),m=c(8343);class f{constructor(...b){this._entries=new Map;for(const[k,S]of b)this.set(k,S)}set(b,k){const S=this._entries.get(b);return this._entries.set(b,k),S}forEach(b){for(const[k,S]of this._entries.entries())b(k,S)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}l.ServiceCollection=f,l.InstantiationService=class{constructor(){this._services=new f,this._services.set(d.IInstantiationService,this)}setService(g,b){this._services.set(g,b)}getService(g){return this._services.get(g)}createInstance(g,...b){const k=(0,m.getServiceDependencies)(g).sort(((v,w)=>v.index-w.index)),S=[];for(const v of k){const w=this._services.get(v.id);if(!w)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${v.id}.`);S.push(w)}const x=k.length>0?k[0].index:b.length;if(b.length!==x)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${x+1} conflicts with ${b.length} static arguments`);return new g(...b,...S)}}},7866:function(o,l,c){var d=this&&this.__decorate||function(x,v,w,y){var C,N=arguments.length,E=N<3?v:y===null?y=Object.getOwnPropertyDescriptor(v,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(x,v,w,y);else for(var M=x.length-1;M>=0;M--)(C=x[M])&&(E=(N<3?C(E):N>3?C(v,w,E):C(v,w))||E);return N>3&&E&&Object.defineProperty(v,w,E),E},m=this&&this.__param||function(x,v){return function(w,y){v(w,y,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const f=c(844),g=c(2585),b={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let k,S=l.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(x){super(),this._optionsService=x,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(x){for(let v=0;vJSON.stringify(E))).join(", ")})`);const N=y.apply(this,C);return k.trace(`GlyphRenderer#${y.name} return`,N),N}}},7302:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const d=c(8460),m=c(844),f=c(6114);l.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:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends m.Disposable{constructor(S){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const x={...l.DEFAULT_OPTIONS};for(const v in S)if(v in x)try{const w=S[v];x[v]=this._sanitizeAndValidateOption(v,w)}catch(w){console.error(w)}this.rawOptions=x,this.options={...x},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(S,x){return this.onOptionChange((v=>{v===S&&x(this.rawOptions[S])}))}onMultipleOptionChange(S,x){return this.onOptionChange((v=>{S.indexOf(v)!==-1&&x()}))}_setupOptions(){const S=v=>{if(!(v in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},x=(v,w)=>{if(!(v in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);w=this._sanitizeAndValidateOption(v,w),this.rawOptions[v]!==w&&(this.rawOptions[v]=w,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const w={get:S.bind(this,v),set:x.bind(this,v)};Object.defineProperty(this.options,v,w)}}_sanitizeAndValidateOption(S,x){switch(S){case"cursorStyle":if(x||(x=l.DEFAULT_OPTIONS[S]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(x))throw new Error(`"${x}" is not a valid value for ${S}`);break;case"wordSeparator":x||(x=l.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof x=="number"&&1<=x&&x<=1e3)break;x=g.includes(x)?x:l.DEFAULT_OPTIONS[S];break;case"cursorWidth":x=Math.floor(x);case"lineHeight":case"tabStopWidth":if(x<1)throw new Error(`${S} cannot be less than 1, value: ${x}`);break;case"minimumContrastRatio":x=Math.max(1,Math.min(21,Math.round(10*x)/10));break;case"scrollback":if((x=Math.min(x,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${x}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(x<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${x}`);break;case"rows":case"cols":if(!x&&x!==0)throw new Error(`${S} must be numeric, value: ${x}`);break;case"windowsPty":x=x??{}}return x}}l.OptionsService=b},2660:function(o,l,c){var d=this&&this.__decorate||function(b,k,S,x){var v,w=arguments.length,y=w<3?k:x===null?x=Object.getOwnPropertyDescriptor(k,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(b,k,S,x);else for(var C=b.length-1;C>=0;C--)(v=b[C])&&(y=(w<3?v(y):w>3?v(k,S,y):v(k,S))||y);return w>3&&y&&Object.defineProperty(k,S,y),y},m=this&&this.__param||function(b,k){return function(S,x){k(S,x,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const f=c(2585);let g=l.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const k=this._bufferService.buffer;if(b.id===void 0){const C=k.addMarker(k.ybase+k.y),N={data:b,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(N,C))),this._dataByLinkId.set(N.id,N),N.id}const S=b,x=this._getEntryIdKey(S),v=this._entriesWithId.get(x);if(v)return this.addLineToLink(v.id,k.ybase+k.y),v.id;const w=k.addMarker(k.ybase+k.y),y={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(y,w))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(b,k){const S=this._dataByLinkId.get(b);if(S&&S.lines.every((x=>x.line!==k))){const x=this._bufferService.buffer.addMarker(k);S.lines.push(x),x.onDispose((()=>this._removeMarkerFromLink(S,x)))}}getLinkData(b){var k;return(k=this._dataByLinkId.get(b))==null?void 0:k.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,k){const S=b.lines.indexOf(k);S!==-1&&(b.lines.splice(S,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};l.OscLinkService=g=d([m(0,f.IBufferService)],g)},8343:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const c="di$target",d="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(m){return m[d]||[]},l.createDecorator=function(m){if(l.serviceRegistry.has(m))return l.serviceRegistry.get(m);const f=function(g,b,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,x,v){x[c]===x?x[d].push({id:S,index:v}):(x[d]=[{id:S,index:v}],x[c]=x)})(f,g,k)};return f.toString=()=>m,l.serviceRegistry.set(m,f),f}},2585:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const d=c(8343);var m;l.IBufferService=(0,d.createDecorator)("BufferService"),l.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),l.ICoreService=(0,d.createDecorator)("CoreService"),l.ICharsetService=(0,d.createDecorator)("CharsetService"),l.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(m||(l.LogLevelEnum=m={})),l.ILogService=(0,d.createDecorator)("LogService"),l.IOptionsService=(0,d.createDecorator)("OptionsService"),l.IOscLinkService=(0,d.createDecorator)("OscLinkService"),l.IUnicodeService=(0,d.createDecorator)("UnicodeService"),l.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(o,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const d=c(8460),m=c(225);class f{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,k,S=!1){return(16777215&b)<<3|(3&k)<<1|(S?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const b=new m.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let k=0,S=0;const x=b.length;for(let v=0;v=x)return k+this.wcwidth(w);const N=b.charCodeAt(v);56320<=N&&N<=57343?w=1024*(w-55296)+N-56320+65536:k+=this.wcwidth(N)}const y=this.charProperties(w,S);let C=f.extractWidth(y);f.extractShouldJoin(y)&&(C-=f.extractWidth(S)),k+=C,S=y}return k}charProperties(b,k){return this._activeProvider.charProperties(b,k)}}l.UnicodeService=f}},r={};function i(o){var l=r[o];if(l!==void 0)return l.exports;var c=r[o]={exports:{}};return n[o].call(c.exports,c,c.exports,i),c.exports}var a={};return(()=>{var o=a;Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const l=i(9042),c=i(3236),d=i(844),m=i(5741),f=i(8285),g=i(7975),b=i(7090),k=["cols","rows"];class S extends d.Disposable{constructor(v){super(),this._core=this.register(new c.Terminal(v)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const w=C=>this._core.options[C],y=(C,N)=>{this._checkReadonlyOptions(C),this._core.options[C]=N};for(const C in this._core.options){const N={get:w.bind(this,C),set:y.bind(this,C)};Object.defineProperty(this._publicOptions,C,N)}}_checkReadonlyOptions(v){if(k.includes(v))throw new Error(`Option "${v}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.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 f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const v=this._core.coreService.decPrivateModes;let w="none";switch(this._core.coreMouseService.activeProtocol){case"X10":w="x10";break;case"VT200":w="vt200";break;case"DRAG":w="drag";break;case"ANY":w="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:w,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const w in v)this._publicOptions[w]=v[w]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,w=!0){this._core.input(v,w)}resize(v,w){this._verifyIntegers(v,w),this._core.resize(v,w)}open(v){this._core.open(v)}attachCustomKeyEventHandler(v){this._core.attachCustomKeyEventHandler(v)}attachCustomWheelEventHandler(v){this._core.attachCustomWheelEventHandler(v)}registerLinkProvider(v){return this._core.registerLinkProvider(v)}registerCharacterJoiner(v){return this._checkProposedApi(),this._core.registerCharacterJoiner(v)}deregisterCharacterJoiner(v){this._checkProposedApi(),this._core.deregisterCharacterJoiner(v)}registerMarker(v=0){return this._verifyIntegers(v),this._core.registerMarker(v)}registerDecoration(v){return this._checkProposedApi(),this._verifyPositiveIntegers(v.x??0,v.width??0,v.height??0),this._core.registerDecoration(v)}hasSelection(){return this._core.hasSelection()}select(v,w,y){this._verifyIntegers(v,w,y),this._core.select(v,w,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,w){this._verifyIntegers(v,w),this._core.selectLines(v,w)}dispose(){super.dispose()}scrollLines(v){this._verifyIntegers(v),this._core.scrollLines(v)}scrollPages(v){this._verifyIntegers(v),this._core.scrollPages(v)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(v){this._verifyIntegers(v),this._core.scrollToLine(v)}clear(){this._core.clear()}write(v,w){this._core.write(v,w)}writeln(v,w){this._core.write(v),this._core.write(`\r +`,w)}paste(v){this._core.paste(v)}refresh(v,w){this._verifyIntegers(v,w),this._core.refresh(v,w)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return l}_verifyIntegers(...v){for(const w of v)if(w===1/0||isNaN(w)||w%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const w of v)if(w&&(w===1/0||isNaN(w)||w%1!=0||w<0))throw new Error("This API only accepts positive integers")}}o.Terminal=S})(),a})()))})(ub)),ub.exports}var aZ=sZ();function C7(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r{const n=t.current;if(!n)return;const r=new aZ.Terminal({convertEol:!0,disableStdin:!0,fontSize:12,fontFamily:getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:"#1a1a1a",foreground:"#e6e1e0",cursor:"#1a1a1a",selectionBackground:"#2c3441"}}),i=new iZ.FitAddon;r.loadAddon(i),r.open(n);try{i.fit()}catch{}const a=new ResizeObserver(()=>{try{i.fit()}catch{}});a.observe(n);let o=!1,l=0,c=!1,d=!1;async function m(){if(c){d=!0;return}c=!0;try{for(;;){const g=await zR(e,l);if(o)return;if(g.dataBase64&&r.write(C7(g.dataBase64)),l=g.nextOffset,g.eof)break}}catch{}finally{c=!1,d&&!o&&(d=!1,m())}}const f=JD(e,g=>{if(o)return;const b=C7(g.dataBase64);!c&&g.offset===l?(r.write(b),l+=b.length):g.offset+b.length>l&&m()});return m(),()=>{o=!0,f(),a.disconnect(),r.dispose()}},[e]),h.jsx("div",{ref:t,style:{width:"100%",height:"100%"}})}function lZ({experiment:e,project:t,view:n,runs:r,selectedRunId:i,onSelectRun:a,parentExperiment:o,onOpenView:l,onOpenCode:c}){const d=r.filter(m=>m.experimentId===e.id).sort((m,f)=>f.createdAt-m.createdAt);return n==="overview"?h.jsx(nZ,{experiment:e,parentExperiment:o,project:t,runs:d,onOpenLogs:m=>l("terminal",m),onOpenCode:()=>c("files")}):h.jsx(cZ,{experiment:e,expRuns:d,selectedRunId:i,onSelectRun:a})}function cZ({experiment:e,expRuns:t,selectedRunId:n,onSelectRun:r}){const[i,a]=R.useState(null),[o,l]=R.useState(null),[c,d]=R.useState(!1),m=R.useRef(null),f=n&&t.find(v=>v.id===n)||t[0]||null,g=(f==null?void 0:f.status)==="running"||(f==null?void 0:f.status)==="starting",b=!!(f&&g&&(f.cancelRequested||o===f.id)),k=v=>{const w=t.findIndex(y=>y.id===v);return w===-1?t.length:t.length-w},S=R.useRef(null);R.useEffect(()=>{if(S.current===null){S.current=new Set(t.map(w=>w.id));return}const v=t.find(w=>!S.current.has(w.id));for(const w of t)S.current.add(w.id);v&&r(v.id)},[t,r]),R.useEffect(()=>{if(!c)return;const v=w=>{var y;(y=m.current)!=null&&y.contains(w.target)||d(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[c]);async function x(){if(f){a(null),l(f.id);try{await pS(f.id)}catch(v){l(null),a(v instanceof Error?v.message:String(v))}}}return h.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[h.jsxs("div",{className:"term-bar flex items-center gap-2 h-10 py-0 px-2.5 border-b border-b-border shrink-0 [&_.error]:text-sm [&_.error]:text-accent-red [&_.btn]:inline-flex [&_.btn]:items-center [&_.btn]:gap-[5px]",children:[h.jsx("div",{className:"term-title min-w-0 text-md font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),h.jsx("span",{style:{flex:1}}),i&&h.jsx("span",{className:"error",role:"alert",children:i}),g&&h.jsxs("button",{className:`${rr} ghost`,disabled:b,onClick:()=>void x(),children:[h.jsx(Z8,{size:13}),b?"Cancelling…":"Stop"]}),t.length>0&&f&&h.jsxs("div",{className:"run-history relative shrink-0",ref:m,children:[h.jsxs("button",{className:"run-picker inline-flex items-center gap-2 pt-1 pr-1.5 pb-1 pl-2.5 border border-border rounded-md bg-background text-text [&:hover]:bg-surface [&_.run-label]:text-sm [&_.run-label]:font-semibold",title:"Switch run",onClick:()=>d(v=>!v),children:[h.jsxs("span",{className:"run-label",children:["Run ",k(f.id)]}),h.jsx(La,{status:b?"cancelling":as(f)}),h.jsx(Bl,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),c&&h.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] right-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] p-[5px] z-50",children:t.map(v=>h.jsxs("button",{className:`history-item flex items-center gap-2 w-full text-left py-1.5 px-2 text-sm rounded-sm [&:hover]:bg-surface [&.active]:bg-surface [&_.run-label]:font-semibold [&_.when]:ml-auto [&_.when]:text-xs [&_.when]:text-muted ${v.id===(f==null?void 0:f.id)?"active":""}`,onClick:()=>{r(v.id),d(!1)},children:[h.jsxs("span",{className:"run-label",children:["Run ",k(v.id)]}),h.jsx(La,{status:as(v)}),h.jsx("span",{className:"when",children:Ks(v.createdAt)})]},v.id))})]})]}),h.jsx("div",{className:"term-fill flex-1 min-h-0 bg-[var(--term-bg)] pt-1 pr-0 pb-1 pl-1.5",children:f?h.jsx(oZ,{runId:f.id},f.id):h.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-md text-muted",children:"No runs yet — ask the agent to launch one."})})]})}function uZ({value:e,onChange:t,onSave:n,onBlur:r,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:l}){const c=R.useMemo(()=>Qk(e,r2(i)),[e,i]),{ruleCh:d,codeCh:m}=yE(c.length),f=R.useRef(null),g=R.useRef(null),b=()=>{const x=f.current;x&&g.current&&(g.current.scrollTop=x.scrollTop)};R.useLayoutEffect(b,[e]),R.useLayoutEffect(()=>{var N;const x=f.current;if(!x||!a)return;const v=e.split(` +`),w=Math.min(Math.max(Math.trunc(a),1),v.length);let y=0;for(let E=0;E{if((x.metaKey||x.ctrlKey)&&x.key.toLowerCase()==="s"){x.preventDefault(),n();return}if(x.key==="Tab"){x.preventDefault();const v=x.currentTarget,{selectionStart:w,selectionEnd:y}=v,C=e.slice(0,w)+" "+e.slice(y);t(C),requestAnimationFrame(()=>{v.selectionStart=v.selectionEnd=w+1})}},S=`absolute inset-0 m-0 py-3.5 pr-4 ${Xf} ${_E} [scrollbar-gutter:stable]`;return h.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${Xf}`,children:[h.jsx("div",{className:"absolute left-0 top-0 bottom-0 border-r border-r-border-variant pointer-events-none",style:{width:`${d}ch`},"aria-hidden":"true"}),h.jsx("div",{ref:g,className:`file-view-code ${S} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:c.map((x,v)=>h.jsxs("div",{"data-line":v+1,className:"relative",style:{paddingLeft:`${m}ch`},children:[h.jsx("span",{className:`${xE} absolute left-0 pr-[1ch]`,style:{width:`${d}ch`},children:v+1}),Jk(x)?h.jsx("br",{}):x]},v))}),h.jsx("textarea",{ref:f,className:`file-view-editarea ${S} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-[var(--text)] outline-none`,style:{paddingLeft:`${m}ch`},value:e,onChange:x=>t(x.target.value),onScroll:b,onKeyDown:k,onBlur:r,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function dZ({projectId:e,path:t,source:n="repo",sessionId:r,gitRef:i,line:a,branchLabel:o,onOpenFile:l,scrollPosition:c,onScrollPositionChange:d,lineScrollRequest:m,onLineScrollRequestHandled:f,onEdit:g}){const[b,k]=R.useState(null),[S,x]=R.useState(null),[v,w]=R.useState(!0),[y,C]=R.useState(0),N=n==="artifacts",E=n==="abs",M=Q2(t),T=t.split("/").slice(0,-1).join("/"),[D,z]=R.useState(!1),[$,F]=R.useState(""),[U,V]=R.useState(!1),[X,Y]=R.useState(null),Q=R.useRef(null),te=R.useRef(c),I=(b==null?void 0:b.file)??null,O=(b==null?void 0:b.source)==="checkout"?b.file.path:t,H=SE(I==null?void 0:I.presentation),G=(b==null?void 0:b.source)==="artifact"&&!N,W=N&&(b==null?void 0:b.source)==="checkout",re=(b==null?void 0:b.source)==="artifact",ce=!i&&(b==null?void 0:b.source)==="checkout"&&I!=null&&!I.notFound,me=ce&&I!=null&&!I.binary&&!I.truncated&&!H&&!(r!=null&&(b==null?void 0:b.source)==="checkout"&&b.file.root==="clone"),ne=me&&!(M&&!D),B=R.useMemo(()=>((I==null?void 0:I.content)??"").replace(/\r\n/g,` +`),[I==null?void 0:I.content]),se=me&&$!==B,le=R.useRef(null);R.useEffect(()=>{const Ue=(I==null?void 0:I.content)??"";if(le.current!==null&&Ue===le.current){le.current=null;return}F(Ue.replace(/\r\n/g,` +`)),Y(null)},[I==null?void 0:I.content,t]);const _e=async()=>{if(!me||I==null||!se||U)return;const Ue=I.content.includes(`\r `)?$.replace(/\n/g,`\r -`):$;V(!0),Y(null);try{await HR(e,O,qe,{sessionId:r}),oe.current=qe,k(ut=>ut&&ut.source==="checkout"?{source:"checkout",file:{...ut.file,content:qe}}:ut)}catch(ut){Y(ut instanceof Error?ut.message:String(ut))}finally{V(!1)}},[be,Ce]=R.useState(!1),[Le,Fe]=R.useState(null),Ve=async()=>{Ce(!0),Fe(null);try{await $R(e,O,{sessionId:r})}catch(qe){Fe(qe instanceof Error?qe.message:String(qe))}finally{Ce(!1)}},dt=`${E?BR(t):re?uh(e,t):IR(e,O,{sessionId:r,ref:i})}&v=${y}`;R.useEffect(()=>{let qe=!1;w(!0);const ut=async()=>{const Ge=await bD(e,t),rt=(Ge==null?void 0:Ge.presentation)==="text"||(Ge==null?void 0:Ge.presentation)==="unknown",ve=Ge&&rt?await _S(e,t):null,je=Ge===null||rt&&ve===null;return{path:t,content:(ve==null?void 0:ve.content)??"",truncated:(ve==null?void 0:ve.truncated)??!1,binary:(ve==null?void 0:ve.binary)??(Ge==null?void 0:Ge.presentation)==="download",notFound:je,presentation:ve?ve.binary?"download":"text":(Ge==null?void 0:Ge.presentation)??"download"}},Zt=async()=>{for(const Ge of[`artifacts/${t}`,t]){const rt=await s3(e,Ge,{sessionId:r}).catch(()=>null);if(rt&&!rt.notFound)return rt}return null};return(E?zR(t).then(Ge=>({source:"absolute",file:Ge})):T?ut().then(async Ge=>{if(!Ge.notFound)return{source:"artifact",file:Ge};const rt=await Zt();return rt?{source:"checkout",file:rt}:{source:"artifact",file:Ge}}):s3(e,t,{sessionId:r,ref:i}).then(Ge=>Ge.notFound&&!i?ut().then(rt=>rt.notFound?{source:"checkout",file:Ge}:{source:"artifact",file:rt,checkoutRoot:Ge.root}):{source:"checkout",file:Ge})).then(Ge=>{qe||(k(Ge),x(null))}).catch(Ge=>{qe||x(Ge.message)}).finally(()=>{qe||w(!1)}),()=>{qe=!0}},[e,t,n,r,i,y]),R.useLayoutEffect(()=>{const qe=Q.current,ut=te.current;!qe||!I||!ut||(qe.scrollTop=ut.top,qe.scrollLeft=ut.left)},[I]);const Qe=qe=>qe.source==="absolute"?"File not found on disk.":T?`File not found in the project's artifacts or the ${r?"session's worktree":"project clone"}.`:i?`File not found on branch ${i}.`:r&&qe.source==="checkout"&&qe.file.root==="clone"?"This session's worktree isn't available, and the file isn't in the project clone or its artifacts.":`File not found in the ${(qe.source==="checkout"?qe.file.root:qe.checkoutRoot)==="worktree"?"session's worktree":"project clone"} or the project's artifacts.`;return h.jsxs("div",{className:"file-view flex flex-col h-full min-h-0",children:[h.jsxs("div",{className:"file-view-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant text-text shrink-0",children:[h.jsx(ah,{size:13,style:{flexShrink:0}}),h.jsx("code",{className:"file-view-path font-mono text-sm text-text flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",title:O,children:O}),o&&h.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 font-mono text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:`Branch: ${o}`,children:[h.jsx(oh,{size:11}),o]}),ne&&(U||se||X)&&h.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-xs shrink-0 ${X?"text-accent-red":"text-muted"}`,title:X??(U?"Saving…":"Unsaved — ⌘S or click away to save"),children:U?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:Pt})," Saving…"]}):X?"Save failed":"Unsaved"}),j&&h.jsx("button",{className:`${nr} ${D?"active":""}`,"data-tip":D?"Rendered view":"View source","data-tip-align":"end","aria-label":D?"Rendered view":"View source",onClick:()=>z(qe=>!qe),children:h.jsx(Q8,{size:13})}),ce&&h.jsx("button",{className:nr,"data-tip":Le??"Open in default editor","data-tip-align":"end","aria-label":"Open in default editor",disabled:be,onClick:()=>void Ve(),children:be?h.jsx("span",{className:Pt}):h.jsx(Cd,{size:13})}),h.jsx("button",{className:nr,"data-tip":"Reload file","data-tip-align":"end","aria-label":"Reload file",onClick:()=>C(qe=>qe+1),children:_?h.jsx("span",{className:Pt}):h.jsx(sS,{size:13})})]}),!S&&W&&(b==null?void 0:b.source)==="checkout"&&h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:["Not in the project's artifacts — showing the copy from the"," ",b.file.root==="worktree"?"session's worktree":"project clone","."]}),h.jsxs("div",{ref:Q,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:qe=>{const ut={top:qe.currentTarget.scrollTop,left:qe.currentTarget.scrollLeft};te.current=ut,d==null||d(ut)},children:[!ne&&!S&&!T&&(b==null?void 0:b.source)==="checkout"&&!b.file.notFound&&!i&&r&&b.file.root==="clone"&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:"This session's worktree isn't available — showing the project clone's copy."}),!ne&&!S&&(b==null?void 0:b.source)==="artifact"&&!b.file.notFound&&G&&h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["Not in the ",b.checkoutRoot==="worktree"?"session's worktree":"project clone"," — showing the copy from the project's artifacts."]}),S?h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["Failed to load file: ",S]}):I===null?h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:"Loading…"}):I.notFound?h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:b?Qe(b):"File not found."}):H?h.jsx(bE,{kind:H,url:dt,name:t.split("/").pop()??t}):I.binary?h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["Binary file — no inline preview. ",h.jsx("a",{href:dt,download:t.split("/").pop()??t,children:"Download"})]}):j&&!D?h.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-[1.5em] [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-[1.25em] [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-[1.1em]",children:re?h.jsx(wE,{projectId:e,folder:N,markdown:I.content}):h.jsx(za,{text:I.content,onOpenFile:l&&(qe=>l(E&&!qe.startsWith("/")?`${N}/${qe}`:qe,r,i))})}):ne?h.jsx(rZ,{value:$,onChange:qe=>{F(qe),g==null||g(),X&&Y(null)},onSave:()=>void _e(),onBlur:()=>void _e(),path:t,highlightLine:a,scrollRequest:m,onScrollRequestHandled:f}):h.jsxs(h.Fragment,{children:[h.jsx(mE,{text:I.content,path:t,highlightLine:a,scrollRequest:m,onScrollRequestHandled:f}),I.truncated&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:"File truncated — showing the first 512 KB."})]})]})]})}const lb=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function sZ({projectName:e,onHome:t,onNewProject:n,onRepository:r,onCollapse:i}){const{open:a,setOpen:o,ref:l}=Go(),u=R.useRef(null);return R.useEffect(()=>{if(!a)return;const d=m=>{var f;m.key==="Escape"&&((f=u.current)==null||f.focus())};return document.addEventListener("keydown",d,!0),()=>document.removeEventListener("keydown",d,!0)},[a]),h.jsxs("div",{className:"rail-brand flex items-center gap-1 h-16 p-2 border-b border-b-border shrink-0 [&_.project-switcher]:relative [&_.project-switcher]:flex-1 [&_.project-switcher]:self-stretch [&_.project-switcher]:min-w-0 [&_.project-back]:shrink-0 [&_.brand]:flex [&_.brand]:items-center [&_.brand]:justify-between [&_.brand]:gap-2 [&_.brand]:w-full [&_.brand]:h-full [&_.brand]:min-w-0 [&_.brand]:font-semibold [&_.brand]:text-base [&_.brand]:text-text [&_.brand]:py-1 [&_.brand]:px-1.5 [&_.brand]:border [&_.brand]:border-transparent [&_.brand]:rounded-sm [&_.brand:hover]:bg-surface [&_.brand:hover]:border-border [&_.brand.open]:bg-surface [&_.brand.open]:border-border [&_.brand_svg]:shrink-0 [&_.brand-project-copy]:flex [&_.brand-project-copy]:flex-col [&_.brand-project-copy]:gap-[3px] [&_.brand-project-copy]:min-w-0 [&_.brand-project-copy]:leading-[1.15] [&_.brand-project-copy]:text-left [&_.brand-project-label]:text-muted [&_.brand-project-label]:text-2xs [&_.brand-project-label]:font-medium [&_.brand-project-label]:tracking-[0.04em] [&_.brand-project-label]:uppercase [&_.brand_.brand-project]:min-w-0 [&_.brand_.brand-project]:overflow-hidden [&_.brand_.brand-project]:text-ellipsis [&_.brand_.brand-project]:whitespace-nowrap [&_.brand_.brand-project]:text-2xl [&_.project-chevron]:text-muted [&_.project-chevron]:opacity-0 [&_.project-chevron]:transition-transform [&_.project-chevron]:duration-120 [&_.project-chevron]:ease-standard [&_.brand:hover_.project-chevron]:opacity-100 [&_.brand.open_.project-chevron]:opacity-100 [&_.brand.open_.project-chevron]:rotate-180 [&_.project-menu]:left-0 [&_.project-menu]:w-52.5 [&_.project-menu]:z-70",children:[h.jsx("button",{className:`${nr} project-back !text-text`,"aria-label":"All projects",onClick:t,children:h.jsx(Tf,{size:18})}),h.jsxs("div",{className:"project-switcher",ref:l,children:[h.jsxs("button",{ref:u,className:`brand${a?" open":""}`,onClick:()=>o(d=>!d),"aria-expanded":a,children:[h.jsxs("span",{className:"brand-project-copy",children:[h.jsx("span",{className:"brand-project-label",children:"Project"}),h.jsx("span",{className:"brand-project",children:e})]}),h.jsx(zl,{className:"project-chevron",size:14})]}),a&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu",children:[h.jsx("button",{className:ui,onClick:()=>{o(!1),r()},children:h.jsxs("span",{className:lb,children:[h.jsx(nS,{size:14}),"Configure Repository"]})}),h.jsx("button",{className:ui,onClick:()=>{o(!1),t()},children:h.jsxs("span",{className:lb,children:[h.jsx(SM,{size:14}),"All projects"]})}),h.jsx("button",{className:ui,onClick:()=>{var d;(d=u.current)==null||d.focus(),o(!1),n()},children:h.jsxs("span",{className:lb,children:[h.jsx(fM,{size:14}),"Create a new project"]})})]})]}),i&&h.jsx("button",{className:nr,"data-tip":"Hide sidebar","data-tip-align":"end","aria-label":"Hide sidebar",onClick:i,children:h.jsx(iS,{size:15})})]})}const C7=["onb-gate-hint text-base font-semibold leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),Ud=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),E7=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-semibold leading-normal","text-text onb-git-hint mt-2"].join(" "),jE=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),A7=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-semibold leading-normal","text-text"].join(" "),T7="Couldn't reach orx. Check it's still running, then re-check.",aZ=["AI/ML","Biology","Physics","Other"];function oZ({onDone:e,preferredAgent:t}){const[n,r]=R.useState(0),[i,a]=R.useState(null),[o,l]=R.useState(),[u,d]=R.useState(!1),[m,f]=R.useState(null),[g,b]=R.useState(null),[k,S]=R.useState(!1),[x,_]=R.useState([]),[w,y]=R.useState(""),[C,T]=R.useState(""),[E,j]=R.useState([]),[N,D]=R.useState(""),[z,$]=R.useState([]),[F,U]=R.useState(!1),V=R.useRef(0),[X,Y]=R.useState(!1),[Q,te]=R.useState(!1),I=(i==null?void 0:i.some(B=>B.agentReady))??!1,O=o!=null,H=R.useRef(0),G=(B,se=!1)=>{const oe=++H.current;S(!0),Y(!1),te(!1),l(void 0);const _e=()=>oe===H.current;Promise.allSettled([Mf(B,se).then(be=>_e()&&a(be)),dS().then(be=>_e()&&l(be.gitVersion))]).then(([be,Ce])=>{_e()&&(be.status==="rejected"&&(Y(!0),a(null)),Ce.status==="rejected"&&(te(!0),l(void 0)))}).finally(()=>_e()&&S(!1))};R.useEffect(()=>G(!1),[]),R.useEffect(()=>{if(i===null)return;const B=i.filter(se=>se.agentReady);b(se=>{var _e;if(se&&B.some(be=>be.id===se))return se;const oe=t&&B.find(be=>be.id===t.harness);return(oe==null?void 0:oe.id)??((_e=B[0])==null?void 0:_e.id)??null})},[i,t]),R.useEffect(()=>u_(()=>{Mf(!0).then(B=>{a(B),Y(!1)}).catch(()=>Y(!0))}),[]),R.useEffect(()=>{_D().then(B=>{_(B.researchAreas),y(B.otherArea??""),T(B.background??""),j(B.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const B=N.trim();if(B.length<3){$([]),U(!1);return}const se=++V.current;U(!0);const oe=setTimeout(()=>{hS(B).then(_e=>se===V.current&&$(_e)).catch(()=>se===V.current&&$([])).finally(()=>se===V.current&&U(!1))},350);return()=>clearTimeout(oe)},[N]);const W=B=>{const se=E.some(oe=>oe.paperId===B.paperId);j(oe=>oe.some(_e=>_e.paperId===B.paperId)?oe:[...oe,{paperId:B.paperId,title:N7(B.title)}]),D(""),$([]),se||Ab(B.paperId).then(oe=>{var be;const _e=(be=oe.title)==null?void 0:be.trim();_e&&j(Ce=>Ce.map(Le=>Le.paperId===B.paperId?{...Le,title:_e}:Le))}).catch(()=>{})},re=B=>j(se=>se.filter(oe=>oe.paperId!==B)),ce=B=>{_(se=>se.includes(B)?se.filter(oe=>oe!==B):[...se,B])},pe=x.length>0&&(!x.includes("Other")||w.trim().length>0),ne=async()=>{const B=i==null?void 0:i.find(oe=>oe.id===g&&oe.agentReady);if(!B||u)return;const se=cZ(B);d(!0),f(null);try{const oe=await SR(se,{researchAreas:x,otherArea:x.includes("Other")?w:null,background:C||null,papers:E});e(oe.project,oe.selection)}catch(oe){f(oe instanceof Error?oe.message:String(oe))}finally{d(!1)}};return h.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${n===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:h.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${n===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:n===0?h.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[h.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[h.jsx("div",{className:"onb-intro-brand text-[4rem] leading-none font-semibold tracking-[-0.035em] mb-10",children:h.jsx(hf,{})}),h.jsx("h2",{className:"onb-title mt-0 mx-0 text-[2.5rem] leading-[1.08] tracking-[-0.035em]",children:"A workspace for your research agents"})]}),h.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[h.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),h.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:"Consolidate your research"}),h.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:"Track experiments, artifacts, compute, skills, and code all in one place."})]})}),h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:"Ground your agents"}),h.jsxs("span",{className:"block text-lg leading-[1.55] text-text",children:["Connected to ",h.jsx(cb,{source:"alphaxiv"}),","," ",h.jsx(cb,{source:"biorxiv"}),", and"," ",h.jsx(cb,{source:"openalex"})," ","to ground your agents in the latest research."]})]})}),h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:"Everything stays local"}),h.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:"Your code, data, and experiment history stay on your machine."})]})})]})]}),h.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:h.jsxs("button",{className:`${Zr} !py-3.5 !px-7 !text-xl !rounded-lg`,onClick:()=>r(1),children:["Continue ",h.jsx(og,{size:20})]})})]}):n===1?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"onb-eyebrow text-xl font-semibold text-muted mb-4.5",children:[h.jsx(hf,{})," · Step 1 of 2"]}),h.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:"Choose a coding agent"}),h.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:"OpenResearch uses a coding agent already installed on this machine."}),i!==null&&!I&&h.jsx("p",{className:C7,children:"Sign in to at least one agent to continue."}),i!==null&&I&&g===null&&h.jsx("p",{className:C7,children:"Choose a coding agent to continue."}),h.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:i!==null?i.map(B=>h.jsx(dZ,{h:B,selected:g===B.id,onSelect:()=>b(B.id)},B.id)):X?h.jsx("div",{className:Ud,children:T7}):h.jsxs("div",{className:"onb-loading flex items-center gap-2 text-subtext text-md py-2 px-0",children:[h.jsx("span",{className:Pt})," Detecting Claude Code, Codex, OpenCode…"]})}),(o===null||Q)&&h.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[h.jsx(hZ,{gitVersion:o,error:Q}),Q?h.jsx("p",{className:E7,children:T7}):h.jsx("p",{className:E7,children:"Git is required for local experiments. Install Git, then re-check."})]}),h.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[h.jsxs("button",{className:dg,onClick:()=>r(0),children:[h.jsx(Tf,{size:12})," Back"]}),(X||Q||o===null||i!==null&&!I)&&h.jsxs("button",{className:dg,onClick:()=>G(!0,!0),disabled:k,children:[h.jsx(lh,{size:12,className:k?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," Re-check"]}),h.jsx("div",{style:{flex:1}}),h.jsxs("button",{className:Zr,onClick:()=>r(2),disabled:k||!I||g===null||!O,title:k?"Waiting for the local tool checks":I?g===null?"Choose your preferred coding agent":Q?"Re-check Git before continuing":o===void 0?"Waiting for the Git check":o===null?"Install Git to continue":void 0:"Sign in to at least one coding agent to continue",children:["Continue ",h.jsx(og,{size:13})]})]})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"onb-eyebrow text-xl font-semibold text-muted mb-4.5",children:[h.jsx(hf,{})," · Step 2 of 2"]}),h.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:"Tell us about your research"}),h.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:h.jsxs("div",{className:jE,children:[h.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-semibold [&_legend]:mb-1.5",children:[h.jsx("legend",{children:"What areas are you interested in?"}),h.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:"Choose one or more."}),h.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:aZ.map(B=>h.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[h.jsx("input",{type:"checkbox",checked:x.includes(B),onChange:()=>ce(B),disabled:u}),h.jsx("span",{children:B})]},B))}),x.includes("Other")&&h.jsx("input",{className:"onb-other-area w-full mt-2",value:w,onChange:B=>y(B.target.value),disabled:u,placeholder:"Tell us your other research area","aria-label":"Other research area"})]}),h.jsx("label",{className:"onb-field-label text-base font-semibold mb-1.5",htmlFor:"onb-background",children:"Research background"}),h.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:C,onChange:B=>T(B.target.value),disabled:u,rows:4,placeholder:"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods."}),h.jsx("label",{className:"onb-field-label text-base font-semibold mb-1.5",htmlFor:"onb-paper-search",children:"Representative papers"}),h.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:"Add papers that represent your research interests, including papers by other authors."}),h.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[h.jsx("input",{id:"onb-paper-search",value:N,onChange:B=>D(B.target.value),disabled:u,placeholder:"Search alphaXiv by title to link a paper…"}),F?h.jsx("div",{className:Ud,children:"Searching alphaXiv…"}):z.length>0?h.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-left [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-md [&_.title]:font-medium [&_.id]:font-mono [&_.id]:text-xs [&_.id]:text-muted",children:z.map(B=>h.jsxs("button",{type:"button",onClick:()=>W(B),disabled:u,children:[h.jsx("span",{className:Td,children:N7(B.title)}),h.jsx("span",{className:"id",children:B.paperId})]},B.paperId))}):null]}),E.length>0&&h.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:E.map(B=>h.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pr-1 pb-1 pl-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:font-mono [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[h.jsx("span",{className:Td,children:B.title||B.paperId}),h.jsx("span",{className:"id",children:B.paperId}),h.jsx("button",{type:"button","aria-label":`Remove ${B.paperId}`,onClick:()=>re(B.paperId),disabled:u,children:h.jsx(Yr,{size:12})})]},B.paperId))})]})}),!pe&&h.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:x.length===0?"Choose at least one research area to continue.":"Describe your research area to continue."}),h.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[h.jsxs("button",{className:dg,onClick:()=>r(1),disabled:u,children:[h.jsx(Tf,{size:12})," Back"]}),h.jsx("div",{style:{flex:1}}),h.jsx("button",{className:Zr,onClick:()=>void ne(),disabled:u||g===null||!pe,children:u?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:Pt})," Setting things up…"]}):h.jsxs(h.Fragment,{children:["Get started ",h.jsx(og,{size:13})]})})]}),g===null&&h.jsx("p",{className:A7,children:"Your selected agent is no longer ready. Go back to Step 1 and choose another."}),m&&h.jsx("p",{className:A7,children:m})]})})})}function cb({source:e}){return h.jsxs("span",{className:"whitespace-nowrap",children:[h.jsx(h_,{source:e,size:18,decorative:!0,className:"mr-1 inline-flex align-[-0.15em] !rounded-none !bg-transparent !p-0 !shadow-none"}),d_[e]]})}function N7(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function lZ(e){return e.agentReady?{cls:"st-done",label:"Signed in"}:e.installed?e.authState==="unknown"?{cls:"st-starting",label:"Unable to verify"}:e.authState==="unsupported"?{cls:"st-starting",label:"Update required"}:e.installed?{cls:"st-starting",label:"Not signed in"}:{cls:"st-idle",label:"Not detected"}:{cls:"st-idle",label:"Not detected"}}function cZ(e){var n,r;const t=((n=e.models[0])==null?void 0:n.id)??null;return{harness:e.id,model:t,permissionMode:((r=e.options)==null?void 0:r.defaultPermissionMode)??null,reasoningLevel:up(e,t).defaultId}}function uZ({harness:e}){return h.jsx(vv,{harness:e,size:18})}function dZ({h:e,selected:t,onSelect:n}){var l;const r=lZ(e),i=t?{cls:"st-done",label:"Selected"}:r,a=(l=e.version)==null?void 0:l.replace(/\s*\(.*\)$/,""),o=h.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[h.jsxs("span",{className:"onb-card-identity flex items-center gap-2.5 min-w-0",children:[h.jsx(uZ,{harness:e.id}),h.jsx("span",{className:"onb-card-name font-semibold text-base",children:e.name})]}),h.jsxs("span",{className:`${p_} ${i.cls}`,children:[e.agentReady?h.jsx(Oi,{size:12,strokeWidth:3}):h.jsx("span",{className:"dot"}),i.label]})]});return e.agentReady?h.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-[5px] bg-background border border-border rounded-lg py-4.5 px-5 onb-agent-choice w-full text-inherit [font:inherit] text-left transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-[0_0_0_1px_var(--accent)]${t?" selected":""}`,"aria-pressed":t,onClick:n,children:[o,h.jsxs("div",{className:`onb-card-detail ${rn}`,children:[e.account??"API key",e.plan?` · ${e.plan}`:""]}),h.jsx("div",{className:Ud,children:[a,e.models.length>0&&`${e.models.length} model${e.models.length===1?"":"s"} — ${e.models.slice(0,3).map(u=>jf(u)).join(", ")}${e.models.length>3?", …":""}`].filter(Boolean).join(" · ")})]}):h.jsxs("div",{className:"onb-card flex flex-col gap-[5px] bg-background border border-border rounded-lg py-4.5 px-5 onb-agent-choice w-full text-inherit [font:inherit] text-left transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-[0_0_0_1px_var(--accent)]",children:[o,h.jsx("div",{className:Ud,children:M2(e.agentNote)})]})}function hZ({gitVersion:e,error:t}){return h.jsxs("div",{className:jE,children:[h.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[h.jsx("span",{className:"onb-card-name font-semibold text-base",children:"Local Git"}),h.jsxs("span",{className:`${p_} ${e?"st-done":t||e===null?"st-failed":"st-starting"}`,children:[e?h.jsx(Oi,{size:12,strokeWidth:3}):h.jsx("span",{className:"dot"}),e?"Ready":t?"Check failed":e===null?"Not found":"Checking"]})]}),(e||!t&&e===void 0)&&h.jsx("div",{className:Ud,children:e??"Checking Git…"})]})}function j7(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"research-project"}function fZ(e){const n=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(n)?n:null}function pZ(e){const t=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return t?{owner:t[1],repo:t[2].replace(/\.git$/,"")}:null}function mZ(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function gZ({onCreated:e,onCancel:t}){const[n,r]=R.useState("folder"),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,d]=R.useState(""),[m,f]=R.useState(!1),[g,b]=R.useState(null),[k,S]=R.useState(null),[x,_]=R.useState(!1),[w,y]=R.useState(!1),[C,T]=R.useState(!1),[E,j]=R.useState(null),[N,D]=R.useState(!1),[z,$]=R.useState(void 0),[F,U]=R.useState("research-project"),[V,X]=R.useState(null),[Y,Q]=R.useState(!1),[te,I]=R.useState(!1),[O,H]=R.useState(""),[G,W]=R.useState(null),[re,ce]=R.useState([]),[pe,ne]=R.useState(!1),B=R.useRef(0),se=R.useRef(0),oe=R.useRef(0),_e=R.useRef({folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),Ce=(n==="paper"?pZ(G==null?void 0:G.repoUrl):null)??(g!=null&&g.githubOwner&&g.githubRepo?{owner:g.githubOwner,repo:g.githubRepo}:null);R.useEffect(()=>{ER().then(({login:De})=>$(De)).catch(()=>$(null)),o_().then(De=>D(De.githubForNewProjects)).catch(()=>{})},[]),R.useEffect(()=>{let De=!0;Q(!0);const tt=setTimeout(()=>{AR(i.trim()).then(({repo:it})=>De&&U(it)).catch(()=>De&&U(j7(i))).finally(()=>De&&Q(!1))},150);return()=>{De=!1,clearTimeout(tt)}},[i]),R.useEffect(()=>{let De=!0;if(X(null),I(!!Ce),!!Ce)return TR(Ce.owner,Ce.repo).then(({canPush:tt})=>{De&&tt&&X(`github.com/${Ce.owner}/${Ce.repo}`)}).catch(()=>{}).finally(()=>De&&I(!1)),()=>{De=!1}},[Ce==null?void 0:Ce.owner,Ce==null?void 0:Ce.repo]),R.useEffect(()=>{if(n!=="paper"||!G||m)return;const De=`~/OpenResearch/${j7(i||G.title||G.paperId)}`;De!==u&&(b(null),_(!0),d(De))},[n,i,G,u,m]),R.useEffect(()=>{const De=++se.current;_(!0),S(null);const tt=setTimeout(()=>{dS(u.trim()).then(it=>{De===se.current&&b(it)}).catch(it=>{De===se.current&&(b(null),S(it instanceof Error?it.message:String(it)))}).finally(()=>{De===se.current&&_(!1)})},u.trim()?200:0);return()=>clearTimeout(tt)},[n,u]),R.useEffect(()=>{const De=++B.current;if(n!=="paper"||G){ne(!1);return}const tt=O.trim(),it=fZ(tt);if(!it&&tt.length<3){ce([]),ne(!1);return}ne(!0);const Tt=setTimeout(()=>{if(it){Ab(it).then(yt=>{var Xt;De===B.current&&(W(yt),o||a(((Xt=yt.title)==null?void 0:Xt.trim().slice(0,60))||yt.paperId))}).catch(yt=>De===B.current&&j(yt instanceof Error?yt.message:String(yt))).finally(()=>De===B.current&&ne(!1));return}hS(tt).then(yt=>De===B.current&&ce(yt)).catch(yt=>De===B.current&&j(yt instanceof Error?yt.message:String(yt))).finally(()=>De===B.current&&ne(!1))},350);return()=>clearTimeout(Tt)},[n,G,O,o]);async function Le(De){var it;const tt=++B.current;ne(!0),j(null);try{const Tt=await Ab(De);if(tt!==B.current)return;W(Tt),ce([]),o||a(((it=Tt.title)==null?void 0:it.trim().slice(0,60))||Tt.paperId)}catch(Tt){tt===B.current&&j(Tt instanceof Error?Tt.message:String(Tt))}finally{tt===B.current&&ne(!1)}}function Fe(){B.current+=1,oe.current+=1,W(null),H(""),ce([]),ne(!1),y(!1),d(""),f(!1),o||a("")}function Ve(De){if(De===n)return;B.current+=1,oe.current+=1,_e.current[n]={name:i,nameTouched:o,path:u,pathTouched:m};const tt=_e.current[De];r(De),j(null),S(null),b(null),ne(!1),y(!1),a(tt.name),l(tt.nameTouched),d(tt.path),f(tt.pathTouched)}async function Pe(){if(w)return;const De=++oe.current;y(!0),j(null);try{const tt=await kR();if(De!==oe.current||!tt)return;if(f(!0),tt!==u&&(b(null),_(!0),d(tt)),n==="folder"&&!o){const it=tt.replace(/[\\/]+$/,"").split(/[\\/]/).pop();it&&a(it)}}catch(tt){De===oe.current&&j(tt instanceof Error?tt.message:String(tt))}finally{De===oe.current&&y(!1)}}async function dt(De){if(De.preventDefault(),!!ve){T(!0),j(null);try{const tt=await CR({name:i.trim(),path:u.trim(),createFolder:n==="paper",initializeGit:!0,githubSyncEnabled:N,...n==="paper"&&G?{paperId:G.paperId,cloneUrl:G.repoUrl??void 0}:{}});e(tt.project,tt.githubPublicationError)}catch(tt){j(tt instanceof Error?tt.message:String(tt))}finally{T(!1)}}}const Qe=(g==null?void 0:g.gitVersion)===null,qe=n==="folder"&&!!u.trim()&&g!==null&&g.exists===!1,ut=!!u.trim()&&(g==null?void 0:g.exists)===!0&&g.directory===!1,Zt=n==="paper"&&!!(G!=null&&G.repoUrl)&&(g==null?void 0:g.empty)===!1,Dt=n==="folder"&&((g==null?void 0:g.gitState)==="detached"||(g==null?void 0:g.gitState)==="invalid"),Ge=ut||Zt,rt=ut?"Choose a different destination. This path is a file, not a folder.":Zt?"Choose a different destination. The paper repository needs a new or empty folder.":G!=null&&G.repoUrl?(g==null?void 0:g.exists)===!1?"OpenResearch will create this folder and clone the paper's repository into it.":"OpenResearch will clone the paper's repository here and use it as your local workspace.":(g==null?void 0:g.exists)===!1?"OpenResearch will create this folder and initialize it as the local project workspace.":"OpenResearch will use this folder as the local workspace and initialize Git if needed.",ve=!!(i.trim()&&u.trim())&&!C&&!w&&!x&&g!==null&&!k&&!Qe&&!qe&&!ut&&!Zt&&!Dt&&(n!=="paper"||!!(G!=null&&G.repoUrl))&&(!N||typeof z=="string"&&!Y&&!te),je=V??`github.com/${z??"you"}/${F}`,Je=z===void 0||Y||te?"Checking":V?"Pushes to":"Creates";return h.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-mono [&_.repo-hint]:font-normal [&_.repo-hint]:text-xs [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-left [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-[0_2px_8px_rgb(0_0_0_/_5%)] [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-semibold [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-semibold [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pr-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:pl-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))] [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-left [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-md [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:font-mono [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-md [&_.paper-pick_.title]:font-semibold flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-xs [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.new-project-actions_.primary]:ml-auto [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:dt,children:[h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-md [&_button]:font-semibold [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[h.jsx("button",{type:"button",className:n==="folder"?"active":"","aria-pressed":n==="folder",onClick:()=>Ve("folder"),children:"From folder"}),h.jsx("button",{type:"button",className:n==="paper"?"active":"","aria-pressed":n==="paper",onClick:()=>Ve("paper"),children:"From a paper"})]}),n==="paper"&&!G&&h.jsxs("label",{children:["Paper",h.jsx("input",{value:O,onChange:De=>H(De.target.value),placeholder:"arXiv id, URL, or title",autoFocus:!0}),h.jsx("span",{className:"repo-hint",children:pe?"Searching alphaXiv…":"The public code repository is cloned without credentials."}),re.length>0&&h.jsx("div",{className:"paper-results",children:re.map(De=>h.jsxs("button",{type:"button",onClick:()=>void Le(De.paperId),children:[h.jsx("span",{className:Td,children:De.title}),h.jsx("span",{className:"id",children:De.paperId})]},De.paperId))})]}),G&&n==="paper"&&h.jsxs("div",{className:"paper-pick",children:[h.jsxs("div",{className:"meta",children:[h.jsx("div",{className:Td,children:G.title||G.paperId}),G.repoUrl?h.jsx("div",{className:"id",children:mZ(G.repoUrl)}):h.jsxs("div",{className:"mt-[9px] inline-flex w-fit items-center gap-[5px] rounded-full border border-border-variant bg-background px-[9px] py-1 text-sm font-medium text-subtext",children:[h.jsx(Fj,{size:14})," No public repository"]})]}),h.jsx("button",{type:"button",className:rr,"aria-label":"Change selected paper",onClick:Fe,children:"Change"})]}),(n!=="paper"||(G==null?void 0:G.repoUrl))&&h.jsxs(h.Fragment,{children:[n==="paper"?h.jsxs("div",{className:"project-location-field",children:[h.jsx("div",{className:"project-location-label",children:G!=null&&G.repoUrl?"Clone destination":"Project location"}),h.jsxs("div",{className:"paper-destination",children:[h.jsx("code",{title:u,children:u}),h.jsx("button",{type:"button",className:rr,"aria-label":`${G!=null&&G.repoUrl?"Change clone destination":"Change project location"}; current location: ${u}`,"aria-describedby":"paper-destination-description",disabled:w,onClick:()=>void Pe(),children:w?"Choosing…":"Change…"})]}),h.jsx("span",{id:"paper-destination-description",className:`folder-picker-hint${Ge?" error":""}`,children:rt})]}):h.jsxs("button",{type:"button",className:"folder-picker-control","aria-label":u?`Change project folder; current folder: ${u}`:"Choose or create a project folder",disabled:w,title:u||void 0,onClick:()=>void Pe(),children:[h.jsx(Ed,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),h.jsx("span",{className:u?rn:"placeholder",children:w?"Choosing…":u||"Choose or create a folder"}),h.jsx(ta,{className:"folder-picker-chevron",size:15})]}),u&&h.jsxs("label",{children:[h.jsx("span",{className:"project-field-label",children:"Project name"}),h.jsx("input",{value:i,onChange:De=>{l(!0),a(De.target.value)},placeholder:"my-research",autoFocus:!0})]}),Qe&&h.jsx("div",{className:"project-path-notice error",children:"Git is required for experiments but is not installed. Install Git, then restart OpenResearch."}),!Qe&&u.trim()&&x&&h.jsx("span",{className:`repo-hint ${rn}`,children:"Checking folder…"}),!Qe&&n==="folder"&&u.trim()&&!x&&(g==null?void 0:g.exists)===!1&&h.jsx("div",{className:"project-path-notice error",children:"That folder no longer exists. Choose it again."}),!Qe&&n==="folder"&&u.trim()&&!x&&ut&&h.jsx("div",{className:"project-path-notice error",children:"The selected path is not a folder."}),!Qe&&n==="folder"&&!x&&(g==null?void 0:g.gitState)==="detached"&&h.jsx("div",{className:"project-path-notice error",children:"Check out a Git branch before importing this folder."}),!Qe&&n==="folder"&&!x&&(g==null?void 0:g.gitState)==="invalid"&&h.jsx("div",{className:"project-path-notice error",children:"The selected folder contains an invalid Git repository."}),!Qe&&n==="folder"&&!x&&(g==null?void 0:g.directory)&&g.initialized===!1&&h.jsx("div",{className:"project-path-notice",children:"This folder is not a Git repository. OpenResearch will initialize Git here."}),k&&h.jsx("div",{className:"project-path-notice error",children:k})]}),E&&h.jsx("div",{className:"error",children:E}),(n!=="paper"||(G==null?void 0:G.repoUrl))&&u&&h.jsxs("label",{className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[h.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[h.jsx("input",{className:"m-0",type:"checkbox",checked:N,onChange:De=>D(De.target.checked),disabled:C}),h.jsx("strong",{className:"text-base font-semibold leading-[1.3] text-text",children:"Sync experiments to GitHub"})]}),h.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext [&_code]:text-sm [&_code]:text-inherit",children:[h.jsxs("span",{children:[Je," ",h.jsx("code",{children:je}),"."]}),h.jsx("span",{children:"Experiment branches will be pushed to the remote GitHub repository."}),z===null&&h.jsx("span",{children:"Connect GitHub before creating the project."})]})]}),h.jsxs("div",{className:"actions new-project-actions",children:[t&&h.jsx("button",{type:"button",className:di,onClick:t,children:"Cancel"}),h.jsx("button",{className:Zr,disabled:!ve,children:C?"Creating…":n==="paper"?G!=null&&G.repoUrl?"Clone paper project":"Create paper project":"Create local project"})]})]})}function ME({onClose:e,onCreated:t}){const n=R.useRef(null),r=R.useRef(e);return r.current=e,R.useEffect(()=>{const i=n.current;if(!i)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(o()[0]??i).focus();const l=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),r.current();return}if(u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!u.altKey&&u.shiftKey){u.preventDefault(),u.stopPropagation();return}if(u.key!=="Tab")return;const d=o();if(d.length===0){u.preventDefault(),i.focus();return}const m=d[0],f=d[d.length-1];u.shiftKey&&document.activeElement===m?(u.preventDefault(),f.focus()):!u.shiftKey&&document.activeElement===f&&(u.preventDefault(),m.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),h.jsx("div",{className:"modal-backdrop fixed inset-0 bg-[rgba(29,_27,_26,_0.42)] flex items-center justify-center p-5 overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:h.jsxs("div",{ref:n,className:"modal w-120 max-w-full max-h-[calc(100vh_-_40px)] overflow-y-auto bg-background border border-border rounded-xl shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)] p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[h.jsx("h2",{id:"new-project-dialog-title",children:"New project"}),h.jsx(gZ,{onCancel:e,onCreated:t})]})})}function M7({projects:e,onOpen:t,onCreated:n,onDeleted:r}){const[i,a]=R.useState(!1),[o,l]=R.useState(null);async function u(d){const m=!!(d.githubUrl||d.githubOwner&&d.githubRepo);if(window.confirm(`Delete project "${d.name}"? +`):$;V(!0),Y(null);try{await UR(e,O,Ue,{sessionId:r}),le.current=Ue,k(ct=>ct&&ct.source==="checkout"?{source:"checkout",file:{...ct.file,content:Ue}}:ct)}catch(ct){Y(ct instanceof Error?ct.message:String(ct))}finally{V(!1)}},[be,Ce]=R.useState(!1),[Le,$e]=R.useState(null),Ge=async()=>{Ce(!0),$e(null);try{await qR(e,O,{sessionId:r})}catch(Ue){$e(Ue instanceof Error?Ue.message:String(Ue))}finally{Ce(!1)}},ut=`${E?PR(t):re?dh(e,t):$R(e,O,{sessionId:r,ref:i})}&v=${y}`;R.useEffect(()=>{let Ue=!1;w(!0);const ct=async()=>{const qe=await yD(e,t),nt=(qe==null?void 0:qe.presentation)==="text"||(qe==null?void 0:qe.presentation)==="unknown",ve=qe&&nt?await _S(e,t):null,je=qe===null||nt&&ve===null;return{path:t,content:(ve==null?void 0:ve.content)??"",truncated:(ve==null?void 0:ve.truncated)??!1,binary:(ve==null?void 0:ve.binary)??(qe==null?void 0:qe.presentation)==="download",notFound:je,presentation:ve?ve.binary?"download":"text":(qe==null?void 0:qe.presentation)??"download"}},Kt=async()=>{for(const qe of[`artifacts/${t}`,t]){const nt=await l3(e,qe,{sessionId:r}).catch(()=>null);if(nt&&!nt.notFound)return nt}return null};return(E?FR(t).then(qe=>({source:"absolute",file:qe})):N?ct().then(async qe=>{if(!qe.notFound)return{source:"artifact",file:qe};const nt=await Kt();return nt?{source:"checkout",file:nt}:{source:"artifact",file:qe}}):l3(e,t,{sessionId:r,ref:i}).then(qe=>qe.notFound&&!i?ct().then(nt=>nt.notFound?{source:"checkout",file:qe}:{source:"artifact",file:nt,checkoutRoot:qe.root}):{source:"checkout",file:qe})).then(qe=>{Ue||(k(qe),x(null))}).catch(qe=>{Ue||x(qe.message)}).finally(()=>{Ue||w(!1)}),()=>{Ue=!0}},[e,t,n,r,i,y]),R.useLayoutEffect(()=>{const Ue=Q.current,ct=te.current;!Ue||!I||!ct||(Ue.scrollTop=ct.top,Ue.scrollLeft=ct.left)},[I]);const Ke=Ue=>Ue.source==="absolute"?"File not found on disk.":N?`File not found in the project's artifacts or the ${r?"session's worktree":"project clone"}.`:i?`File not found on branch ${i}.`:r&&Ue.source==="checkout"&&Ue.file.root==="clone"?"This session's worktree isn't available, and the file isn't in the project clone or its artifacts.":`File not found in the ${(Ue.source==="checkout"?Ue.file.root:Ue.checkoutRoot)==="worktree"?"session's worktree":"project clone"} or the project's artifacts.`;return h.jsxs("div",{className:"file-view flex flex-col h-full min-h-0",children:[h.jsxs("div",{className:"file-view-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant text-text shrink-0",children:[h.jsx(oh,{size:13,style:{flexShrink:0}}),h.jsx("code",{className:"file-view-path font-mono text-sm text-text flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",title:O,children:O}),o&&h.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 font-mono text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:`Branch: ${o}`,children:[h.jsx(lh,{size:11}),o]}),ne&&(U||se||X)&&h.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-xs shrink-0 ${X?"text-accent-red":"text-muted"}`,title:X??(U?"Saving…":"Unsaved — ⌘S or click away to save"),children:U?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:Pt})," Saving…"]}):X?"Save failed":"Unsaved"}),M&&h.jsx("button",{className:`${nr} ${D?"active":""}`,"data-tip":D?"Rendered view":"View source","data-tip-align":"end","aria-label":D?"Rendered view":"View source",onClick:()=>z(Ue=>!Ue),children:h.jsx(J8,{size:13})}),ce&&h.jsx("button",{className:nr,"data-tip":Le??"Open in default editor","data-tip-align":"end","aria-label":"Open in default editor",disabled:be,onClick:()=>void Ge(),children:be?h.jsx("span",{className:Pt}):h.jsx(Ed,{size:13})}),h.jsx("button",{className:nr,"data-tip":"Reload file","data-tip-align":"end","aria-label":"Reload file",onClick:()=>C(Ue=>Ue+1),children:v?h.jsx("span",{className:Pt}):h.jsx(aS,{size:13})})]}),!S&&W&&(b==null?void 0:b.source)==="checkout"&&h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:["Not in the project's artifacts — showing the copy from the"," ",b.file.root==="worktree"?"session's worktree":"project clone","."]}),h.jsxs("div",{ref:Q,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:Ue=>{const ct={top:Ue.currentTarget.scrollTop,left:Ue.currentTarget.scrollLeft};te.current=ct,d==null||d(ct)},children:[!ne&&!S&&!N&&(b==null?void 0:b.source)==="checkout"&&!b.file.notFound&&!i&&r&&b.file.root==="clone"&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:"This session's worktree isn't available — showing the project clone's copy."}),!ne&&!S&&(b==null?void 0:b.source)==="artifact"&&!b.file.notFound&&G&&h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["Not in the ",b.checkoutRoot==="worktree"?"session's worktree":"project clone"," — showing the copy from the project's artifacts."]}),S?h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["Failed to load file: ",S]}):I===null?h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:"Loading…"}):I.notFound?h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:b?Ke(b):"File not found."}):H?h.jsx(kE,{kind:H,url:ut,name:t.split("/").pop()??t}):I.binary?h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["Binary file — no inline preview. ",h.jsx("a",{href:ut,download:t.split("/").pop()??t,children:"Download"})]}):M&&!D?h.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-[1.5em] [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-[1.25em] [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-[1.1em]",children:re?h.jsx(NE,{projectId:e,folder:T,markdown:I.content}):h.jsx(za,{text:I.content,onOpenFile:l&&(Ue=>l(E&&!Ue.startsWith("/")?`${T}/${Ue}`:Ue,r,i))})}):ne?h.jsx(uZ,{value:$,onChange:Ue=>{F(Ue),g==null||g(),X&&Y(null)},onSave:()=>void _e(),onBlur:()=>void _e(),path:t,highlightLine:a,scrollRequest:m,onScrollRequestHandled:f}):h.jsxs(h.Fragment,{children:[h.jsx(wE,{text:I.content,path:t,highlightLine:a,scrollRequest:m,onScrollRequestHandled:f}),I.truncated&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:"File truncated — showing the first 512 KB."})]})]})]})}const db=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function hZ({projectName:e,onHome:t,onNewProject:n,onRepository:r,onCollapse:i}){const{open:a,setOpen:o,ref:l}=Vo(),c=R.useRef(null);return R.useEffect(()=>{if(!a)return;const d=m=>{var f;m.key==="Escape"&&((f=c.current)==null||f.focus())};return document.addEventListener("keydown",d,!0),()=>document.removeEventListener("keydown",d,!0)},[a]),h.jsxs("div",{className:"rail-brand flex items-center gap-1 h-16 p-2 border-b border-b-border shrink-0 [&_.project-switcher]:relative [&_.project-switcher]:flex-1 [&_.project-switcher]:self-stretch [&_.project-switcher]:min-w-0 [&_.project-back]:shrink-0 [&_.brand]:flex [&_.brand]:items-center [&_.brand]:justify-between [&_.brand]:gap-2 [&_.brand]:w-full [&_.brand]:h-full [&_.brand]:min-w-0 [&_.brand]:font-semibold [&_.brand]:text-base [&_.brand]:text-text [&_.brand]:py-1 [&_.brand]:px-1.5 [&_.brand]:border [&_.brand]:border-transparent [&_.brand]:rounded-sm [&_.brand:hover]:bg-surface [&_.brand:hover]:border-border [&_.brand.open]:bg-surface [&_.brand.open]:border-border [&_.brand_svg]:shrink-0 [&_.brand-project-copy]:flex [&_.brand-project-copy]:flex-col [&_.brand-project-copy]:gap-[3px] [&_.brand-project-copy]:min-w-0 [&_.brand-project-copy]:leading-[1.15] [&_.brand-project-copy]:text-left [&_.brand-project-label]:text-muted [&_.brand-project-label]:text-2xs [&_.brand-project-label]:font-medium [&_.brand-project-label]:tracking-[0.04em] [&_.brand-project-label]:uppercase [&_.brand_.brand-project]:min-w-0 [&_.brand_.brand-project]:overflow-hidden [&_.brand_.brand-project]:text-ellipsis [&_.brand_.brand-project]:whitespace-nowrap [&_.brand_.brand-project]:text-2xl [&_.project-chevron]:text-muted [&_.project-chevron]:opacity-0 [&_.project-chevron]:transition-transform [&_.project-chevron]:duration-120 [&_.project-chevron]:ease-standard [&_.brand:hover_.project-chevron]:opacity-100 [&_.brand.open_.project-chevron]:opacity-100 [&_.brand.open_.project-chevron]:rotate-180 [&_.project-menu]:left-0 [&_.project-menu]:w-52.5 [&_.project-menu]:z-70",children:[h.jsx("button",{className:`${nr} project-back !text-text`,"aria-label":"All projects",onClick:t,children:h.jsx(Nf,{size:18})}),h.jsxs("div",{className:"project-switcher",ref:l,children:[h.jsxs("button",{ref:c,className:`brand${a?" open":""}`,onClick:()=>o(d=>!d),"aria-expanded":a,children:[h.jsxs("span",{className:"brand-project-copy",children:[h.jsx("span",{className:"brand-project-label",children:"Project"}),h.jsx("span",{className:"brand-project",children:e})]}),h.jsx(Bl,{className:"project-chevron",size:14})]}),a&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu",children:[h.jsx("button",{className:li,onClick:()=>{o(!1),r()},children:h.jsxs("span",{className:db,children:[h.jsx(rS,{size:14}),"Configure Repository"]})}),h.jsx("button",{className:li,onClick:()=>{o(!1),t()},children:h.jsxs("span",{className:db,children:[h.jsx(NM,{size:14}),"All projects"]})}),h.jsx("button",{className:li,onClick:()=>{var d;(d=c.current)==null||d.focus(),o(!1),n()},children:h.jsxs("span",{className:db,children:[h.jsx(_M,{size:14}),"Create a new project"]})})]})]}),i&&h.jsx("button",{className:nr,"data-tip":"Hide sidebar","data-tip-align":"end","aria-label":"Hide sidebar",onClick:i,children:h.jsx(sS,{size:15})})]})}const E7=["onb-gate-hint text-base font-semibold leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),qd=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),A7=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-semibold leading-normal","text-text onb-git-hint mt-2"].join(" "),zE=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),T7=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-semibold leading-normal","text-text"].join(" "),N7="Couldn't reach orx. Check it's still running, then re-check.",fZ=["AI/ML","Biology","Physics","Other"];function pZ({onDone:e,preferredAgent:t}){const[n,r]=R.useState(0),[i,a]=R.useState(null),[o,l]=R.useState(),[c,d]=R.useState(!1),[m,f]=R.useState(null),[g,b]=R.useState(null),[k,S]=R.useState(!1),[x,v]=R.useState([]),[w,y]=R.useState(""),[C,N]=R.useState(""),[E,M]=R.useState([]),[T,D]=R.useState(""),[z,$]=R.useState([]),[F,U]=R.useState(!1),V=R.useRef(0),[X,Y]=R.useState(!1),[Q,te]=R.useState(!1),I=(i==null?void 0:i.some(B=>B.agentReady))??!1,O=o!=null,H=R.useRef(0),G=(B,se=!1)=>{const le=++H.current;S(!0),Y(!1),te(!1),l(void 0);const _e=()=>le===H.current;Promise.allSettled([Rf(B,se).then(be=>_e()&&a(be)),dS().then(be=>_e()&&l(be.gitVersion))]).then(([be,Ce])=>{_e()&&(be.status==="rejected"&&(Y(!0),a(null)),Ce.status==="rejected"&&(te(!0),l(void 0)))}).finally(()=>_e()&&S(!1))};R.useEffect(()=>G(!1),[]),R.useEffect(()=>{if(i===null)return;const B=i.filter(se=>se.agentReady);b(se=>{var _e;if(se&&B.some(be=>be.id===se))return se;const le=t&&B.find(be=>be.id===t.harness);return(le==null?void 0:le.id)??((_e=B[0])==null?void 0:_e.id)??null})},[i,t]),R.useEffect(()=>p_(()=>{Rf(!0).then(B=>{a(B),Y(!1)}).catch(()=>Y(!0))}),[]),R.useEffect(()=>{SD().then(B=>{v(B.researchAreas),y(B.otherArea??""),N(B.background??""),M(B.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const B=T.trim();if(B.length<3){$([]),U(!1);return}const se=++V.current;U(!0);const le=setTimeout(()=>{hS(B).then(_e=>se===V.current&&$(_e)).catch(()=>se===V.current&&$([])).finally(()=>se===V.current&&U(!1))},350);return()=>clearTimeout(le)},[T]);const W=B=>{const se=E.some(le=>le.paperId===B.paperId);M(le=>le.some(_e=>_e.paperId===B.paperId)?le:[...le,{paperId:B.paperId,title:j7(B.title)}]),D(""),$([]),se||jb(B.paperId).then(le=>{var be;const _e=(be=le.title)==null?void 0:be.trim();_e&&M(Ce=>Ce.map(Le=>Le.paperId===B.paperId?{...Le,title:_e}:Le))}).catch(()=>{})},re=B=>M(se=>se.filter(le=>le.paperId!==B)),ce=B=>{v(se=>se.includes(B)?se.filter(le=>le!==B):[...se,B])},me=x.length>0&&(!x.includes("Other")||w.trim().length>0),ne=async()=>{const B=i==null?void 0:i.find(le=>le.id===g&&le.agentReady);if(!B||c)return;const se=gZ(B);d(!0),f(null);try{const le=await AR(se,{researchAreas:x,otherArea:x.includes("Other")?w:null,background:C||null,papers:E});e(le.project,le.selection)}catch(le){f(le instanceof Error?le.message:String(le))}finally{d(!1)}};return h.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${n===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:h.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${n===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:n===0?h.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[h.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[h.jsx("div",{className:"onb-intro-brand text-[4rem] leading-none font-semibold tracking-[-0.035em] mb-10",children:h.jsx(ff,{})}),h.jsx("h2",{className:"onb-title mt-0 mx-0 text-[2.5rem] leading-[1.08] tracking-[-0.035em]",children:"A workspace for your research agents"})]}),h.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[h.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),h.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:"Consolidate your research"}),h.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:"Track experiments, artifacts, compute, skills, and code all in one place."})]})}),h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:"Ground your agents"}),h.jsxs("span",{className:"block text-lg leading-[1.55] text-text",children:["Connected to ",h.jsx(hb,{source:"alphaxiv"}),","," ",h.jsx(hb,{source:"biorxiv"}),", and"," ",h.jsx(hb,{source:"openalex"})," ","to ground your agents in the latest research."]})]})}),h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:"Everything stays local"}),h.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:"Your code, data, and experiment history stay on your machine."})]})})]})]}),h.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:h.jsxs("button",{className:`${Xr} !py-3.5 !px-7 !text-xl !rounded-lg`,onClick:()=>r(1),children:["Continue ",h.jsx(cg,{size:20})]})})]}):n===1?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"onb-eyebrow text-xl font-semibold text-muted mb-4.5",children:[h.jsx(ff,{})," · Step 1 of 2"]}),h.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:"Choose a coding agent"}),h.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:"OpenResearch uses a coding agent already installed on this machine."}),i!==null&&!I&&h.jsx("p",{className:E7,children:"Sign in to at least one agent to continue."}),i!==null&&I&&g===null&&h.jsx("p",{className:E7,children:"Choose a coding agent to continue."}),h.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:i!==null?i.map(B=>h.jsx(vZ,{h:B,selected:g===B.id,onSelect:()=>b(B.id)},B.id)):X?h.jsx("div",{className:qd,children:N7}):h.jsxs("div",{className:"onb-loading flex items-center gap-2 text-subtext text-md py-2 px-0",children:[h.jsx("span",{className:Pt})," Detecting Claude Code, Codex, OpenCode…"]})}),(o===null||Q)&&h.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[h.jsx(_Z,{gitVersion:o,error:Q}),Q?h.jsx("p",{className:A7,children:N7}):h.jsx("p",{className:A7,children:"Git is required for local experiments. Install Git, then re-check."})]}),h.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[h.jsxs("button",{className:fg,onClick:()=>r(0),children:[h.jsx(Nf,{size:12})," Back"]}),(X||Q||o===null||i!==null&&!I)&&h.jsxs("button",{className:fg,onClick:()=>G(!0,!0),disabled:k,children:[h.jsx(ch,{size:12,className:k?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," Re-check"]}),h.jsx("div",{style:{flex:1}}),h.jsxs("button",{className:Xr,onClick:()=>r(2),disabled:k||!I||g===null||!O,title:k?"Waiting for the local tool checks":I?g===null?"Choose your preferred coding agent":Q?"Re-check Git before continuing":o===void 0?"Waiting for the Git check":o===null?"Install Git to continue":void 0:"Sign in to at least one coding agent to continue",children:["Continue ",h.jsx(cg,{size:13})]})]})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"onb-eyebrow text-xl font-semibold text-muted mb-4.5",children:[h.jsx(ff,{})," · Step 2 of 2"]}),h.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:"Tell us about your research"}),h.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:h.jsxs("div",{className:zE,children:[h.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-semibold [&_legend]:mb-1.5",children:[h.jsx("legend",{children:"What areas are you interested in?"}),h.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:"Choose one or more."}),h.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:fZ.map(B=>h.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[h.jsx("input",{type:"checkbox",checked:x.includes(B),onChange:()=>ce(B),disabled:c}),h.jsx("span",{children:B})]},B))}),x.includes("Other")&&h.jsx("input",{className:"onb-other-area w-full mt-2",value:w,onChange:B=>y(B.target.value),disabled:c,placeholder:"Tell us your other research area","aria-label":"Other research area"})]}),h.jsx("label",{className:"onb-field-label text-base font-semibold mb-1.5",htmlFor:"onb-background",children:"Research background"}),h.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:C,onChange:B=>N(B.target.value),disabled:c,rows:4,placeholder:"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods."}),h.jsx("label",{className:"onb-field-label text-base font-semibold mb-1.5",htmlFor:"onb-paper-search",children:"Representative papers"}),h.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:"Add papers that represent your research interests, including papers by other authors."}),h.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[h.jsx("input",{id:"onb-paper-search",value:T,onChange:B=>D(B.target.value),disabled:c,placeholder:"Search alphaXiv by title to link a paper…"}),F?h.jsx("div",{className:qd,children:"Searching alphaXiv…"}):z.length>0?h.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-left [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-md [&_.title]:font-medium [&_.id]:font-mono [&_.id]:text-xs [&_.id]:text-muted",children:z.map(B=>h.jsxs("button",{type:"button",onClick:()=>W(B),disabled:c,children:[h.jsx("span",{className:Nd,children:j7(B.title)}),h.jsx("span",{className:"id",children:B.paperId})]},B.paperId))}):null]}),E.length>0&&h.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:E.map(B=>h.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pr-1 pb-1 pl-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:font-mono [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[h.jsx("span",{className:Nd,children:B.title||B.paperId}),h.jsx("span",{className:"id",children:B.paperId}),h.jsx("button",{type:"button","aria-label":`Remove ${B.paperId}`,onClick:()=>re(B.paperId),disabled:c,children:h.jsx(Vr,{size:12})})]},B.paperId))})]})}),!me&&h.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:x.length===0?"Choose at least one research area to continue.":"Describe your research area to continue."}),h.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[h.jsxs("button",{className:fg,onClick:()=>r(1),disabled:c,children:[h.jsx(Nf,{size:12})," Back"]}),h.jsx("div",{style:{flex:1}}),h.jsx("button",{className:Xr,onClick:()=>void ne(),disabled:c||g===null||!me,children:c?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:Pt})," Setting things up…"]}):h.jsxs(h.Fragment,{children:["Get started ",h.jsx(cg,{size:13})]})})]}),g===null&&h.jsx("p",{className:T7,children:"Your selected agent is no longer ready. Go back to Step 1 and choose another."}),m&&h.jsx("p",{className:T7,children:m})]})})})}function hb({source:e}){return h.jsxs("span",{className:"whitespace-nowrap",children:[h.jsx(g_,{source:e,size:18,decorative:!0,className:"mr-1 inline-flex align-[-0.15em] !rounded-none !bg-transparent !p-0 !shadow-none"}),m_[e]]})}function j7(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function mZ(e){return e.agentReady?{cls:"st-done",label:"Signed in"}:e.installed?e.authState==="unknown"?{cls:"st-starting",label:"Unable to verify"}:e.authState==="unsupported"?{cls:"st-starting",label:"Update required"}:e.installed?{cls:"st-starting",label:"Not signed in"}:{cls:"st-idle",label:"Not detected"}:{cls:"st-idle",label:"Not detected"}}function gZ(e){var n,r;const t=((n=e.models[0])==null?void 0:n.id)??null;return{harness:e.id,model:t,permissionMode:((r=e.options)==null?void 0:r.defaultPermissionMode)??null,reasoningLevel:hp(e,t).defaultId}}function bZ({harness:e}){return h.jsx(yv,{harness:e,size:18})}function vZ({h:e,selected:t,onSelect:n}){var l;const r=mZ(e),i=t?{cls:"st-done",label:"Selected"}:r,a=(l=e.version)==null?void 0:l.replace(/\s*\(.*\)$/,""),o=h.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[h.jsxs("span",{className:"onb-card-identity flex items-center gap-2.5 min-w-0",children:[h.jsx(bZ,{harness:e.id}),h.jsx("span",{className:"onb-card-name font-semibold text-base",children:e.name})]}),h.jsxs("span",{className:`${v_} ${i.cls}`,children:[e.agentReady?h.jsx(Di,{size:12,strokeWidth:3}):h.jsx("span",{className:"dot"}),i.label]})]});return e.agentReady?h.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-[5px] bg-background border border-border rounded-lg py-4.5 px-5 onb-agent-choice w-full text-inherit [font:inherit] text-left transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-[0_0_0_1px_var(--accent)]${t?" selected":""}`,"aria-pressed":t,onClick:n,children:[o,h.jsxs("div",{className:`onb-card-detail ${nn}`,children:[e.account??"API key",e.plan?` · ${e.plan}`:""]}),h.jsx("div",{className:qd,children:[a,e.models.length>0&&`${e.models.length} model${e.models.length===1?"":"s"} — ${e.models.slice(0,3).map(c=>Mf(c)).join(", ")}${e.models.length>3?", …":""}`].filter(Boolean).join(" · ")})]}):h.jsxs("div",{className:"onb-card flex flex-col gap-[5px] bg-background border border-border rounded-lg py-4.5 px-5 onb-agent-choice w-full text-inherit [font:inherit] text-left transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-[0_0_0_1px_var(--accent)]",children:[o,h.jsx("div",{className:qd,children:L2(e.agentNote)})]})}function _Z({gitVersion:e,error:t}){return h.jsxs("div",{className:zE,children:[h.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[h.jsx("span",{className:"onb-card-name font-semibold text-base",children:"Local Git"}),h.jsxs("span",{className:`${v_} ${e?"st-done":t||e===null?"st-failed":"st-starting"}`,children:[e?h.jsx(Di,{size:12,strokeWidth:3}):h.jsx("span",{className:"dot"}),e?"Ready":t?"Check failed":e===null?"Not found":"Checking"]})]}),(e||!t&&e===void 0)&&h.jsx("div",{className:qd,children:e??"Checking Git…"})]})}function M7(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"research-project"}function xZ(e){const n=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(n)?n:null}function yZ(e){const t=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return t?{owner:t[1],repo:t[2].replace(/\.git$/,"")}:null}function wZ(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function SZ({onCreated:e,onCancel:t}){const[n,r]=R.useState("folder"),[i,a]=R.useState(""),[o,l]=R.useState(!1),[c,d]=R.useState(""),[m,f]=R.useState(!1),[g,b]=R.useState(null),[k,S]=R.useState(null),[x,v]=R.useState(!1),[w,y]=R.useState(!1),[C,N]=R.useState(!1),[E,M]=R.useState(null),[T,D]=R.useState(!1),[z,$]=R.useState(void 0),[F,U]=R.useState("research-project"),[V,X]=R.useState(null),[Y,Q]=R.useState(!1),[te,I]=R.useState(!1),[O,H]=R.useState(""),[G,W]=R.useState(null),[re,ce]=R.useState([]),[me,ne]=R.useState(!1),B=R.useRef(0),se=R.useRef(0),le=R.useRef(0),_e=R.useRef({folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),Ce=(n==="paper"?yZ(G==null?void 0:G.repoUrl):null)??(g!=null&&g.githubOwner&&g.githubRepo?{owner:g.githubOwner,repo:g.githubRepo}:null);R.useEffect(()=>{jR().then(({login:De})=>$(De)).catch(()=>$(null)),d_().then(De=>D(De.githubForNewProjects)).catch(()=>{})},[]),R.useEffect(()=>{let De=!0;Q(!0);const et=setTimeout(()=>{MR(i.trim()).then(({repo:rt})=>De&&U(rt)).catch(()=>De&&U(M7(i))).finally(()=>De&&Q(!1))},150);return()=>{De=!1,clearTimeout(et)}},[i]),R.useEffect(()=>{let De=!0;if(X(null),I(!!Ce),!!Ce)return RR(Ce.owner,Ce.repo).then(({canPush:et})=>{De&&et&&X(`github.com/${Ce.owner}/${Ce.repo}`)}).catch(()=>{}).finally(()=>De&&I(!1)),()=>{De=!1}},[Ce==null?void 0:Ce.owner,Ce==null?void 0:Ce.repo]),R.useEffect(()=>{if(n!=="paper"||!G||m)return;const De=`~/OpenResearch/${M7(i||G.title||G.paperId)}`;De!==c&&(b(null),v(!0),d(De))},[n,i,G,c,m]),R.useEffect(()=>{const De=++se.current;v(!0),S(null);const et=setTimeout(()=>{dS(c.trim()).then(rt=>{De===se.current&&b(rt)}).catch(rt=>{De===se.current&&(b(null),S(rt instanceof Error?rt.message:String(rt)))}).finally(()=>{De===se.current&&v(!1)})},c.trim()?200:0);return()=>clearTimeout(et)},[n,c]),R.useEffect(()=>{const De=++B.current;if(n!=="paper"||G){ne(!1);return}const et=O.trim(),rt=xZ(et);if(!rt&&et.length<3){ce([]),ne(!1);return}ne(!0);const At=setTimeout(()=>{if(rt){jb(rt).then(xt=>{var Xt;De===B.current&&(W(xt),o||a(((Xt=xt.title)==null?void 0:Xt.trim().slice(0,60))||xt.paperId))}).catch(xt=>De===B.current&&M(xt instanceof Error?xt.message:String(xt))).finally(()=>De===B.current&&ne(!1));return}hS(et).then(xt=>De===B.current&&ce(xt)).catch(xt=>De===B.current&&M(xt instanceof Error?xt.message:String(xt))).finally(()=>De===B.current&&ne(!1))},350);return()=>clearTimeout(At)},[n,G,O,o]);async function Le(De){var rt;const et=++B.current;ne(!0),M(null);try{const At=await jb(De);if(et!==B.current)return;W(At),ce([]),o||a(((rt=At.title)==null?void 0:rt.trim().slice(0,60))||At.paperId)}catch(At){et===B.current&&M(At instanceof Error?At.message:String(At))}finally{et===B.current&&ne(!1)}}function $e(){B.current+=1,le.current+=1,W(null),H(""),ce([]),ne(!1),y(!1),d(""),f(!1),o||a("")}function Ge(De){if(De===n)return;B.current+=1,le.current+=1,_e.current[n]={name:i,nameTouched:o,path:c,pathTouched:m};const et=_e.current[De];r(De),M(null),S(null),b(null),ne(!1),y(!1),a(et.name),l(et.nameTouched),d(et.path),f(et.pathTouched)}async function Fe(){if(w)return;const De=++le.current;y(!0),M(null);try{const et=await TR();if(De!==le.current||!et)return;if(f(!0),et!==c&&(b(null),v(!0),d(et)),n==="folder"&&!o){const rt=et.replace(/[\\/]+$/,"").split(/[\\/]/).pop();rt&&a(rt)}}catch(et){De===le.current&&M(et instanceof Error?et.message:String(et))}finally{De===le.current&&y(!1)}}async function ut(De){if(De.preventDefault(),!!ve){N(!0),M(null);try{const et=await NR({name:i.trim(),path:c.trim(),createFolder:n==="paper",initializeGit:!0,githubSyncEnabled:T,...n==="paper"&&G?{paperId:G.paperId,cloneUrl:G.repoUrl??void 0}:{}});e(et.project,et.githubPublicationError)}catch(et){M(et instanceof Error?et.message:String(et))}finally{N(!1)}}}const Ke=(g==null?void 0:g.gitVersion)===null,Ue=n==="folder"&&!!c.trim()&&g!==null&&g.exists===!1,ct=!!c.trim()&&(g==null?void 0:g.exists)===!0&&g.directory===!1,Kt=n==="paper"&&!!(G!=null&&G.repoUrl)&&(g==null?void 0:g.empty)===!1,Rt=n==="folder"&&((g==null?void 0:g.gitState)==="detached"||(g==null?void 0:g.gitState)==="invalid"),qe=ct||Kt,nt=ct?"Choose a different destination. This path is a file, not a folder.":Kt?"Choose a different destination. The paper repository needs a new or empty folder.":G!=null&&G.repoUrl?(g==null?void 0:g.exists)===!1?"OpenResearch will create this folder and clone the paper's repository into it.":"OpenResearch will clone the paper's repository here and use it as your local workspace.":(g==null?void 0:g.exists)===!1?"OpenResearch will create this folder and initialize it as the local project workspace.":"OpenResearch will use this folder as the local workspace and initialize Git if needed.",ve=!!(i.trim()&&c.trim())&&!C&&!w&&!x&&g!==null&&!k&&!Ke&&!Ue&&!ct&&!Kt&&!Rt&&(n!=="paper"||!!(G!=null&&G.repoUrl))&&(!T||typeof z=="string"&&!Y&&!te),je=V??`github.com/${z??"you"}/${F}`,Ze=z===void 0||Y||te?"Checking":V?"Pushes to":"Creates";return h.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-mono [&_.repo-hint]:font-normal [&_.repo-hint]:text-xs [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-left [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-[0_2px_8px_rgb(0_0_0_/_5%)] [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-semibold [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-semibold [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pr-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:pl-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))] [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-left [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-md [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:font-mono [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-md [&_.paper-pick_.title]:font-semibold flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-xs [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.new-project-actions_.primary]:ml-auto [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:ut,children:[h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-md [&_button]:font-semibold [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[h.jsx("button",{type:"button",className:n==="folder"?"active":"","aria-pressed":n==="folder",onClick:()=>Ge("folder"),children:"From folder"}),h.jsx("button",{type:"button",className:n==="paper"?"active":"","aria-pressed":n==="paper",onClick:()=>Ge("paper"),children:"From a paper"})]}),n==="paper"&&!G&&h.jsxs("label",{children:["Paper",h.jsx("input",{value:O,onChange:De=>H(De.target.value),placeholder:"arXiv id, URL, or title",autoFocus:!0}),h.jsx("span",{className:"repo-hint",children:me?"Searching alphaXiv…":"The public code repository is cloned without credentials."}),re.length>0&&h.jsx("div",{className:"paper-results",children:re.map(De=>h.jsxs("button",{type:"button",onClick:()=>void Le(De.paperId),children:[h.jsx("span",{className:Nd,children:De.title}),h.jsx("span",{className:"id",children:De.paperId})]},De.paperId))})]}),G&&n==="paper"&&h.jsxs("div",{className:"paper-pick",children:[h.jsxs("div",{className:"meta",children:[h.jsx("div",{className:Nd,children:G.title||G.paperId}),G.repoUrl?h.jsx("div",{className:"id",children:wZ(G.repoUrl)}):h.jsxs("div",{className:"mt-[9px] inline-flex w-fit items-center gap-[5px] rounded-full border border-border-variant bg-background px-[9px] py-1 text-sm font-medium text-subtext",children:[h.jsx(Wj,{size:14})," No public repository"]})]}),h.jsx("button",{type:"button",className:rr,"aria-label":"Change selected paper",onClick:$e,children:"Change"})]}),(n!=="paper"||(G==null?void 0:G.repoUrl))&&h.jsxs(h.Fragment,{children:[n==="paper"?h.jsxs("div",{className:"project-location-field",children:[h.jsx("div",{className:"project-location-label",children:G!=null&&G.repoUrl?"Clone destination":"Project location"}),h.jsxs("div",{className:"paper-destination",children:[h.jsx("code",{title:c,children:c}),h.jsx("button",{type:"button",className:rr,"aria-label":`${G!=null&&G.repoUrl?"Change clone destination":"Change project location"}; current location: ${c}`,"aria-describedby":"paper-destination-description",disabled:w,onClick:()=>void Fe(),children:w?"Choosing…":"Change…"})]}),h.jsx("span",{id:"paper-destination-description",className:`folder-picker-hint${qe?" error":""}`,children:nt})]}):h.jsxs("button",{type:"button",className:"folder-picker-control","aria-label":c?`Change project folder; current folder: ${c}`:"Choose or create a project folder",disabled:w,title:c||void 0,onClick:()=>void Fe(),children:[h.jsx(Ad,{className:c?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),h.jsx("span",{className:c?nn:"placeholder",children:w?"Choosing…":c||"Choose or create a folder"}),h.jsx(ea,{className:"folder-picker-chevron",size:15})]}),c&&h.jsxs("label",{children:[h.jsx("span",{className:"project-field-label",children:"Project name"}),h.jsx("input",{value:i,onChange:De=>{l(!0),a(De.target.value)},placeholder:"my-research",autoFocus:!0})]}),Ke&&h.jsx("div",{className:"project-path-notice error",children:"Git is required for experiments but is not installed. Install Git, then restart OpenResearch."}),!Ke&&c.trim()&&x&&h.jsx("span",{className:`repo-hint ${nn}`,children:"Checking folder…"}),!Ke&&n==="folder"&&c.trim()&&!x&&(g==null?void 0:g.exists)===!1&&h.jsx("div",{className:"project-path-notice error",children:"That folder no longer exists. Choose it again."}),!Ke&&n==="folder"&&c.trim()&&!x&&ct&&h.jsx("div",{className:"project-path-notice error",children:"The selected path is not a folder."}),!Ke&&n==="folder"&&!x&&(g==null?void 0:g.gitState)==="detached"&&h.jsx("div",{className:"project-path-notice error",children:"Check out a Git branch before importing this folder."}),!Ke&&n==="folder"&&!x&&(g==null?void 0:g.gitState)==="invalid"&&h.jsx("div",{className:"project-path-notice error",children:"The selected folder contains an invalid Git repository."}),!Ke&&n==="folder"&&!x&&(g==null?void 0:g.directory)&&g.initialized===!1&&h.jsx("div",{className:"project-path-notice",children:"This folder is not a Git repository. OpenResearch will initialize Git here."}),k&&h.jsx("div",{className:"project-path-notice error",children:k})]}),E&&h.jsx("div",{className:"error",children:E}),(n!=="paper"||(G==null?void 0:G.repoUrl))&&c&&h.jsxs("label",{className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[h.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[h.jsx("input",{className:"m-0",type:"checkbox",checked:T,onChange:De=>D(De.target.checked),disabled:C}),h.jsx("strong",{className:"text-base font-semibold leading-[1.3] text-text",children:"Sync experiments to GitHub"})]}),h.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext [&_code]:text-sm [&_code]:text-inherit",children:[h.jsxs("span",{children:[Ze," ",h.jsx("code",{children:je}),"."]}),h.jsx("span",{children:"Experiment branches will be pushed to the remote GitHub repository."}),z===null&&h.jsx("span",{children:"Connect GitHub before creating the project."})]})]}),h.jsxs("div",{className:"actions new-project-actions",children:[t&&h.jsx("button",{type:"button",className:ci,onClick:t,children:"Cancel"}),h.jsx("button",{className:Xr,disabled:!ve,children:C?"Creating…":n==="paper"?G!=null&&G.repoUrl?"Clone paper project":"Create paper project":"Create local project"})]})]})}function BE({onClose:e,onCreated:t}){const n=R.useRef(null),r=R.useRef(e);return r.current=e,R.useEffect(()=>{const i=n.current;if(!i)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(o()[0]??i).focus();const l=c=>{if(c.key==="Escape"){c.preventDefault(),c.stopPropagation(),r.current();return}if(c.key==="Enter"&&(c.metaKey||c.ctrlKey)&&!c.altKey&&c.shiftKey){c.preventDefault(),c.stopPropagation();return}if(c.key!=="Tab")return;const d=o();if(d.length===0){c.preventDefault(),i.focus();return}const m=d[0],f=d[d.length-1];c.shiftKey&&document.activeElement===m?(c.preventDefault(),f.focus()):!c.shiftKey&&document.activeElement===f&&(c.preventDefault(),m.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),h.jsx("div",{className:"modal-backdrop fixed inset-0 bg-[rgba(29,_27,_26,_0.42)] flex items-center justify-center p-5 overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:h.jsxs("div",{ref:n,className:"modal w-120 max-w-full max-h-[calc(100vh_-_40px)] overflow-y-auto bg-background border border-border rounded-xl shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)] p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[h.jsx("h2",{id:"new-project-dialog-title",children:"New project"}),h.jsx(SZ,{onCancel:e,onCreated:t})]})})}function R7({projects:e,onOpen:t,onCreated:n,onDeleted:r}){const[i,a]=R.useState(!1),[o,l]=R.useState(null);async function c(d){const m=!!(d.githubUrl||d.githubOwner&&d.githubRepo);if(window.confirm(`Delete project "${d.name}"? -Its experiments, runs and chats are removed from orx. The local folder (${d.path})${m?" and its GitHub repository":""} are kept.`)){l(d.id);try{await jR(d.id),r(d.id)}catch(g){window.alert(g instanceof Error?g.message:String(g))}finally{l(null)}}}return h.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[h.jsxs("div",{className:"home-inner max-w-155 my-0 mx-auto pt-12 px-6 pb-16",children:[h.jsx("div",{className:"home-brand font-display text-4xl tracking-[-0.02em] mb-9",children:h.jsx(hf,{})}),h.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-2xl [&_h2]:tracking-[-0.01em]",children:[h.jsx("h2",{children:"Projects"}),h.jsxs("button",{className:di,onClick:()=>a(!0),children:[h.jsx(i_,{size:15})," New project"]})]}),h.jsx("div",{className:"home-list flex flex-col gap-2.5",children:e.length===0?h.jsx("div",{className:"changes-note text-sm text-muted",children:"No projects yet — create one to get started."}):[...e].sort((d,m)=>m.updatedAt-d.updatedAt).map(d=>{const m=!!(d.githubUrl||d.githubOwner&&d.githubRepo),f=d.githubUrl??(d.githubOwner&&d.githubRepo?`https://github.com/${d.githubOwner}/${d.githubRepo}`:null),g=d.githubEnabled?"GitHub syncing on":m?"GitHub syncing off":"local only";return h.jsxs("div",{className:"project-card relative flex flex-col gap-1 text-left py-3.5 px-4 bg-background border border-border rounded-lg cursor-pointer transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-[0_3px_12px_color-mix(in_srgb,_var(--text)_8%,_transparent)] [&_>_:not(.project-card-open,_.project-delete)]:relative [&_>_:not(.project-card-open,_.project-delete)]:z-1 [&_>_:not(.project-card-open,_.project-delete)]:pointer-events-none [&_.project-delete]:absolute [&_.project-delete]:top-2.5 [&_.project-delete]:right-2.5 [&_.project-delete]:z-2 [&_.project-delete]:hidden [&_.project-delete]:p-[5px] [&_.project-delete]:rounded-sm [&_.project-delete]:text-muted [&_.project-delete]:leading-[0] [&:is(:hover,_:focus-within)_.project-delete]:block [&_.name]:font-semibold [&_.name]:text-base [&_.paper]:text-xs [&_.paper]:text-muted [&_.time]:text-xs [&_.time]:text-muted",children:[h.jsx("button",{className:"project-card-open absolute inset-0 rounded-[inherit] [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2","aria-label":`Open ${d.name}`,onClick:()=>t(d.id)}),h.jsx("span",{className:"name",children:d.name}),h.jsxs("span",{className:`project-card-sync [&_a]:pointer-events-auto inline-flex items-center self-start gap-[7px] text-text [&_a]:inline-flex [&_a]:text-subtext [&_a:hover]:text-text ${rn}`,children:[g,d.githubEnabled&&f&&h.jsx("a",{href:f,target:"_blank",rel:"noreferrer","data-tip":"Open repository on GitHub","aria-label":`Open ${d.name} on GitHub`,onClick:b=>b.stopPropagation(),children:h.jsx(Dp,{size:14})})]}),d.paperId&&h.jsxs("span",{className:`paper ${rn}`,children:["arXiv ",d.paperId]}),h.jsxs("span",{className:"time",children:["created ",Zs(d.createdAt)]}),h.jsx("button",{className:"project-delete [&:hover]:text-[var(--danger,_#d33)] [&:hover]:bg-[var(--overlay,_rgba(0,_0,_0,_0.05))]","data-tip":`Delete ${d.name}`,"data-tip-align":"end","aria-label":`Delete ${d.name}`,disabled:o===d.id,onClick:b=>{b.stopPropagation(),u(d)},children:h.jsx(ch,{size:14})})]},d.id)})})]}),i&&h.jsx(ME,{onClose:()=>a(!1),onCreated:(d,m)=>{a(!1),n(d,m)}})]})}const R7=["experiment-table-action inline-flex items-center gap-1.5 py-1.5 px-2.5","border border-border rounded-md bg-background text-text","text-sm font-medium leading-none","[&:hover:not(:disabled)]:bg-surface","[&:hover:not(:disabled)]:border-border-strong [&:disabled]:text-muted","[&:disabled]:cursor-default [&:disabled]:opacity-50","[&.danger]:border-[color-mix(in_oklab,_var(--accent-red)_42%,_var(--border))]","[&.danger]:bg-[color-mix(in_oklab,_var(--accent-red)_6%,_var(--base))]","[&.danger]:text-accent-red [&.danger:hover:not(:disabled)]:border-accent-red","[&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_10%,_var(--base))]","[@container((max-width:_560px))]:[&.danger]:ml-auto"].join(" ");function bZ({runs:e,experiments:t,emptyHint:n,onOpen:r,onOpenLogs:i,onOpenCode:a,onCancel:o}){const[l,u]=R.useState(new Set),[d,m]=R.useState(null),f=new Map;for(const k of e){const S=f.get(k.experimentId);S?S.push(k):f.set(k.experimentId,[k])}for(const k of f.values())k.sort((S,x)=>x.createdAt-S.createdAt);const g=[...t].sort((k,S)=>{var w,y,C,T;const x=((y=(w=f.get(k.id))==null?void 0:w[0])==null?void 0:y.createdAt)??k.createdAt;return(((T=(C=f.get(S.id))==null?void 0:C[0])==null?void 0:T.createdAt)??S.createdAt)-x});if(g.length===0)return h.jsx("div",{className:"empty-state absolute inset-0 flex flex-col items-center justify-center gap-2.5 p-6 text-center text-subtext [&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:leading-normal [&_p]:text-balance [&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext experiments-empty-state [&_p]:text-2xl",children:h.jsx("p",{children:n??"No experiments yet."})});async function b(k){m(null),u(S=>new Set(S).add(k));try{await o(k)}catch(S){u(x=>{const _=new Set(x);return _.delete(k),_}),m(S instanceof Error?S.message:String(S))}}return h.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[d&&h.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:["Stop failed: ",d]}),h.jsx("div",{className:"experiments-table w-full text-md bg-background",role:"list","aria-label":"Experiments",children:g.map(k=>{const S=f.get(k.id)??[],x=S[0]??null,_=S.find(T=>T.status==="running"||T.status==="starting"),w=_??x,y=!!(_&&(_.cancelRequested||l.has(_.id))),C=_?y?"cancelling":ls(_):x?ls(x):"idle";return h.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-[color-mix(in_oklab,_var(--text)_7%,_transparent)] bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(k),children:[h.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[h.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-left text-ellipsis whitespace-nowrap",onClick:T=>{T.stopPropagation(),r(k)},children:k.title||k.slug}),h.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:k.branchName,children:[h.jsx(oh,{size:14,"aria-hidden":"true"}),h.jsx("code",{children:k.branchName})]})]}),h.jsxs("div",{className:"experiment-table-meta [grid-area:meta] self-start flex items-center justify-end gap-4.5 whitespace-nowrap [@container((max-width:_560px))]:flex-col [@container((max-width:_560px))]:items-end [@container((max-width:_560px))]:gap-1.5 [@container((max-width:_400px))]:!flex-row [@container((max-width:_400px))]:!items-center [@container((max-width:_400px))]:flex-wrap [@container((max-width:_400px))]:justify-start [@container((max-width:_400px))]:gap-3",children:[h.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:h.jsx(La,{status:C})}),h.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-xs font-medium",children:h.jsxs("span",{children:[S.length," ",S.length===1?"run":"runs"]})}),h.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-xs font-medium whitespace-nowrap",children:h.jsx("span",{children:x?Zs(x.createdAt):"Not run yet"})})]}),h.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":`Actions for ${k.title||k.slug}`,onClick:T=>T.stopPropagation(),children:[h.jsxs("button",{className:R7,disabled:!w,title:w?"Open logs":"No runs yet",onClick:()=>w&&i(k.id,w.id),children:[h.jsx(Wc,{size:15}),"Logs"]}),h.jsxs("button",{className:R7,title:`Browse code on ${k.branchName}`,onClick:()=>a(k.id),children:[h.jsx(ap,{size:15}),"Code"]}),_&&h.jsxs("button",{className:"experiment-table-action inline-flex items-center gap-1.5 py-1.5 px-2.5 border border-border rounded-md bg-background text-text text-sm font-medium leading-none [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:border-border-strong [&:disabled]:text-muted [&:disabled]:cursor-default [&:disabled]:opacity-50 [&.danger]:border-[color-mix(in_oklab,_var(--accent-red)_42%,_var(--border))] [&.danger]:bg-[color-mix(in_oklab,_var(--accent-red)_6%,_var(--base))] [&.danger]:text-accent-red [&.danger:hover:not(:disabled)]:border-accent-red [&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_10%,_var(--base))] [@container((max-width:_560px))]:[&.danger]:ml-auto danger",disabled:y,title:y?"Stop requested":"Stop run",onClick:()=>void b(_.id),children:[h.jsx(K8,{size:15}),y?"Stopping…":"Stop"]})]})]},k.id)})})]})}var RE=G8();function vZ({onClose:e,onCreateProject:t}){const[n,r]=R.useState(!1),[i,a]=R.useState(null),o=R.useRef(null),l=R.useCallback(u=>{n||(r(!0),a(null),u().catch(()=>a("Couldn't save your progress. Try again.")).finally(()=>r(!1)))},[n]);return R.useEffect(()=>{const u=d=>{d.key==="Escape"&&(d.preventDefault(),d.stopPropagation(),l(e))};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[e,l]),R.useEffect(()=>{const u=o.current;if(!u)return;const d=document.activeElement instanceof HTMLElement?document.activeElement:null,m=()=>[...u.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(m()[0]??u).focus();const f=g=>{if(g.key!=="Tab")return;const b=m();if(b.length===0){g.preventDefault(),u.focus();return}const k=b[0],S=b[b.length-1];g.shiftKey&&document.activeElement===k?(g.preventDefault(),S.focus()):!g.shiftKey&&document.activeElement===S&&(g.preventDefault(),k.focus())};return document.addEventListener("keydown",f,!0),()=>{document.removeEventListener("keydown",f,!0),d==null||d.focus()}},[]),RE.createPortal(h.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-[rgba(29,_27,_26,_0.42)] p-5",children:h.jsxs("div",{ref:o,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)]",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[h.jsx("button",{className:`${nr} !absolute top-3.5 right-3.5`,"aria-label":"Close",onClick:()=>l(e),disabled:n,children:h.jsx(Yr,{size:16})}),h.jsxs("div",{className:"mb-5 flex items-center gap-3 pr-8",children:[h.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:h.jsx(c_,{})}),h.jsxs("div",{children:[h.jsx("div",{className:"mb-0.5 text-xs font-semibold tracking-[0.08em] text-primary uppercase",children:"Demo project"}),h.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-3xl leading-tight tracking-[-0.02em]",children:"Welcome to OpenResearch"})]})]}),h.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[h.jsxs("p",{children:["This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's"," ",h.jsx("a",{href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-semibold text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:"nanochat"}),", a repo for training a mini-GPT from scratch."]}),h.jsx("p",{children:"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together."})]}),i&&h.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:i}),h.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[h.jsx("button",{className:di,onClick:()=>l(t),disabled:n,children:"Create a new project"}),h.jsx("button",{className:Zr,onClick:()=>l(e),disabled:n,children:n?"Saving…":"Explore the demo"})]})]})}),document.body)}function sr(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function Yp(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}xf.prototype=Yp.prototype={constructor:xf,on:function(e,t){var n=this._,r=xZ(e+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a0)for(var n=new Array(i),r=0,i,a;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),L7.hasOwnProperty(t)?{space:L7[t],local:e}:e}function wZ(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Hv&&t.documentElement.namespaceURI===Hv?t.createElement(e):t.createElementNS(n,e)}}function SZ(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function DE(e){var t=Xp(e);return(t.local?SZ:wZ)(t)}function kZ(){}function Z2(e){return e==null?kZ:function(){return this.querySelector(e)}}function CZ(e){typeof e!="function"&&(e=Z2(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=y&&(y=w+1);!(T=x[y])&&++y=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function KZ(e){e||(e=ZZ);function t(f,g){return f&&g?e(f.__data__,g.__data__):!f-!g}for(var n=this._groups,r=n.length,i=new Array(r),a=0;at?1:e>=t?0:NaN}function QZ(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function JZ(){return Array.from(this)}function eQ(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?dQ:typeof t=="function"?fQ:hQ)(e,t,n??"")):eu(this.node(),e)}function eu(e,t){return e.style.getPropertyValue(t)||BE(e).getComputedStyle(e,null).getPropertyValue(t)}function mQ(e){return function(){delete this[e]}}function gQ(e,t){return function(){this[e]=t}}function bQ(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function vQ(e,t){return arguments.length>1?this.each((t==null?mQ:typeof t=="function"?bQ:gQ)(e,t)):this.node()[e]}function HE(e){return e.trim().split(/^|\s+/)}function Q2(e){return e.classList||new $E(e)}function $E(e){this._node=e,this._names=HE(e.getAttribute("class")||"")}$E.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 FE(e,t){for(var n=Q2(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function VQ(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n()=>e;function $v(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:l,dx:u,dy:d,dispatch:m}){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:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:m}})}$v.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function nJ(e){return!e.ctrlKey&&!e.button}function rJ(){return this.parentNode}function iJ(e,t){return t??{x:e.x,y:e.y}}function sJ(){return navigator.maxTouchPoints||"ontouchstart"in this}function WE(){var e=nJ,t=rJ,n=iJ,r=sJ,i={},a=Yp("start","drag","end"),o=0,l,u,d,m,f=0;function g(C){C.on("mousedown.drag",b).filter(r).on("touchstart.drag",x).on("touchmove.drag",_,tJ).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(C,T){if(!(m||!e.call(this,C,T))){var E=y(this,t.call(this,C,T),C,T,"mouse");E&&(Di(C.view).on("mousemove.drag",k,qd).on("mouseup.drag",S,qd),GE(C.view),ub(C),d=!1,l=C.clientX,u=C.clientY,E("start",C))}}function k(C){if(Pc(C),!d){var T=C.clientX-l,E=C.clientY-u;d=T*T+E*E>f}i.mouse("drag",C)}function S(C){Di(C.view).on("mousemove.drag mouseup.drag",null),VE(C.view,d),Pc(C),i.mouse("end",C)}function x(C,T){if(e.call(this,C,T)){var E=C.changedTouches,j=t.call(this,C,T),N=E.length,D,z;for(D=0;D>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Q0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Q0(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=oJ.exec(e))?new hi(t[1],t[2],t[3],1):(t=lJ.exec(e))?new hi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cJ.exec(e))?Q0(t[1],t[2],t[3],t[4]):(t=uJ.exec(e))?Q0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=dJ.exec(e))?F7(t[1],t[2]/100,t[3]/100,1):(t=hJ.exec(e))?F7(t[1],t[2]/100,t[3]/100,t[4]):O7.hasOwnProperty(e)?B7(O7[e]):e==="transparent"?new hi(NaN,NaN,NaN,0):null}function B7(e){return new hi(e>>16&255,e>>8&255,e&255,1)}function Q0(e,t,n,r){return r<=0&&(e=t=n=NaN),new hi(e,t,n,r)}function mJ(e){return e instanceof Sh||(e=Rl(e)),e?(e=e.rgb(),new hi(e.r,e.g,e.b,e.opacity)):new hi}function Fv(e,t,n,r){return arguments.length===1?mJ(e):new hi(e,t,n,r??1)}function hi(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}J2(hi,Fv,YE(Sh,{brighter(e){return e=e==null?Xf:Math.pow(Xf,e),new hi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Gd:Math.pow(Gd,e),new hi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new hi(Tl(this.r),Tl(this.g),Tl(this.b),Kf(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:H7,formatHex:H7,formatHex8:gJ,formatRgb:$7,toString:$7}));function H7(){return`#${wl(this.r)}${wl(this.g)}${wl(this.b)}`}function gJ(){return`#${wl(this.r)}${wl(this.g)}${wl(this.b)}${wl((isNaN(this.opacity)?1:this.opacity)*255)}`}function $7(){const e=Kf(this.opacity);return`${e===1?"rgb(":"rgba("}${Tl(this.r)}, ${Tl(this.g)}, ${Tl(this.b)}${e===1?")":`, ${e})`}`}function Kf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Tl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function wl(e){return e=Tl(e),(e<16?"0":"")+e.toString(16)}function F7(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ss(e,t,n,r)}function XE(e){if(e instanceof Ss)return new Ss(e.h,e.s,e.l,e.opacity);if(e instanceof Sh||(e=Rl(e)),!e)return new Ss;if(e instanceof Ss)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-i,u=(a+i)/2;return l?(t===a?o=(n-r)/l+(n0&&u<1?0:o,new Ss(o,l,u,e.opacity)}function bJ(e,t,n,r){return arguments.length===1?XE(e):new Ss(e,t,n,r??1)}function Ss(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}J2(Ss,bJ,YE(Sh,{brighter(e){return e=e==null?Xf:Math.pow(Xf,e),new Ss(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Gd:Math.pow(Gd,e),new Ss(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new hi(db(e>=240?e-240:e+120,i,r),db(e,i,r),db(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ss(P7(this.h),J0(this.s),J0(this.l),Kf(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=Kf(this.opacity);return`${e===1?"hsl(":"hsla("}${P7(this.h)}, ${J0(this.s)*100}%, ${J0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function P7(e){return e=(e||0)%360,e<0?e+360:e}function J0(e){return Math.max(0,Math.min(1,e||0))}function db(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 ex=e=>()=>e;function vJ(e,t){return function(n){return e+n*t}}function _J(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 xJ(e){return(e=+e)==1?KE:function(t,n){return n-t?_J(t,n,e):ex(isNaN(t)?n:t)}}function KE(e,t){var n=t-e;return n?vJ(e,n):ex(isNaN(e)?t:e)}const Zf=(function e(t){var n=xJ(t);function r(i,a){var o=n((i=Fv(i)).r,(a=Fv(a)).r),l=n(i.g,a.g),u=n(i.b,a.b),d=KE(i.opacity,a.opacity);return function(m){return i.r=o(m),i.g=l(m),i.b=u(m),i.opacity=d(m),i+""}}return r.gamma=e,r})(1);function yJ(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;in&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,u.push({i:o,x:Ys(r,i)})),n=hb.lastIndex;return n180?m+=360:m-d>180&&(d+=360),g.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Ys(d,m)})):m&&f.push(i(f)+"rotate("+m+r)}function l(d,m,f,g){d!==m?g.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Ys(d,m)}):m&&f.push(i(f)+"skewX("+m+r)}function u(d,m,f,g,b,k){if(d!==f||m!==g){var S=b.push(i(b)+"scale(",null,",",null,")");k.push({i:S-4,x:Ys(d,f)},{i:S-2,x:Ys(m,g)})}else(f!==1||g!==1)&&b.push(i(b)+"scale("+f+","+g+")")}return function(d,m){var f=[],g=[];return d=e(d),m=e(m),a(d.translateX,d.translateY,m.translateX,m.translateY,f,g),o(d.rotate,m.rotate,f,g),l(d.skewX,m.skewX,f,g),u(d.scaleX,d.scaleY,m.scaleX,m.scaleY,f,g),d=m=null,function(b){for(var k=-1,S=g.length,x;++k=0&&e._call.call(void 0,t),e=e._next;--tu}function G7(){Dl=(Jf=Wd.now())+Kp,tu=hd=0;try{IJ()}finally{tu=0,BJ(),Dl=0}}function zJ(){var e=Wd.now(),t=e-Jf;t>eA&&(Kp-=t,Jf=e)}function BJ(){for(var e,t=Qf,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:Qf=n);fd=e,qv(r)}function qv(e){if(!tu){hd&&(hd=clearTimeout(hd));var t=e-Dl;t>24?(e<1/0&&(hd=setTimeout(G7,e-Wd.now()-Kp)),ad&&(ad=clearInterval(ad))):(ad||(Jf=Wd.now(),ad=setInterval(zJ,eA)),tu=1,tA(G7))}}function V7(e,t,n){var r=new ep;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var HJ=Yp("start","end","cancel","interrupt"),$J=[],rA=0,W7=1,Gv=2,wf=3,Y7=4,Vv=5,Sf=6;function Zp(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;FJ(e,n,{name:t,index:r,group:i,on:HJ,tween:$J,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:rA})}function nx(e,t){var n=Ms(e,t);if(n.state>rA)throw new Error("too late; already scheduled");return n}function oa(e,t){var n=Ms(e,t);if(n.state>wf)throw new Error("too late; already running");return n}function Ms(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function FJ(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=nA(a,0,n.time);function a(d){n.state=W7,n.timer.restart(o,n.delay,n.time),n.delay<=d&&o(d-n.delay)}function o(d){var m,f,g,b;if(n.state!==W7)return u();for(m in r)if(b=r[m],b.name===n.name){if(b.state===wf)return V7(o);b.state===Y7?(b.state=Sf,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete r[m]):+mGv&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function bee(e,t,n){var r,i,a=gee(t)?nx:oa;return function(){var o=a(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}function vee(e,t){var n=this._id;return arguments.length<2?Ms(this.node(),n).on.on(e):this.each(bee(n,e,t))}function _ee(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function xee(){return this.on("end.remove",_ee(this._id))}function yee(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Z2(e));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o()=>e;function Vee(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){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:i}})}function Ra(e,t,n){this.k=e,this.x=t,this.y=n}Ra.prototype={constructor:Ra,scale:function(e){return e===1?this:new Ra(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ra(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 Qp=new Ra(1,0,0);oA.prototype=Ra.prototype;function oA(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Qp;return e.__zoom}function fb(e){e.stopImmediatePropagation()}function od(e){e.preventDefault(),e.stopImmediatePropagation()}function Wee(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Yee(){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 X7(){return this.__zoom||Qp}function Xee(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Kee(){return navigator.maxTouchPoints||"ontouchstart"in this}function Zee(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function lA(){var e=Wee,t=Yee,n=Zee,r=Xee,i=Kee,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,u=yf,d=Yp("start","zoom","end"),m,f,g,b=500,k=150,S=0,x=10;function _(V){V.property("__zoom",X7).on("wheel.zoom",N,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",z).filter(i).on("touchstart.zoom",$).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(V,X,Y,Q){var te=V.selection?V.selection():V;te.property("__zoom",X7),V!==te?T(V,X,Y,Q):te.interrupt().each(function(){E(this,arguments).event(Q).start().zoom(null,typeof X=="function"?X.apply(this,arguments):X).end()})},_.scaleBy=function(V,X,Y,Q){_.scaleTo(V,function(){var te=this.__zoom.k,I=typeof X=="function"?X.apply(this,arguments):X;return te*I},Y,Q)},_.scaleTo=function(V,X,Y,Q){_.transform(V,function(){var te=t.apply(this,arguments),I=this.__zoom,O=Y==null?C(te):typeof Y=="function"?Y.apply(this,arguments):Y,H=I.invert(O),G=typeof X=="function"?X.apply(this,arguments):X;return n(y(w(I,G),O,H),te,o)},Y,Q)},_.translateBy=function(V,X,Y,Q){_.transform(V,function(){return n(this.__zoom.translate(typeof X=="function"?X.apply(this,arguments):X,typeof Y=="function"?Y.apply(this,arguments):Y),t.apply(this,arguments),o)},null,Q)},_.translateTo=function(V,X,Y,Q,te){_.transform(V,function(){var I=t.apply(this,arguments),O=this.__zoom,H=Q==null?C(I):typeof Q=="function"?Q.apply(this,arguments):Q;return n(Qp.translate(H[0],H[1]).scale(O.k).translate(typeof X=="function"?-X.apply(this,arguments):-X,typeof Y=="function"?-Y.apply(this,arguments):-Y),I,o)},Q,te)};function w(V,X){return X=Math.max(a[0],Math.min(a[1],X)),X===V.k?V:new Ra(X,V.x,V.y)}function y(V,X,Y){var Q=X[0]-Y[0]*V.k,te=X[1]-Y[1]*V.k;return Q===V.x&&te===V.y?V:new Ra(V.k,Q,te)}function C(V){return[(+V[0][0]+ +V[1][0])/2,(+V[0][1]+ +V[1][1])/2]}function T(V,X,Y,Q){V.on("start.zoom",function(){E(this,arguments).event(Q).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(Q).end()}).tween("zoom",function(){var te=this,I=arguments,O=E(te,I).event(Q),H=t.apply(te,I),G=Y==null?C(H):typeof Y=="function"?Y.apply(te,I):Y,W=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),re=te.__zoom,ce=typeof X=="function"?X.apply(te,I):X,pe=u(re.invert(G).concat(W/re.k),ce.invert(G).concat(W/ce.k));return function(ne){if(ne===1)ne=ce;else{var B=pe(ne),se=W/B[2];ne=new Ra(se,G[0]-B[0]*se,G[1]-B[1]*se)}O.zoom(null,ne)}})}function E(V,X,Y){return!Y&&V.__zooming||new j(V,X)}function j(V,X){this.that=V,this.args=X,this.active=0,this.sourceEvent=null,this.extent=t.apply(V,X),this.taps=0}j.prototype={event:function(V){return V&&(this.sourceEvent=V),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(V,X){return this.mouse&&V!=="mouse"&&(this.mouse[1]=X.invert(this.mouse[0])),this.touch0&&V!=="touch"&&(this.touch0[1]=X.invert(this.touch0[0])),this.touch1&&V!=="touch"&&(this.touch1[1]=X.invert(this.touch1[0])),this.that.__zoom=X,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(V){var X=Di(this.that).datum();d.call(V,this.that,new Vee(V,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:d}),X)}};function N(V,...X){if(!e.apply(this,arguments))return;var Y=E(this,X).event(V),Q=this.__zoom,te=Math.max(a[0],Math.min(a[1],Q.k*Math.pow(2,r.apply(this,arguments)))),I=ys(V);if(Y.wheel)(Y.mouse[0][0]!==I[0]||Y.mouse[0][1]!==I[1])&&(Y.mouse[1]=Q.invert(Y.mouse[0]=I)),clearTimeout(Y.wheel);else{if(Q.k===te)return;Y.mouse=[I,Q.invert(I)],kf(this),Y.start()}od(V),Y.wheel=setTimeout(O,k),Y.zoom("mouse",n(y(w(Q,te),Y.mouse[0],Y.mouse[1]),Y.extent,o));function O(){Y.wheel=null,Y.end()}}function D(V,...X){if(g||!e.apply(this,arguments))return;var Y=V.currentTarget,Q=E(this,X,!0).event(V),te=Di(V.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",W,!0),I=ys(V,Y),O=V.clientX,H=V.clientY;GE(V.view),fb(V),Q.mouse=[I,this.__zoom.invert(I)],kf(this),Q.start();function G(re){if(od(re),!Q.moved){var ce=re.clientX-O,pe=re.clientY-H;Q.moved=ce*ce+pe*pe>S}Q.event(re).zoom("mouse",n(y(Q.that.__zoom,Q.mouse[0]=ys(re,Y),Q.mouse[1]),Q.extent,o))}function W(re){te.on("mousemove.zoom mouseup.zoom",null),VE(re.view,Q.moved),od(re),Q.event(re).end()}}function z(V,...X){if(e.apply(this,arguments)){var Y=this.__zoom,Q=ys(V.changedTouches?V.changedTouches[0]:V,this),te=Y.invert(Q),I=Y.k*(V.shiftKey?.5:2),O=n(y(w(Y,I),Q,te),t.apply(this,X),o);od(V),l>0?Di(this).transition().duration(l).call(T,O,Q,V):Di(this).call(_.transform,O,Q,V)}}function $(V,...X){if(e.apply(this,arguments)){var Y=V.touches,Q=Y.length,te=E(this,X,V.changedTouches.length===Q).event(V),I,O,H,G;for(fb(V),O=0;O`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.`},Yd=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],cA=["Enter"," ","Escape"],uA={"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 nu;(function(e){e.Strict="strict",e.Loose="loose"})(nu||(nu={}));var Nl;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Nl||(Nl={}));var Xd;(function(e){e.Partial="partial",e.Full="full"})(Xd||(Xd={}));const dA={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ro;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ro||(Ro={}));var tp;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(tp||(tp={}));var at;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(at||(at={}));const K7={[at.Left]:at.Right,[at.Right]:at.Left,[at.Top]:at.Bottom,[at.Bottom]:at.Top};function hA(e){return e===null?null:e?"valid":"invalid"}const fA=e=>"id"in e&&"source"in e&&"target"in e,Qee=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ix=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),kh=(e,t=[0,0])=>{const{width:n,height:r}=Wa(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},Jee=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const a=typeof i=="string";let o=!t.nodeLookup&&!a?i:void 0;t.nodeLookup&&(o=a?t.nodeLookup.get(i):ix(i)?i:t.nodeLookup.get(i.id));const l=o?np(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Jp(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return em(n)},Ch=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=Jp(n,np(i)),r=!0)}),r?em(n):{x:0,y:0,width:0,height:0}},sx=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{const l=(t.x-n)/i,u=(t.y-r)/i,d=t.width/i,m=t.height/i,f=[];for(const g of e.values()){const{measured:b,selectable:k=!0,hidden:S=!1}=g;if(o&&!k||S)continue;const x=b.width??g.width??g.initialWidth??0,_=b.height??g.height??g.initialHeight??0,{x:w,y}=g.internals.positionAbsolute,C=bA(l,u,d,m,w,y,x,_),T=x*_,E=a&&C>0;(!g.internals.handleBounds||E||C>=T||g.dragging)&&f.push(g)}return f},ete=(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 tte(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function nte({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;const l=tte(e,o),u=Ch(l),d=ox(u,t,n,(o==null?void 0:o.minZoom)??i,(o==null?void 0:o.maxZoom)??a,(o==null?void 0:o.padding)??.1);return await r.setViewport(d,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function pA({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:u,y:d}=l?l.internals.positionAbsolute:{x:0,y:0},m=o.origin??r;let f=o.extent||i;if(o.extent==="parent"&&!o.expandParent)if(!l)a==null||a("005",js.error005());else{const b=l.measured.width,k=l.measured.height;b&&k&&(f=[[u,d],[u+b,d+k]])}else l&&Ol(o.extent)&&(f=[[o.extent[0][0]+u,o.extent[0][1]+d],[o.extent[1][0]+u,o.extent[1][1]+d]]);const g=Ol(f)?Ll(t,f,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",js.error015())),{position:{x:g.x-u+(o.measured.width??0)*m[0],y:g.y-d+(o.measured.height??0)*m[1]},positionAbsolute:g}}async function rte({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const a=new Set(e.map(g=>g.id)),o=[];for(const g of n){if(g.deletable===!1)continue;const b=a.has(g.id),k=!b&&g.parentId&&o.find(S=>S.id===g.parentId);(b||k)&&o.push(g)}const l=new Set(t.map(g=>g.id)),u=r.filter(g=>g.deletable!==!1),m=ete(o,u);for(const g of u)l.has(g.id)&&!m.find(k=>k.id===g.id)&&m.push(g);if(!i)return{edges:m,nodes:o};const f=await i({nodes:o,edges:m});return typeof f=="boolean"?f?{edges:m,nodes:o}:{edges:[],nodes:[]}:f}const ru=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ll=(e={x:0,y:0},t,n)=>({x:ru(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ru(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function mA(e,t,n){const{width:r,height:i}=Wa(n),{x:a,y:o}=n.internals.positionAbsolute;return Ll(e,[[a,o],[a+r,o+i]],t)}const Z7=(e,t,n)=>en?-ru(Math.abs(e-n),1,t)/t:0,ax=(e,t,n=15,r=40)=>{const i=Z7(e.x,r,t.width-r)*n,a=Z7(e.y,r,t.height-r)*n;return[i,a]},Jp=(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)}),Wv=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),em=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Kd=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=ix(e)?e.internals.positionAbsolute:kh(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},np=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=ix(e)?e.internals.positionAbsolute:kh(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},gA=(e,t)=>em(Jp(Wv(e),Wv(t))),bA=(e,t,n,r,i,a,o,l)=>{const u=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),d=Math.max(0,Math.min(t+r,a+l)-Math.max(t,a));return Math.ceil(u*d)},rp=(e,t)=>bA(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Q7=e=>ks(e.width)&&ks(e.height)&&ks(e.x)&&ks(e.y),ks=e=>!isNaN(e)&&isFinite(e),vA=(e,t)=>(n,r)=>{},Eh=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Ah=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return a?Eh(l,o):l},iu=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Ec(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 ite(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Ec(e,n),i=Ec(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=Ec(e.top??e.y??0,n),i=Ec(e.bottom??e.y??0,n),a=Ec(e.left??e.x??0,t),o=Ec(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function ste(e,t,n,r,i,a){const{x:o,y:l}=iu(e,[t,n,r]),{x:u,y:d}=iu({x:e.x+e.width,y:e.y+e.height},[t,n,r]),m=i-u,f=a-d;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(m),bottom:Math.floor(f)}}const ox=(e,t,n,r,i,a)=>{const o=ite(a,t,n),l=(t-o.x)/e.width,u=(n-o.y)/e.height,d=Math.min(l,u),m=ru(d,r,i),f=e.x+e.width/2,g=e.y+e.height/2,b=t/2-f*m,k=n/2-g*m,S=ste(e,b,k,m,t,n),x={left:Math.min(S.left-o.left,0),top:Math.min(S.top-o.top,0),right:Math.min(S.right-o.right,0),bottom:Math.min(S.bottom-o.bottom,0)};return{x:b-x.left+x.right,y:k-x.top+x.bottom,zoom:m}},Zd=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ol(e){return e!=null&&e!=="parent"}function Wa(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 _A(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 xA(e,t={width:0,height:0},n,r,i){const a={...e},o=r.get(n);if(o){const l=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return a}function J7(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function ate(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function ote(e){return{...uA,...e||{}}}function kd(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:a,y:o}=Cs(e),l=Ah({x:a-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:u,y:d}=n?Eh(l,t):l;return{xSnapped:u,ySnapped:d,...l}}const lx=e=>({width:e.offsetWidth,height:e.offsetHeight}),yA=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},lte=["INPUT","SELECT","TEXTAREA"];function wA(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:lte.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const SA=e=>"clientX"in e,Cs=(e,t)=>{var a,o;const n=SA(e),r=n?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,i=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},e8=(e,t,n,r,i)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:i,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...lx(o)}})};function kA({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:l}){const u=e*.125+i*.375+o*.375+n*.125,d=t*.125+a*.375+l*.375+r*.125,m=Math.abs(u-e),f=Math.abs(d-t);return[u,d,m,f]}function nf(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function t8({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case at.Left:return[t-nf(t-r,a),n];case at.Right:return[t+nf(r-t,a),n];case at.Top:return[t,n-nf(n-i,a)];case at.Bottom:return[t,n+nf(i-n,a)]}}function CA({sourceX:e,sourceY:t,sourcePosition:n=at.Bottom,targetX:r,targetY:i,targetPosition:a=at.Top,curvature:o=.25}){const[l,u]=t8({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[d,m]=t8({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[f,g,b,k]=kA({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:u,targetControlX:d,targetControlY:m});return[`M${e},${t} C${l},${u} ${d},${m} ${r},${i}`,f,g,b,k]}function EA({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,a=n0}const dte=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,hte=(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)),fte=(e,t,n={})=>{var a;if(!e.source||!e.target)return(a=n.onError)==null||a.call(n,"006",js.error006()),t;const r=n.getEdgeId||dte;let i;return fA(e)?i={...e}:i={...e,id:r(e)},hte(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function AA({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,a,o,l]=EA({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,l]}const n8={[at.Left]:{x:-1,y:0},[at.Right]:{x:1,y:0},[at.Top]:{x:0,y:-1},[at.Bottom]:{x:0,y:1}},pte=({source:e,sourcePosition:t=at.Bottom,target:n})=>t===at.Left||t===at.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function mte({source:e,sourcePosition:t=at.Bottom,target:n,targetPosition:r=at.Top,center:i,offset:a,stepPosition:o}){const l=n8[t],u=n8[r],d={x:e.x+l.x*a,y:e.y+l.y*a},m={x:n.x+u.x*a,y:n.y+u.y*a},f=pte({source:d,sourcePosition:t,target:m}),g=f.x!==0?"x":"y",b=f[g];let k=[],S,x;const _={x:0,y:0},w={x:0,y:0},[,,y,C]=EA({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[g]*u[g]===-1){g==="x"?(S=i.x??d.x+(m.x-d.x)*o,x=i.y??(d.y+m.y)/2):(S=i.x??(d.x+m.x)/2,x=i.y??d.y+(m.y-d.y)*o);const N=[{x:S,y:d.y},{x:S,y:m.y}],D=[{x:d.x,y:x},{x:m.x,y:x}];l[g]===b?k=g==="x"?N:D:k=g==="x"?D:N}else{const N=[{x:d.x,y:m.y}],D=[{x:m.x,y:d.y}];if(g==="x"?k=l.x===b?D:N:k=l.y===b?N:D,t===r){const V=Math.abs(e[g]-n[g]);if(V<=a){const X=Math.min(a-1,a-V);l[g]===b?_[g]=(d[g]>e[g]?-1:1)*X:w[g]=(m[g]>n[g]?-1:1)*X}}if(t!==r){const V=g==="x"?"y":"x",X=l[g]===u[V],Y=d[V]>m[V],Q=d[V]=U?(S=(z.x+$.x)/2,x=k[0].y):(S=k[0].x,x=(z.y+$.y)/2)}const T={x:d.x+_.x,y:d.y+_.y},E={x:m.x+w.x,y:m.y+w.y};return[[e,...T.x!==k[0].x||T.y!==k[0].y?[T]:[],...k,...E.x!==k[k.length-1].x||E.y!==k[k.length-1].y?[E]:[],n],S,x,y,C]}function gte(e,t,n,r){const i=Math.min(r8(e,t)/2,r8(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){const d=e.xn.id===t):e[0])||null}function Xv(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function vte(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const a=new Set;return e.reduce((o,l)=>([l.markerStart||r,l.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const d=Xv(u,t);a.has(d)||(o.push({id:d,color:u.color||n,...u}),a.add(d))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const TA=1e3,_te=10,cx={nodeOrigin:[0,0],nodeExtent:Yd,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},xte={...cx,checkEquality:!0};function ux(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function yte(e,t,n){const r=ux(cx,n);for(const i of e.values())if(i.parentId)hx(i,e,t,r);else{const a=kh(i,r.nodeOrigin),o=Ol(i.extent)?i.extent:r.nodeExtent,l=Ll(a,o,Wa(i));i.internals.positionAbsolute=l}}function wte(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const a={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(a):i.type==="target"&&r.push(a)}return{source:n,target:r}}function dx(e){return e==="manual"}function Kv(e,t,n,r={}){var m,f;const i=ux(xte,r),a={i:0},o=new Map(t),l=i!=null&&i.elevateNodesOnSelect&&!dx(i.zIndexMode)?TA:0;let u=e.length>0,d=!1;t.clear(),n.clear();for(const g of e){let b=o.get(g.id);if(i.checkEquality&&g===(b==null?void 0:b.internals.userNode))t.set(g.id,b);else{const k=kh(g,i.nodeOrigin),S=Ol(g.extent)?g.extent:i.nodeExtent,x=Ll(k,S,Wa(g));b={...i.defaults,...g,measured:{width:(m=g.measured)==null?void 0:m.width,height:(f=g.measured)==null?void 0:f.height},internals:{positionAbsolute:x,handleBounds:wte(g,b),z:NA(g,l,i.zIndexMode),userNode:g}},t.set(g.id,b)}(b.measured===void 0||b.measured.width===void 0||b.measured.height===void 0)&&!b.hidden&&(u=!1),g.parentId&&hx(b,t,n,r,a),d||(d=g.selected??!1)}return{nodesInitialized:u,hasSelectedNodes:d}}function Ste(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 hx(e,t,n,r,i){const{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:l,zIndexMode:u}=ux(cx,r),d=e.parentId,m=t.get(d);if(!m){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Ste(e,n),i&&!m.parentId&&m.internals.rootParentIndex===void 0&&u==="auto"&&(m.internals.rootParentIndex=++i.i,m.internals.z=m.internals.z+i.i*_te),i&&m.internals.rootParentIndex!==void 0&&(i.i=m.internals.rootParentIndex);const f=a&&!dx(u)?TA:0,{x:g,y:b,z:k}=kte(e,m,o,l,f,u),{positionAbsolute:S}=e.internals,x=g!==S.x||b!==S.y;(x||k!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:g,y:b}:S,z:k}})}function NA(e,t,n){const r=ks(e.zIndex)?e.zIndex:0;return dx(n)?r:r+(e.selected?t:0)}function kte(e,t,n,r,i,a){const{x:o,y:l}=t.internals.positionAbsolute,u=Wa(e),d=kh(e,n),m=Ol(e.extent)?Ll(d,e.extent,u):d;let f=Ll({x:o+m.x,y:l+m.y},r,u);e.extent==="parent"&&(f=mA(f,u,t));const g=NA(e,i,a),b=t.internals.z??0;return{x:f.x,y:f.y,z:b>=g?b+1:g}}function fx(e,t,n,r=[0,0]){var o;const i=[],a=new Map;for(const l of e){const u=t.get(l.parentId);if(!u)continue;const d=((o=a.get(l.parentId))==null?void 0:o.expandedRect)??Kd(u),m=gA(d,l.rect);a.set(l.parentId,{expandedRect:m,parent:u})}return a.size>0&&a.forEach(({expandedRect:l,parent:u},d)=>{var y;const m=u.internals.positionAbsolute,f=Wa(u),g=u.origin??r,b=l.x0||k>0||_||w)&&(i.push({id:d,type:"position",position:{x:u.position.x-b+_,y:u.position.y-k+w}}),(y=n.get(d))==null||y.forEach(C=>{e.some(T=>T.id===C.id)||i.push({id:C.id,type:"position",position:{x:C.position.x+b,y:C.position.y+k}})})),(f.width0){const b=fx(g,t,n,i);d.push(...b)}return{changes:d,updatedInternals:u}}async function Ete({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function o8(e,t,n,r,i,a){let o=i;const l=r.get(o)||new Map;r.set(o,l.set(n,t)),o=`${i}-${e}`;const u=r.get(o)||new Map;if(r.set(o,u.set(n,t)),a){o=`${i}-${e}-${a}`;const d=r.get(o)||new Map;r.set(o,d.set(n,t))}}function jA(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:a,sourceHandle:o=null,targetHandle:l=null}=r,u={edgeId:r.id,source:i,target:a,sourceHandle:o,targetHandle:l},d=`${i}-${o}--${a}-${l}`,m=`${a}-${l}--${i}-${o}`;o8("source",u,m,e,i,o),o8("target",u,d,e,a,l),t.set(r.id,r)}}function MA(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:MA(n,t):!1}function l8(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Ate(e,t,n,r){const i=new Map;for(const[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!MA(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(a);l&&i.set(a,{id:a,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function pb({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,u;const i=[];for(const[d,m]of t){const f=(o=n.get(d))==null?void 0:o.internals.userNode;f&&i.push({...f,position:m.position,dragging:r})}if(!e)return[i[0],i];const a=(l=n.get(e))==null?void 0:l.internals.userNode;return[a?{...a,position:((u=t.get(e))==null?void 0:u.position)||a.position,dragging:r}:i[0],i]}function Tte({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const a={x:n-i.distance.x,y:r-i.distance.y},o=Eh(a,t);return{x:o.x-a.x,y:o.y-a.y}}function Nte({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,l=new Map,u=!1,d={x:0,y:0},m=null,f=!1,g=null,b=!1,k=!1,S=null;function x({noDragClassName:w,handleSelector:y,domNode:C,isSelectable:T,nodeId:E,nodeClickDistance:j=0}){g=Di(C);function N({x:F,y:U}){const{nodeLookup:V,nodeExtent:X,snapGrid:Y,snapToGrid:Q,nodeOrigin:te,onNodeDrag:I,onSelectionDrag:O,onError:H,updateNodePositions:G}=t();a={x:F,y:U};let W=!1;const re=l.size>1,ce=re&&X?Wv(Ch(l)):null,pe=re&&Q?Tte({dragItems:l,snapGrid:Y,x:F,y:U}):null;for(const[ne,B]of l){if(!V.has(ne))continue;let se={x:F-B.distance.x,y:U-B.distance.y};Q&&(se=pe?{x:Math.round(se.x+pe.x),y:Math.round(se.y+pe.y)}:Eh(se,Y));let oe=null;if(re&&X&&!B.extent&&ce){const{positionAbsolute:Ce}=B.internals,Le=Ce.x-ce.x+X[0][0],Fe=Ce.x+B.measured.width-ce.x2+X[1][0],Ve=Ce.y-ce.y+X[0][1],Pe=Ce.y+B.measured.height-ce.y2+X[1][1];oe=[[Le,Ve],[Fe,Pe]]}const{position:_e,positionAbsolute:be}=pA({nodeId:ne,nextPosition:se,nodeLookup:V,nodeExtent:oe||X,nodeOrigin:te,onError:H});W=W||B.position.x!==_e.x||B.position.y!==_e.y,B.position=_e,B.internals.positionAbsolute=be}if(k=k||W,!!W&&(G(l,!0),S&&(r||I||!E&&O))){const[ne,B]=pb({nodeId:E,dragItems:l,nodeLookup:V});r==null||r(S,l,ne,B),I==null||I(S,ne,B),E||O==null||O(S,B)}}async function D(){if(!m)return;const{transform:F,panBy:U,autoPanSpeed:V,autoPanOnNodeDrag:X}=t();if(!X){u=!1,cancelAnimationFrame(o);return}const[Y,Q]=ax(d,m,V);(Y!==0||Q!==0)&&(a.x=(a.x??0)-Y/F[2],a.y=(a.y??0)-Q/F[2],await U({x:Y,y:Q})&&N(a)),o=requestAnimationFrame(D)}function z(F){var re;const{nodeLookup:U,multiSelectionActive:V,nodesDraggable:X,transform:Y,snapGrid:Q,snapToGrid:te,selectNodesOnDrag:I,onNodeDragStart:O,onSelectionDragStart:H,unselectNodesAndEdges:G}=t();f=!0,(!I||!T)&&!V&&E&&((re=U.get(E))!=null&&re.selected||G()),T&&I&&E&&(e==null||e(E));const W=kd(F.sourceEvent,{transform:Y,snapGrid:Q,snapToGrid:te,containerBounds:m});if(a=W,l=Ate(U,X,W,E),l.size>0&&(n||O||!E&&H)){const[ce,pe]=pb({nodeId:E,dragItems:l,nodeLookup:U});n==null||n(F.sourceEvent,l,ce,pe),O==null||O(F.sourceEvent,ce,pe),E||H==null||H(F.sourceEvent,pe)}}const $=WE().clickDistance(j).on("start",F=>{const{domNode:U,nodeDragThreshold:V,transform:X,snapGrid:Y,snapToGrid:Q}=t();m=(U==null?void 0:U.getBoundingClientRect())||null,b=!1,k=!1,S=F.sourceEvent,V===0&&z(F),a=kd(F.sourceEvent,{transform:X,snapGrid:Y,snapToGrid:Q,containerBounds:m}),d=Cs(F.sourceEvent,m)}).on("drag",F=>{const{autoPanOnNodeDrag:U,transform:V,snapGrid:X,snapToGrid:Y,nodeDragThreshold:Q,nodeLookup:te}=t(),I=kd(F.sourceEvent,{transform:V,snapGrid:X,snapToGrid:Y,containerBounds:m});if(S=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||E&&!te.has(E))&&(b=!0),!b){if(!u&&U&&f&&(u=!0,D()),!f){const O=Cs(F.sourceEvent,m),H=O.x-d.x,G=O.y-d.y;Math.sqrt(H*H+G*G)>Q&&z(F)}(a.x!==I.xSnapped||a.y!==I.ySnapped)&&l&&f&&(d=Cs(F.sourceEvent,m),N(I))}}).on("end",F=>{if(!f||b){b&&l.size>0&&t().updateNodePositions(l,!1);return}if(u=!1,f=!1,cancelAnimationFrame(o),l.size>0){const{nodeLookup:U,updateNodePositions:V,onNodeDragStop:X,onSelectionDragStop:Y}=t();if(k&&(V(l,!1),k=!1),i||X||!E&&Y){const[Q,te]=pb({nodeId:E,dragItems:l,nodeLookup:U,dragging:!1});i==null||i(F.sourceEvent,l,Q,te),X==null||X(F.sourceEvent,Q,te),E||Y==null||Y(F.sourceEvent,te)}}}).filter(F=>{const U=F.target;return!F.button&&(!w||!l8(U,`.${w}`,C))&&(!y||l8(U,y,C))});g.call($)}function _(){g==null||g.on(".drag",null)}return{update:x,destroy:_}}function jte(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())rp(i,Kd(a))>0&&r.push(a);return r}const Mte=250;function Rte(e,t,n,r){var l,u;let i=[],a=1/0;const o=jte(e,n,t+Mte);for(const d of o){const m=[...((l=d.internals.handleBounds)==null?void 0:l.source)??[],...((u=d.internals.handleBounds)==null?void 0:u.target)??[]];for(const f of m){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:g,y:b}=Il(d,f,f.position,!0),k=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(b-e.y,2));k>t||(k1){const d=r.type==="source"?"target":"source";return i.find(m=>m.type===d)??i[0]}return i[0]}function RA(e,t,n,r,i,a=!1){var d,m,f;const o=r.get(e);if(!o)return null;const l=i==="strict"?(d=o.internals.handleBounds)==null?void 0:d[t]:[...((m=o.internals.handleBounds)==null?void 0:m.source)??[],...((f=o.internals.handleBounds)==null?void 0:f.target)??[]],u=(n?l==null?void 0:l.find(g=>g.id===n):l==null?void 0:l[0])??null;return u&&a?{...u,...Il(o,u,u.position,!0)}:u}function DA(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Dte(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const LA=()=>!0;function Lte(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:l,nodeLookup:u,lib:d,autoPanOnConnect:m,flowId:f,panBy:g,cancelConnection:b,onConnectStart:k,onConnect:S,onConnectEnd:x,isValidConnection:_=LA,onReconnectEnd:w,updateConnection:y,getTransform:C,getFromHandle:T,autoPanSpeed:E,dragThreshold:j=1,handleDomNode:N}){const D=yA(e.target);let z=0,$;const{x:F,y:U}=Cs(e),V=DA(a,N),X=l==null?void 0:l.getBoundingClientRect();let Y=!1;if(!X||!V)return;const Q=RA(i,V,r,u,t);if(!Q)return;let te=Cs(e,X),I=!1,O=null,H=!1,G=null;function W(){if(!m||!X)return;const[_e,be]=ax(te,X,E);g({x:_e,y:be}),z=requestAnimationFrame(W)}const re={...Q,nodeId:i,type:V,position:Q.position},ce=u.get(i);let ne={inProgress:!0,isValid:null,from:Il(ce,re,at.Left,!0),fromHandle:re,fromPosition:re.position,fromNode:ce,to:te,toHandle:null,toPosition:K7[re.position],toNode:null,pointer:te};function B(){Y=!0,y(ne),k==null||k(e,{nodeId:i,handleId:r,handleType:V})}j===0&&B();function se(_e){if(!Y){const{x:Pe,y:dt}=Cs(_e),Qe=Pe-F,qe=dt-U;if(!(Qe*Qe+qe*qe>j*j))return;B()}if(!T()||!re){oe(_e);return}const be=C();te=Cs(_e,X),$=Rte(Ah(te,be,!1,[1,1]),n,u,re),I||(W(),I=!0);const Ce=OA(_e,{handle:$,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:_,doc:D,lib:d,flowId:f,nodeLookup:u});G=Ce.handleDomNode,O=Ce.connection,H=Dte(!!$,Ce.isValid);const Le=u.get(i),Fe=Le?Il(Le,re,at.Left,!0):ne.from,Ve={...ne,from:Fe,isValid:H,to:Ce.toHandle&&H?iu({x:Ce.toHandle.x,y:Ce.toHandle.y},be):te,toHandle:Ce.toHandle,toPosition:H&&Ce.toHandle?Ce.toHandle.position:K7[re.position],toNode:Ce.toHandle?u.get(Ce.toHandle.nodeId):null,pointer:te};y(Ve),ne=Ve}function oe(_e){if(!("touches"in _e&&_e.touches.length>0)){if(Y){($||G)&&O&&H&&(S==null||S(O));const{inProgress:be,...Ce}=ne,Le={...Ce,toPosition:ne.toHandle?ne.toPosition:null};x==null||x(_e,Le),a&&(w==null||w(_e,Le))}b(),cancelAnimationFrame(z),I=!1,H=!1,O=null,G=null,D.removeEventListener("mousemove",se),D.removeEventListener("mouseup",oe),D.removeEventListener("touchmove",se),D.removeEventListener("touchend",oe)}}D.addEventListener("mousemove",se),D.addEventListener("mouseup",oe),D.addEventListener("touchmove",se),D.addEventListener("touchend",oe)}function OA(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:l,flowId:u,isValidConnection:d=LA,nodeLookup:m}){const f=a==="target",g=t?o.querySelector(`.${l}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:b,y:k}=Cs(e),S=o.elementFromPoint(b,k),x=S!=null&&S.classList.contains(`${l}-flow__handle`)?S:g,_={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const w=DA(void 0,x),y=x.getAttribute("data-nodeid"),C=x.getAttribute("data-handleid"),T=x.classList.contains("connectable"),E=x.classList.contains("connectableend");if(!y||!w)return _;const j={source:f?y:r,sourceHandle:f?C:i,target:f?r:y,targetHandle:f?i:C};_.connection=j;const D=T&&E&&(n===nu.Strict?f&&w==="source"||!f&&w==="target":y!==r||C!==i);_.isValid=D&&d(j),_.toHandle=RA(y,w,C,m,n,!0)}return _}const Zv={onPointerDown:Lte,isValid:OA};function Ote({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=Di(e);function a({translateExtent:l,width:u,height:d,zoomStep:m=1,pannable:f=!0,zoomable:g=!0,inversePan:b=!1}){const k=y=>{if(y.sourceEvent.type!=="wheel"||!t)return;const C=n(),T=y.sourceEvent.ctrlKey&&Zd()?10:1,E=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*m,j=C[2]*Math.pow(2,E*T);t.scaleTo(j)};let S=[0,0];const x=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(S=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},_=y=>{const C=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const T=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],E=[T[0]-S[0],T[1]-S[1]];S=T;const j=r()*Math.max(C[2],Math.log(C[2]))*(b?-1:1),N={x:C[0]-E[0]*j,y:C[1]-E[1]*j},D=[[0,0],[u,d]];t.setViewportConstrained({x:N.x,y:N.y,zoom:C[2]},D,l)},w=lA().on("start",x).on("zoom",f?_:null).on("zoom.wheel",g?k:null);i.call(w,{})}function o(){i.on("zoom",null)}return{update:a,destroy:o,pointer:ys}}const tm=e=>({x:e.x,y:e.y,zoom:e.k}),mb=({x:e,y:t,zoom:n})=>Qp.translate(e,t).scale(n),Oc=(e,t)=>e.target.closest(`.${t}`),IA=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Ite=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,gb=(e,t=0,n=Ite,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},zA=e=>{const t=e.ctrlKey&&Zd()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function zte({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:d}){return m=>{if(Oc(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(m.ctrlKey&&o){const x=ys(m),_=zA(m),w=f*Math.pow(2,_);r.scaleTo(n,w,x,m);return}const g=m.deltaMode===1?20:1;let b=i===Nl.Vertical?0:m.deltaX*g,k=i===Nl.Horizontal?0:m.deltaY*g;!Zd()&&m.shiftKey&&i!==Nl.Vertical&&(b=m.deltaY*g,k=0),r.translateBy(n,-(b/f)*a,-(k/f)*a,{internal:!0});const S=tm(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(m,S),e.panScrollTimeout=setTimeout(()=>{d==null||d(m,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(m,S))}}function Bte({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const a=r.type==="wheel",o=!t&&a&&!r.ctrlKey,l=Oc(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,i)}}function Hte({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,o,l;if((a=r.sourceEvent)!=null&&a.internal)return;const i=tm(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function $te({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{var o,l;e.usedRightMouseButton=!!(n&&IA(t,e.mouseButton??0)),(o=a.sourceEvent)!=null&&o.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!((l=a.sourceEvent)!=null&&l.internal)&&(i==null||i(a.sourceEvent,tm(a.transform)))}}function Fte({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,a&&IA(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const u=tm(o.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,u)},n?150:0)}}}function Pte({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:l,noPanClassName:u,lib:d,connectionInProgress:m}){return f=>{var x;const g=e||t,b=n&&f.ctrlKey,k=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Oc(f,`${d}-flow__node`)||Oc(f,`${d}-flow__edge`)))return!0;if(!r&&!g&&!i&&!a&&!n||o||m&&!k||Oc(f,l)&&k||Oc(f,u)&&(!k||i&&k&&!e)||!n&&f.ctrlKey&&k)return!1;if(!n&&f.type==="touchstart"&&((x=f.touches)==null?void 0:x.length)>1)return f.preventDefault(),!1;if(!g&&!i&&!b&&k||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const S=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||k)&&S}}function Ute({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:u}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),f=lA().scaleExtent([t,n]).translateExtent(r),g=Di(e).call(f);w({x:i.x,y:i.y,zoom:ru(i.zoom,t,n)},[[0,0],[m.width,m.height]],r);const b=g.on("wheel.zoom"),k=g.on("dblclick.zoom");f.wheelDelta(zA);async function S($,F){return g?new Promise(U=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Sd:yf).transform(gb(g,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>U(!0)),$)}):!1}function x({noWheelClassName:$,noPanClassName:F,onPaneContextMenu:U,userSelectionActive:V,panOnScroll:X,panOnDrag:Y,panOnScrollMode:Q,panOnScrollSpeed:te,preventScrolling:I,zoomOnPinch:O,zoomOnScroll:H,zoomOnDoubleClick:G,zoomActivationKeyPressed:W,lib:re,onTransformChange:ce,connectionInProgress:pe,paneClickDistance:ne,selectionOnDrag:B}){V&&!d.isZoomingOrPanning&&_();const se=X&&!W&&!V;f.clickDistance(B?1/0:!ks(ne)||ne<0?0:ne);const oe=se?zte({zoomPanValues:d,noWheelClassName:$,d3Selection:g,d3Zoom:f,panOnScrollMode:Q,panOnScrollSpeed:te,zoomOnPinch:O,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:l}):Bte({noWheelClassName:$,preventScrolling:I,d3ZoomHandler:b});g.on("wheel.zoom",oe,{passive:!1});const _e=Hte({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:o});f.on("start",_e);const be=$te({zoomPanValues:d,panOnDrag:Y,onPaneContextMenu:!!U,onPanZoom:a,onTransformChange:ce});f.on("zoom",be);const Ce=Fte({zoomPanValues:d,panOnDrag:Y,panOnScroll:X,onPaneContextMenu:U,onPanZoomEnd:l,onDraggingChange:u});f.on("end",Ce);const Le=Pte({zoomActivationKeyPressed:W,panOnDrag:Y,zoomOnScroll:H,panOnScroll:X,zoomOnDoubleClick:G,zoomOnPinch:O,userSelectionActive:V,noPanClassName:F,noWheelClassName:$,lib:re,connectionInProgress:pe});f.filter(Le),G?g.on("dblclick.zoom",k):g.on("dblclick.zoom",null)}function _(){f.on("zoom",null)}async function w($,F,U){const V=mb($),X=f==null?void 0:f.constrain()(V,F,U);return X&&await S(X),X}async function y($,F){const U=mb($);return await S(U,F),U}function C($){if(g){const F=mb($),U=g.property("__zoom");(U.k!==$.zoom||U.x!==$.x||U.y!==$.y)&&(f==null||f.transform(g,F,null,{sync:!0}))}}function T(){const $=g?oA(g.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}async function E($,F){return g?new Promise(U=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Sd:yf).scaleTo(gb(g,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>U(!0)),$)}):!1}async function j($,F){return g?new Promise(U=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Sd:yf).scaleBy(gb(g,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>U(!0)),$)}):!1}function N($){f==null||f.scaleExtent($)}function D($){f==null||f.translateExtent($)}function z($){const F=!ks($)||$<0?0:$;f==null||f.clickDistance(F)}return{update:x,destroy:_,setViewport:y,setViewportConstrained:w,getViewport:T,scaleTo:E,scaleBy:j,setScaleExtent:N,setTranslateExtent:D,syncViewport:C,setClickDistance:z}}var su;(function(e){e.Line="line",e.Handle="handle"})(su||(su={}));function qte({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){const o=e-t,l=n-r,u=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&i&&(u[0]=u[0]*-1),l&&a&&(u[1]=u[1]*-1),u}function c8(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function jo(e,t){return Math.max(0,t-e)}function Mo(e,t){return Math.max(0,e-t)}function rf(e,t,n){return Math.max(0,t-e,e-n)}function u8(e,t){return e?!t:t}function Gte(e,t,n,r,i,a,o,l){let{affectsX:u,affectsY:d}=t;const{isHorizontal:m,isVertical:f}=t,g=m&&f,{xSnapped:b,ySnapped:k}=n,{minWidth:S,maxWidth:x,minHeight:_,maxHeight:w}=r,{x:y,y:C,width:T,height:E,aspectRatio:j}=e;let N=Math.floor(m?b-e.pointerX:0),D=Math.floor(f?k-e.pointerY:0);const z=T+(u?-N:N),$=E+(d?-D:D),F=-a[0]*T,U=-a[1]*E;let V=rf(z,S,x),X=rf($,_,w);if(o){let te=0,I=0;u&&N<0?te=jo(y+N+F,o[0][0]):!u&&N>0&&(te=Mo(y+z+F,o[1][0])),d&&D<0?I=jo(C+D+U,o[0][1]):!d&&D>0&&(I=Mo(C+$+U,o[1][1])),V=Math.max(V,te),X=Math.max(X,I)}if(l){let te=0,I=0;u&&N>0?te=Mo(y+N,l[0][0]):!u&&N<0&&(te=jo(y+z,l[1][0])),d&&D>0?I=Mo(C+D,l[0][1]):!d&&D<0&&(I=jo(C+$,l[1][1])),V=Math.max(V,te),X=Math.max(X,I)}if(i){if(m){const te=rf(z/j,_,w)*j;if(V=Math.max(V,te),o){let I=0;!u&&!d||u&&!d&&g?I=Mo(C+U+z/j,o[1][1])*j:I=jo(C+U+(u?N:-N)/j,o[0][1])*j,V=Math.max(V,I)}if(l){let I=0;!u&&!d||u&&!d&&g?I=jo(C+z/j,l[1][1])*j:I=Mo(C+(u?N:-N)/j,l[0][1])*j,V=Math.max(V,I)}}if(f){const te=rf($*j,S,x)/j;if(X=Math.max(X,te),o){let I=0;!u&&!d||d&&!u&&g?I=Mo(y+$*j+F,o[1][0])/j:I=jo(y+(d?D:-D)*j+F,o[0][0])/j,X=Math.max(X,I)}if(l){let I=0;!u&&!d||d&&!u&&g?I=jo(y+$*j,l[1][0])/j:I=Mo(y+(d?D:-D)*j,l[0][0])/j,X=Math.max(X,I)}}}D=D+(D<0?X:-X),N=N+(N<0?V:-V),i&&(g?z>$*j?D=(u8(u,d)?-N:N)/j:N=(u8(u,d)?-D:D)*j:m?(D=N/j,d=u):(N=D*j,u=d));const Y=u?y+N:y,Q=d?C+D:C;return{width:T+(u?-N:N),height:E+(d?-D:D),x:a[0]*N*(u?-1:1)+Y,y:a[1]*D*(d?-1:1)+Q}}const BA={width:0,height:0,x:0,y:0},Vte={...BA,pointerX:0,pointerY:0,aspectRatio:1};function Wte(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,l=n[0]*a,u=n[1]*o;return[[r-l,i-u],[r+a-l,i+o-u]]}function Yte({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const a=Di(e);let o={controlDirection:c8("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:d,boundaries:m,keepAspectRatio:f,resizeDirection:g,onResizeStart:b,onResize:k,onResizeEnd:S,shouldResize:x}){let _={...BA},w={...Vte};o={boundaries:m,resizeDirection:g,keepAspectRatio:f,controlDirection:c8(d)};let y,C=null,T=[],E,j,N,D=!1;const z=WE().on("start",$=>{const{nodeLookup:F,transform:U,snapGrid:V,snapToGrid:X,nodeOrigin:Y,paneDomNode:Q}=n();if(y=F.get(t),!y)return;C=(Q==null?void 0:Q.getBoundingClientRect())??null;const{xSnapped:te,ySnapped:I}=kd($.sourceEvent,{transform:U,snapGrid:V,snapToGrid:X,containerBounds:C});_={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={..._,pointerX:te,pointerY:I,aspectRatio:_.width/_.height},E=void 0,j=Ol(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(E=F.get(y.parentId)),E&&y.extent==="parent"&&(j=[[0,0],[E.measured.width,E.measured.height]]),T=[],N=void 0;for(const[O,H]of F)if(H.parentId===t&&(T.push({id:O,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const G=Wte(H,y,H.origin??Y);N?N=[[Math.min(G[0][0],N[0][0]),Math.min(G[0][1],N[0][1])],[Math.max(G[1][0],N[1][0]),Math.max(G[1][1],N[1][1])]]:N=G}b==null||b($,{..._})}).on("drag",$=>{const{transform:F,snapGrid:U,snapToGrid:V,nodeOrigin:X}=n(),Y=kd($.sourceEvent,{transform:F,snapGrid:U,snapToGrid:V,containerBounds:C}),Q=[];if(!y)return;const{x:te,y:I,width:O,height:H}=_,G={},W=y.origin??X,{width:re,height:ce,x:pe,y:ne}=Gte(w,o.controlDirection,Y,o.boundaries,o.keepAspectRatio,W,j,N),B=re!==O,se=ce!==H,oe=pe!==te&&B,_e=ne!==I&&se;if(!oe&&!_e&&!B&&!se)return;if((oe||_e||W[0]===1||W[1]===1)&&(G.x=oe?pe:_.x,G.y=_e?ne:_.y,_.x=G.x,_.y=G.y,T.length>0)){const Fe=pe-te,Ve=ne-I;for(const Pe of T)Pe.position={x:Pe.position.x-Fe+W[0]*(re-O),y:Pe.position.y-Ve+W[1]*(ce-H)},Q.push(Pe)}if((B||se)&&(G.width=B&&(!o.resizeDirection||o.resizeDirection==="horizontal")?re:_.width,G.height=se&&(!o.resizeDirection||o.resizeDirection==="vertical")?ce:_.height,_.width=G.width,_.height=G.height),E&&y.expandParent){const Fe=W[0]*(G.width??0);G.x&&G.x{D&&(S==null||S($,{..._}),i==null||i({..._}),D=!1)});a.call(z)}function u(){a.on(".drag",null)}return{update:l,destroy:u}}var bb={exports:{}},vb={},_b={exports:{}},xb={};/** +Its experiments, runs and chats are removed from orx. The local folder (${d.path})${m?" and its GitHub repository":""} are kept.`)){l(d.id);try{await LR(d.id),r(d.id)}catch(g){window.alert(g instanceof Error?g.message:String(g))}finally{l(null)}}}return h.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[h.jsxs("div",{className:"home-inner max-w-155 my-0 mx-auto pt-12 px-6 pb-16",children:[h.jsx("div",{className:"home-brand font-display text-4xl tracking-[-0.02em] mb-9",children:h.jsx(ff,{})}),h.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-2xl [&_h2]:tracking-[-0.01em]",children:[h.jsx("h2",{children:"Projects"}),h.jsxs("button",{className:ci,onClick:()=>a(!0),children:[h.jsx(o_,{size:15})," New project"]})]}),h.jsx("div",{className:"home-list flex flex-col gap-2.5",children:e.length===0?h.jsx("div",{className:"changes-note text-sm text-muted",children:"No projects yet — create one to get started."}):[...e].sort((d,m)=>m.updatedAt-d.updatedAt).map(d=>{const m=!!(d.githubUrl||d.githubOwner&&d.githubRepo),f=d.githubUrl??(d.githubOwner&&d.githubRepo?`https://github.com/${d.githubOwner}/${d.githubRepo}`:null),g=d.githubEnabled?"GitHub syncing on":m?"GitHub syncing off":"local only";return h.jsxs("div",{className:"project-card relative flex flex-col gap-1 text-left py-3.5 px-4 bg-background border border-border rounded-lg cursor-pointer transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-[0_3px_12px_color-mix(in_srgb,_var(--text)_8%,_transparent)] [&_>_:not(.project-card-open,_.project-delete)]:relative [&_>_:not(.project-card-open,_.project-delete)]:z-1 [&_>_:not(.project-card-open,_.project-delete)]:pointer-events-none [&_.project-delete]:absolute [&_.project-delete]:top-2.5 [&_.project-delete]:right-2.5 [&_.project-delete]:z-2 [&_.project-delete]:hidden [&_.project-delete]:p-[5px] [&_.project-delete]:rounded-sm [&_.project-delete]:text-muted [&_.project-delete]:leading-[0] [&:is(:hover,_:focus-within)_.project-delete]:block [&_.name]:font-semibold [&_.name]:text-base [&_.paper]:text-xs [&_.paper]:text-muted [&_.time]:text-xs [&_.time]:text-muted",children:[h.jsx("button",{className:"project-card-open absolute inset-0 rounded-[inherit] [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2","aria-label":`Open ${d.name}`,onClick:()=>t(d.id)}),h.jsx("span",{className:"name",children:d.name}),h.jsxs("span",{className:`project-card-sync [&_a]:pointer-events-auto inline-flex items-center self-start gap-[7px] text-text [&_a]:inline-flex [&_a]:text-subtext [&_a:hover]:text-text ${nn}`,children:[g,d.githubEnabled&&f&&h.jsx("a",{href:f,target:"_blank",rel:"noreferrer","data-tip":"Open repository on GitHub","aria-label":`Open ${d.name} on GitHub`,onClick:b=>b.stopPropagation(),children:h.jsx(Op,{size:14})})]}),d.paperId&&h.jsxs("span",{className:`paper ${nn}`,children:["arXiv ",d.paperId]}),h.jsxs("span",{className:"time",children:["created ",Ks(d.createdAt)]}),h.jsx("button",{className:"project-delete [&:hover]:text-[var(--danger,_#d33)] [&:hover]:bg-[var(--overlay,_rgba(0,_0,_0,_0.05))]","data-tip":`Delete ${d.name}`,"data-tip-align":"end","aria-label":`Delete ${d.name}`,disabled:o===d.id,onClick:b=>{b.stopPropagation(),c(d)},children:h.jsx(uh,{size:14})})]},d.id)})})]}),i&&h.jsx(BE,{onClose:()=>a(!1),onCreated:(d,m)=>{a(!1),n(d,m)}})]})}const D7=["experiment-table-action inline-flex items-center gap-1.5 py-1.5 px-2.5","border border-border rounded-md bg-background text-text","text-sm font-medium leading-none","[&:hover:not(:disabled)]:bg-surface","[&:hover:not(:disabled)]:border-border-strong [&:disabled]:text-muted","[&:disabled]:cursor-default [&:disabled]:opacity-50","[&.danger]:border-[color-mix(in_oklab,_var(--accent-red)_42%,_var(--border))]","[&.danger]:bg-[color-mix(in_oklab,_var(--accent-red)_6%,_var(--base))]","[&.danger]:text-accent-red [&.danger:hover:not(:disabled)]:border-accent-red","[&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_10%,_var(--base))]","[@container((max-width:_560px))]:[&.danger]:ml-auto"].join(" ");function kZ({runs:e,experiments:t,emptyHint:n,onOpen:r,onOpenLogs:i,onOpenCode:a,onCancel:o}){const[l,c]=R.useState(new Set),[d,m]=R.useState(null),f=new Map;for(const k of e){const S=f.get(k.experimentId);S?S.push(k):f.set(k.experimentId,[k])}for(const k of f.values())k.sort((S,x)=>x.createdAt-S.createdAt);const g=[...t].sort((k,S)=>{var w,y,C,N;const x=((y=(w=f.get(k.id))==null?void 0:w[0])==null?void 0:y.createdAt)??k.createdAt;return(((N=(C=f.get(S.id))==null?void 0:C[0])==null?void 0:N.createdAt)??S.createdAt)-x});if(g.length===0)return h.jsx("div",{className:"empty-state absolute inset-0 flex flex-col items-center justify-center gap-2.5 p-6 text-center text-subtext [&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:leading-normal [&_p]:text-balance [&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext experiments-empty-state [&_p]:text-2xl",children:h.jsx("p",{children:n??"No experiments yet."})});async function b(k){m(null),c(S=>new Set(S).add(k));try{await o(k)}catch(S){c(x=>{const v=new Set(x);return v.delete(k),v}),m(S instanceof Error?S.message:String(S))}}return h.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[d&&h.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:["Stop failed: ",d]}),h.jsx("div",{className:"experiments-table w-full text-md bg-background",role:"list","aria-label":"Experiments",children:g.map(k=>{const S=f.get(k.id)??[],x=S[0]??null,v=S.find(N=>N.status==="running"||N.status==="starting"),w=v??x,y=!!(v&&(v.cancelRequested||l.has(v.id))),C=v?y?"cancelling":as(v):x?as(x):"idle";return h.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-[color-mix(in_oklab,_var(--text)_7%,_transparent)] bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(k),children:[h.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[h.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-left text-ellipsis whitespace-nowrap",onClick:N=>{N.stopPropagation(),r(k)},children:k.title||k.slug}),h.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:k.branchName,children:[h.jsx(lh,{size:14,"aria-hidden":"true"}),h.jsx("code",{children:k.branchName})]})]}),h.jsxs("div",{className:"experiment-table-meta [grid-area:meta] self-start flex items-center justify-end gap-4.5 whitespace-nowrap [@container((max-width:_560px))]:flex-col [@container((max-width:_560px))]:items-end [@container((max-width:_560px))]:gap-1.5 [@container((max-width:_400px))]:!flex-row [@container((max-width:_400px))]:!items-center [@container((max-width:_400px))]:flex-wrap [@container((max-width:_400px))]:justify-start [@container((max-width:_400px))]:gap-3",children:[h.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:h.jsx(La,{status:C})}),h.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-xs font-medium",children:h.jsxs("span",{children:[S.length," ",S.length===1?"run":"runs"]})}),h.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-xs font-medium whitespace-nowrap",children:h.jsx("span",{children:x?Ks(x.createdAt):"Not run yet"})})]}),h.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":`Actions for ${k.title||k.slug}`,onClick:N=>N.stopPropagation(),children:[h.jsxs("button",{className:D7,disabled:!w,title:w?"Open logs":"No runs yet",onClick:()=>w&&i(k.id,w.id),children:[h.jsx(Wc,{size:15}),"Logs"]}),h.jsxs("button",{className:D7,title:`Browse code on ${k.branchName}`,onClick:()=>a(k.id),children:[h.jsx(lp,{size:15}),"Code"]}),v&&h.jsxs("button",{className:"experiment-table-action inline-flex items-center gap-1.5 py-1.5 px-2.5 border border-border rounded-md bg-background text-text text-sm font-medium leading-none [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:border-border-strong [&:disabled]:text-muted [&:disabled]:cursor-default [&:disabled]:opacity-50 [&.danger]:border-[color-mix(in_oklab,_var(--accent-red)_42%,_var(--border))] [&.danger]:bg-[color-mix(in_oklab,_var(--accent-red)_6%,_var(--base))] [&.danger]:text-accent-red [&.danger:hover:not(:disabled)]:border-accent-red [&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_10%,_var(--base))] [@container((max-width:_560px))]:[&.danger]:ml-auto danger",disabled:y,title:y?"Stop requested":"Stop run",onClick:()=>void b(v.id),children:[h.jsx(Z8,{size:15}),y?"Stopping…":"Stop"]})]})]},k.id)})})]})}var HE=V8();function CZ({onClose:e,onCreateProject:t}){const[n,r]=R.useState(!1),[i,a]=R.useState(null),o=R.useRef(null),l=R.useCallback(c=>{n||(r(!0),a(null),c().catch(()=>a("Couldn't save your progress. Try again.")).finally(()=>r(!1)))},[n]);return R.useEffect(()=>{const c=d=>{d.key==="Escape"&&(d.preventDefault(),d.stopPropagation(),l(e))};return document.addEventListener("keydown",c,!0),()=>document.removeEventListener("keydown",c,!0)},[e,l]),R.useEffect(()=>{const c=o.current;if(!c)return;const d=document.activeElement instanceof HTMLElement?document.activeElement:null,m=()=>[...c.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(m()[0]??c).focus();const f=g=>{if(g.key!=="Tab")return;const b=m();if(b.length===0){g.preventDefault(),c.focus();return}const k=b[0],S=b[b.length-1];g.shiftKey&&document.activeElement===k?(g.preventDefault(),S.focus()):!g.shiftKey&&document.activeElement===S&&(g.preventDefault(),k.focus())};return document.addEventListener("keydown",f,!0),()=>{document.removeEventListener("keydown",f,!0),d==null||d.focus()}},[]),HE.createPortal(h.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-[rgba(29,_27,_26,_0.42)] p-5",children:h.jsxs("div",{ref:o,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)]",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[h.jsx("button",{className:`${nr} !absolute top-3.5 right-3.5`,"aria-label":"Close",onClick:()=>l(e),disabled:n,children:h.jsx(Vr,{size:16})}),h.jsxs("div",{className:"mb-5 flex items-center gap-3 pr-8",children:[h.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:h.jsx(f_,{})}),h.jsxs("div",{children:[h.jsx("div",{className:"mb-0.5 text-xs font-semibold tracking-[0.08em] text-primary uppercase",children:"Demo project"}),h.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-3xl leading-tight tracking-[-0.02em]",children:"Welcome to OpenResearch"})]})]}),h.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[h.jsxs("p",{children:["This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's"," ",h.jsx("a",{href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-semibold text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:"nanochat"}),", a repo for training a mini-GPT from scratch."]}),h.jsx("p",{children:"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together."})]}),i&&h.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:i}),h.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[h.jsx("button",{className:ci,onClick:()=>l(t),disabled:n,children:"Create a new project"}),h.jsx("button",{className:Xr,onClick:()=>l(e),disabled:n,children:n?"Saving…":"Explore the demo"})]})]})}),document.body)}function sr(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function Kp(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}yf.prototype=Kp.prototype={constructor:yf,on:function(e,t){var n=this._,r=AZ(e+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a0)for(var n=new Array(i),r=0,i,a;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),O7.hasOwnProperty(t)?{space:O7[t],local:e}:e}function NZ(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Pv&&t.documentElement.namespaceURI===Pv?t.createElement(e):t.createElementNS(n,e)}}function jZ(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function $E(e){var t=Zp(e);return(t.local?jZ:NZ)(t)}function MZ(){}function ex(e){return e==null?MZ:function(){return this.querySelector(e)}}function RZ(e){typeof e!="function"&&(e=ex(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=y&&(y=w+1);!(N=x[y])&&++y=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function rQ(e){e||(e=iQ);function t(f,g){return f&&g?e(f.__data__,g.__data__):!f-!g}for(var n=this._groups,r=n.length,i=new Array(r),a=0;at?1:e>=t?0:NaN}function sQ(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function aQ(){return Array.from(this)}function oQ(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?vQ:typeof t=="function"?xQ:_Q)(e,t,n??"")):eu(this.node(),e)}function eu(e,t){return e.style.getPropertyValue(t)||GE(e).getComputedStyle(e,null).getPropertyValue(t)}function wQ(e){return function(){delete this[e]}}function SQ(e,t){return function(){this[e]=t}}function kQ(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function CQ(e,t){return arguments.length>1?this.each((t==null?wQ:typeof t=="function"?kQ:SQ)(e,t)):this.node()[e]}function VE(e){return e.trim().split(/^|\s+/)}function tx(e){return e.classList||new WE(e)}function WE(e){this._node=e,this._names=VE(e.getAttribute("class")||"")}WE.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 YE(e,t){for(var n=tx(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function JQ(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n()=>e;function Uv(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:l,dx:c,dy:d,dispatch:m}){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:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:m}})}Uv.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function cJ(e){return!e.ctrlKey&&!e.button}function uJ(){return this.parentNode}function dJ(e,t){return t??{x:e.x,y:e.y}}function hJ(){return navigator.maxTouchPoints||"ontouchstart"in this}function eA(){var e=cJ,t=uJ,n=dJ,r=hJ,i={},a=Kp("start","drag","end"),o=0,l,c,d,m,f=0;function g(C){C.on("mousedown.drag",b).filter(r).on("touchstart.drag",x).on("touchmove.drag",v,lJ).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(C,N){if(!(m||!e.call(this,C,N))){var E=y(this,t.call(this,C,N),C,N,"mouse");E&&(Mi(C.view).on("mousemove.drag",k,Gd).on("mouseup.drag",S,Gd),QE(C.view),fb(C),d=!1,l=C.clientX,c=C.clientY,E("start",C))}}function k(C){if(Pc(C),!d){var N=C.clientX-l,E=C.clientY-c;d=N*N+E*E>f}i.mouse("drag",C)}function S(C){Mi(C.view).on("mousemove.drag mouseup.drag",null),JE(C.view,d),Pc(C),i.mouse("end",C)}function x(C,N){if(e.call(this,C,N)){var E=C.changedTouches,M=t.call(this,C,N),T=E.length,D,z;for(D=0;D>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?J0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?J0(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=pJ.exec(e))?new ui(t[1],t[2],t[3],1):(t=mJ.exec(e))?new ui(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gJ.exec(e))?J0(t[1],t[2],t[3],t[4]):(t=bJ.exec(e))?J0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=vJ.exec(e))?P7(t[1],t[2]/100,t[3]/100,1):(t=_J.exec(e))?P7(t[1],t[2]/100,t[3]/100,t[4]):I7.hasOwnProperty(e)?H7(I7[e]):e==="transparent"?new ui(NaN,NaN,NaN,0):null}function H7(e){return new ui(e>>16&255,e>>8&255,e&255,1)}function J0(e,t,n,r){return r<=0&&(e=t=n=NaN),new ui(e,t,n,r)}function wJ(e){return e instanceof kh||(e=Dl(e)),e?(e=e.rgb(),new ui(e.r,e.g,e.b,e.opacity)):new ui}function qv(e,t,n,r){return arguments.length===1?wJ(e):new ui(e,t,n,r??1)}function ui(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}nx(ui,qv,tA(kh,{brighter(e){return e=e==null?Zf:Math.pow(Zf,e),new ui(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Vd:Math.pow(Vd,e),new ui(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ui(jl(this.r),jl(this.g),jl(this.b),Qf(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:$7,formatHex:$7,formatHex8:SJ,formatRgb:F7,toString:F7}));function $7(){return`#${kl(this.r)}${kl(this.g)}${kl(this.b)}`}function SJ(){return`#${kl(this.r)}${kl(this.g)}${kl(this.b)}${kl((isNaN(this.opacity)?1:this.opacity)*255)}`}function F7(){const e=Qf(this.opacity);return`${e===1?"rgb(":"rgba("}${jl(this.r)}, ${jl(this.g)}, ${jl(this.b)}${e===1?")":`, ${e})`}`}function Qf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function jl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function kl(e){return e=jl(e),(e<16?"0":"")+e.toString(16)}function P7(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new _s(e,t,n,r)}function nA(e){if(e instanceof _s)return new _s(e.h,e.s,e.l,e.opacity);if(e instanceof kh||(e=Dl(e)),!e)return new _s;if(e instanceof _s)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-i,c=(a+i)/2;return l?(t===a?o=(n-r)/l+(n0&&c<1?0:o,new _s(o,l,c,e.opacity)}function kJ(e,t,n,r){return arguments.length===1?nA(e):new _s(e,t,n,r??1)}function _s(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}nx(_s,kJ,tA(kh,{brighter(e){return e=e==null?Zf:Math.pow(Zf,e),new _s(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Vd:Math.pow(Vd,e),new _s(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ui(pb(e>=240?e-240:e+120,i,r),pb(e,i,r),pb(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new _s(U7(this.h),ef(this.s),ef(this.l),Qf(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=Qf(this.opacity);return`${e===1?"hsl(":"hsla("}${U7(this.h)}, ${ef(this.s)*100}%, ${ef(this.l)*100}%${e===1?")":`, ${e})`}`}}));function U7(e){return e=(e||0)%360,e<0?e+360:e}function ef(e){return Math.max(0,Math.min(1,e||0))}function pb(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 rx=e=>()=>e;function CJ(e,t){return function(n){return e+n*t}}function EJ(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 AJ(e){return(e=+e)==1?rA:function(t,n){return n-t?EJ(t,n,e):rx(isNaN(t)?n:t)}}function rA(e,t){var n=t-e;return n?CJ(e,n):rx(isNaN(e)?t:e)}const Jf=(function e(t){var n=AJ(t);function r(i,a){var o=n((i=qv(i)).r,(a=qv(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),d=rA(i.opacity,a.opacity);return function(m){return i.r=o(m),i.g=l(m),i.b=c(m),i.opacity=d(m),i+""}}return r.gamma=e,r})(1);function TJ(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;in&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:Ws(r,i)})),n=mb.lastIndex;return n180?m+=360:m-d>180&&(d+=360),g.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Ws(d,m)})):m&&f.push(i(f)+"rotate("+m+r)}function l(d,m,f,g){d!==m?g.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Ws(d,m)}):m&&f.push(i(f)+"skewX("+m+r)}function c(d,m,f,g,b,k){if(d!==f||m!==g){var S=b.push(i(b)+"scale(",null,",",null,")");k.push({i:S-4,x:Ws(d,f)},{i:S-2,x:Ws(m,g)})}else(f!==1||g!==1)&&b.push(i(b)+"scale("+f+","+g+")")}return function(d,m){var f=[],g=[];return d=e(d),m=e(m),a(d.translateX,d.translateY,m.translateX,m.translateY,f,g),o(d.rotate,m.rotate,f,g),l(d.skewX,m.skewX,f,g),c(d.scaleX,d.scaleY,m.scaleX,m.scaleY,f,g),d=m=null,function(b){for(var k=-1,S=g.length,x;++k=0&&e._call.call(void 0,t),e=e._next;--tu}function V7(){Ll=(tp=Yd.now())+Qp,tu=fd=0;try{UJ()}finally{tu=0,GJ(),Ll=0}}function qJ(){var e=Yd.now(),t=e-tp;t>oA&&(Qp-=t,tp=e)}function GJ(){for(var e,t=ep,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:ep=n);pd=e,Wv(r)}function Wv(e){if(!tu){fd&&(fd=clearTimeout(fd));var t=e-Ll;t>24?(e<1/0&&(fd=setTimeout(V7,e-Yd.now()-Qp)),od&&(od=clearInterval(od))):(od||(tp=Yd.now(),od=setInterval(qJ,oA)),tu=1,lA(V7))}}function W7(e,t,n){var r=new np;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var VJ=Kp("start","end","cancel","interrupt"),WJ=[],uA=0,Y7=1,Yv=2,Sf=3,X7=4,Xv=5,kf=6;function Jp(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;YJ(e,n,{name:t,index:r,group:i,on:VJ,tween:WJ,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:uA})}function sx(e,t){var n=As(e,t);if(n.state>uA)throw new Error("too late; already scheduled");return n}function aa(e,t){var n=As(e,t);if(n.state>Sf)throw new Error("too late; already running");return n}function As(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function YJ(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=cA(a,0,n.time);function a(d){n.state=Y7,n.timer.restart(o,n.delay,n.time),n.delay<=d&&o(d-n.delay)}function o(d){var m,f,g,b;if(n.state!==Y7)return c();for(m in r)if(b=r[m],b.name===n.name){if(b.state===Sf)return W7(o);b.state===X7?(b.state=kf,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete r[m]):+mYv&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function kee(e,t,n){var r,i,a=See(t)?sx:aa;return function(){var o=a(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}function Cee(e,t){var n=this._id;return arguments.length<2?As(this.node(),n).on.on(e):this.each(kee(n,e,t))}function Eee(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Aee(){return this.on("end.remove",Eee(this._id))}function Tee(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ex(e));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o()=>e;function Jee(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){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:i}})}function Ra(e,t,n){this.k=e,this.x=t,this.y=n}Ra.prototype={constructor:Ra,scale:function(e){return e===1?this:new Ra(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ra(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 em=new Ra(1,0,0);pA.prototype=Ra.prototype;function pA(e){for(;!e.__zoom;)if(!(e=e.parentNode))return em;return e.__zoom}function gb(e){e.stopImmediatePropagation()}function ld(e){e.preventDefault(),e.stopImmediatePropagation()}function ete(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function tte(){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 K7(){return this.__zoom||em}function nte(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function rte(){return navigator.maxTouchPoints||"ontouchstart"in this}function ite(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function mA(){var e=ete,t=tte,n=ite,r=nte,i=rte,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=wf,d=Kp("start","zoom","end"),m,f,g,b=500,k=150,S=0,x=10;function v(V){V.property("__zoom",K7).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",z).filter(i).on("touchstart.zoom",$).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}v.transform=function(V,X,Y,Q){var te=V.selection?V.selection():V;te.property("__zoom",K7),V!==te?N(V,X,Y,Q):te.interrupt().each(function(){E(this,arguments).event(Q).start().zoom(null,typeof X=="function"?X.apply(this,arguments):X).end()})},v.scaleBy=function(V,X,Y,Q){v.scaleTo(V,function(){var te=this.__zoom.k,I=typeof X=="function"?X.apply(this,arguments):X;return te*I},Y,Q)},v.scaleTo=function(V,X,Y,Q){v.transform(V,function(){var te=t.apply(this,arguments),I=this.__zoom,O=Y==null?C(te):typeof Y=="function"?Y.apply(this,arguments):Y,H=I.invert(O),G=typeof X=="function"?X.apply(this,arguments):X;return n(y(w(I,G),O,H),te,o)},Y,Q)},v.translateBy=function(V,X,Y,Q){v.transform(V,function(){return n(this.__zoom.translate(typeof X=="function"?X.apply(this,arguments):X,typeof Y=="function"?Y.apply(this,arguments):Y),t.apply(this,arguments),o)},null,Q)},v.translateTo=function(V,X,Y,Q,te){v.transform(V,function(){var I=t.apply(this,arguments),O=this.__zoom,H=Q==null?C(I):typeof Q=="function"?Q.apply(this,arguments):Q;return n(em.translate(H[0],H[1]).scale(O.k).translate(typeof X=="function"?-X.apply(this,arguments):-X,typeof Y=="function"?-Y.apply(this,arguments):-Y),I,o)},Q,te)};function w(V,X){return X=Math.max(a[0],Math.min(a[1],X)),X===V.k?V:new Ra(X,V.x,V.y)}function y(V,X,Y){var Q=X[0]-Y[0]*V.k,te=X[1]-Y[1]*V.k;return Q===V.x&&te===V.y?V:new Ra(V.k,Q,te)}function C(V){return[(+V[0][0]+ +V[1][0])/2,(+V[0][1]+ +V[1][1])/2]}function N(V,X,Y,Q){V.on("start.zoom",function(){E(this,arguments).event(Q).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(Q).end()}).tween("zoom",function(){var te=this,I=arguments,O=E(te,I).event(Q),H=t.apply(te,I),G=Y==null?C(H):typeof Y=="function"?Y.apply(te,I):Y,W=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),re=te.__zoom,ce=typeof X=="function"?X.apply(te,I):X,me=c(re.invert(G).concat(W/re.k),ce.invert(G).concat(W/ce.k));return function(ne){if(ne===1)ne=ce;else{var B=me(ne),se=W/B[2];ne=new Ra(se,G[0]-B[0]*se,G[1]-B[1]*se)}O.zoom(null,ne)}})}function E(V,X,Y){return!Y&&V.__zooming||new M(V,X)}function M(V,X){this.that=V,this.args=X,this.active=0,this.sourceEvent=null,this.extent=t.apply(V,X),this.taps=0}M.prototype={event:function(V){return V&&(this.sourceEvent=V),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(V,X){return this.mouse&&V!=="mouse"&&(this.mouse[1]=X.invert(this.mouse[0])),this.touch0&&V!=="touch"&&(this.touch0[1]=X.invert(this.touch0[0])),this.touch1&&V!=="touch"&&(this.touch1[1]=X.invert(this.touch1[0])),this.that.__zoom=X,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(V){var X=Mi(this.that).datum();d.call(V,this.that,new Jee(V,{sourceEvent:this.sourceEvent,target:v,transform:this.that.__zoom,dispatch:d}),X)}};function T(V,...X){if(!e.apply(this,arguments))return;var Y=E(this,X).event(V),Q=this.__zoom,te=Math.max(a[0],Math.min(a[1],Q.k*Math.pow(2,r.apply(this,arguments)))),I=bs(V);if(Y.wheel)(Y.mouse[0][0]!==I[0]||Y.mouse[0][1]!==I[1])&&(Y.mouse[1]=Q.invert(Y.mouse[0]=I)),clearTimeout(Y.wheel);else{if(Q.k===te)return;Y.mouse=[I,Q.invert(I)],Cf(this),Y.start()}ld(V),Y.wheel=setTimeout(O,k),Y.zoom("mouse",n(y(w(Q,te),Y.mouse[0],Y.mouse[1]),Y.extent,o));function O(){Y.wheel=null,Y.end()}}function D(V,...X){if(g||!e.apply(this,arguments))return;var Y=V.currentTarget,Q=E(this,X,!0).event(V),te=Mi(V.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",W,!0),I=bs(V,Y),O=V.clientX,H=V.clientY;QE(V.view),gb(V),Q.mouse=[I,this.__zoom.invert(I)],Cf(this),Q.start();function G(re){if(ld(re),!Q.moved){var ce=re.clientX-O,me=re.clientY-H;Q.moved=ce*ce+me*me>S}Q.event(re).zoom("mouse",n(y(Q.that.__zoom,Q.mouse[0]=bs(re,Y),Q.mouse[1]),Q.extent,o))}function W(re){te.on("mousemove.zoom mouseup.zoom",null),JE(re.view,Q.moved),ld(re),Q.event(re).end()}}function z(V,...X){if(e.apply(this,arguments)){var Y=this.__zoom,Q=bs(V.changedTouches?V.changedTouches[0]:V,this),te=Y.invert(Q),I=Y.k*(V.shiftKey?.5:2),O=n(y(w(Y,I),Q,te),t.apply(this,X),o);ld(V),l>0?Mi(this).transition().duration(l).call(N,O,Q,V):Mi(this).call(v.transform,O,Q,V)}}function $(V,...X){if(e.apply(this,arguments)){var Y=V.touches,Q=Y.length,te=E(this,X,V.changedTouches.length===Q).event(V),I,O,H,G;for(gb(V),O=0;O`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.`},Xd=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],gA=["Enter"," ","Escape"],bA={"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 nu;(function(e){e.Strict="strict",e.Loose="loose"})(nu||(nu={}));var Ml;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ml||(Ml={}));var Kd;(function(e){e.Partial="partial",e.Full="full"})(Kd||(Kd={}));const vA={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ro;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ro||(Ro={}));var rp;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(rp||(rp={}));var at;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(at||(at={}));const Z7={[at.Left]:at.Right,[at.Right]:at.Left,[at.Top]:at.Bottom,[at.Bottom]:at.Top};function _A(e){return e===null?null:e?"valid":"invalid"}const xA=e=>"id"in e&&"source"in e&&"target"in e,ste=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ox=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ch=(e,t=[0,0])=>{const{width:n,height:r}=Wa(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},ate=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const a=typeof i=="string";let o=!t.nodeLookup&&!a?i:void 0;t.nodeLookup&&(o=a?t.nodeLookup.get(i):ox(i)?i:t.nodeLookup.get(i.id));const l=o?ip(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return tm(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return nm(n)},Eh=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=tm(n,ip(i)),r=!0)}),r?nm(n):{x:0,y:0,width:0,height:0}},lx=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{const l=(t.x-n)/i,c=(t.y-r)/i,d=t.width/i,m=t.height/i,f=[];for(const g of e.values()){const{measured:b,selectable:k=!0,hidden:S=!1}=g;if(o&&!k||S)continue;const x=b.width??g.width??g.initialWidth??0,v=b.height??g.height??g.initialHeight??0,{x:w,y}=g.internals.positionAbsolute,C=kA(l,c,d,m,w,y,x,v),N=x*v,E=a&&C>0;(!g.internals.handleBounds||E||C>=N||g.dragging)&&f.push(g)}return f},ote=(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 lte(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function cte({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;const l=lte(e,o),c=Eh(l),d=ux(c,t,n,(o==null?void 0:o.minZoom)??i,(o==null?void 0:o.maxZoom)??a,(o==null?void 0:o.padding)??.1);return await r.setViewport(d,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function yA({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:d}=l?l.internals.positionAbsolute:{x:0,y:0},m=o.origin??r;let f=o.extent||i;if(o.extent==="parent"&&!o.expandParent)if(!l)a==null||a("005",Es.error005());else{const b=l.measured.width,k=l.measured.height;b&&k&&(f=[[c,d],[c+b,d+k]])}else l&&Il(o.extent)&&(f=[[o.extent[0][0]+c,o.extent[0][1]+d],[o.extent[1][0]+c,o.extent[1][1]+d]]);const g=Il(f)?Ol(t,f,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",Es.error015())),{position:{x:g.x-c+(o.measured.width??0)*m[0],y:g.y-d+(o.measured.height??0)*m[1]},positionAbsolute:g}}async function ute({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const a=new Set(e.map(g=>g.id)),o=[];for(const g of n){if(g.deletable===!1)continue;const b=a.has(g.id),k=!b&&g.parentId&&o.find(S=>S.id===g.parentId);(b||k)&&o.push(g)}const l=new Set(t.map(g=>g.id)),c=r.filter(g=>g.deletable!==!1),m=ote(o,c);for(const g of c)l.has(g.id)&&!m.find(k=>k.id===g.id)&&m.push(g);if(!i)return{edges:m,nodes:o};const f=await i({nodes:o,edges:m});return typeof f=="boolean"?f?{edges:m,nodes:o}:{edges:[],nodes:[]}:f}const ru=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ol=(e={x:0,y:0},t,n)=>({x:ru(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ru(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function wA(e,t,n){const{width:r,height:i}=Wa(n),{x:a,y:o}=n.internals.positionAbsolute;return Ol(e,[[a,o],[a+r,o+i]],t)}const Q7=(e,t,n)=>en?-ru(Math.abs(e-n),1,t)/t:0,cx=(e,t,n=15,r=40)=>{const i=Q7(e.x,r,t.width-r)*n,a=Q7(e.y,r,t.height-r)*n;return[i,a]},tm=(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)}),Kv=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),nm=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Zd=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=ox(e)?e.internals.positionAbsolute:Ch(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},ip=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=ox(e)?e.internals.positionAbsolute:Ch(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},SA=(e,t)=>nm(tm(Kv(e),Kv(t))),kA=(e,t,n,r,i,a,o,l)=>{const c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),d=Math.max(0,Math.min(t+r,a+l)-Math.max(t,a));return Math.ceil(c*d)},sp=(e,t)=>kA(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),J7=e=>xs(e.width)&&xs(e.height)&&xs(e.x)&&xs(e.y),xs=e=>!isNaN(e)&&isFinite(e),CA=(e,t)=>(n,r)=>{},Ah=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Th=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return a?Ah(l,o):l},iu=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Ec(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 dte(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Ec(e,n),i=Ec(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=Ec(e.top??e.y??0,n),i=Ec(e.bottom??e.y??0,n),a=Ec(e.left??e.x??0,t),o=Ec(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function hte(e,t,n,r,i,a){const{x:o,y:l}=iu(e,[t,n,r]),{x:c,y:d}=iu({x:e.x+e.width,y:e.y+e.height},[t,n,r]),m=i-c,f=a-d;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(m),bottom:Math.floor(f)}}const ux=(e,t,n,r,i,a)=>{const o=dte(a,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,d=Math.min(l,c),m=ru(d,r,i),f=e.x+e.width/2,g=e.y+e.height/2,b=t/2-f*m,k=n/2-g*m,S=hte(e,b,k,m,t,n),x={left:Math.min(S.left-o.left,0),top:Math.min(S.top-o.top,0),right:Math.min(S.right-o.right,0),bottom:Math.min(S.bottom-o.bottom,0)};return{x:b-x.left+x.right,y:k-x.top+x.bottom,zoom:m}},Qd=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Il(e){return e!=null&&e!=="parent"}function Wa(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 EA(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 AA(e,t={width:0,height:0},n,r,i){const a={...e},o=r.get(n);if(o){const l=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return a}function e8(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function fte(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function pte(e){return{...bA,...e||{}}}function Cd(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:a,y:o}=ys(e),l=Th({x:a-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:c,y:d}=n?Ah(l,t):l;return{xSnapped:c,ySnapped:d,...l}}const dx=e=>({width:e.offsetWidth,height:e.offsetHeight}),TA=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},mte=["INPUT","SELECT","TEXTAREA"];function NA(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:mte.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const jA=e=>"clientX"in e,ys=(e,t)=>{var a,o;const n=jA(e),r=n?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,i=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},t8=(e,t,n,r,i)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:i,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...dx(o)}})};function MA({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:l}){const c=e*.125+i*.375+o*.375+n*.125,d=t*.125+a*.375+l*.375+r*.125,m=Math.abs(c-e),f=Math.abs(d-t);return[c,d,m,f]}function rf(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function n8({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case at.Left:return[t-rf(t-r,a),n];case at.Right:return[t+rf(r-t,a),n];case at.Top:return[t,n-rf(n-i,a)];case at.Bottom:return[t,n+rf(i-n,a)]}}function RA({sourceX:e,sourceY:t,sourcePosition:n=at.Bottom,targetX:r,targetY:i,targetPosition:a=at.Top,curvature:o=.25}){const[l,c]=n8({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[d,m]=n8({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[f,g,b,k]=MA({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:m});return[`M${e},${t} C${l},${c} ${d},${m} ${r},${i}`,f,g,b,k]}function DA({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,a=n0}const vte=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,_te=(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)),xte=(e,t,n={})=>{var a;if(!e.source||!e.target)return(a=n.onError)==null||a.call(n,"006",Es.error006()),t;const r=n.getEdgeId||vte;let i;return xA(e)?i={...e}:i={...e,id:r(e)},_te(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function LA({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,a,o,l]=DA({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,l]}const r8={[at.Left]:{x:-1,y:0},[at.Right]:{x:1,y:0},[at.Top]:{x:0,y:-1},[at.Bottom]:{x:0,y:1}},yte=({source:e,sourcePosition:t=at.Bottom,target:n})=>t===at.Left||t===at.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function wte({source:e,sourcePosition:t=at.Bottom,target:n,targetPosition:r=at.Top,center:i,offset:a,stepPosition:o}){const l=r8[t],c=r8[r],d={x:e.x+l.x*a,y:e.y+l.y*a},m={x:n.x+c.x*a,y:n.y+c.y*a},f=yte({source:d,sourcePosition:t,target:m}),g=f.x!==0?"x":"y",b=f[g];let k=[],S,x;const v={x:0,y:0},w={x:0,y:0},[,,y,C]=DA({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[g]*c[g]===-1){g==="x"?(S=i.x??d.x+(m.x-d.x)*o,x=i.y??(d.y+m.y)/2):(S=i.x??(d.x+m.x)/2,x=i.y??d.y+(m.y-d.y)*o);const T=[{x:S,y:d.y},{x:S,y:m.y}],D=[{x:d.x,y:x},{x:m.x,y:x}];l[g]===b?k=g==="x"?T:D:k=g==="x"?D:T}else{const T=[{x:d.x,y:m.y}],D=[{x:m.x,y:d.y}];if(g==="x"?k=l.x===b?D:T:k=l.y===b?T:D,t===r){const V=Math.abs(e[g]-n[g]);if(V<=a){const X=Math.min(a-1,a-V);l[g]===b?v[g]=(d[g]>e[g]?-1:1)*X:w[g]=(m[g]>n[g]?-1:1)*X}}if(t!==r){const V=g==="x"?"y":"x",X=l[g]===c[V],Y=d[V]>m[V],Q=d[V]=U?(S=(z.x+$.x)/2,x=k[0].y):(S=k[0].x,x=(z.y+$.y)/2)}const N={x:d.x+v.x,y:d.y+v.y},E={x:m.x+w.x,y:m.y+w.y};return[[e,...N.x!==k[0].x||N.y!==k[0].y?[N]:[],...k,...E.x!==k[k.length-1].x||E.y!==k[k.length-1].y?[E]:[],n],S,x,y,C]}function Ste(e,t,n,r){const i=Math.min(i8(e,t)/2,i8(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){const d=e.xn.id===t):e[0])||null}function Qv(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Cte(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const a=new Set;return e.reduce((o,l)=>([l.markerStart||r,l.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){const d=Qv(c,t);a.has(d)||(o.push({id:d,color:c.color||n,...c}),a.add(d))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const OA=1e3,Ete=10,hx={nodeOrigin:[0,0],nodeExtent:Xd,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Ate={...hx,checkEquality:!0};function fx(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Tte(e,t,n){const r=fx(hx,n);for(const i of e.values())if(i.parentId)mx(i,e,t,r);else{const a=Ch(i,r.nodeOrigin),o=Il(i.extent)?i.extent:r.nodeExtent,l=Ol(a,o,Wa(i));i.internals.positionAbsolute=l}}function Nte(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const a={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(a):i.type==="target"&&r.push(a)}return{source:n,target:r}}function px(e){return e==="manual"}function Jv(e,t,n,r={}){var m,f;const i=fx(Ate,r),a={i:0},o=new Map(t),l=i!=null&&i.elevateNodesOnSelect&&!px(i.zIndexMode)?OA:0;let c=e.length>0,d=!1;t.clear(),n.clear();for(const g of e){let b=o.get(g.id);if(i.checkEquality&&g===(b==null?void 0:b.internals.userNode))t.set(g.id,b);else{const k=Ch(g,i.nodeOrigin),S=Il(g.extent)?g.extent:i.nodeExtent,x=Ol(k,S,Wa(g));b={...i.defaults,...g,measured:{width:(m=g.measured)==null?void 0:m.width,height:(f=g.measured)==null?void 0:f.height},internals:{positionAbsolute:x,handleBounds:Nte(g,b),z:IA(g,l,i.zIndexMode),userNode:g}},t.set(g.id,b)}(b.measured===void 0||b.measured.width===void 0||b.measured.height===void 0)&&!b.hidden&&(c=!1),g.parentId&&mx(b,t,n,r,a),d||(d=g.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:d}}function jte(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 mx(e,t,n,r,i){const{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=fx(hx,r),d=e.parentId,m=t.get(d);if(!m){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}jte(e,n),i&&!m.parentId&&m.internals.rootParentIndex===void 0&&c==="auto"&&(m.internals.rootParentIndex=++i.i,m.internals.z=m.internals.z+i.i*Ete),i&&m.internals.rootParentIndex!==void 0&&(i.i=m.internals.rootParentIndex);const f=a&&!px(c)?OA:0,{x:g,y:b,z:k}=Mte(e,m,o,l,f,c),{positionAbsolute:S}=e.internals,x=g!==S.x||b!==S.y;(x||k!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:g,y:b}:S,z:k}})}function IA(e,t,n){const r=xs(e.zIndex)?e.zIndex:0;return px(n)?r:r+(e.selected?t:0)}function Mte(e,t,n,r,i,a){const{x:o,y:l}=t.internals.positionAbsolute,c=Wa(e),d=Ch(e,n),m=Il(e.extent)?Ol(d,e.extent,c):d;let f=Ol({x:o+m.x,y:l+m.y},r,c);e.extent==="parent"&&(f=wA(f,c,t));const g=IA(e,i,a),b=t.internals.z??0;return{x:f.x,y:f.y,z:b>=g?b+1:g}}function gx(e,t,n,r=[0,0]){var o;const i=[],a=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const d=((o=a.get(l.parentId))==null?void 0:o.expandedRect)??Zd(c),m=SA(d,l.rect);a.set(l.parentId,{expandedRect:m,parent:c})}return a.size>0&&a.forEach(({expandedRect:l,parent:c},d)=>{var y;const m=c.internals.positionAbsolute,f=Wa(c),g=c.origin??r,b=l.x0||k>0||v||w)&&(i.push({id:d,type:"position",position:{x:c.position.x-b+v,y:c.position.y-k+w}}),(y=n.get(d))==null||y.forEach(C=>{e.some(N=>N.id===C.id)||i.push({id:C.id,type:"position",position:{x:C.position.x+b,y:C.position.y+k}})})),(f.width0){const b=gx(g,t,n,i);d.push(...b)}return{changes:d,updatedInternals:c}}async function Dte({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function l8(e,t,n,r,i,a){let o=i;const l=r.get(o)||new Map;r.set(o,l.set(n,t)),o=`${i}-${e}`;const c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;const d=r.get(o)||new Map;r.set(o,d.set(n,t))}}function zA(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:a,sourceHandle:o=null,targetHandle:l=null}=r,c={edgeId:r.id,source:i,target:a,sourceHandle:o,targetHandle:l},d=`${i}-${o}--${a}-${l}`,m=`${a}-${l}--${i}-${o}`;l8("source",c,m,e,i,o),l8("target",c,d,e,a,l),t.set(r.id,r)}}function BA(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:BA(n,t):!1}function c8(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Lte(e,t,n,r){const i=new Map;for(const[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!BA(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(a);l&&i.set(a,{id:a,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function bb({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,c;const i=[];for(const[d,m]of t){const f=(o=n.get(d))==null?void 0:o.internals.userNode;f&&i.push({...f,position:m.position,dragging:r})}if(!e)return[i[0],i];const a=(l=n.get(e))==null?void 0:l.internals.userNode;return[a?{...a,position:((c=t.get(e))==null?void 0:c.position)||a.position,dragging:r}:i[0],i]}function Ote({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const a={x:n-i.distance.x,y:r-i.distance.y},o=Ah(a,t);return{x:o.x-a.x,y:o.y-a.y}}function Ite({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,l=new Map,c=!1,d={x:0,y:0},m=null,f=!1,g=null,b=!1,k=!1,S=null;function x({noDragClassName:w,handleSelector:y,domNode:C,isSelectable:N,nodeId:E,nodeClickDistance:M=0}){g=Mi(C);function T({x:F,y:U}){const{nodeLookup:V,nodeExtent:X,snapGrid:Y,snapToGrid:Q,nodeOrigin:te,onNodeDrag:I,onSelectionDrag:O,onError:H,updateNodePositions:G}=t();a={x:F,y:U};let W=!1;const re=l.size>1,ce=re&&X?Kv(Eh(l)):null,me=re&&Q?Ote({dragItems:l,snapGrid:Y,x:F,y:U}):null;for(const[ne,B]of l){if(!V.has(ne))continue;let se={x:F-B.distance.x,y:U-B.distance.y};Q&&(se=me?{x:Math.round(se.x+me.x),y:Math.round(se.y+me.y)}:Ah(se,Y));let le=null;if(re&&X&&!B.extent&&ce){const{positionAbsolute:Ce}=B.internals,Le=Ce.x-ce.x+X[0][0],$e=Ce.x+B.measured.width-ce.x2+X[1][0],Ge=Ce.y-ce.y+X[0][1],Fe=Ce.y+B.measured.height-ce.y2+X[1][1];le=[[Le,Ge],[$e,Fe]]}const{position:_e,positionAbsolute:be}=yA({nodeId:ne,nextPosition:se,nodeLookup:V,nodeExtent:le||X,nodeOrigin:te,onError:H});W=W||B.position.x!==_e.x||B.position.y!==_e.y,B.position=_e,B.internals.positionAbsolute=be}if(k=k||W,!!W&&(G(l,!0),S&&(r||I||!E&&O))){const[ne,B]=bb({nodeId:E,dragItems:l,nodeLookup:V});r==null||r(S,l,ne,B),I==null||I(S,ne,B),E||O==null||O(S,B)}}async function D(){if(!m)return;const{transform:F,panBy:U,autoPanSpeed:V,autoPanOnNodeDrag:X}=t();if(!X){c=!1,cancelAnimationFrame(o);return}const[Y,Q]=cx(d,m,V);(Y!==0||Q!==0)&&(a.x=(a.x??0)-Y/F[2],a.y=(a.y??0)-Q/F[2],await U({x:Y,y:Q})&&T(a)),o=requestAnimationFrame(D)}function z(F){var re;const{nodeLookup:U,multiSelectionActive:V,nodesDraggable:X,transform:Y,snapGrid:Q,snapToGrid:te,selectNodesOnDrag:I,onNodeDragStart:O,onSelectionDragStart:H,unselectNodesAndEdges:G}=t();f=!0,(!I||!N)&&!V&&E&&((re=U.get(E))!=null&&re.selected||G()),N&&I&&E&&(e==null||e(E));const W=Cd(F.sourceEvent,{transform:Y,snapGrid:Q,snapToGrid:te,containerBounds:m});if(a=W,l=Lte(U,X,W,E),l.size>0&&(n||O||!E&&H)){const[ce,me]=bb({nodeId:E,dragItems:l,nodeLookup:U});n==null||n(F.sourceEvent,l,ce,me),O==null||O(F.sourceEvent,ce,me),E||H==null||H(F.sourceEvent,me)}}const $=eA().clickDistance(M).on("start",F=>{const{domNode:U,nodeDragThreshold:V,transform:X,snapGrid:Y,snapToGrid:Q}=t();m=(U==null?void 0:U.getBoundingClientRect())||null,b=!1,k=!1,S=F.sourceEvent,V===0&&z(F),a=Cd(F.sourceEvent,{transform:X,snapGrid:Y,snapToGrid:Q,containerBounds:m}),d=ys(F.sourceEvent,m)}).on("drag",F=>{const{autoPanOnNodeDrag:U,transform:V,snapGrid:X,snapToGrid:Y,nodeDragThreshold:Q,nodeLookup:te}=t(),I=Cd(F.sourceEvent,{transform:V,snapGrid:X,snapToGrid:Y,containerBounds:m});if(S=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||E&&!te.has(E))&&(b=!0),!b){if(!c&&U&&f&&(c=!0,D()),!f){const O=ys(F.sourceEvent,m),H=O.x-d.x,G=O.y-d.y;Math.sqrt(H*H+G*G)>Q&&z(F)}(a.x!==I.xSnapped||a.y!==I.ySnapped)&&l&&f&&(d=ys(F.sourceEvent,m),T(I))}}).on("end",F=>{if(!f||b){b&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(o),l.size>0){const{nodeLookup:U,updateNodePositions:V,onNodeDragStop:X,onSelectionDragStop:Y}=t();if(k&&(V(l,!1),k=!1),i||X||!E&&Y){const[Q,te]=bb({nodeId:E,dragItems:l,nodeLookup:U,dragging:!1});i==null||i(F.sourceEvent,l,Q,te),X==null||X(F.sourceEvent,Q,te),E||Y==null||Y(F.sourceEvent,te)}}}).filter(F=>{const U=F.target;return!F.button&&(!w||!c8(U,`.${w}`,C))&&(!y||c8(U,y,C))});g.call($)}function v(){g==null||g.on(".drag",null)}return{update:x,destroy:v}}function zte(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())sp(i,Zd(a))>0&&r.push(a);return r}const Bte=250;function Hte(e,t,n,r){var l,c;let i=[],a=1/0;const o=zte(e,n,t+Bte);for(const d of o){const m=[...((l=d.internals.handleBounds)==null?void 0:l.source)??[],...((c=d.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of m){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:g,y:b}=zl(d,f,f.position,!0),k=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(b-e.y,2));k>t||(k1){const d=r.type==="source"?"target":"source";return i.find(m=>m.type===d)??i[0]}return i[0]}function HA(e,t,n,r,i,a=!1){var d,m,f;const o=r.get(e);if(!o)return null;const l=i==="strict"?(d=o.internals.handleBounds)==null?void 0:d[t]:[...((m=o.internals.handleBounds)==null?void 0:m.source)??[],...((f=o.internals.handleBounds)==null?void 0:f.target)??[]],c=(n?l==null?void 0:l.find(g=>g.id===n):l==null?void 0:l[0])??null;return c&&a?{...c,...zl(o,c,c.position,!0)}:c}function $A(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function $te(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const FA=()=>!0;function Fte(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:l,nodeLookup:c,lib:d,autoPanOnConnect:m,flowId:f,panBy:g,cancelConnection:b,onConnectStart:k,onConnect:S,onConnectEnd:x,isValidConnection:v=FA,onReconnectEnd:w,updateConnection:y,getTransform:C,getFromHandle:N,autoPanSpeed:E,dragThreshold:M=1,handleDomNode:T}){const D=TA(e.target);let z=0,$;const{x:F,y:U}=ys(e),V=$A(a,T),X=l==null?void 0:l.getBoundingClientRect();let Y=!1;if(!X||!V)return;const Q=HA(i,V,r,c,t);if(!Q)return;let te=ys(e,X),I=!1,O=null,H=!1,G=null;function W(){if(!m||!X)return;const[_e,be]=cx(te,X,E);g({x:_e,y:be}),z=requestAnimationFrame(W)}const re={...Q,nodeId:i,type:V,position:Q.position},ce=c.get(i);let ne={inProgress:!0,isValid:null,from:zl(ce,re,at.Left,!0),fromHandle:re,fromPosition:re.position,fromNode:ce,to:te,toHandle:null,toPosition:Z7[re.position],toNode:null,pointer:te};function B(){Y=!0,y(ne),k==null||k(e,{nodeId:i,handleId:r,handleType:V})}M===0&&B();function se(_e){if(!Y){const{x:Fe,y:ut}=ys(_e),Ke=Fe-F,Ue=ut-U;if(!(Ke*Ke+Ue*Ue>M*M))return;B()}if(!N()||!re){le(_e);return}const be=C();te=ys(_e,X),$=Hte(Th(te,be,!1,[1,1]),n,c,re),I||(W(),I=!0);const Ce=PA(_e,{handle:$,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:v,doc:D,lib:d,flowId:f,nodeLookup:c});G=Ce.handleDomNode,O=Ce.connection,H=$te(!!$,Ce.isValid);const Le=c.get(i),$e=Le?zl(Le,re,at.Left,!0):ne.from,Ge={...ne,from:$e,isValid:H,to:Ce.toHandle&&H?iu({x:Ce.toHandle.x,y:Ce.toHandle.y},be):te,toHandle:Ce.toHandle,toPosition:H&&Ce.toHandle?Ce.toHandle.position:Z7[re.position],toNode:Ce.toHandle?c.get(Ce.toHandle.nodeId):null,pointer:te};y(Ge),ne=Ge}function le(_e){if(!("touches"in _e&&_e.touches.length>0)){if(Y){($||G)&&O&&H&&(S==null||S(O));const{inProgress:be,...Ce}=ne,Le={...Ce,toPosition:ne.toHandle?ne.toPosition:null};x==null||x(_e,Le),a&&(w==null||w(_e,Le))}b(),cancelAnimationFrame(z),I=!1,H=!1,O=null,G=null,D.removeEventListener("mousemove",se),D.removeEventListener("mouseup",le),D.removeEventListener("touchmove",se),D.removeEventListener("touchend",le)}}D.addEventListener("mousemove",se),D.addEventListener("mouseup",le),D.addEventListener("touchmove",se),D.addEventListener("touchend",le)}function PA(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:l,flowId:c,isValidConnection:d=FA,nodeLookup:m}){const f=a==="target",g=t?o.querySelector(`.${l}-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:b,y:k}=ys(e),S=o.elementFromPoint(b,k),x=S!=null&&S.classList.contains(`${l}-flow__handle`)?S:g,v={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const w=$A(void 0,x),y=x.getAttribute("data-nodeid"),C=x.getAttribute("data-handleid"),N=x.classList.contains("connectable"),E=x.classList.contains("connectableend");if(!y||!w)return v;const M={source:f?y:r,sourceHandle:f?C:i,target:f?r:y,targetHandle:f?i:C};v.connection=M;const D=N&&E&&(n===nu.Strict?f&&w==="source"||!f&&w==="target":y!==r||C!==i);v.isValid=D&&d(M),v.toHandle=HA(y,w,C,m,n,!0)}return v}const e_={onPointerDown:Fte,isValid:PA};function Pte({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=Mi(e);function a({translateExtent:l,width:c,height:d,zoomStep:m=1,pannable:f=!0,zoomable:g=!0,inversePan:b=!1}){const k=y=>{if(y.sourceEvent.type!=="wheel"||!t)return;const C=n(),N=y.sourceEvent.ctrlKey&&Qd()?10:1,E=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*m,M=C[2]*Math.pow(2,E*N);t.scaleTo(M)};let S=[0,0];const x=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(S=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},v=y=>{const C=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const N=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],E=[N[0]-S[0],N[1]-S[1]];S=N;const M=r()*Math.max(C[2],Math.log(C[2]))*(b?-1:1),T={x:C[0]-E[0]*M,y:C[1]-E[1]*M},D=[[0,0],[c,d]];t.setViewportConstrained({x:T.x,y:T.y,zoom:C[2]},D,l)},w=mA().on("start",x).on("zoom",f?v:null).on("zoom.wheel",g?k:null);i.call(w,{})}function o(){i.on("zoom",null)}return{update:a,destroy:o,pointer:bs}}const rm=e=>({x:e.x,y:e.y,zoom:e.k}),vb=({x:e,y:t,zoom:n})=>em.translate(e,t).scale(n),Oc=(e,t)=>e.target.closest(`.${t}`),UA=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Ute=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,_b=(e,t=0,n=Ute,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},qA=e=>{const t=e.ctrlKey&&Qd()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function qte({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:d}){return m=>{if(Oc(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(m.ctrlKey&&o){const x=bs(m),v=qA(m),w=f*Math.pow(2,v);r.scaleTo(n,w,x,m);return}const g=m.deltaMode===1?20:1;let b=i===Ml.Vertical?0:m.deltaX*g,k=i===Ml.Horizontal?0:m.deltaY*g;!Qd()&&m.shiftKey&&i!==Ml.Vertical&&(b=m.deltaY*g,k=0),r.translateBy(n,-(b/f)*a,-(k/f)*a,{internal:!0});const S=rm(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(m,S),e.panScrollTimeout=setTimeout(()=>{d==null||d(m,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(m,S))}}function Gte({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const a=r.type==="wheel",o=!t&&a&&!r.ctrlKey,l=Oc(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,i)}}function Vte({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,o,l;if((a=r.sourceEvent)!=null&&a.internal)return;const i=rm(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function Wte({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{var o,l;e.usedRightMouseButton=!!(n&&UA(t,e.mouseButton??0)),(o=a.sourceEvent)!=null&&o.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!((l=a.sourceEvent)!=null&&l.internal)&&(i==null||i(a.sourceEvent,rm(a.transform)))}}function Yte({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,a&&UA(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const c=rm(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,c)},n?150:0)}}}function Xte({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:d,connectionInProgress:m}){return f=>{var x;const g=e||t,b=n&&f.ctrlKey,k=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Oc(f,`${d}-flow__node`)||Oc(f,`${d}-flow__edge`)))return!0;if(!r&&!g&&!i&&!a&&!n||o||m&&!k||Oc(f,l)&&k||Oc(f,c)&&(!k||i&&k&&!e)||!n&&f.ctrlKey&&k)return!1;if(!n&&f.type==="touchstart"&&((x=f.touches)==null?void 0:x.length)>1)return f.preventDefault(),!1;if(!g&&!i&&!b&&k||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const S=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||k)&&S}}function Kte({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:c}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),f=mA().scaleExtent([t,n]).translateExtent(r),g=Mi(e).call(f);w({x:i.x,y:i.y,zoom:ru(i.zoom,t,n)},[[0,0],[m.width,m.height]],r);const b=g.on("wheel.zoom"),k=g.on("dblclick.zoom");f.wheelDelta(qA);async function S($,F){return g?new Promise(U=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?kd:wf).transform(_b(g,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>U(!0)),$)}):!1}function x({noWheelClassName:$,noPanClassName:F,onPaneContextMenu:U,userSelectionActive:V,panOnScroll:X,panOnDrag:Y,panOnScrollMode:Q,panOnScrollSpeed:te,preventScrolling:I,zoomOnPinch:O,zoomOnScroll:H,zoomOnDoubleClick:G,zoomActivationKeyPressed:W,lib:re,onTransformChange:ce,connectionInProgress:me,paneClickDistance:ne,selectionOnDrag:B}){V&&!d.isZoomingOrPanning&&v();const se=X&&!W&&!V;f.clickDistance(B?1/0:!xs(ne)||ne<0?0:ne);const le=se?qte({zoomPanValues:d,noWheelClassName:$,d3Selection:g,d3Zoom:f,panOnScrollMode:Q,panOnScrollSpeed:te,zoomOnPinch:O,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:l}):Gte({noWheelClassName:$,preventScrolling:I,d3ZoomHandler:b});g.on("wheel.zoom",le,{passive:!1});const _e=Vte({zoomPanValues:d,onDraggingChange:c,onPanZoomStart:o});f.on("start",_e);const be=Wte({zoomPanValues:d,panOnDrag:Y,onPaneContextMenu:!!U,onPanZoom:a,onTransformChange:ce});f.on("zoom",be);const Ce=Yte({zoomPanValues:d,panOnDrag:Y,panOnScroll:X,onPaneContextMenu:U,onPanZoomEnd:l,onDraggingChange:c});f.on("end",Ce);const Le=Xte({zoomActivationKeyPressed:W,panOnDrag:Y,zoomOnScroll:H,panOnScroll:X,zoomOnDoubleClick:G,zoomOnPinch:O,userSelectionActive:V,noPanClassName:F,noWheelClassName:$,lib:re,connectionInProgress:me});f.filter(Le),G?g.on("dblclick.zoom",k):g.on("dblclick.zoom",null)}function v(){f.on("zoom",null)}async function w($,F,U){const V=vb($),X=f==null?void 0:f.constrain()(V,F,U);return X&&await S(X),X}async function y($,F){const U=vb($);return await S(U,F),U}function C($){if(g){const F=vb($),U=g.property("__zoom");(U.k!==$.zoom||U.x!==$.x||U.y!==$.y)&&(f==null||f.transform(g,F,null,{sync:!0}))}}function N(){const $=g?pA(g.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}async function E($,F){return g?new Promise(U=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?kd:wf).scaleTo(_b(g,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>U(!0)),$)}):!1}async function M($,F){return g?new Promise(U=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?kd:wf).scaleBy(_b(g,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>U(!0)),$)}):!1}function T($){f==null||f.scaleExtent($)}function D($){f==null||f.translateExtent($)}function z($){const F=!xs($)||$<0?0:$;f==null||f.clickDistance(F)}return{update:x,destroy:v,setViewport:y,setViewportConstrained:w,getViewport:N,scaleTo:E,scaleBy:M,setScaleExtent:T,setTranslateExtent:D,syncViewport:C,setClickDistance:z}}var su;(function(e){e.Line="line",e.Handle="handle"})(su||(su={}));function Zte({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){const o=e-t,l=n-r,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&i&&(c[0]=c[0]*-1),l&&a&&(c[1]=c[1]*-1),c}function u8(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function jo(e,t){return Math.max(0,t-e)}function Mo(e,t){return Math.max(0,e-t)}function sf(e,t,n){return Math.max(0,t-e,e-n)}function d8(e,t){return e?!t:t}function Qte(e,t,n,r,i,a,o,l){let{affectsX:c,affectsY:d}=t;const{isHorizontal:m,isVertical:f}=t,g=m&&f,{xSnapped:b,ySnapped:k}=n,{minWidth:S,maxWidth:x,minHeight:v,maxHeight:w}=r,{x:y,y:C,width:N,height:E,aspectRatio:M}=e;let T=Math.floor(m?b-e.pointerX:0),D=Math.floor(f?k-e.pointerY:0);const z=N+(c?-T:T),$=E+(d?-D:D),F=-a[0]*N,U=-a[1]*E;let V=sf(z,S,x),X=sf($,v,w);if(o){let te=0,I=0;c&&T<0?te=jo(y+T+F,o[0][0]):!c&&T>0&&(te=Mo(y+z+F,o[1][0])),d&&D<0?I=jo(C+D+U,o[0][1]):!d&&D>0&&(I=Mo(C+$+U,o[1][1])),V=Math.max(V,te),X=Math.max(X,I)}if(l){let te=0,I=0;c&&T>0?te=Mo(y+T,l[0][0]):!c&&T<0&&(te=jo(y+z,l[1][0])),d&&D>0?I=Mo(C+D,l[0][1]):!d&&D<0&&(I=jo(C+$,l[1][1])),V=Math.max(V,te),X=Math.max(X,I)}if(i){if(m){const te=sf(z/M,v,w)*M;if(V=Math.max(V,te),o){let I=0;!c&&!d||c&&!d&&g?I=Mo(C+U+z/M,o[1][1])*M:I=jo(C+U+(c?T:-T)/M,o[0][1])*M,V=Math.max(V,I)}if(l){let I=0;!c&&!d||c&&!d&&g?I=jo(C+z/M,l[1][1])*M:I=Mo(C+(c?T:-T)/M,l[0][1])*M,V=Math.max(V,I)}}if(f){const te=sf($*M,S,x)/M;if(X=Math.max(X,te),o){let I=0;!c&&!d||d&&!c&&g?I=Mo(y+$*M+F,o[1][0])/M:I=jo(y+(d?D:-D)*M+F,o[0][0])/M,X=Math.max(X,I)}if(l){let I=0;!c&&!d||d&&!c&&g?I=jo(y+$*M,l[1][0])/M:I=Mo(y+(d?D:-D)*M,l[0][0])/M,X=Math.max(X,I)}}}D=D+(D<0?X:-X),T=T+(T<0?V:-V),i&&(g?z>$*M?D=(d8(c,d)?-T:T)/M:T=(d8(c,d)?-D:D)*M:m?(D=T/M,d=c):(T=D*M,c=d));const Y=c?y+T:y,Q=d?C+D:C;return{width:N+(c?-T:T),height:E+(d?-D:D),x:a[0]*T*(c?-1:1)+Y,y:a[1]*D*(d?-1:1)+Q}}const GA={width:0,height:0,x:0,y:0},Jte={...GA,pointerX:0,pointerY:0,aspectRatio:1};function ene(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,l=n[0]*a,c=n[1]*o;return[[r-l,i-c],[r+a-l,i+o-c]]}function tne({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const a=Mi(e);let o={controlDirection:u8("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:d,boundaries:m,keepAspectRatio:f,resizeDirection:g,onResizeStart:b,onResize:k,onResizeEnd:S,shouldResize:x}){let v={...GA},w={...Jte};o={boundaries:m,resizeDirection:g,keepAspectRatio:f,controlDirection:u8(d)};let y,C=null,N=[],E,M,T,D=!1;const z=eA().on("start",$=>{const{nodeLookup:F,transform:U,snapGrid:V,snapToGrid:X,nodeOrigin:Y,paneDomNode:Q}=n();if(y=F.get(t),!y)return;C=(Q==null?void 0:Q.getBoundingClientRect())??null;const{xSnapped:te,ySnapped:I}=Cd($.sourceEvent,{transform:U,snapGrid:V,snapToGrid:X,containerBounds:C});v={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={...v,pointerX:te,pointerY:I,aspectRatio:v.width/v.height},E=void 0,M=Il(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(E=F.get(y.parentId)),E&&y.extent==="parent"&&(M=[[0,0],[E.measured.width,E.measured.height]]),N=[],T=void 0;for(const[O,H]of F)if(H.parentId===t&&(N.push({id:O,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const G=ene(H,y,H.origin??Y);T?T=[[Math.min(G[0][0],T[0][0]),Math.min(G[0][1],T[0][1])],[Math.max(G[1][0],T[1][0]),Math.max(G[1][1],T[1][1])]]:T=G}b==null||b($,{...v})}).on("drag",$=>{const{transform:F,snapGrid:U,snapToGrid:V,nodeOrigin:X}=n(),Y=Cd($.sourceEvent,{transform:F,snapGrid:U,snapToGrid:V,containerBounds:C}),Q=[];if(!y)return;const{x:te,y:I,width:O,height:H}=v,G={},W=y.origin??X,{width:re,height:ce,x:me,y:ne}=Qte(w,o.controlDirection,Y,o.boundaries,o.keepAspectRatio,W,M,T),B=re!==O,se=ce!==H,le=me!==te&&B,_e=ne!==I&&se;if(!le&&!_e&&!B&&!se)return;if((le||_e||W[0]===1||W[1]===1)&&(G.x=le?me:v.x,G.y=_e?ne:v.y,v.x=G.x,v.y=G.y,N.length>0)){const $e=me-te,Ge=ne-I;for(const Fe of N)Fe.position={x:Fe.position.x-$e+W[0]*(re-O),y:Fe.position.y-Ge+W[1]*(ce-H)},Q.push(Fe)}if((B||se)&&(G.width=B&&(!o.resizeDirection||o.resizeDirection==="horizontal")?re:v.width,G.height=se&&(!o.resizeDirection||o.resizeDirection==="vertical")?ce:v.height,v.width=G.width,v.height=G.height),E&&y.expandParent){const $e=W[0]*(G.width??0);G.x&&G.x<$e&&(v.x=$e,w.x=w.x-(G.x-$e));const Ge=W[1]*(G.height??0);G.y&&G.y{D&&(S==null||S($,{...v}),i==null||i({...v}),D=!1)});a.call(z)}function c(){a.on(".drag",null)}return{update:l,destroy:c}}var xb={exports:{}},yb={},wb={exports:{}},Sb={};/** * @license React * use-sync-external-store-shim.production.js * @@ -1016,7 +1010,7 @@ Its experiments, runs and chats are removed from orx. The local folder (${d.path * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var d8;function Xte(){if(d8)return xb;d8=1;var e=sh();function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function l(f,g){var b=g(),k=r({inst:{value:b,getSnapshot:g}}),S=k[0].inst,x=k[1];return a(function(){S.value=b,S.getSnapshot=g,u(S)&&x({inst:S})},[f,b,g]),i(function(){return u(S)&&x({inst:S}),f(function(){u(S)&&x({inst:S})})},[f]),o(b),b}function u(f){var g=f.getSnapshot;f=f.value;try{var b=g();return!n(f,b)}catch{return!0}}function d(f,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return xb.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,xb}var h8;function Kte(){return h8||(h8=1,_b.exports=Xte()),_b.exports}/** + */var h8;function nne(){if(h8)return Sb;h8=1;var e=ah();function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function l(f,g){var b=g(),k=r({inst:{value:b,getSnapshot:g}}),S=k[0].inst,x=k[1];return a(function(){S.value=b,S.getSnapshot=g,c(S)&&x({inst:S})},[f,b,g]),i(function(){return c(S)&&x({inst:S}),f(function(){c(S)&&x({inst:S})})},[f]),o(b),b}function c(f){var g=f.getSnapshot;f=f.value;try{var b=g();return!n(f,b)}catch{return!0}}function d(f,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return Sb.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Sb}var f8;function rne(){return f8||(f8=1,wb.exports=nne()),wb.exports}/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -1024,12 +1018,12 @@ Its experiments, runs and chats are removed from orx. The local folder (${d.path * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var f8;function Zte(){if(f8)return vb;f8=1;var e=sh(),t=Kte();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,l=e.useMemo,u=e.useDebugValue;return vb.useSyncExternalStoreWithSelector=function(d,m,f,g,b){var k=a(null);if(k.current===null){var S={hasValue:!1,value:null};k.current=S}else S=k.current;k=l(function(){function _(E){if(!w){if(w=!0,y=E,E=g(E),b!==void 0&&S.hasValue){var j=S.value;if(b(j,E))return C=j}return C=E}if(j=C,r(y,E))return j;var N=g(E);return b!==void 0&&b(j,N)?(y=E,j):(y=E,C=N)}var w=!1,y,C,T=f===void 0?null:f;return[function(){return _(m())},T===null?void 0:function(){return _(T())}]},[m,f,g,b]);var x=i(d,k[0],k[1]);return o(function(){S.hasValue=!0,S.value=x},[x]),u(x),x},vb}var p8;function Qte(){return p8||(p8=1,bb.exports=Zte()),bb.exports}var Jte=Qte();const ene=sp(Jte),tne={},m8=e=>{let t;const n=new Set,r=(m,f)=>{const g=typeof m=="function"?m(t):m;if(!Object.is(g,t)){const b=t;t=f??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(k=>k(t,b))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>d,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(tne?"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()}},d=t=e(r,i,u);return u},nne=e=>e?m8(e):m8,{useDebugValue:rne}=dj,{useSyncExternalStoreWithSelector:ine}=ene,sne=e=>e;function HA(e,t=sne,n){const r=ine(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return rne(r),r}const g8=(e,t)=>{const n=nne(e),r=(i,a=t)=>HA(n,i,a);return Object.assign(r,n),r},ane=(e,t)=>e?g8(e,t):g8;function Nn(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,i]of e)if(!Object.is(i,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}const nm=R.createContext(null),one=nm.Provider,$A=js.error001("react");function Ht(e,t){const n=R.useContext(nm);if(n===null)throw new Error($A);return HA(n,e,t)}function Mn(){const e=R.useContext(nm);if(e===null)throw new Error($A);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const b8={display:"none"},lne={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},FA="react-flow__node-desc",PA="react-flow__edge-desc",cne="react-flow__aria-live",une=e=>e.ariaLiveMessage,dne=e=>e.ariaLabelConfig;function hne({rfId:e}){const t=Ht(une);return h.jsx("div",{id:`${cne}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:lne,children:t})}function fne({rfId:e,disableKeyboardA11y:t}){const n=Ht(dne);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${FA}-${e}`,style:b8,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${PA}-${e}`,style:b8,children:n["edge.a11yDescription.default"]}),!t&&h.jsx(hne,{rfId:e})]})}const rm=R.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},a)=>{const o=`${e}`.split("-");return h.jsx("div",{className:sr(["react-flow__panel",n,...o]),style:r,ref:a,...i,children:t})});rm.displayName="Panel";const v8="https://reactflow.dev?utm_source=attribution";function pne({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:h.jsx(rm,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${v8}`,children:h.jsx("a",{href:v8,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const mne=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}},sf=e=>e.id;function gne(e,t){return Nn(e.selectedNodes.map(sf),t.selectedNodes.map(sf))&&Nn(e.selectedEdges.map(sf),t.selectedEdges.map(sf))}function bne({onSelectionChange:e}){const t=Mn(),{selectedNodes:n,selectedEdges:r}=Ht(mne,gne);return R.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(a=>a(i))},[n,r,e]),null}const vne=e=>!!e.onSelectionChangeHandlers;function _ne({onSelectionChange:e}){const t=Ht(vne);return e||t?h.jsx(bne,{onSelectionChange:e}):null}const UA=[0,0],xne={x:0,y:0,zoom:1},yne=["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"],_8=[...yne,"rfId"],wne=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}),x8={translateExtent:Yd,nodeOrigin:UA,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Sne(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:u}=Ht(wne,Nn),d=Mn();R.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{m.current=x8,l()}),[]);const m=R.useRef(x8);return R.useEffect(()=>{for(const f of _8){const g=e[f],b=m.current[f];g!==b&&(typeof e[f]>"u"||(f==="nodes"?t(g):f==="edges"?n(g):f==="minZoom"?r(g):f==="maxZoom"?i(g):f==="translateExtent"?a(g):f==="nodeExtent"?o(g):f==="ariaLabelConfig"?d.setState({ariaLabelConfig:ote(g)}):f==="fitView"?d.setState({fitViewQueued:g}):f==="fitViewOptions"?d.setState({fitViewOptions:g}):d.setState({[f]:g})))}m.current=e},_8.map(f=>e[f])),null}function y8(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function kne(e){var r;const[t,n]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){n(e);return}const i=y8(),a=()=>n(i!=null&&i.matches?"dark":"light");return a(),i==null||i.addEventListener("change",a),()=>{i==null||i.removeEventListener("change",a)}},[e]),t!==null?t:(r=y8())!=null&&r.matches?"dark":"light"}const w8=typeof document<"u"?document:null;function Qd(e=null,t={target:w8,actInsideInputWithModifier:!0}){const[n,r]=R.useState(!1),i=R.useRef(!1),a=R.useRef(new Set([])),[o,l]=R.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` + */var p8;function ine(){if(p8)return yb;p8=1;var e=ah(),t=rne();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,l=e.useMemo,c=e.useDebugValue;return yb.useSyncExternalStoreWithSelector=function(d,m,f,g,b){var k=a(null);if(k.current===null){var S={hasValue:!1,value:null};k.current=S}else S=k.current;k=l(function(){function v(E){if(!w){if(w=!0,y=E,E=g(E),b!==void 0&&S.hasValue){var M=S.value;if(b(M,E))return C=M}return C=E}if(M=C,r(y,E))return M;var T=g(E);return b!==void 0&&b(M,T)?(y=E,M):(y=E,C=T)}var w=!1,y,C,N=f===void 0?null:f;return[function(){return v(m())},N===null?void 0:function(){return v(N())}]},[m,f,g,b]);var x=i(d,k[0],k[1]);return o(function(){S.hasValue=!0,S.value=x},[x]),c(x),x},yb}var m8;function sne(){return m8||(m8=1,xb.exports=ine()),xb.exports}var ane=sne();const one=op(ane),lne={},g8=e=>{let t;const n=new Set,r=(m,f)=>{const g=typeof m=="function"?m(t):m;if(!Object.is(g,t)){const b=t;t=f??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(k=>k(t,b))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>d,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(lne?"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()}},d=t=e(r,i,c);return c},cne=e=>e?g8(e):g8,{useDebugValue:une}=bj,{useSyncExternalStoreWithSelector:dne}=one,hne=e=>e;function VA(e,t=hne,n){const r=dne(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return une(r),r}const b8=(e,t)=>{const n=cne(e),r=(i,a=t)=>VA(n,i,a);return Object.assign(r,n),r},fne=(e,t)=>e?b8(e,t):b8;function Tn(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,i]of e)if(!Object.is(i,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}const im=R.createContext(null),pne=im.Provider,WA=Es.error001("react");function Ht(e,t){const n=R.useContext(im);if(n===null)throw new Error(WA);return VA(n,e,t)}function jn(){const e=R.useContext(im);if(e===null)throw new Error(WA);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const v8={display:"none"},mne={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},YA="react-flow__node-desc",XA="react-flow__edge-desc",gne="react-flow__aria-live",bne=e=>e.ariaLiveMessage,vne=e=>e.ariaLabelConfig;function _ne({rfId:e}){const t=Ht(bne);return h.jsx("div",{id:`${gne}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:mne,children:t})}function xne({rfId:e,disableKeyboardA11y:t}){const n=Ht(vne);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${YA}-${e}`,style:v8,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${XA}-${e}`,style:v8,children:n["edge.a11yDescription.default"]}),!t&&h.jsx(_ne,{rfId:e})]})}const sm=R.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},a)=>{const o=`${e}`.split("-");return h.jsx("div",{className:sr(["react-flow__panel",n,...o]),style:r,ref:a,...i,children:t})});sm.displayName="Panel";const _8="https://reactflow.dev?utm_source=attribution";function yne({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:h.jsx(sm,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${_8}`,children:h.jsx("a",{href:_8,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const wne=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}},af=e=>e.id;function Sne(e,t){return Tn(e.selectedNodes.map(af),t.selectedNodes.map(af))&&Tn(e.selectedEdges.map(af),t.selectedEdges.map(af))}function kne({onSelectionChange:e}){const t=jn(),{selectedNodes:n,selectedEdges:r}=Ht(wne,Sne);return R.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(a=>a(i))},[n,r,e]),null}const Cne=e=>!!e.onSelectionChangeHandlers;function Ene({onSelectionChange:e}){const t=Ht(Cne);return e||t?h.jsx(kne,{onSelectionChange:e}):null}const KA=[0,0],Ane={x:0,y:0,zoom:1},Tne=["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"],x8=[...Tne,"rfId"],Nne=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}),y8={translateExtent:Xd,nodeOrigin:KA,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function jne(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=Ht(Nne,Tn),d=jn();R.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{m.current=y8,l()}),[]);const m=R.useRef(y8);return R.useEffect(()=>{for(const f of x8){const g=e[f],b=m.current[f];g!==b&&(typeof e[f]>"u"||(f==="nodes"?t(g):f==="edges"?n(g):f==="minZoom"?r(g):f==="maxZoom"?i(g):f==="translateExtent"?a(g):f==="nodeExtent"?o(g):f==="ariaLabelConfig"?d.setState({ariaLabelConfig:pte(g)}):f==="fitView"?d.setState({fitViewQueued:g}):f==="fitViewOptions"?d.setState({fitViewOptions:g}):d.setState({[f]:g})))}m.current=e},x8.map(f=>e[f])),null}function w8(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Mne(e){var r;const[t,n]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){n(e);return}const i=w8(),a=()=>n(i!=null&&i.matches?"dark":"light");return a(),i==null||i.addEventListener("change",a),()=>{i==null||i.removeEventListener("change",a)}},[e]),t!==null?t:(r=w8())!=null&&r.matches?"dark":"light"}const S8=typeof document<"u"?document:null;function Jd(e=null,t={target:S8,actInsideInputWithModifier:!0}){const[n,r]=R.useState(!1),i=R.useRef(!1),a=R.useRef(new Set([])),[o,l]=R.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` `).replace(` `,` +`).split(` -`)),m=d.reduce((f,g)=>f.concat(...g),[]);return[d,m]}return[[],[]]},[e]);return R.useEffect(()=>{const u=(t==null?void 0:t.target)??w8,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=b=>{var x,_;if(i.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!i.current||i.current&&!d)&&wA(b))return!1;const S=k8(b.code,l);if(a.current.add(b[S]),S8(o,a.current,!1)){const w=((_=(x=b.composedPath)==null?void 0:x.call(b))==null?void 0:_[0])||b.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(i.current||!y)&&b.preventDefault(),r(!0)}},f=b=>{const k=k8(b.code,l);S8(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(b[k]),b.key==="Meta"&&a.current.clear(),i.current=!1},g=()=>{a.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",m),u==null||u.addEventListener("keyup",f),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{u==null||u.removeEventListener("keydown",m),u==null||u.removeEventListener("keyup",f),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function S8(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function k8(e,t){return t.includes(e)?"code":"key"}const Cne=()=>{const e=Mn();return R.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,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},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:i,minZoom:a,maxZoom:o,panZoom:l}=e.getState(),u=ox(t,r,i,a,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(u,{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:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;const{x:l,y:u}=o.getBoundingClientRect(),d={x:t.x-l,y:t.y-u},m=n.snapGrid??i,f=n.snapToGrid??a;return Ah(d,r,f,m)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:a}=r.getBoundingClientRect(),o=iu(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function qA(e,t){const n=[],r=new Map,i=[];for(const a of e)if(a.type==="add"){i.push(a);continue}else if(a.type==="remove"||a.type==="replace")r.set(a.id,[a]);else{const o=r.get(a.id);o?o.push(a):r.set(a.id,[a])}for(const a of t){const o=r.get(a.id);if(!o){n.push(a);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...a};for(const u of o)Ene(u,l);n.push(l)}return i.length&&i.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function Ene(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 Ane(e,t){return qA(e,t)}function Tne(e,t){return qA(e,t)}function vl(e,t){return{id:e,type:"select",selected:t}}function Ic(e,t=new Set,n=!1){const r=[];for(const[i,a]of e){const o=t.has(i);!(a.selected===void 0&&!o)&&a.selected!==o&&(n&&(a.selected=o),r.push(vl(a.id,o)))}return r}function C8({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,o]of e.entries()){const l=t.get(o.id),u=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;u!==void 0&&u!==o&&n.push({id:o.id,item:o,type:"replace"}),u===void 0&&n.push({item:o,type:"add",index:a})}for(const[a]of t)r.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function E8(e){return{id:e.id,type:"remove"}}const Nne=vA();function jne(e,t,n={}){return fte(e,t,{...n,onError:n.onError??Nne})}const A8=e=>Qee(e),Mne=e=>fA(e);function GA(e){return R.forwardRef(e)}const Rne=typeof window<"u"?R.useLayoutEffect:R.useEffect;function T8(e){const[t,n]=R.useState(BigInt(0)),[r]=R.useState(()=>Dne(()=>n(i=>i+BigInt(1))));return Rne(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function Dne(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const VA=R.createContext(null);function Lne({children:e}){const t=Mn(),n=R.useCallback(l=>{const{nodes:u=[],setNodes:d,hasDefaultNodes:m,onNodesChange:f,nodeLookup:g,fitViewQueued:b,onNodesChangeMiddlewareMap:k}=t.getState();let S=u;for(const _ of l)S=typeof _=="function"?_(S):_;let x=C8({items:S,lookup:g});for(const _ of k.values())x=_(x);m&&d(S),x.length>0?f==null||f(x):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:_,nodes:w,setNodes:y}=t.getState();_&&y(w)})},[]),r=T8(n),i=R.useCallback(l=>{const{edges:u=[],setEdges:d,hasDefaultEdges:m,onEdgesChange:f,edgeLookup:g}=t.getState();let b=u;for(const k of l)b=typeof k=="function"?k(b):k;m?d(b):f&&f(C8({items:b,lookup:g}))},[]),a=T8(i),o=R.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return h.jsx(VA.Provider,{value:o,children:e})}function One(){const e=R.useContext(VA);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Ine=e=>!!e.panZoom;function px(){const e=Cne(),t=Mn(),n=One(),r=Ht(Ine),i=R.useMemo(()=>{const a=f=>t.getState().nodeLookup.get(f),o=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},u=f=>{var _,w;const{nodeLookup:g,nodeOrigin:b}=t.getState(),k=A8(f)?f:g.get(f.id),S=k.parentId?xA(k.position,k.measured,k.parentId,g,b):k.position,x={...k,position:S,width:((_=k.measured)==null?void 0:_.width)??k.width,height:((w=k.measured)==null?void 0:w.height)??k.height};return Kd(x)},d=(f,g,b={replace:!1})=>{o(k=>k.map(S=>{if(S.id===f){const x=typeof g=="function"?g(S):g;return b.replace&&A8(x)?x:{...S,...x}}return S}))},m=(f,g,b={replace:!1})=>{l(k=>k.map(S=>{if(S.id===f){const x=typeof g=="function"?g(S):g;return b.replace&&Mne(x)?x:{...S,...x}}return S}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var g;return(g=a(f))==null?void 0:g.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(g=>({...g}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:o,setEdges:l,addNodes:f=>{const g=Array.isArray(f)?f:[f];n.nodeQueue.push(b=>[...b,...g])},addEdges:f=>{const g=Array.isArray(f)?f:[f];n.edgeQueue.push(b=>[...b,...g])},toObject:()=>{const{nodes:f=[],edges:g=[],transform:b}=t.getState(),[k,S,x]=b;return{nodes:f.map(_=>({..._})),edges:g.map(_=>({..._})),viewport:{x:k,y:S,zoom:x}}},deleteElements:async({nodes:f=[],edges:g=[]})=>{const{nodes:b,edges:k,onNodesDelete:S,onEdgesDelete:x,triggerNodeChanges:_,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:C}=t.getState(),{nodes:T,edges:E}=await rte({nodesToRemove:f,edgesToRemove:g,nodes:b,edges:k,onBeforeDelete:C}),j=E.length>0,N=T.length>0;if(j){const D=E.map(E8);x==null||x(E),w(D)}if(N){const D=T.map(E8);S==null||S(T),_(D)}return(N||j)&&(y==null||y({nodes:T,edges:E})),{deletedNodes:T,deletedEdges:E}},getIntersectingNodes:(f,g=!0,b)=>{const k=Q7(f),S=k?f:u(f),x=b!==void 0;return S?(b||t.getState().nodes).filter(_=>{const w=t.getState().nodeLookup.get(_.id);if(w&&!k&&(_.id===f.id||!w.internals.positionAbsolute))return!1;const y=Kd(x?_:w),C=rp(y,S);return g&&C>0||C>=y.width*y.height||C>=S.width*S.height}):[]},isNodeIntersecting:(f,g,b=!0)=>{const S=Q7(f)?f:u(f);if(!S)return!1;const x=rp(S,g);return b&&x>0||x>=g.width*g.height||x>=S.width*S.height},updateNode:d,updateNodeData:(f,g,b={replace:!1})=>{d(f,k=>{const S=typeof g=="function"?g(k):g;return b.replace?{...k,data:S}:{...k,data:{...k.data,...S}}},b)},updateEdge:m,updateEdgeData:(f,g,b={replace:!1})=>{m(f,k=>{const S=typeof g=="function"?g(k):g;return b.replace?{...k,data:S}:{...k,data:{...k.data,...S}}},b)},getNodesBounds:f=>{const{nodeLookup:g,nodeOrigin:b}=t.getState();return Jee(f,{nodeLookup:g,nodeOrigin:b})},getHandleConnections:({type:f,id:g,nodeId:b})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${b}-${f}${g?`-${g}`:""}`))==null?void 0:k.values())??[])},getNodeConnections:({type:f,handleId:g,nodeId:b})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${b}${f?g?`-${f}-${g}`:`-${f}`:""}`))==null?void 0:k.values())??[])},fitView:async f=>{const g=t.getState().fitViewResolver??ate();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:g}),n.nodeQueue.push(b=>[...b]),g.promise}}},[]);return R.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const N8=e=>e.selected,zne=typeof window<"u"?window:void 0;function Bne({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Mn(),{deleteElements:r}=px(),i=Qd(e,{actInsideInputWithModifier:!1}),a=Qd(t,{target:zne});R.useEffect(()=>{if(i){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(N8),edges:o.filter(N8)}),n.setState({nodesSelectionActive:!1})}},[i]),R.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function Hne(e){const t=Mn();R.useEffect(()=>{const n=()=>{var i,a,o,l;if(!e.current||!(((a=(i=e.current).checkVisibility)==null?void 0:a.call(i))??!0))return!1;const r=lx(e.current);(r.height===0||r.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",js.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 im={position:"absolute",width:"100%",height:"100%",top:0,left:0},$ne=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Fne({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=Nl.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:d,minZoom:m,maxZoom:f,zoomActivationKeyCode:g,preventScrolling:b=!0,children:k,noWheelClassName:S,noPanClassName:x,onViewportChange:_,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:C}){const T=Mn(),E=R.useRef(null),{userSelectionActive:j,lib:N,connectionInProgress:D}=Ht($ne,Nn),z=Qd(g),$=R.useRef();Hne(E);const F=R.useCallback(U=>{_==null||_({x:U[0],y:U[1],zoom:U[2]}),w||T.setState({transform:U})},[_,w]);return R.useEffect(()=>{if(E.current){$.current=Ute({domNode:E.current,minZoom:m,maxZoom:f,translateExtent:d,viewport:u,onDraggingChange:Y=>T.setState(Q=>Q.paneDragging===Y?Q:{paneDragging:Y}),onPanZoomStart:(Y,Q)=>{const{onViewportChangeStart:te,onMoveStart:I}=T.getState();I==null||I(Y,Q),te==null||te(Q)},onPanZoom:(Y,Q)=>{const{onViewportChange:te,onMove:I}=T.getState();I==null||I(Y,Q),te==null||te(Q)},onPanZoomEnd:(Y,Q)=>{const{onViewportChangeEnd:te,onMoveEnd:I}=T.getState();I==null||I(Y,Q),te==null||te(Q)}});const{x:U,y:V,zoom:X}=$.current.getViewport();return T.setState({panZoom:$.current,transform:[U,V,X],domNode:E.current.closest(".react-flow")}),()=>{var Y;(Y=$.current)==null||Y.destroy()}}},[]),R.useEffect(()=>{var U;(U=$.current)==null||U.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:z,preventScrolling:b,noPanClassName:x,userSelectionActive:j,noWheelClassName:S,lib:N,onTransformChange:F,connectionInProgress:D,selectionOnDrag:C,paneClickDistance:y})},[e,t,n,r,i,a,o,l,z,b,x,j,S,N,F,D,C,y]),h.jsx("div",{className:"react-flow__renderer",ref:E,style:im,children:k})}const Pne=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Une(){const{userSelectionActive:e,userSelectionRect:t}=Ht(Pne,Nn);return e&&t?h.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 yb=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},qne=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Gne({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Xd.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:u,onPaneClick:d,onPaneContextMenu:m,onPaneScroll:f,onPaneMouseEnter:g,onPaneMouseMove:b,onPaneMouseLeave:k,children:S}){const x=R.useRef(0),_=Mn(),{userSelectionActive:w,elementsSelectable:y,dragging:C,panBy:T,autoPanSpeed:E}=Ht(qne,Nn),j=y&&(e||w),N=R.useRef(null),D=R.useRef(),z=R.useRef(new Set),$=R.useRef(new Set),F=R.useRef(!1),U=R.useRef(!1),V=R.useRef({x:0,y:0}),X=R.useRef(!1),Y=B=>{if(U.current||F.current||_.getState().connection.inProgress){U.current=!1,F.current=!1;return}d==null||d(B),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},Q=B=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){B.preventDefault();return}m==null||m(B)},te=f?B=>f(B):void 0,I=B=>{U.current&&(B.stopPropagation(),U.current=!1)},O=B=>{var Pe,dt;const{domNode:se,transform:oe}=_.getState();if(D.current=se==null?void 0:se.getBoundingClientRect(),!D.current)return;const _e=B.target===N.current;if(!_e&&!!B.target.closest(".nokey")||!e||!(o&&_e||t)||B.button!==0||!B.isPrimary)return;(dt=(Pe=B.target)==null?void 0:Pe.setPointerCapture)==null||dt.call(Pe,B.pointerId),U.current=!1;const{x:Le,y:Fe}=Cs(B.nativeEvent,D.current),Ve=Ah({x:Le,y:Fe},oe);_.setState({userSelectionRect:{width:0,height:0,startX:Ve.x,startY:Ve.y,x:Le,y:Fe}}),_e||(B.stopPropagation(),B.preventDefault())};function H(B,se){const{userSelectionRect:oe}=_.getState();if(!oe)return;const{transform:_e,nodeLookup:be,edgeLookup:Ce,connectionLookup:Le,triggerNodeChanges:Fe,triggerEdgeChanges:Ve,defaultEdgeOptions:Pe}=_.getState(),dt={x:oe.startX,y:oe.startY},{x:Qe,y:qe}=iu(dt,_e),ut={startX:dt.x,startY:dt.y,x:Brt.id)),$.current=new Set;const Ge=(Pe==null?void 0:Pe.selectable)??!0;for(const rt of z.current){const ve=Le.get(rt);if(ve)for(const{edgeId:je}of ve.values()){const Ue=Ce.get(je);Ue&&(Ue.selectable??Ge)&&$.current.add(je)}}if(!J7(Zt,z.current)){const rt=Ic(be,z.current,!0);Fe(rt)}if(!J7(Dt,$.current)){const rt=Ic(Ce,$.current);Ve(rt)}_.setState({userSelectionRect:ut,userSelectionActive:!0,nodesSelectionActive:!1})}function G(){if(!i||!D.current)return;const[B,se]=ax(V.current,D.current,E);T({x:B,y:se}).then(oe=>{if(!U.current||!oe){x.current=requestAnimationFrame(G);return}const{x:_e,y:be}=V.current;H(_e,be),x.current=requestAnimationFrame(G)})}const W=()=>{cancelAnimationFrame(x.current),x.current=0,X.current=!1};R.useEffect(()=>()=>W(),[]);const re=B=>{const{userSelectionRect:se,transform:oe,resetSelectedElements:_e}=_.getState();if(!D.current||!se)return;const{x:be,y:Ce}=Cs(B.nativeEvent,D.current);V.current={x:be,y:Ce};const Le=iu({x:se.startX,y:se.startY},oe);if(!U.current){const Fe=t?0:a;if(Math.hypot(be-Le.x,Ce-Le.y)<=Fe)return;_e(),l==null||l(B)}U.current=!0,X.current||(G(),X.current=!0),H(be,Ce)},ce=B=>{var se,oe;if(!j){B.target===N.current&&_.getState().connection.inProgress&&(F.current=!0);return}B.button===0&&((oe=(se=B.target)==null?void 0:se.releasePointerCapture)==null||oe.call(se,B.pointerId),!w&&B.target===N.current&&_.getState().userSelectionRect&&(Y==null||Y(B)),_.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(u==null||u(B),_.setState({nodesSelectionActive:z.current.size>0})),W())},pe=B=>{var se,oe;(oe=(se=B.target)==null?void 0:se.releasePointerCapture)==null||oe.call(se,B.pointerId),W()},ne=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:sr(["react-flow__pane",{draggable:ne,dragging:C,selection:e}]),onClick:j?void 0:yb(Y,N),onContextMenu:yb(Q,N),onWheel:yb(te,N),onPointerEnter:j?void 0:g,onPointerMove:j?re:b,onPointerUp:ce,onPointerCancel:j?pe:void 0,onPointerDownCapture:j?O:void 0,onClickCapture:j?I:void 0,onPointerLeave:k,ref:N,style:im,children:[S,h.jsx(Une,{})]})}function Qv({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:l,onError:u}=t.getState(),d=l.get(e);if(!d){u==null||u("012",js.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&o)&&(a({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var m;return(m=r==null?void 0:r.current)==null?void 0:m.blur()})):i([e])}function WA({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){const l=Mn(),[u,d]=R.useState(!1),m=R.useRef();return R.useEffect(()=>{m.current=Nte({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{Qv({id:f,store:l,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),R.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{var f;(f=m.current)==null||f.destroy()}},[n,r,t,a,e,i,o]),u}const Vne=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function YA(){const e=Mn();return R.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:a,nodesDraggable:o,onError:l,updateNodePositions:u,nodeLookup:d,nodeOrigin:m}=e.getState(),f=new Map,g=Vne(o),b=i?a[0]:5,k=i?a[1]:5,S=n.direction.x*b*n.factor,x=n.direction.y*k*n.factor;for(const[,_]of d){if(!g(_))continue;let w={x:_.internals.positionAbsolute.x+S,y:_.internals.positionAbsolute.y+x};i&&(w=Eh(w,a));const{position:y,positionAbsolute:C}=pA({nodeId:_.id,nextPosition:w,nodeLookup:d,nodeExtent:r,nodeOrigin:m,onError:l});_.position=y,_.internals.positionAbsolute=C,f.set(_.id,_)}u(f)},[])}const mx=R.createContext(null),Wne=mx.Provider;mx.Consumer;const XA=()=>R.useContext(mx),Yne=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),KA=R.createContext(null);function Xne({children:e}){const t=Ht(Yne,Nn);return h.jsx(KA.Provider,{value:t,children:e})}function Kne(){const e=R.useContext(KA);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const Zne={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},Qne=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:l,toHandle:u,isValid:d}=o;if(!l&&!i)return Zne;const m=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:m,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:a===nu.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:m&&d}};function Jne({type:e="source",position:t=at.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:l,children:u,className:d,onMouseDown:m,onTouchStart:f,...g},b){var X,Y;const k=o||null,S=e==="target",x=Mn(),_=XA(),{connectOnClick:w,noPanClassName:y,rfId:C}=Kne(),{connectingFrom:T,connectingTo:E,clickConnecting:j,isPossibleEndHandle:N,connectionInProcess:D,clickConnectionInProcess:z,valid:$}=Ht(Qne(_,k,e),Nn);_||(Y=(X=x.getState()).onError)==null||Y.call(X,"010",js.error010());const F=Q=>{const{defaultEdgeOptions:te,onConnect:I,hasDefaultEdges:O}=x.getState(),H={...te,...Q};if(O){const{edges:G,setEdges:W,onError:re}=x.getState();W(jne(H,G,{onError:re}))}I==null||I(H),l==null||l(H)},U=Q=>{if(!_)return;const te=SA(Q.nativeEvent);if(i&&(te&&Q.button===0||!te)){const I=x.getState();Zv.onPointerDown(Q.nativeEvent,{handleDomNode:Q.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:S,handleId:k,nodeId:_,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...O)=>{var H,G;return(G=(H=x.getState()).onConnectEnd)==null?void 0:G.call(H,...O)},updateConnection:I.updateConnection,onConnect:F,isValidConnection:n||((...O)=>{var H,G;return((G=(H=x.getState()).isValidConnection)==null?void 0:G.call(H,...O))??!0}),getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}te?m==null||m(Q):f==null||f(Q)},V=Q=>{const{onClickConnectStart:te,onClickConnectEnd:I,connectionClickStartHandle:O,connectionMode:H,isValidConnection:G,lib:W,rfId:re,nodeLookup:ce,connection:pe}=x.getState();if(!_||!O&&!i)return;if(!O){te==null||te(Q.nativeEvent,{nodeId:_,handleId:k,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:_,type:e,id:k}});return}const ne=yA(Q.target),B=n||G,{connection:se,isValid:oe}=Zv.isValid(Q.nativeEvent,{handle:{nodeId:_,id:k,type:e},connectionMode:H,fromNodeId:O.nodeId,fromHandleId:O.id||null,fromType:O.type,isValidConnection:B,flowId:re,doc:ne,lib:W,nodeLookup:ce});oe&&se&&F(se);const _e=structuredClone(pe);delete _e.inProgress,_e.toPosition=_e.toHandle?_e.toHandle.position:null,I==null||I(Q,_e),x.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":k,"data-nodeid":_,"data-handlepos":t,"data-id":`${C}-${_}-${k}-${e}`,className:sr(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,d,{source:!S,target:S,connectable:r,connectablestart:i,connectableend:a,clickconnecting:j,connectingfrom:T,connectingto:E,valid:$,connectionindicator:r&&(!D||N)&&(D||z?a:i)}]),onMouseDown:U,onTouchStart:U,onClick:w?V:void 0,ref:b,...g,children:u})}const Po=R.memo(GA(Jne));function ere({data:e,isConnectable:t,sourcePosition:n=at.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(Po,{type:"source",position:n,isConnectable:t})]})}function tre({data:e,isConnectable:t,targetPosition:n=at.Top,sourcePosition:r=at.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(Po,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(Po,{type:"source",position:r,isConnectable:t})]})}function nre(){return null}function rre({data:e,isConnectable:t,targetPosition:n=at.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(Po,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ip={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},j8={input:ere,default:tre,output:rre,group:nre};function ire(e){var t,n,r,i;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??((i=e.style)==null?void 0:i.height)}}const sre=e=>{const{width:t,height:n,x:r,y:i}=Ch(e.nodeLookup,{filter:a=>!!a.selected});return{width:ks(t)?t:null,height:ks(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function are({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Mn(),{width:i,height:a,transformString:o,userSelectionActive:l}=Ht(sre,Nn),u=YA(),d=R.useRef(null);R.useEffect(()=>{var b;n||(b=d.current)==null||b.focus({preventScroll:!0})},[n]);const m=!l&&i!==null&&a!==null;if(WA({nodeRef:d,disabled:!m}),!m)return null;const f=e?b=>{const k=r.getState().nodes.filter(S=>S.selected);e(b,k)}:void 0,g=b=>{Object.prototype.hasOwnProperty.call(ip,b.key)&&(b.preventDefault(),u({direction:ip[b.key],factor:b.shiftKey?4:1}))};return h.jsx("div",{className:sr(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:h.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:i,height:a}})})}const M8=typeof window<"u"?window:void 0,ore=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function ZA({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:d,selectionOnDrag:m,selectionMode:f,onSelectionStart:g,onSelectionEnd:b,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:x,elementsSelectable:_,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:T,panOnScrollMode:E,zoomOnDoubleClick:j,panOnDrag:N,autoPanOnSelection:D,defaultViewport:z,translateExtent:$,minZoom:F,maxZoom:U,preventScrolling:V,onSelectionContextMenu:X,noWheelClassName:Y,noPanClassName:Q,disableKeyboardA11y:te,onViewportChange:I,isControlledViewport:O}){const{nodesSelectionActive:H,userSelectionActive:G}=Ht(ore,Nn),W=Qd(d,{target:M8}),re=Qd(S,{target:M8}),ce=re||N,pe=re||C,ne=m&&ce!==!0,B=W||G||ne;return Bne({deleteKeyCode:u,multiSelectionKeyCode:k}),h.jsx(Fne,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:pe,panOnScrollSpeed:T,panOnScrollMode:E,zoomOnDoubleClick:j,panOnDrag:!W&&ce,defaultViewport:z,translateExtent:$,minZoom:F,maxZoom:U,zoomActivationKeyCode:x,preventScrolling:V,noWheelClassName:Y,noPanClassName:Q,onViewportChange:I,isControlledViewport:O,paneClickDistance:l,selectionOnDrag:ne,children:h.jsxs(Gne,{onSelectionStart:g,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:ce,autoPanOnSelection:D,isSelecting:!!B,selectionMode:f,selectionKeyPressed:W,paneClickDistance:l,selectionOnDrag:ne,children:[e,H&&h.jsx(are,{onSelectionContextMenu:X,noPanClassName:Q,disableKeyboardA11y:te})]})})}ZA.displayName="FlowRenderer";const lre=R.memo(ZA),cre=e=>t=>e?sx(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 ure(e){return Ht(R.useCallback(cre(e),[e]),Nn)}const dre=e=>e.updateNodeInternals;function hre(){const e=Ht(dre),[t]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const a=i.target.getAttribute("data-id");r.set(a,{id:a,nodeElement:i.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function fre({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=Mn(),a=R.useRef(null),o=R.useRef(null),l=R.useRef(e.sourcePosition),u=R.useRef(e.targetPosition),d=R.useRef(t),m=n&&!!e.internals.handleBounds;return R.useEffect(()=>{a.current&&!e.hidden&&(!m||o.current!==a.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(a.current),o.current=a.current)},[m,e.hidden]),R.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),R.useEffect(()=>{if(a.current){const f=d.current!==t,g=l.current!==e.sourcePosition,b=u.current!==e.targetPosition;(f||g||b)&&(d.current=t,l.current=e.sourcePosition,u.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function pre({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:l,elementsSelectable:u,nodesConnectable:d,nodesFocusable:m,resizeObserver:f,noDragClassName:g,noPanClassName:b,disableKeyboardA11y:k,rfId:S,nodeTypes:x,nodeClickDistance:_,onError:w}){const{node:y,internals:C,isParent:T}=Ht(B=>{const se=B.nodeLookup.get(e),oe=B.parentLookup.has(e);return{node:se,internals:se.internals,isParent:oe}},Nn);let E=y.type||"default",j=(x==null?void 0:x[E])||j8[E];j===void 0&&(w==null||w("003",js.error003(E)),E="default",j=(x==null?void 0:x.default)||j8.default);const N=!!(y.draggable||l&&typeof y.draggable>"u"),D=!!(y.selectable||u&&typeof y.selectable>"u"),z=!!(y.connectable||d&&typeof y.connectable>"u"),$=!!(y.focusable||m&&typeof y.focusable>"u"),F=Mn(),U=_A(y),V=fre({node:y,nodeType:E,hasDimensions:U,resizeObserver:f}),X=WA({nodeRef:V,disabled:y.hidden||!N,noDragClassName:g,handleSelector:y.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:_}),Y=YA();if(y.hidden)return null;const Q=Wa(y),te=ire(y),I=D||N||t||n||r||i,O=n?B=>n(B,{...C.userNode}):void 0,H=r?B=>r(B,{...C.userNode}):void 0,G=i?B=>i(B,{...C.userNode}):void 0,W=a?B=>a(B,{...C.userNode}):void 0,re=o?B=>o(B,{...C.userNode}):void 0,ce=B=>{const{selectNodesOnDrag:se,nodeDragThreshold:oe}=F.getState();D&&(!se||!N||oe>0)&&Qv({id:e,store:F,nodeRef:V}),t&&t(B,{...C.userNode})},pe=B=>{if(!(wA(B.nativeEvent)||k)){if(cA.includes(B.key)&&D){const se=B.key==="Escape";Qv({id:e,store:F,unselect:se,nodeRef:V})}else if(N&&y.selected&&Object.prototype.hasOwnProperty.call(ip,B.key)){B.preventDefault();const{ariaLabelConfig:se}=F.getState();F.setState({ariaLiveMessage:se["node.a11yDescription.ariaLiveMessage"]({direction:B.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),Y({direction:ip[B.key],factor:B.shiftKey?4:1})}}},ne=()=>{var Le;if(k||!((Le=V.current)!=null&&Le.matches(":focus-visible")))return;const{transform:B,width:se,height:oe,autoPanOnNodeFocus:_e,setCenter:be}=F.getState();if(!_e)return;sx(new Map([[e,y]]),{x:0,y:0,width:se,height:oe},B,!0).length>0||be(y.position.x+Q.width/2,y.position.y+Q.height/2,{zoom:B[2]})};return h.jsx("div",{className:sr(["react-flow__node",`react-flow__node-${E}`,{[b]:N},y.className,{selected:y.selected,selectable:D,parent:T,draggable:N,dragging:X}]),ref:V,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:U?"visible":"hidden",...y.style,...te},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:O,onMouseMove:H,onMouseLeave:G,onContextMenu:W,onClick:ce,onDoubleClick:re,onKeyDown:$?pe:void 0,tabIndex:$?0:void 0,onFocus:$?ne:void 0,role:y.ariaRole??($?"group":void 0),"aria-roledescription":"node","aria-describedby":k?void 0:`${FA}-${S}`,"aria-label":y.ariaLabel,...y.domAttributes,children:h.jsx(Wne,{value:e,children:h.jsx(j,{id:e,data:y.data,type:E,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:D,draggable:N,deletable:y.deletable??!0,isConnectable:z,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:X,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...Q})})})}var mre=R.memo(pre);const gre=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function QA(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=Ht(gre,Nn),o=ure(e.onlyRenderVisibleElements),l=hre();return h.jsx("div",{className:"react-flow__nodes",style:im,children:o.map(u=>h.jsx(mre,{id:u,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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},u))})}QA.displayName="NodeRenderer";const bre=R.memo(QA);function vre(e){return Ht(R.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const a=n.nodeLookup.get(i.source),o=n.nodeLookup.get(i.target);a&&o&&ute({sourceNode:a,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),Nn)}const _re=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return h.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},xre=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return h.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},R8={[tp.Arrow]:_re,[tp.ArrowClosed]:xre};function yre(e){const t=Mn();return R.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(R8,e)?R8[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",js.error009(e)),null)},[e])}const wre=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const u=yre(t);return u?h.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0",children:h.jsx(u,{color:n,strokeWidth:o})}):null},JA=({defaultColor:e,rfId:t})=>{const n=Ht(a=>a.edges),r=Ht(a=>a.defaultEdgeOptions),i=R.useMemo(()=>vte(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:i.map(a=>h.jsx(wre,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};JA.displayName="MarkerDefinitions";var Sre=R.memo(JA);function eT({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:u,className:d,...m}){const[f,g]=R.useState({x:1,y:0,width:0,height:0}),b=sr(["react-flow__edge-textwrapper",d]),k=R.useRef(null);return R.useEffect(()=>{if(k.current){const S=k.current.getBBox();g({x:S.x,y:S.y,width:S.width,height:S.height})}},[n]),n?h.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:b,visibility:f.width?"visible":"hidden",...m,children:[i&&h.jsx("rect",{width:f.width+2*o[0],x:-o[0],y:-o[1],height:f.height+2*o[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),h.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:k,style:r,children:n}),u]}):null}eT.displayName="EdgeText";const kre=R.memo(eT);function sm({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:u,interactionWidth:d=20,...m}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{...m,d:e,fill:"none",className:sr(["react-flow__edge-path",m.className])}),d?h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&ks(t)&&ks(n)?h.jsx(kre,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:u}):null]})}function D8({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===at.Left||e===at.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function tT({sourceX:e,sourceY:t,sourcePosition:n=at.Bottom,targetX:r,targetY:i,targetPosition:a=at.Top}){const[o,l]=D8({pos:n,x1:e,y1:t,x2:r,y2:i}),[u,d]=D8({pos:a,x1:r,y1:i,x2:e,y2:t}),[m,f,g,b]=kA({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${o},${l} ${u},${d} ${r},${i}`,m,f,g,b]}function nT(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:b,style:k,markerEnd:S,markerStart:x,interactionWidth:_})=>{const[w,y,C]=tT({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l}),T=e.isInternal?void 0:t;return h.jsx(sm,{id:T,path:w,labelX:y,labelY:C,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:b,style:k,markerEnd:S,markerStart:x,interactionWidth:_})})}const Cre=nT({isInternal:!1}),rT=nT({isInternal:!0});Cre.displayName="SimpleBezierEdge";rT.displayName="SimpleBezierEdgeInternal";function iT(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:g,sourcePosition:b=at.Bottom,targetPosition:k=at.Top,markerEnd:S,markerStart:x,pathOptions:_,interactionWidth:w})=>{const[y,C,T]=Yv({sourceX:n,sourceY:r,sourcePosition:b,targetX:i,targetY:a,targetPosition:k,borderRadius:_==null?void 0:_.borderRadius,offset:_==null?void 0:_.offset,stepPosition:_==null?void 0:_.stepPosition}),E=e.isInternal?void 0:t;return h.jsx(sm,{id:E,path:y,labelX:C,labelY:T,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:g,markerEnd:S,markerStart:x,interactionWidth:w})})}const sT=iT({isInternal:!1}),aT=iT({isInternal:!0});sT.displayName="SmoothStepEdge";aT.displayName="SmoothStepEdgeInternal";function oT(e){return R.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return h.jsx(sT,{...n,id:r,pathOptions:R.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const Ere=oT({isInternal:!1}),lT=oT({isInternal:!0});Ere.displayName="StepEdge";lT.displayName="StepEdgeInternal";function cT(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:g,markerEnd:b,markerStart:k,interactionWidth:S})=>{const[x,_,w]=AA({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return h.jsx(sm,{id:y,path:x,labelX:_,labelY:w,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:g,markerEnd:b,markerStart:k,interactionWidth:S})})}const Are=cT({isInternal:!1}),uT=cT({isInternal:!0});Are.displayName="StraightEdge";uT.displayName="StraightEdgeInternal";function dT(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=at.Bottom,targetPosition:l=at.Top,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:b,style:k,markerEnd:S,markerStart:x,pathOptions:_,interactionWidth:w})=>{const[y,C,T]=CA({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l,curvature:_==null?void 0:_.curvature}),E=e.isInternal?void 0:t;return h.jsx(sm,{id:E,path:y,labelX:C,labelY:T,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:b,style:k,markerEnd:S,markerStart:x,interactionWidth:w})})}const Tre=dT({isInternal:!1}),hT=dT({isInternal:!0});Tre.displayName="BezierEdge";hT.displayName="BezierEdgeInternal";const L8={default:hT,straight:uT,step:lT,smoothstep:aT,simplebezier:rT},O8={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},Nre=(e,t,n)=>n===at.Left?e-t:n===at.Right?e+t:e,jre=(e,t,n)=>n===at.Top?e-t:n===at.Bottom?e+t:e,I8="react-flow__edgeupdater";function z8({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:l}){return h.jsx("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:sr([I8,`${I8}-${l}`]),cx:Nre(t,r,e),cy:jre(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Mre({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:l,targetPosition:u,onReconnect:d,onReconnectStart:m,onReconnectEnd:f,setReconnecting:g,setUpdateHover:b}){const k=Mn(),S=(C,T)=>{if(C.button!==0)return;const{autoPanOnConnect:E,domNode:j,connectionMode:N,connectionRadius:D,lib:z,onConnectStart:$,cancelConnection:F,nodeLookup:U,rfId:V,panBy:X,updateConnection:Y}=k.getState(),Q=T.type==="target",te=(H,G)=>{g(!1),f==null||f(H,n,T.type,G)},I=H=>d==null?void 0:d(n,H),O=(H,G)=>{g(!0),m==null||m(C,n,T.type),$==null||$(H,G)};Zv.onPointerDown(C.nativeEvent,{autoPanOnConnect:E,connectionMode:N,connectionRadius:D,domNode:j,handleId:T.id,nodeId:T.nodeId,nodeLookup:U,isTarget:Q,edgeUpdaterType:T.type,lib:z,flowId:V,cancelConnection:F,panBy:X,isValidConnection:(...H)=>{var G,W;return((W=(G=k.getState()).isValidConnection)==null?void 0:W.call(G,...H))??!0},onConnect:I,onConnectStart:O,onConnectEnd:(...H)=>{var G,W;return(W=(G=k.getState()).onConnectEnd)==null?void 0:W.call(G,...H)},onReconnectEnd:te,updateConnection:Y,getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,dragThreshold:k.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},x=C=>S(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),_=C=>S(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>b(!0),y=()=>b(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(z8,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:x,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&h.jsx(z8,{position:u,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function Rre({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:l,onMouseMove:u,onMouseLeave:d,reconnectRadius:m,onReconnect:f,onReconnectStart:g,onReconnectEnd:b,rfId:k,edgeTypes:S,noPanClassName:x,onError:_,disableKeyboardA11y:w}){let y=Ht(be=>be.edgeLookup.get(e));const C=Ht(be=>be.defaultEdgeOptions);y=C?{...C,...y}:y;let T=y.type||"default",E=(S==null?void 0:S[T])||L8[T];E===void 0&&(_==null||_("011",js.error011(T)),T="default",E=(S==null?void 0:S.default)||L8.default);const j=!!(y.focusable||t&&typeof y.focusable>"u"),N=typeof f<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),D=!!(y.selectable||r&&typeof y.selectable>"u"),z=R.useRef(null),[$,F]=R.useState(!1),[U,V]=R.useState(!1),X=Mn(),{zIndex:Y=y.zIndex,sourceX:Q,sourceY:te,targetX:I,targetY:O,sourcePosition:H,targetPosition:G}=Ht(R.useCallback(be=>{const Ce=be.nodeLookup.get(y.source),Le=be.nodeLookup.get(y.target);if(!Ce||!Le)return O8;const Fe=bte({id:e,sourceNode:Ce,targetNode:Le,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:be.connectionMode,onError:_}),Ve=cte({selected:y.selected,zIndex:y.zIndex,sourceNode:Ce,targetNode:Le,elevateOnSelect:be.elevateEdgesOnSelect,zIndexMode:be.zIndexMode});return{...Fe||O8,zIndex:Ve}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),Nn),W=R.useMemo(()=>y.markerStart?`url('#${Xv(y.markerStart,k)}')`:void 0,[y.markerStart,k]),re=R.useMemo(()=>y.markerEnd?`url('#${Xv(y.markerEnd,k)}')`:void 0,[y.markerEnd,k]);if(y.hidden||Q===null||te===null||I===null||O===null)return null;const ce=be=>{var Ve;const{addSelectedEdges:Ce,unselectNodesAndEdges:Le,multiSelectionActive:Fe}=X.getState();D&&(X.setState({nodesSelectionActive:!1}),y.selected&&Fe?(Le({nodes:[],edges:[y]}),(Ve=z.current)==null||Ve.blur()):Ce([e])),i&&i(be,y)},pe=a?be=>{a(be,{...y})}:void 0,ne=o?be=>{o(be,{...y})}:void 0,B=l?be=>{l(be,{...y})}:void 0,se=u?be=>{u(be,{...y})}:void 0,oe=d?be=>{d(be,{...y})}:void 0,_e=be=>{var Ce;if(!w&&cA.includes(be.key)&&D){const{unselectNodesAndEdges:Le,addSelectedEdges:Fe}=X.getState();be.key==="Escape"?((Ce=z.current)==null||Ce.blur(),Le({edges:[y]})):Fe([e])}};return h.jsx("svg",{style:{zIndex:Y},children:h.jsxs("g",{className:sr(["react-flow__edge",`react-flow__edge-${T}`,y.className,x,{selected:y.selected,animated:y.animated,inactive:!D&&!i,updating:$,selectable:D}]),onClick:ce,onDoubleClick:pe,onContextMenu:ne,onMouseEnter:B,onMouseMove:se,onMouseLeave:oe,onKeyDown:j?_e:void 0,tabIndex:j?0:void 0,role:y.ariaRole??(j?"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":j?`${PA}-${k}`:void 0,ref:z,...y.domAttributes,children:[!U&&h.jsx(E,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:D,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:Q,sourceY:te,targetX:I,targetY:O,sourcePosition:H,targetPosition:G,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:W,markerEnd:re,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),N&&h.jsx(Mre,{edge:y,isReconnectable:N,reconnectRadius:m,onReconnect:f,onReconnectStart:g,onReconnectEnd:b,sourceX:Q,sourceY:te,targetX:I,targetY:O,sourcePosition:H,targetPosition:G,setUpdateHover:F,setReconnecting:V})]})})}var Dre=R.memo(Rre);const Lre=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function fT({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:m,reconnectRadius:f,onEdgeDoubleClick:g,onReconnectStart:b,onReconnectEnd:k,disableKeyboardA11y:S}){const{edgesFocusable:x,edgesReconnectable:_,elementsSelectable:w,onError:y}=Ht(Lre,Nn),C=vre(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(Sre,{defaultColor:e,rfId:n}),C.map(T=>h.jsx(Dre,{id:T,edgesFocusable:x,edgesReconnectable:_,elementsSelectable:w,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:l,onMouseMove:u,onMouseLeave:d,onClick:m,reconnectRadius:f,onDoubleClick:g,onReconnectStart:b,onReconnectEnd:k,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:S},T))]})}fT.displayName="EdgeRenderer";const Ore=R.memo(fT),Ire=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function zre({children:e}){const t=Ht(Ire);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Bre(e){const t=px(),n=R.useRef(!1);R.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Hre=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function $re(e){const t=Ht(Hre),n=Mn();return R.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Fre(e){return e.connection.inProgress?{...e.connection,to:Ah(e.connection.to,e.transform)}:{...e.connection}}function Pre(e){return Fre}function Ure(e){const t=Pre();return Ht(t,Nn)}const qre=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Gre({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:a,height:o,isValid:l,inProgress:u}=Ht(qre,Nn);return!(a&&i&&u)?null:h.jsx("svg",{style:e,width:a,height:o,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:sr(["react-flow__connection",hA(l)]),children:h.jsx(pT,{style:t,type:n,CustomComponent:r,isValid:l})})})}const pT=({style:e,type:t=Ro.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:a,fromNode:o,fromHandle:l,fromPosition:u,to:d,toNode:m,toHandle:f,toPosition:g,pointer:b}=Ure();if(!i)return;if(n)return h.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:a.x,fromY:a.y,toX:d.x,toY:d.y,fromPosition:u,toPosition:g,connectionStatus:hA(r),toNode:m,toHandle:f,pointer:b});let k="";const S={sourceX:a.x,sourceY:a.y,sourcePosition:u,targetX:d.x,targetY:d.y,targetPosition:g};switch(t){case Ro.Bezier:[k]=CA(S);break;case Ro.SimpleBezier:[k]=tT(S);break;case Ro.Step:[k]=Yv({...S,borderRadius:0});break;case Ro.SmoothStep:[k]=Yv(S);break;default:[k]=AA(S)}return h.jsx("path",{d:k,fill:"none",className:"react-flow__connection-path",style:e})};pT.displayName="ConnectionLine";const Vre={};function B8(e=Vre){R.useRef(e),Mn(),R.useEffect(()=>{},[e])}function Wre(){Mn(),R.useRef(!1),R.useEffect(()=>{},[])}function mT({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:m,onSelectionContextMenu:f,onSelectionStart:g,onSelectionEnd:b,connectionLineType:k,connectionLineStyle:S,connectionLineComponent:x,connectionLineContainerStyle:_,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:T,panActivationKeyCode:E,zoomActivationKeyCode:j,deleteKeyCode:N,onlyRenderVisibleElements:D,elementsSelectable:z,defaultViewport:$,translateExtent:F,minZoom:U,maxZoom:V,preventScrolling:X,defaultMarkerColor:Y,zoomOnScroll:Q,zoomOnPinch:te,panOnScroll:I,panOnScrollSpeed:O,panOnScrollMode:H,zoomOnDoubleClick:G,panOnDrag:W,autoPanOnSelection:re,onPaneClick:ce,onPaneMouseEnter:pe,onPaneMouseMove:ne,onPaneMouseLeave:B,onPaneScroll:se,onPaneContextMenu:oe,paneClickDistance:_e,nodeClickDistance:be,onEdgeContextMenu:Ce,onEdgeMouseEnter:Le,onEdgeMouseMove:Fe,onEdgeMouseLeave:Ve,reconnectRadius:Pe,onReconnect:dt,onReconnectStart:Qe,onReconnectEnd:qe,noDragClassName:ut,noWheelClassName:Zt,noPanClassName:Dt,disableKeyboardA11y:Ge,nodeExtent:rt,rfId:ve,viewport:je,onViewportChange:Ue}){return B8(e),B8(t),Wre(),Bre(n),$re(je),h.jsx(lre,{onPaneClick:ce,onPaneMouseEnter:pe,onPaneMouseMove:ne,onPaneMouseLeave:B,onPaneContextMenu:oe,onPaneScroll:se,paneClickDistance:_e,deleteKeyCode:N,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,onSelectionStart:g,onSelectionEnd:b,multiSelectionKeyCode:T,panActivationKeyCode:E,zoomActivationKeyCode:j,elementsSelectable:z,zoomOnScroll:Q,zoomOnPinch:te,zoomOnDoubleClick:G,panOnScroll:I,panOnScrollSpeed:O,panOnScrollMode:H,panOnDrag:W,autoPanOnSelection:re,defaultViewport:$,translateExtent:F,minZoom:U,maxZoom:V,onSelectionContextMenu:f,preventScrolling:X,noDragClassName:ut,noWheelClassName:Zt,noPanClassName:Dt,disableKeyboardA11y:Ge,onViewportChange:Ue,isControlledViewport:!!je,children:h.jsxs(zre,{children:[h.jsx(Ore,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:dt,onReconnectStart:Qe,onReconnectEnd:qe,onlyRenderVisibleElements:D,onEdgeContextMenu:Ce,onEdgeMouseEnter:Le,onEdgeMouseMove:Fe,onEdgeMouseLeave:Ve,reconnectRadius:Pe,defaultMarkerColor:Y,noPanClassName:Dt,disableKeyboardA11y:Ge,rfId:ve}),h.jsx(Gre,{style:S,type:k,component:x,containerStyle:_}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(bre,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:m,nodeClickDistance:be,onlyRenderVisibleElements:D,noPanClassName:Dt,noDragClassName:ut,disableKeyboardA11y:Ge,nodeExtent:rt,rfId:ve}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}mT.displayName="GraphView";const Yre=R.memo(mT),Xre=vA(),H8=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u=.5,maxZoom:d=2,nodeOrigin:m,nodeExtent:f,zIndexMode:g="basic"}={})=>{const b=new Map,k=new Map,S=new Map,x=new Map,_=r??t??[],w=n??e??[],y=m??[0,0],C=f??Yd;jA(S,x,_);const{nodesInitialized:T}=Kv(w,b,k,{nodeOrigin:y,nodeExtent:C,zIndexMode:g});let E=[0,0,1];if(o&&i&&a){const j=Ch(b,{filter:$=>!!(($.width||$.initialWidth)&&($.height||$.initialHeight))}),{x:N,y:D,zoom:z}=ox(j,i,a,u,d,(l==null?void 0:l.padding)??.1);E=[N,D,z]}return{rfId:"1",width:i??0,height:a??0,transform:E,nodes:w,nodesInitialized:T,nodeLookup:b,parentLookup:k,edges:_,edgeLookup:x,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:d,translateExtent:Yd,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:nu.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:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...dA},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Xre,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:uA,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Kre=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:m,nodeExtent:f,zIndexMode:g})=>ane((b,k)=>{async function S(){const{nodeLookup:x,panZoom:_,fitViewOptions:w,fitViewResolver:y,width:C,height:T,minZoom:E,maxZoom:j}=k();_&&(await nte({nodes:x,width:C,height:T,panZoom:_,minZoom:E,maxZoom:j},w),y==null||y.resolve(!0),b({fitViewResolver:null}))}return{...H8({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:m,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:x=>{const{nodeLookup:_,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:T,zIndexMode:E,nodesSelectionActive:j}=k(),{nodesInitialized:N,hasSelectedNodes:D}=Kv(x,_,w,{nodeOrigin:y,nodeExtent:f,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:E}),z=j&&D;T&&N?(S(),b({nodes:x,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:z})):b({nodes:x,nodesInitialized:N,nodesSelectionActive:z})},setEdges:x=>{const{connectionLookup:_,edgeLookup:w}=k();jA(_,w,x),b({edges:x})},setDefaultNodesAndEdges:(x,_)=>{if(x){const{setNodes:w}=k();w(x),b({hasDefaultNodes:!0})}if(_){const{setEdges:w}=k();w(_),b({hasDefaultEdges:!0})}},updateNodeInternals:x=>{const{triggerNodeChanges:_,nodeLookup:w,parentLookup:y,domNode:C,nodeOrigin:T,nodeExtent:E,debug:j,fitViewQueued:N,zIndexMode:D}=k(),{changes:z,updatedInternals:$}=Cte(x,w,y,C,T,E,D);$&&(yte(w,y,{nodeOrigin:T,nodeExtent:E,zIndexMode:D}),N?(S(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),(z==null?void 0:z.length)>0&&(j&&console.log("React Flow: trigger node changes",z),_==null||_(z)))},updateNodePositions:(x,_=!1)=>{const w=[];let y=[];const{nodeLookup:C,triggerNodeChanges:T,connection:E,updateConnection:j,onNodesChangeMiddlewareMap:N}=k();for(const[D,z]of x){const $=C.get(D),F=!!($!=null&&$.expandParent&&($!=null&&$.parentId)&&(z!=null&&z.position)),U={id:D,type:"position",position:F?{x:Math.max(0,z.position.x),y:Math.max(0,z.position.y)}:z.position,dragging:_};if($&&E.inProgress&&E.fromNode.id===$.id){const V=Il($,E.fromHandle,at.Left,!0);j({...E,from:V})}F&&$.parentId&&w.push({id:D,parentId:$.parentId,rect:{...z.internals.positionAbsolute,width:z.measured.width??0,height:z.measured.height??0}}),y.push(U)}if(w.length>0){const{parentLookup:D,nodeOrigin:z}=k(),$=fx(w,C,D,z);y.push(...$)}for(const D of N.values())y=D(y);T(y)},triggerNodeChanges:x=>{const{onNodesChange:_,setNodes:w,nodes:y,hasDefaultNodes:C,debug:T}=k();if(x!=null&&x.length){if(C){const E=Ane(x,y);w(E)}T&&console.log("React Flow: trigger node changes",x),_==null||_(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:_,setEdges:w,edges:y,hasDefaultEdges:C,debug:T}=k();if(x!=null&&x.length){if(C){const E=Tne(x,y);w(E)}T&&console.log("React Flow: trigger edge changes",x),_==null||_(x)}},addSelectedNodes:x=>{const{multiSelectionActive:_,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:T}=k();if(_){const E=x.map(j=>vl(j,!0));C(E);return}C(Ic(y,new Set([...x]),!0)),T(Ic(w))},addSelectedEdges:x=>{const{multiSelectionActive:_,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:T}=k();if(_){const E=x.map(j=>vl(j,!0));T(E);return}T(Ic(w,new Set([...x]))),C(Ic(y,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:_}={})=>{const{edges:w,nodes:y,nodeLookup:C,triggerNodeChanges:T,triggerEdgeChanges:E}=k(),j=x||y,N=_||w,D=[];for(const $ of j){if(!$.selected)continue;const F=C.get($.id);F&&(F.selected=!1),D.push(vl($.id,!1))}const z=[];for(const $ of N)$.selected&&z.push(vl($.id,!1));T(D),E(z)},setMinZoom:x=>{const{panZoom:_,maxZoom:w}=k();_==null||_.setScaleExtent([x,w]),b({minZoom:x})},setMaxZoom:x=>{const{panZoom:_,minZoom:w}=k();_==null||_.setScaleExtent([w,x]),b({maxZoom:x})},setTranslateExtent:x=>{var _;(_=k().panZoom)==null||_.setTranslateExtent(x),b({translateExtent:x})},resetSelectedElements:()=>{const{edges:x,nodes:_,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:C}=k();if(!C)return;const T=_.reduce((j,N)=>N.selected?[...j,vl(N.id,!1)]:j,[]),E=x.reduce((j,N)=>N.selected?[...j,vl(N.id,!1)]:j,[]);w(T),y(E)},setNodeExtent:x=>{const{nodes:_,nodeLookup:w,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:T,nodeExtent:E,zIndexMode:j}=k();x[0][0]===E[0][0]&&x[0][1]===E[0][1]&&x[1][0]===E[1][0]&&x[1][1]===E[1][1]||(Kv(_,w,y,{nodeOrigin:C,nodeExtent:x,elevateNodesOnSelect:T,checkEquality:!1,zIndexMode:j}),b({nodeExtent:x}))},panBy:x=>{const{transform:_,width:w,height:y,panZoom:C,translateExtent:T}=k();return Ete({delta:x,panZoom:C,transform:_,translateExtent:T,width:w,height:y})},setCenter:async(x,_,w)=>{const{width:y,height:C,maxZoom:T,panZoom:E}=k();if(!E)return!1;const j=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:T;return await E.setViewport({x:y/2-x*j,y:C/2-_*j,zoom:j},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{b({connection:{...dA}})},updateConnection:x=>{b({connection:x})},reset:()=>b({...H8()})}},Object.is);function Zre({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:u,fitView:d,nodeOrigin:m,nodeExtent:f,zIndexMode:g,children:b}){const[k]=R.useState(()=>Kre({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:d,minZoom:o,maxZoom:l,fitViewOptions:u,nodeOrigin:m,nodeExtent:f,zIndexMode:g}));return h.jsx(one,{value:k,children:h.jsx(Lne,{children:h.jsx(Xne,{children:b})})})}function Qre({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:l,fitViewOptions:u,minZoom:d,maxZoom:m,nodeOrigin:f,nodeExtent:g,zIndexMode:b}){return R.useContext(nm)?h.jsx(h.Fragment,{children:e}):h.jsx(Zre,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:l,initialFitViewOptions:u,initialMinZoom:d,initialMaxZoom:m,nodeOrigin:f,nodeExtent:g,zIndexMode:b,children:e})}const Jre={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function eie({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:l,onEdgeClick:u,onInit:d,onMove:m,onMoveStart:f,onMoveEnd:g,onConnect:b,onConnectStart:k,onConnectEnd:S,onClickConnectStart:x,onClickConnectEnd:_,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:T,onNodeDoubleClick:E,onNodeDragStart:j,onNodeDrag:N,onNodeDragStop:D,onNodesDelete:z,onEdgesDelete:$,onDelete:F,onSelectionChange:U,onSelectionDragStart:V,onSelectionDrag:X,onSelectionDragStop:Y,onSelectionContextMenu:Q,onSelectionStart:te,onSelectionEnd:I,onBeforeDelete:O,connectionMode:H,connectionLineType:G=Ro.Bezier,connectionLineStyle:W,connectionLineComponent:re,connectionLineContainerStyle:ce,deleteKeyCode:pe="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:B=!1,selectionMode:se=Xd.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:_e=Zd()?"Meta":"Control",zoomActivationKeyCode:be=Zd()?"Meta":"Control",snapToGrid:Ce,snapGrid:Le,onlyRenderVisibleElements:Fe=!1,selectNodesOnDrag:Ve,nodesDraggable:Pe,autoPanOnNodeFocus:dt,nodesConnectable:Qe,nodesFocusable:qe,nodeOrigin:ut=UA,edgesFocusable:Zt,edgesReconnectable:Dt,elementsSelectable:Ge=!0,defaultViewport:rt=xne,minZoom:ve=.5,maxZoom:je=2,translateExtent:Ue=Yd,preventScrolling:Je=!0,nodeExtent:De,defaultMarkerColor:tt="#b1b1b7",zoomOnScroll:it=!0,zoomOnPinch:Tt=!0,panOnScroll:yt=!1,panOnScrollSpeed:Xt=.5,panOnScrollMode:ht=Nl.Free,zoomOnDoubleClick:sn=!0,panOnDrag:mn=!0,onPaneClick:Un,onPaneMouseEnter:Gi,onPaneMouseMove:Vi,onPaneMouseLeave:Rs,onPaneScroll:Nr,onPaneContextMenu:pi,paneClickDistance:mr=1,nodeClickDistance:Wo=0,children:Jr,onReconnect:Qt,onReconnectStart:cn,onReconnectEnd:mi,onEdgeContextMenu:la,onEdgeDoubleClick:Ds,onEdgeMouseEnter:us,onEdgeMouseMove:jr,onEdgeMouseLeave:xr,reconnectRadius:yr=10,onNodesChange:gi,onEdgesChange:Rn,noDragClassName:pt="nodrag",noWheelClassName:_t="nowheel",noPanClassName:yn="nopan",fitView:We,fitViewOptions:St,connectOnClick:ca,attributionPosition:zn,proOptions:bi,defaultEdgeOptions:zr,elevateNodesOnSelect:Br=!0,elevateEdgesOnSelect:Mr=!1,disableKeyboardA11y:$t=!1,autoPanOnConnect:qn,autoPanOnNodeDrag:Jt,autoPanOnSelection:ar=!0,autoPanSpeed:vi,connectionRadius:Hr,isValidConnection:ei,onError:ds,style:hs,id:ua,nodeDragThreshold:Ya,connectionDragThreshold:Gn,viewport:_i,onViewportChange:gr,width:Dn,height:or,colorMode:Ln="light",debug:Ls,onScroll:Wi,ariaLabelConfig:$r,zIndexMode:Xa="basic",...wn},Yi){const en=ua||"1",Os=kne(Ln),gn=R.useCallback(Vn=>{Vn.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Wi==null||Wi(Vn)},[Wi]);return h.jsx("div",{"data-testid":"rf__wrapper",...wn,onScroll:gn,style:{...hs,...Jre},ref:Yi,className:sr(["react-flow",i,Os]),id:ua,role:"application",children:h.jsxs(Qre,{nodes:e,edges:t,width:Dn,height:or,fitView:We,fitViewOptions:St,minZoom:ve,maxZoom:je,nodeOrigin:ut,nodeExtent:De,zIndexMode:Xa,children:[h.jsx(Sne,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:b,onConnectStart:k,onConnectEnd:S,onClickConnectStart:x,onClickConnectEnd:_,nodesDraggable:Pe,autoPanOnNodeFocus:dt,nodesConnectable:Qe,nodesFocusable:qe,edgesFocusable:Zt,edgesReconnectable:Dt,elementsSelectable:Ge,elevateNodesOnSelect:Br,elevateEdgesOnSelect:Mr,minZoom:ve,maxZoom:je,nodeExtent:De,onNodesChange:gi,onEdgesChange:Rn,snapToGrid:Ce,snapGrid:Le,connectionMode:H,translateExtent:Ue,connectOnClick:ca,defaultEdgeOptions:zr,fitView:We,fitViewOptions:St,onNodesDelete:z,onEdgesDelete:$,onDelete:F,onNodeDragStart:j,onNodeDrag:N,onNodeDragStop:D,onSelectionDrag:X,onSelectionDragStart:V,onSelectionDragStop:Y,onMove:m,onMoveStart:f,onMoveEnd:g,noPanClassName:yn,nodeOrigin:ut,rfId:en,autoPanOnConnect:qn,autoPanOnNodeDrag:Jt,autoPanSpeed:vi,onError:ds,connectionRadius:Hr,isValidConnection:ei,selectNodesOnDrag:Ve,nodeDragThreshold:Ya,connectionDragThreshold:Gn,onBeforeDelete:O,debug:Ls,ariaLabelConfig:$r,zIndexMode:Xa}),h.jsx(Yre,{onInit:d,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:T,onNodeDoubleClick:E,nodeTypes:a,edgeTypes:o,connectionLineType:G,connectionLineStyle:W,connectionLineComponent:re,connectionLineContainerStyle:ce,selectionKeyCode:ne,selectionOnDrag:B,selectionMode:se,deleteKeyCode:pe,multiSelectionKeyCode:_e,panActivationKeyCode:oe,zoomActivationKeyCode:be,onlyRenderVisibleElements:Fe,defaultViewport:rt,translateExtent:Ue,minZoom:ve,maxZoom:je,preventScrolling:Je,zoomOnScroll:it,zoomOnPinch:Tt,zoomOnDoubleClick:sn,panOnScroll:yt,panOnScrollSpeed:Xt,panOnScrollMode:ht,panOnDrag:mn,autoPanOnSelection:ar,onPaneClick:Un,onPaneMouseEnter:Gi,onPaneMouseMove:Vi,onPaneMouseLeave:Rs,onPaneScroll:Nr,onPaneContextMenu:pi,paneClickDistance:mr,nodeClickDistance:Wo,onSelectionContextMenu:Q,onSelectionStart:te,onSelectionEnd:I,onReconnect:Qt,onReconnectStart:cn,onReconnectEnd:mi,onEdgeContextMenu:la,onEdgeDoubleClick:Ds,onEdgeMouseEnter:us,onEdgeMouseMove:jr,onEdgeMouseLeave:xr,reconnectRadius:yr,defaultMarkerColor:tt,noDragClassName:pt,noWheelClassName:_t,noPanClassName:yn,rfId:en,disableKeyboardA11y:$t,nodeExtent:De,viewport:_i,onViewportChange:gr}),h.jsx(_ne,{onSelectionChange:U}),Jr,h.jsx(pne,{proOptions:bi,position:zn}),h.jsx(fne,{rfId:en,disableKeyboardA11y:$t})]})})}var tie=GA(eie);function nie({dimensions:e,lineWidth:t,variant:n,className:r}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:sr(["react-flow__background-pattern",n,r])})}function rie({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:sr(["react-flow__background-pattern","dots",t])})}var Oa;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Oa||(Oa={}));const iie={[Oa.Dots]:1,[Oa.Lines]:1,[Oa.Cross]:6},sie=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function gT({id:e,variant:t=Oa.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:l,style:u,className:d,patternClassName:m}){const f=R.useRef(null),{transform:g,patternId:b}=Ht(sie,Nn),k=r||iie[t],S=t===Oa.Dots,x=t===Oa.Cross,_=Array.isArray(n)?n:[n,n],w=[_[0]*g[2]||1,_[1]*g[2]||1],y=k*g[2],C=Array.isArray(a)?a:[a,a],T=x?[y,y]:w,E=[C[0]*g[2]||1+T[0]/2,C[1]*g[2]||1+T[1]/2],j=`${b}${e||""}`;return h.jsxs("svg",{className:sr(["react-flow__background",d]),style:{...u,...im,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:f,"data-testid":"rf__background",children:[h.jsx("pattern",{id:j,x:g[0]%w[0],y:g[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:S?h.jsx(rie,{radius:y/2,className:m}):h.jsx(nie,{dimensions:T,lineWidth:i,variant:t,className:m})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${j})`})]})}gT.displayName="Background";const aie=R.memo(gT);function oie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function lie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function cie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.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 uie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 die(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 af({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:sr(["react-flow__controls-button",t]),...n,children:e})}const hie=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function bT({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:l,onInteractiveChange:u,className:d,children:m,position:f="bottom-left",orientation:g="vertical","aria-label":b}){const k=Mn(),{isInteractive:S,minZoomReached:x,maxZoomReached:_,ariaLabelConfig:w}=Ht(hie,Nn),{zoomIn:y,zoomOut:C,fitView:T}=px(),E=()=>{y(),a==null||a()},j=()=>{C(),o==null||o()},N=()=>{T(i),l==null||l()},D=()=>{k.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),u==null||u(!S)},z=g==="horizontal"?"horizontal":"vertical";return h.jsxs(rm,{className:sr(["react-flow__controls",z,d]),position:f,style:e,"data-testid":"rf__controls","aria-label":b??w["controls.ariaLabel"],children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(af,{onClick:E,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:_,children:h.jsx(oie,{})}),h.jsx(af,{onClick:j,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:x,children:h.jsx(lie,{})})]}),n&&h.jsx(af,{className:"react-flow__controls-fitview",onClick:N,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:h.jsx(cie,{})}),r&&h.jsx(af,{className:"react-flow__controls-interactive",onClick:D,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:S?h.jsx(die,{}):h.jsx(uie,{})}),m]})}bT.displayName="Controls";R.memo(bT);function fie({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:l,strokeWidth:u,className:d,borderRadius:m,shapeRendering:f,selected:g,onClick:b}){const{background:k,backgroundColor:S}=a||{},x=o||k||S;return h.jsx("rect",{className:sr(["react-flow__minimap-node",{selected:g},d]),x:t,y:n,rx:m,ry:m,width:r,height:i,style:{fill:x,stroke:l,strokeWidth:u},shapeRendering:f,onClick:b?_=>b(_,e):void 0})}const pie=R.memo(fie),mie=e=>e.nodes.map(t=>t.id),wb=e=>e instanceof Function?e:()=>e;function gie({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=pie,onClick:o}){const l=Ht(mie,Nn),u=wb(t),d=wb(e),m=wb(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:l.map(g=>h.jsx(vie,{id:g,nodeColorFunc:u,nodeStrokeColorFunc:d,nodeClassNameFunc:m,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:f},g))})}function bie({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:l,onClick:u}){const{node:d,x:m,y:f,width:g,height:b}=Ht(k=>{const S=k.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const x=S.internals.userNode,{x:_,y:w}=S.internals.positionAbsolute,{width:y,height:C}=Wa(x);return{node:x,x:_,y:w,width:y,height:C}},Nn);return!d||d.hidden||!_A(d)?null:h.jsx(l,{x:m,y:f,width:g,height:b,style:d.style,selected:!!d.selected,className:r(d),color:t(d),borderRadius:i,strokeColor:n(d),strokeWidth:a,shapeRendering:o,onClick:u,id:d.id})}const vie=R.memo(bie);var _ie=R.memo(gie);const xie=200,yie=150,wie=e=>!e.hidden,Sie=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?gA(Ch(e.nodeLookup,{filter:wie}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},kie="react-flow__minimap-desc";function vT({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:u,maskColor:d,maskStrokeColor:m,maskStrokeWidth:f,position:g="bottom-right",onClick:b,onNodeClick:k,pannable:S=!1,zoomable:x=!1,ariaLabel:_,inversePan:w,zoomStep:y=1,offsetScale:C=5}){const T=Mn(),E=R.useRef(null),{boundingRect:j,viewBB:N,rfId:D,panZoom:z,translateExtent:$,flowWidth:F,flowHeight:U,ariaLabelConfig:V}=Ht(Sie,Nn),X=(e==null?void 0:e.width)??xie,Y=(e==null?void 0:e.height)??yie,Q=j.width/X,te=j.height/Y,I=Math.max(Q,te),O=I*X,H=I*Y,G=C*I,W=j.x-(O-j.width)/2-G,re=j.y-(H-j.height)/2-G,ce=O+G*2,pe=H+G*2,ne=`${kie}-${D}`,B=R.useRef(0),se=R.useRef();B.current=I,R.useEffect(()=>{if(E.current&&z)return se.current=Ote({domNode:E.current,panZoom:z,getTransform:()=>T.getState().transform,getViewScale:()=>B.current}),()=>{var Ce;(Ce=se.current)==null||Ce.destroy()}},[z]),R.useEffect(()=>{var Ce;(Ce=se.current)==null||Ce.update({translateExtent:$,width:F,height:U,inversePan:w,pannable:S,zoomStep:y,zoomable:x})},[S,x,w,y,$,F,U]);const oe=b?Ce=>{var Ve;const[Le,Fe]=((Ve=se.current)==null?void 0:Ve.pointer(Ce))||[0,0];b(Ce,{x:Le,y:Fe})}:void 0,_e=k?R.useCallback((Ce,Le)=>{const Fe=T.getState().nodeLookup.get(Le).internals.userNode;k(Ce,Fe)},[]):void 0,be=_??V["minimap.ariaLabel"];return h.jsx(rm,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*I: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 o=="number"?o:void 0},className:sr(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:X,height:Y,viewBox:`${W} ${re} ${ce} ${pe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:E,onClick:oe,children:[be&&h.jsx("title",{id:ne,children:be}),h.jsx(_ie,{onClick:_e,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:l}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-G},${re-G}h${ce+G*2}v${pe+G*2}h${-ce-G*2}z - M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}vT.displayName="MiniMap";R.memo(vT);const Cie=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Eie={[su.Line]:"right",[su.Handle]:"bottom-right"};function Aie({nodeId:e,position:t,variant:n=su.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:l=10,minHeight:u=10,maxWidth:d=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:g,autoScale:b=!0,shouldResize:k,onResizeStart:S,onResize:x,onResizeEnd:_}){const w=XA(),y=typeof e=="string"?e:w,C=Mn(),T=R.useRef(null),E=n===su.Handle,j=Ht(R.useCallback(Cie(E&&b),[E,b]),Nn),N=R.useRef(null),D=t??Eie[n];R.useEffect(()=>{if(!(!T.current||!y))return N.current||(N.current=Yte({domNode:T.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:$,transform:F,snapGrid:U,snapToGrid:V,nodeOrigin:X,domNode:Y}=C.getState();return{nodeLookup:$,transform:F,snapGrid:U,snapToGrid:V,nodeOrigin:X,paneDomNode:Y}},onChange:($,F)=>{const{triggerNodeChanges:U,nodeLookup:V,parentLookup:X,nodeOrigin:Y}=C.getState(),Q=[],te={x:$.x,y:$.y},I=V.get(y);if(I&&I.expandParent&&I.parentId){const O=I.origin??Y,H=$.width??I.measured.width??0,G=$.height??I.measured.height??0,W={id:I.id,parentId:I.parentId,rect:{width:H,height:G,...xA({x:$.x??I.position.x,y:$.y??I.position.y},{width:H,height:G},I.parentId,V,O)}},re=fx([W],V,X,Y);Q.push(...re),te.x=$.x?Math.max(O[0]*H,$.x):void 0,te.y=$.y?Math.max(O[1]*G,$.y):void 0}if(te.x!==void 0&&te.y!==void 0){const O={id:y,type:"position",position:{...te}};Q.push(O)}if($.width!==void 0&&$.height!==void 0){const H={id:y,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:$.width,height:$.height}};Q.push(H)}for(const O of F){const H={...O,type:"position"};Q.push(H)}U(Q)},onEnd:({width:$,height:F})=>{const U={id:y,type:"dimensions",resizing:!1,dimensions:{width:$,height:F}};C.getState().triggerNodeChanges([U])}})),N.current.update({controlPosition:D,boundaries:{minWidth:l,minHeight:u,maxWidth:d,maxHeight:m},keepAspectRatio:f,resizeDirection:g,onResizeStart:S,onResize:x,onResizeEnd:_,shouldResize:k}),()=>{var $;($=N.current)==null||$.destroy()}},[D,l,u,d,m,f,S,x,_,k]);const z=D.split("-");return h.jsx("div",{className:sr(["react-flow__resize-control","nodrag",...z,n,r]),ref:T,style:{...i,scale:j,...o&&{[E?"backgroundColor":"borderColor"]:o}},children:a})}R.memo(Aie);function Tie(){const[e,t]=R.useState(0),[n,r]=R.useState(0);return{ref:R.useCallback(a=>{if(!a)return;function o(){t(a.offsetWidth),r(a.offsetHeight)}const l=new ResizeObserver(o),u=new MutationObserver(o);return l.observe(a),u.observe(a,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),o(),()=>{l.disconnect(),u.disconnect()}},[]),offsetWidth:e,offsetHeight:n}}const of=8;function Nie(e,t){const{offsetWidth:n,offsetHeight:r}=t,[{viewHeight:i,viewWidth:a},o]=R.useState({viewWidth:0,viewHeight:0});R.useEffect(()=>{function m(){o({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",m),m(),()=>window.removeEventListener("resize",m)},[]);let l=0,u=0,d=0;if(e){const{distance:m}=e;switch(e.anchor){case"left":l=e.x-n-m,u=e.y+e.height/2-r/2;break;case"right":l=e.x+e.width+m,u=e.y+e.height/2-r/2;break;case"below":l=e.x+e.width/2-n/2,u=e.y+e.height+m;break;case"above":l=e.x+e.width/2-n/2,u=e.y-r-m;break}const f=l,g=u;l=Math.min(Math.max(l,of),a-n-of),u=Math.min(Math.max(u,of),i-r-of),d=e.anchor==="left"||e.anchor==="right"?g-u:f-l}return{x:l,y:u,arrowAdjustment:d}}const Sb=380,kb=12,jie=350,Mie=150,Jv=new EventTarget;function Rie(){Jv.dispatchEvent(new Event("move"))}function Die(e,t){const[n,r]=R.useState(null),i=R.useRef(void 0),a=R.useRef(void 0);R.useEffect(()=>{const d=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current),r(null)};return Jv.addEventListener("move",d),()=>{Jv.removeEventListener("move",d),window.clearTimeout(i.current),window.clearTimeout(a.current)}},[]),R.useEffect(()=>{r(d=>{var f;if(!d)return d;const m=((f=e.current)==null?void 0:f.getBoundingClientRect())??null;return m&&d.x===m.x&&d.y===m.y&&d.width===m.width&&d.height===m.height?d:m})},[e,t]);const o=R.useCallback(()=>{window.clearTimeout(a.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>{var d;r(((d=e.current)==null?void 0:d.getBoundingClientRect())??null)},jie)},[e]),l=R.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(a.current),a.current=window.setTimeout(()=>r(null),Mie)},[]),u=R.useCallback(()=>window.clearTimeout(a.current),[]);return{rect:n,onMouseEnter:o,onMouseLeave:l,keepOpen:u}}function Lie(e){const t=new Date(e),n=t.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return t.toLocaleDateString(void 0,n)}function Oie({exp:e,runs:t,latestRun:n,parentSlug:r,anchor:i,onOpenLogs:a,onOpenCode:o,onMouseEnter:l,onMouseLeave:u}){const d=Tie(),m=i.right+kb+Sb<=window.innerWidth,f=i.x-kb-Sb>=0,g=m?"right":f?"left":i.y>window.innerHeight/2?"above":"below",{x:b,y:k}=Nie({x:i.x,y:i.y,width:i.width,height:i.height,anchor:g,distance:kb},d),[S,x]=R.useState(null),_=e.parentExperimentId&&(n!=null&&n.commitSha)?n.id:null;R.useEffect(()=>{if(x(null),!_)return;let $=!1;return LR(_).then(F=>{let U=F.diff;if(F.truncated){const Q=U.lastIndexOf(` +`)),m=d.reduce((f,g)=>f.concat(...g),[]);return[d,m]}return[[],[]]},[e]);return R.useEffect(()=>{const c=(t==null?void 0:t.target)??S8,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=b=>{var x,v;if(i.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!i.current||i.current&&!d)&&NA(b))return!1;const S=C8(b.code,l);if(a.current.add(b[S]),k8(o,a.current,!1)){const w=((v=(x=b.composedPath)==null?void 0:x.call(b))==null?void 0:v[0])||b.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(i.current||!y)&&b.preventDefault(),r(!0)}},f=b=>{const k=C8(b.code,l);k8(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(b[k]),b.key==="Meta"&&a.current.clear(),i.current=!1},g=()=>{a.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",m),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{c==null||c.removeEventListener("keydown",m),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function k8(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function C8(e,t){return t.includes(e)?"code":"key"}const Rne=()=>{const e=jn();return R.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,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},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:i,minZoom:a,maxZoom:o,panZoom:l}=e.getState(),c=ux(t,r,i,a,o,(n==null?void 0:n.padding)??.1);return l?(await l.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:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),d={x:t.x-l,y:t.y-c},m=n.snapGrid??i,f=n.snapToGrid??a;return Th(d,r,f,m)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:a}=r.getBoundingClientRect(),o=iu(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function ZA(e,t){const n=[],r=new Map,i=[];for(const a of e)if(a.type==="add"){i.push(a);continue}else if(a.type==="remove"||a.type==="replace")r.set(a.id,[a]);else{const o=r.get(a.id);o?o.push(a):r.set(a.id,[a])}for(const a of t){const o=r.get(a.id);if(!o){n.push(a);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...a};for(const c of o)Dne(c,l);n.push(l)}return i.length&&i.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function Dne(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 Lne(e,t){return ZA(e,t)}function One(e,t){return ZA(e,t)}function xl(e,t){return{id:e,type:"select",selected:t}}function Ic(e,t=new Set,n=!1){const r=[];for(const[i,a]of e){const o=t.has(i);!(a.selected===void 0&&!o)&&a.selected!==o&&(n&&(a.selected=o),r.push(xl(a.id,o)))}return r}function E8({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,o]of e.entries()){const l=t.get(o.id),c=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:a})}for(const[a]of t)r.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function A8(e){return{id:e.id,type:"remove"}}const Ine=CA();function zne(e,t,n={}){return xte(e,t,{...n,onError:n.onError??Ine})}const T8=e=>ste(e),Bne=e=>xA(e);function QA(e){return R.forwardRef(e)}const Hne=typeof window<"u"?R.useLayoutEffect:R.useEffect;function N8(e){const[t,n]=R.useState(BigInt(0)),[r]=R.useState(()=>$ne(()=>n(i=>i+BigInt(1))));return Hne(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function $ne(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const JA=R.createContext(null);function Fne({children:e}){const t=jn(),n=R.useCallback(l=>{const{nodes:c=[],setNodes:d,hasDefaultNodes:m,onNodesChange:f,nodeLookup:g,fitViewQueued:b,onNodesChangeMiddlewareMap:k}=t.getState();let S=c;for(const v of l)S=typeof v=="function"?v(S):v;let x=E8({items:S,lookup:g});for(const v of k.values())x=v(x);m&&d(S),x.length>0?f==null||f(x):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:v,nodes:w,setNodes:y}=t.getState();v&&y(w)})},[]),r=N8(n),i=R.useCallback(l=>{const{edges:c=[],setEdges:d,hasDefaultEdges:m,onEdgesChange:f,edgeLookup:g}=t.getState();let b=c;for(const k of l)b=typeof k=="function"?k(b):k;m?d(b):f&&f(E8({items:b,lookup:g}))},[]),a=N8(i),o=R.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return h.jsx(JA.Provider,{value:o,children:e})}function Pne(){const e=R.useContext(JA);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Une=e=>!!e.panZoom;function bx(){const e=Rne(),t=jn(),n=Pne(),r=Ht(Une),i=R.useMemo(()=>{const a=f=>t.getState().nodeLookup.get(f),o=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var v,w;const{nodeLookup:g,nodeOrigin:b}=t.getState(),k=T8(f)?f:g.get(f.id),S=k.parentId?AA(k.position,k.measured,k.parentId,g,b):k.position,x={...k,position:S,width:((v=k.measured)==null?void 0:v.width)??k.width,height:((w=k.measured)==null?void 0:w.height)??k.height};return Zd(x)},d=(f,g,b={replace:!1})=>{o(k=>k.map(S=>{if(S.id===f){const x=typeof g=="function"?g(S):g;return b.replace&&T8(x)?x:{...S,...x}}return S}))},m=(f,g,b={replace:!1})=>{l(k=>k.map(S=>{if(S.id===f){const x=typeof g=="function"?g(S):g;return b.replace&&Bne(x)?x:{...S,...x}}return S}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var g;return(g=a(f))==null?void 0:g.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(g=>({...g}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:o,setEdges:l,addNodes:f=>{const g=Array.isArray(f)?f:[f];n.nodeQueue.push(b=>[...b,...g])},addEdges:f=>{const g=Array.isArray(f)?f:[f];n.edgeQueue.push(b=>[...b,...g])},toObject:()=>{const{nodes:f=[],edges:g=[],transform:b}=t.getState(),[k,S,x]=b;return{nodes:f.map(v=>({...v})),edges:g.map(v=>({...v})),viewport:{x:k,y:S,zoom:x}}},deleteElements:async({nodes:f=[],edges:g=[]})=>{const{nodes:b,edges:k,onNodesDelete:S,onEdgesDelete:x,triggerNodeChanges:v,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:C}=t.getState(),{nodes:N,edges:E}=await ute({nodesToRemove:f,edgesToRemove:g,nodes:b,edges:k,onBeforeDelete:C}),M=E.length>0,T=N.length>0;if(M){const D=E.map(A8);x==null||x(E),w(D)}if(T){const D=N.map(A8);S==null||S(N),v(D)}return(T||M)&&(y==null||y({nodes:N,edges:E})),{deletedNodes:N,deletedEdges:E}},getIntersectingNodes:(f,g=!0,b)=>{const k=J7(f),S=k?f:c(f),x=b!==void 0;return S?(b||t.getState().nodes).filter(v=>{const w=t.getState().nodeLookup.get(v.id);if(w&&!k&&(v.id===f.id||!w.internals.positionAbsolute))return!1;const y=Zd(x?v:w),C=sp(y,S);return g&&C>0||C>=y.width*y.height||C>=S.width*S.height}):[]},isNodeIntersecting:(f,g,b=!0)=>{const S=J7(f)?f:c(f);if(!S)return!1;const x=sp(S,g);return b&&x>0||x>=g.width*g.height||x>=S.width*S.height},updateNode:d,updateNodeData:(f,g,b={replace:!1})=>{d(f,k=>{const S=typeof g=="function"?g(k):g;return b.replace?{...k,data:S}:{...k,data:{...k.data,...S}}},b)},updateEdge:m,updateEdgeData:(f,g,b={replace:!1})=>{m(f,k=>{const S=typeof g=="function"?g(k):g;return b.replace?{...k,data:S}:{...k,data:{...k.data,...S}}},b)},getNodesBounds:f=>{const{nodeLookup:g,nodeOrigin:b}=t.getState();return ate(f,{nodeLookup:g,nodeOrigin:b})},getHandleConnections:({type:f,id:g,nodeId:b})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${b}-${f}${g?`-${g}`:""}`))==null?void 0:k.values())??[])},getNodeConnections:({type:f,handleId:g,nodeId:b})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${b}${f?g?`-${f}-${g}`:`-${f}`:""}`))==null?void 0:k.values())??[])},fitView:async f=>{const g=t.getState().fitViewResolver??fte();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:g}),n.nodeQueue.push(b=>[...b]),g.promise}}},[]);return R.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const j8=e=>e.selected,qne=typeof window<"u"?window:void 0;function Gne({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=jn(),{deleteElements:r}=bx(),i=Jd(e,{actInsideInputWithModifier:!1}),a=Jd(t,{target:qne});R.useEffect(()=>{if(i){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(j8),edges:o.filter(j8)}),n.setState({nodesSelectionActive:!1})}},[i]),R.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function Vne(e){const t=jn();R.useEffect(()=>{const n=()=>{var i,a,o,l;if(!e.current||!(((a=(i=e.current).checkVisibility)==null?void 0:a.call(i))??!0))return!1;const r=dx(e.current);(r.height===0||r.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",Es.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 am={position:"absolute",width:"100%",height:"100%",top:0,left:0},Wne=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Yne({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=Ml.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:d,minZoom:m,maxZoom:f,zoomActivationKeyCode:g,preventScrolling:b=!0,children:k,noWheelClassName:S,noPanClassName:x,onViewportChange:v,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:C}){const N=jn(),E=R.useRef(null),{userSelectionActive:M,lib:T,connectionInProgress:D}=Ht(Wne,Tn),z=Jd(g),$=R.useRef();Vne(E);const F=R.useCallback(U=>{v==null||v({x:U[0],y:U[1],zoom:U[2]}),w||N.setState({transform:U})},[v,w]);return R.useEffect(()=>{if(E.current){$.current=Kte({domNode:E.current,minZoom:m,maxZoom:f,translateExtent:d,viewport:c,onDraggingChange:Y=>N.setState(Q=>Q.paneDragging===Y?Q:{paneDragging:Y}),onPanZoomStart:(Y,Q)=>{const{onViewportChangeStart:te,onMoveStart:I}=N.getState();I==null||I(Y,Q),te==null||te(Q)},onPanZoom:(Y,Q)=>{const{onViewportChange:te,onMove:I}=N.getState();I==null||I(Y,Q),te==null||te(Q)},onPanZoomEnd:(Y,Q)=>{const{onViewportChangeEnd:te,onMoveEnd:I}=N.getState();I==null||I(Y,Q),te==null||te(Q)}});const{x:U,y:V,zoom:X}=$.current.getViewport();return N.setState({panZoom:$.current,transform:[U,V,X],domNode:E.current.closest(".react-flow")}),()=>{var Y;(Y=$.current)==null||Y.destroy()}}},[]),R.useEffect(()=>{var U;(U=$.current)==null||U.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:z,preventScrolling:b,noPanClassName:x,userSelectionActive:M,noWheelClassName:S,lib:T,onTransformChange:F,connectionInProgress:D,selectionOnDrag:C,paneClickDistance:y})},[e,t,n,r,i,a,o,l,z,b,x,M,S,T,F,D,C,y]),h.jsx("div",{className:"react-flow__renderer",ref:E,style:am,children:k})}const Xne=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Kne(){const{userSelectionActive:e,userSelectionRect:t}=Ht(Xne,Tn);return e&&t?h.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 kb=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Zne=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Qne({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Kd.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:c,onPaneClick:d,onPaneContextMenu:m,onPaneScroll:f,onPaneMouseEnter:g,onPaneMouseMove:b,onPaneMouseLeave:k,children:S}){const x=R.useRef(0),v=jn(),{userSelectionActive:w,elementsSelectable:y,dragging:C,panBy:N,autoPanSpeed:E}=Ht(Zne,Tn),M=y&&(e||w),T=R.useRef(null),D=R.useRef(),z=R.useRef(new Set),$=R.useRef(new Set),F=R.useRef(!1),U=R.useRef(!1),V=R.useRef({x:0,y:0}),X=R.useRef(!1),Y=B=>{if(U.current||F.current||v.getState().connection.inProgress){U.current=!1,F.current=!1;return}d==null||d(B),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},Q=B=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){B.preventDefault();return}m==null||m(B)},te=f?B=>f(B):void 0,I=B=>{U.current&&(B.stopPropagation(),U.current=!1)},O=B=>{var Fe,ut;const{domNode:se,transform:le}=v.getState();if(D.current=se==null?void 0:se.getBoundingClientRect(),!D.current)return;const _e=B.target===T.current;if(!_e&&!!B.target.closest(".nokey")||!e||!(o&&_e||t)||B.button!==0||!B.isPrimary)return;(ut=(Fe=B.target)==null?void 0:Fe.setPointerCapture)==null||ut.call(Fe,B.pointerId),U.current=!1;const{x:Le,y:$e}=ys(B.nativeEvent,D.current),Ge=Th({x:Le,y:$e},le);v.setState({userSelectionRect:{width:0,height:0,startX:Ge.x,startY:Ge.y,x:Le,y:$e}}),_e||(B.stopPropagation(),B.preventDefault())};function H(B,se){const{userSelectionRect:le}=v.getState();if(!le)return;const{transform:_e,nodeLookup:be,edgeLookup:Ce,connectionLookup:Le,triggerNodeChanges:$e,triggerEdgeChanges:Ge,defaultEdgeOptions:Fe}=v.getState(),ut={x:le.startX,y:le.startY},{x:Ke,y:Ue}=iu(ut,_e),ct={startX:ut.x,startY:ut.y,x:Bnt.id)),$.current=new Set;const qe=(Fe==null?void 0:Fe.selectable)??!0;for(const nt of z.current){const ve=Le.get(nt);if(ve)for(const{edgeId:je}of ve.values()){const Pe=Ce.get(je);Pe&&(Pe.selectable??qe)&&$.current.add(je)}}if(!e8(Kt,z.current)){const nt=Ic(be,z.current,!0);$e(nt)}if(!e8(Rt,$.current)){const nt=Ic(Ce,$.current);Ge(nt)}v.setState({userSelectionRect:ct,userSelectionActive:!0,nodesSelectionActive:!1})}function G(){if(!i||!D.current)return;const[B,se]=cx(V.current,D.current,E);N({x:B,y:se}).then(le=>{if(!U.current||!le){x.current=requestAnimationFrame(G);return}const{x:_e,y:be}=V.current;H(_e,be),x.current=requestAnimationFrame(G)})}const W=()=>{cancelAnimationFrame(x.current),x.current=0,X.current=!1};R.useEffect(()=>()=>W(),[]);const re=B=>{const{userSelectionRect:se,transform:le,resetSelectedElements:_e}=v.getState();if(!D.current||!se)return;const{x:be,y:Ce}=ys(B.nativeEvent,D.current);V.current={x:be,y:Ce};const Le=iu({x:se.startX,y:se.startY},le);if(!U.current){const $e=t?0:a;if(Math.hypot(be-Le.x,Ce-Le.y)<=$e)return;_e(),l==null||l(B)}U.current=!0,X.current||(G(),X.current=!0),H(be,Ce)},ce=B=>{var se,le;if(!M){B.target===T.current&&v.getState().connection.inProgress&&(F.current=!0);return}B.button===0&&((le=(se=B.target)==null?void 0:se.releasePointerCapture)==null||le.call(se,B.pointerId),!w&&B.target===T.current&&v.getState().userSelectionRect&&(Y==null||Y(B)),v.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(c==null||c(B),v.setState({nodesSelectionActive:z.current.size>0})),W())},me=B=>{var se,le;(le=(se=B.target)==null?void 0:se.releasePointerCapture)==null||le.call(se,B.pointerId),W()},ne=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:sr(["react-flow__pane",{draggable:ne,dragging:C,selection:e}]),onClick:M?void 0:kb(Y,T),onContextMenu:kb(Q,T),onWheel:kb(te,T),onPointerEnter:M?void 0:g,onPointerMove:M?re:b,onPointerUp:ce,onPointerCancel:M?me:void 0,onPointerDownCapture:M?O:void 0,onClickCapture:M?I:void 0,onPointerLeave:k,ref:T,style:am,children:[S,h.jsx(Kne,{})]})}function t_({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),d=l.get(e);if(!d){c==null||c("012",Es.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&o)&&(a({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var m;return(m=r==null?void 0:r.current)==null?void 0:m.blur()})):i([e])}function eT({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){const l=jn(),[c,d]=R.useState(!1),m=R.useRef();return R.useEffect(()=>{m.current=Ite({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{t_({id:f,store:l,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),R.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{var f;(f=m.current)==null||f.destroy()}},[n,r,t,a,e,i,o]),c}const Jne=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function tT(){const e=jn();return R.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:a,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:d,nodeOrigin:m}=e.getState(),f=new Map,g=Jne(o),b=i?a[0]:5,k=i?a[1]:5,S=n.direction.x*b*n.factor,x=n.direction.y*k*n.factor;for(const[,v]of d){if(!g(v))continue;let w={x:v.internals.positionAbsolute.x+S,y:v.internals.positionAbsolute.y+x};i&&(w=Ah(w,a));const{position:y,positionAbsolute:C}=yA({nodeId:v.id,nextPosition:w,nodeLookup:d,nodeExtent:r,nodeOrigin:m,onError:l});v.position=y,v.internals.positionAbsolute=C,f.set(v.id,v)}c(f)},[])}const vx=R.createContext(null),ere=vx.Provider;vx.Consumer;const nT=()=>R.useContext(vx),tre=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),rT=R.createContext(null);function nre({children:e}){const t=Ht(tre,Tn);return h.jsx(rT.Provider,{value:t,children:e})}function rre(){const e=R.useContext(rT);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const ire={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},sre=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:l,toHandle:c,isValid:d}=o;if(!l&&!i)return ire;const m=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:m,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:a===nu.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:m&&d}};function are({type:e="source",position:t=at.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:l,children:c,className:d,onMouseDown:m,onTouchStart:f,...g},b){var X,Y;const k=o||null,S=e==="target",x=jn(),v=nT(),{connectOnClick:w,noPanClassName:y,rfId:C}=rre(),{connectingFrom:N,connectingTo:E,clickConnecting:M,isPossibleEndHandle:T,connectionInProcess:D,clickConnectionInProcess:z,valid:$}=Ht(sre(v,k,e),Tn);v||(Y=(X=x.getState()).onError)==null||Y.call(X,"010",Es.error010());const F=Q=>{const{defaultEdgeOptions:te,onConnect:I,hasDefaultEdges:O}=x.getState(),H={...te,...Q};if(O){const{edges:G,setEdges:W,onError:re}=x.getState();W(zne(H,G,{onError:re}))}I==null||I(H),l==null||l(H)},U=Q=>{if(!v)return;const te=jA(Q.nativeEvent);if(i&&(te&&Q.button===0||!te)){const I=x.getState();e_.onPointerDown(Q.nativeEvent,{handleDomNode:Q.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:S,handleId:k,nodeId:v,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...O)=>{var H,G;return(G=(H=x.getState()).onConnectEnd)==null?void 0:G.call(H,...O)},updateConnection:I.updateConnection,onConnect:F,isValidConnection:n||((...O)=>{var H,G;return((G=(H=x.getState()).isValidConnection)==null?void 0:G.call(H,...O))??!0}),getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}te?m==null||m(Q):f==null||f(Q)},V=Q=>{const{onClickConnectStart:te,onClickConnectEnd:I,connectionClickStartHandle:O,connectionMode:H,isValidConnection:G,lib:W,rfId:re,nodeLookup:ce,connection:me}=x.getState();if(!v||!O&&!i)return;if(!O){te==null||te(Q.nativeEvent,{nodeId:v,handleId:k,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:v,type:e,id:k}});return}const ne=TA(Q.target),B=n||G,{connection:se,isValid:le}=e_.isValid(Q.nativeEvent,{handle:{nodeId:v,id:k,type:e},connectionMode:H,fromNodeId:O.nodeId,fromHandleId:O.id||null,fromType:O.type,isValidConnection:B,flowId:re,doc:ne,lib:W,nodeLookup:ce});le&&se&&F(se);const _e=structuredClone(me);delete _e.inProgress,_e.toPosition=_e.toHandle?_e.toHandle.position:null,I==null||I(Q,_e),x.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":k,"data-nodeid":v,"data-handlepos":t,"data-id":`${C}-${v}-${k}-${e}`,className:sr(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,d,{source:!S,target:S,connectable:r,connectablestart:i,connectableend:a,clickconnecting:M,connectingfrom:N,connectingto:E,valid:$,connectionindicator:r&&(!D||T)&&(D||z?a:i)}]),onMouseDown:U,onTouchStart:U,onClick:w?V:void 0,ref:b,...g,children:c})}const Uo=R.memo(QA(are));function ore({data:e,isConnectable:t,sourcePosition:n=at.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(Uo,{type:"source",position:n,isConnectable:t})]})}function lre({data:e,isConnectable:t,targetPosition:n=at.Top,sourcePosition:r=at.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(Uo,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(Uo,{type:"source",position:r,isConnectable:t})]})}function cre(){return null}function ure({data:e,isConnectable:t,targetPosition:n=at.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(Uo,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ap={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},M8={input:ore,default:lre,output:ure,group:cre};function dre(e){var t,n,r,i;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??((i=e.style)==null?void 0:i.height)}}const hre=e=>{const{width:t,height:n,x:r,y:i}=Eh(e.nodeLookup,{filter:a=>!!a.selected});return{width:xs(t)?t:null,height:xs(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function fre({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=jn(),{width:i,height:a,transformString:o,userSelectionActive:l}=Ht(hre,Tn),c=tT(),d=R.useRef(null);R.useEffect(()=>{var b;n||(b=d.current)==null||b.focus({preventScroll:!0})},[n]);const m=!l&&i!==null&&a!==null;if(eT({nodeRef:d,disabled:!m}),!m)return null;const f=e?b=>{const k=r.getState().nodes.filter(S=>S.selected);e(b,k)}:void 0,g=b=>{Object.prototype.hasOwnProperty.call(ap,b.key)&&(b.preventDefault(),c({direction:ap[b.key],factor:b.shiftKey?4:1}))};return h.jsx("div",{className:sr(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:h.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:i,height:a}})})}const R8=typeof window<"u"?window:void 0,pre=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function iT({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:d,selectionOnDrag:m,selectionMode:f,onSelectionStart:g,onSelectionEnd:b,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:x,elementsSelectable:v,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:N,panOnScrollMode:E,zoomOnDoubleClick:M,panOnDrag:T,autoPanOnSelection:D,defaultViewport:z,translateExtent:$,minZoom:F,maxZoom:U,preventScrolling:V,onSelectionContextMenu:X,noWheelClassName:Y,noPanClassName:Q,disableKeyboardA11y:te,onViewportChange:I,isControlledViewport:O}){const{nodesSelectionActive:H,userSelectionActive:G}=Ht(pre,Tn),W=Jd(d,{target:R8}),re=Jd(S,{target:R8}),ce=re||T,me=re||C,ne=m&&ce!==!0,B=W||G||ne;return Gne({deleteKeyCode:c,multiSelectionKeyCode:k}),h.jsx(Yne,{onPaneContextMenu:a,elementsSelectable:v,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:me,panOnScrollSpeed:N,panOnScrollMode:E,zoomOnDoubleClick:M,panOnDrag:!W&&ce,defaultViewport:z,translateExtent:$,minZoom:F,maxZoom:U,zoomActivationKeyCode:x,preventScrolling:V,noWheelClassName:Y,noPanClassName:Q,onViewportChange:I,isControlledViewport:O,paneClickDistance:l,selectionOnDrag:ne,children:h.jsxs(Qne,{onSelectionStart:g,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:ce,autoPanOnSelection:D,isSelecting:!!B,selectionMode:f,selectionKeyPressed:W,paneClickDistance:l,selectionOnDrag:ne,children:[e,H&&h.jsx(fre,{onSelectionContextMenu:X,noPanClassName:Q,disableKeyboardA11y:te})]})})}iT.displayName="FlowRenderer";const mre=R.memo(iT),gre=e=>t=>e?lx(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 bre(e){return Ht(R.useCallback(gre(e),[e]),Tn)}const vre=e=>e.updateNodeInternals;function _re(){const e=Ht(vre),[t]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const a=i.target.getAttribute("data-id");r.set(a,{id:a,nodeElement:i.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function xre({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=jn(),a=R.useRef(null),o=R.useRef(null),l=R.useRef(e.sourcePosition),c=R.useRef(e.targetPosition),d=R.useRef(t),m=n&&!!e.internals.handleBounds;return R.useEffect(()=>{a.current&&!e.hidden&&(!m||o.current!==a.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(a.current),o.current=a.current)},[m,e.hidden]),R.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),R.useEffect(()=>{if(a.current){const f=d.current!==t,g=l.current!==e.sourcePosition,b=c.current!==e.targetPosition;(f||g||b)&&(d.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function yre({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:d,nodesFocusable:m,resizeObserver:f,noDragClassName:g,noPanClassName:b,disableKeyboardA11y:k,rfId:S,nodeTypes:x,nodeClickDistance:v,onError:w}){const{node:y,internals:C,isParent:N}=Ht(B=>{const se=B.nodeLookup.get(e),le=B.parentLookup.has(e);return{node:se,internals:se.internals,isParent:le}},Tn);let E=y.type||"default",M=(x==null?void 0:x[E])||M8[E];M===void 0&&(w==null||w("003",Es.error003(E)),E="default",M=(x==null?void 0:x.default)||M8.default);const T=!!(y.draggable||l&&typeof y.draggable>"u"),D=!!(y.selectable||c&&typeof y.selectable>"u"),z=!!(y.connectable||d&&typeof y.connectable>"u"),$=!!(y.focusable||m&&typeof y.focusable>"u"),F=jn(),U=EA(y),V=xre({node:y,nodeType:E,hasDimensions:U,resizeObserver:f}),X=eT({nodeRef:V,disabled:y.hidden||!T,noDragClassName:g,handleSelector:y.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:v}),Y=tT();if(y.hidden)return null;const Q=Wa(y),te=dre(y),I=D||T||t||n||r||i,O=n?B=>n(B,{...C.userNode}):void 0,H=r?B=>r(B,{...C.userNode}):void 0,G=i?B=>i(B,{...C.userNode}):void 0,W=a?B=>a(B,{...C.userNode}):void 0,re=o?B=>o(B,{...C.userNode}):void 0,ce=B=>{const{selectNodesOnDrag:se,nodeDragThreshold:le}=F.getState();D&&(!se||!T||le>0)&&t_({id:e,store:F,nodeRef:V}),t&&t(B,{...C.userNode})},me=B=>{if(!(NA(B.nativeEvent)||k)){if(gA.includes(B.key)&&D){const se=B.key==="Escape";t_({id:e,store:F,unselect:se,nodeRef:V})}else if(T&&y.selected&&Object.prototype.hasOwnProperty.call(ap,B.key)){B.preventDefault();const{ariaLabelConfig:se}=F.getState();F.setState({ariaLiveMessage:se["node.a11yDescription.ariaLiveMessage"]({direction:B.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),Y({direction:ap[B.key],factor:B.shiftKey?4:1})}}},ne=()=>{var Le;if(k||!((Le=V.current)!=null&&Le.matches(":focus-visible")))return;const{transform:B,width:se,height:le,autoPanOnNodeFocus:_e,setCenter:be}=F.getState();if(!_e)return;lx(new Map([[e,y]]),{x:0,y:0,width:se,height:le},B,!0).length>0||be(y.position.x+Q.width/2,y.position.y+Q.height/2,{zoom:B[2]})};return h.jsx("div",{className:sr(["react-flow__node",`react-flow__node-${E}`,{[b]:T},y.className,{selected:y.selected,selectable:D,parent:N,draggable:T,dragging:X}]),ref:V,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:U?"visible":"hidden",...y.style,...te},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:O,onMouseMove:H,onMouseLeave:G,onContextMenu:W,onClick:ce,onDoubleClick:re,onKeyDown:$?me:void 0,tabIndex:$?0:void 0,onFocus:$?ne:void 0,role:y.ariaRole??($?"group":void 0),"aria-roledescription":"node","aria-describedby":k?void 0:`${YA}-${S}`,"aria-label":y.ariaLabel,...y.domAttributes,children:h.jsx(ere,{value:e,children:h.jsx(M,{id:e,data:y.data,type:E,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:D,draggable:T,deletable:y.deletable??!0,isConnectable:z,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:X,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...Q})})})}var wre=R.memo(yre);const Sre=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function sT(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=Ht(Sre,Tn),o=bre(e.onlyRenderVisibleElements),l=_re();return h.jsx("div",{className:"react-flow__nodes",style:am,children:o.map(c=>h.jsx(wre,{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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},c))})}sT.displayName="NodeRenderer";const kre=R.memo(sT);function Cre(e){return Ht(R.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const a=n.nodeLookup.get(i.source),o=n.nodeLookup.get(i.target);a&&o&&bte({sourceNode:a,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),Tn)}const Ere=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return h.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Are=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return h.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},D8={[rp.Arrow]:Ere,[rp.ArrowClosed]:Are};function Tre(e){const t=jn();return R.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(D8,e)?D8[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",Es.error009(e)),null)},[e])}const Nre=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=Tre(t);return c?h.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0",children:h.jsx(c,{color:n,strokeWidth:o})}):null},aT=({defaultColor:e,rfId:t})=>{const n=Ht(a=>a.edges),r=Ht(a=>a.defaultEdgeOptions),i=R.useMemo(()=>Cte(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:i.map(a=>h.jsx(Nre,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};aT.displayName="MarkerDefinitions";var jre=R.memo(aT);function oT({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:d,...m}){const[f,g]=R.useState({x:1,y:0,width:0,height:0}),b=sr(["react-flow__edge-textwrapper",d]),k=R.useRef(null);return R.useEffect(()=>{if(k.current){const S=k.current.getBBox();g({x:S.x,y:S.y,width:S.width,height:S.height})}},[n]),n?h.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:b,visibility:f.width?"visible":"hidden",...m,children:[i&&h.jsx("rect",{width:f.width+2*o[0],x:-o[0],y:-o[1],height:f.height+2*o[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),h.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:k,style:r,children:n}),c]}):null}oT.displayName="EdgeText";const Mre=R.memo(oT);function om({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:d=20,...m}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{...m,d:e,fill:"none",className:sr(["react-flow__edge-path",m.className])}),d?h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&xs(t)&&xs(n)?h.jsx(Mre,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function L8({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===at.Left||e===at.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function lT({sourceX:e,sourceY:t,sourcePosition:n=at.Bottom,targetX:r,targetY:i,targetPosition:a=at.Top}){const[o,l]=L8({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,d]=L8({pos:a,x1:r,y1:i,x2:e,y2:t}),[m,f,g,b]=MA({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${e},${t} C${o},${l} ${c},${d} ${r},${i}`,m,f,g,b]}function cT(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,label:c,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:b,style:k,markerEnd:S,markerStart:x,interactionWidth:v})=>{const[w,y,C]=lT({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l}),N=e.isInternal?void 0:t;return h.jsx(om,{id:N,path:w,labelX:y,labelY:C,label:c,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:b,style:k,markerEnd:S,markerStart:x,interactionWidth:v})})}const Rre=cT({isInternal:!1}),uT=cT({isInternal:!0});Rre.displayName="SimpleBezierEdge";uT.displayName="SimpleBezierEdgeInternal";function dT(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:g,sourcePosition:b=at.Bottom,targetPosition:k=at.Top,markerEnd:S,markerStart:x,pathOptions:v,interactionWidth:w})=>{const[y,C,N]=Zv({sourceX:n,sourceY:r,sourcePosition:b,targetX:i,targetY:a,targetPosition:k,borderRadius:v==null?void 0:v.borderRadius,offset:v==null?void 0:v.offset,stepPosition:v==null?void 0:v.stepPosition}),E=e.isInternal?void 0:t;return h.jsx(om,{id:E,path:y,labelX:C,labelY:N,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:g,markerEnd:S,markerStart:x,interactionWidth:w})})}const hT=dT({isInternal:!1}),fT=dT({isInternal:!0});hT.displayName="SmoothStepEdge";fT.displayName="SmoothStepEdgeInternal";function pT(e){return R.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return h.jsx(hT,{...n,id:r,pathOptions:R.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const Dre=pT({isInternal:!1}),mT=pT({isInternal:!0});Dre.displayName="StepEdge";mT.displayName="StepEdgeInternal";function gT(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:g,markerEnd:b,markerStart:k,interactionWidth:S})=>{const[x,v,w]=LA({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return h.jsx(om,{id:y,path:x,labelX:v,labelY:w,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:g,markerEnd:b,markerStart:k,interactionWidth:S})})}const Lre=gT({isInternal:!1}),bT=gT({isInternal:!0});Lre.displayName="StraightEdge";bT.displayName="StraightEdgeInternal";function vT(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=at.Bottom,targetPosition:l=at.Top,label:c,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:b,style:k,markerEnd:S,markerStart:x,pathOptions:v,interactionWidth:w})=>{const[y,C,N]=RA({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l,curvature:v==null?void 0:v.curvature}),E=e.isInternal?void 0:t;return h.jsx(om,{id:E,path:y,labelX:C,labelY:N,label:c,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:b,style:k,markerEnd:S,markerStart:x,interactionWidth:w})})}const Ore=vT({isInternal:!1}),_T=vT({isInternal:!0});Ore.displayName="BezierEdge";_T.displayName="BezierEdgeInternal";const O8={default:_T,straight:bT,step:mT,smoothstep:fT,simplebezier:uT},I8={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},Ire=(e,t,n)=>n===at.Left?e-t:n===at.Right?e+t:e,zre=(e,t,n)=>n===at.Top?e-t:n===at.Bottom?e+t:e,z8="react-flow__edgeupdater";function B8({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:l}){return h.jsx("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:sr([z8,`${z8}-${l}`]),cx:Ire(t,r,e),cy:zre(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Bre({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:d,onReconnectStart:m,onReconnectEnd:f,setReconnecting:g,setUpdateHover:b}){const k=jn(),S=(C,N)=>{if(C.button!==0)return;const{autoPanOnConnect:E,domNode:M,connectionMode:T,connectionRadius:D,lib:z,onConnectStart:$,cancelConnection:F,nodeLookup:U,rfId:V,panBy:X,updateConnection:Y}=k.getState(),Q=N.type==="target",te=(H,G)=>{g(!1),f==null||f(H,n,N.type,G)},I=H=>d==null?void 0:d(n,H),O=(H,G)=>{g(!0),m==null||m(C,n,N.type),$==null||$(H,G)};e_.onPointerDown(C.nativeEvent,{autoPanOnConnect:E,connectionMode:T,connectionRadius:D,domNode:M,handleId:N.id,nodeId:N.nodeId,nodeLookup:U,isTarget:Q,edgeUpdaterType:N.type,lib:z,flowId:V,cancelConnection:F,panBy:X,isValidConnection:(...H)=>{var G,W;return((W=(G=k.getState()).isValidConnection)==null?void 0:W.call(G,...H))??!0},onConnect:I,onConnectStart:O,onConnectEnd:(...H)=>{var G,W;return(W=(G=k.getState()).onConnectEnd)==null?void 0:W.call(G,...H)},onReconnectEnd:te,updateConnection:Y,getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,dragThreshold:k.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},x=C=>S(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),v=C=>S(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>b(!0),y=()=>b(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(B8,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:x,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&h.jsx(B8,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:v,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function Hre({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,reconnectRadius:m,onReconnect:f,onReconnectStart:g,onReconnectEnd:b,rfId:k,edgeTypes:S,noPanClassName:x,onError:v,disableKeyboardA11y:w}){let y=Ht(be=>be.edgeLookup.get(e));const C=Ht(be=>be.defaultEdgeOptions);y=C?{...C,...y}:y;let N=y.type||"default",E=(S==null?void 0:S[N])||O8[N];E===void 0&&(v==null||v("011",Es.error011(N)),N="default",E=(S==null?void 0:S.default)||O8.default);const M=!!(y.focusable||t&&typeof y.focusable>"u"),T=typeof f<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),D=!!(y.selectable||r&&typeof y.selectable>"u"),z=R.useRef(null),[$,F]=R.useState(!1),[U,V]=R.useState(!1),X=jn(),{zIndex:Y=y.zIndex,sourceX:Q,sourceY:te,targetX:I,targetY:O,sourcePosition:H,targetPosition:G}=Ht(R.useCallback(be=>{const Ce=be.nodeLookup.get(y.source),Le=be.nodeLookup.get(y.target);if(!Ce||!Le)return I8;const $e=kte({id:e,sourceNode:Ce,targetNode:Le,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:be.connectionMode,onError:v}),Ge=gte({selected:y.selected,zIndex:y.zIndex,sourceNode:Ce,targetNode:Le,elevateOnSelect:be.elevateEdgesOnSelect,zIndexMode:be.zIndexMode});return{...$e||I8,zIndex:Ge}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),Tn),W=R.useMemo(()=>y.markerStart?`url('#${Qv(y.markerStart,k)}')`:void 0,[y.markerStart,k]),re=R.useMemo(()=>y.markerEnd?`url('#${Qv(y.markerEnd,k)}')`:void 0,[y.markerEnd,k]);if(y.hidden||Q===null||te===null||I===null||O===null)return null;const ce=be=>{var Ge;const{addSelectedEdges:Ce,unselectNodesAndEdges:Le,multiSelectionActive:$e}=X.getState();D&&(X.setState({nodesSelectionActive:!1}),y.selected&&$e?(Le({nodes:[],edges:[y]}),(Ge=z.current)==null||Ge.blur()):Ce([e])),i&&i(be,y)},me=a?be=>{a(be,{...y})}:void 0,ne=o?be=>{o(be,{...y})}:void 0,B=l?be=>{l(be,{...y})}:void 0,se=c?be=>{c(be,{...y})}:void 0,le=d?be=>{d(be,{...y})}:void 0,_e=be=>{var Ce;if(!w&&gA.includes(be.key)&&D){const{unselectNodesAndEdges:Le,addSelectedEdges:$e}=X.getState();be.key==="Escape"?((Ce=z.current)==null||Ce.blur(),Le({edges:[y]})):$e([e])}};return h.jsx("svg",{style:{zIndex:Y},children:h.jsxs("g",{className:sr(["react-flow__edge",`react-flow__edge-${N}`,y.className,x,{selected:y.selected,animated:y.animated,inactive:!D&&!i,updating:$,selectable:D}]),onClick:ce,onDoubleClick:me,onContextMenu:ne,onMouseEnter:B,onMouseMove:se,onMouseLeave:le,onKeyDown:M?_e:void 0,tabIndex:M?0:void 0,role:y.ariaRole??(M?"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":M?`${XA}-${k}`:void 0,ref:z,...y.domAttributes,children:[!U&&h.jsx(E,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:D,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:Q,sourceY:te,targetX:I,targetY:O,sourcePosition:H,targetPosition:G,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:W,markerEnd:re,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),T&&h.jsx(Bre,{edge:y,isReconnectable:T,reconnectRadius:m,onReconnect:f,onReconnectStart:g,onReconnectEnd:b,sourceX:Q,sourceY:te,targetX:I,targetY:O,sourcePosition:H,targetPosition:G,setUpdateHover:F,setReconnecting:V})]})})}var $re=R.memo(Hre);const Fre=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function xT({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:m,reconnectRadius:f,onEdgeDoubleClick:g,onReconnectStart:b,onReconnectEnd:k,disableKeyboardA11y:S}){const{edgesFocusable:x,edgesReconnectable:v,elementsSelectable:w,onError:y}=Ht(Fre,Tn),C=Cre(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(jre,{defaultColor:e,rfId:n}),C.map(N=>h.jsx($re,{id:N,edgesFocusable:x,edgesReconnectable:v,elementsSelectable:w,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onClick:m,reconnectRadius:f,onDoubleClick:g,onReconnectStart:b,onReconnectEnd:k,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:S},N))]})}xT.displayName="EdgeRenderer";const Pre=R.memo(xT),Ure=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function qre({children:e}){const t=Ht(Ure);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Gre(e){const t=bx(),n=R.useRef(!1);R.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Vre=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Wre(e){const t=Ht(Vre),n=jn();return R.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Yre(e){return e.connection.inProgress?{...e.connection,to:Th(e.connection.to,e.transform)}:{...e.connection}}function Xre(e){return Yre}function Kre(e){const t=Xre();return Ht(t,Tn)}const Zre=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Qre({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:a,height:o,isValid:l,inProgress:c}=Ht(Zre,Tn);return!(a&&i&&c)?null:h.jsx("svg",{style:e,width:a,height:o,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:sr(["react-flow__connection",_A(l)]),children:h.jsx(yT,{style:t,type:n,CustomComponent:r,isValid:l})})})}const yT=({style:e,type:t=Ro.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:a,fromNode:o,fromHandle:l,fromPosition:c,to:d,toNode:m,toHandle:f,toPosition:g,pointer:b}=Kre();if(!i)return;if(n)return h.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:a.x,fromY:a.y,toX:d.x,toY:d.y,fromPosition:c,toPosition:g,connectionStatus:_A(r),toNode:m,toHandle:f,pointer:b});let k="";const S={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:d.x,targetY:d.y,targetPosition:g};switch(t){case Ro.Bezier:[k]=RA(S);break;case Ro.SimpleBezier:[k]=lT(S);break;case Ro.Step:[k]=Zv({...S,borderRadius:0});break;case Ro.SmoothStep:[k]=Zv(S);break;default:[k]=LA(S)}return h.jsx("path",{d:k,fill:"none",className:"react-flow__connection-path",style:e})};yT.displayName="ConnectionLine";const Jre={};function H8(e=Jre){R.useRef(e),jn(),R.useEffect(()=>{},[e])}function eie(){jn(),R.useRef(!1),R.useEffect(()=>{},[])}function wT({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:m,onSelectionContextMenu:f,onSelectionStart:g,onSelectionEnd:b,connectionLineType:k,connectionLineStyle:S,connectionLineComponent:x,connectionLineContainerStyle:v,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:N,panActivationKeyCode:E,zoomActivationKeyCode:M,deleteKeyCode:T,onlyRenderVisibleElements:D,elementsSelectable:z,defaultViewport:$,translateExtent:F,minZoom:U,maxZoom:V,preventScrolling:X,defaultMarkerColor:Y,zoomOnScroll:Q,zoomOnPinch:te,panOnScroll:I,panOnScrollSpeed:O,panOnScrollMode:H,zoomOnDoubleClick:G,panOnDrag:W,autoPanOnSelection:re,onPaneClick:ce,onPaneMouseEnter:me,onPaneMouseMove:ne,onPaneMouseLeave:B,onPaneScroll:se,onPaneContextMenu:le,paneClickDistance:_e,nodeClickDistance:be,onEdgeContextMenu:Ce,onEdgeMouseEnter:Le,onEdgeMouseMove:$e,onEdgeMouseLeave:Ge,reconnectRadius:Fe,onReconnect:ut,onReconnectStart:Ke,onReconnectEnd:Ue,noDragClassName:ct,noWheelClassName:Kt,noPanClassName:Rt,disableKeyboardA11y:qe,nodeExtent:nt,rfId:ve,viewport:je,onViewportChange:Pe}){return H8(e),H8(t),eie(),Gre(n),Wre(je),h.jsx(mre,{onPaneClick:ce,onPaneMouseEnter:me,onPaneMouseMove:ne,onPaneMouseLeave:B,onPaneContextMenu:le,onPaneScroll:se,paneClickDistance:_e,deleteKeyCode:T,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,onSelectionStart:g,onSelectionEnd:b,multiSelectionKeyCode:N,panActivationKeyCode:E,zoomActivationKeyCode:M,elementsSelectable:z,zoomOnScroll:Q,zoomOnPinch:te,zoomOnDoubleClick:G,panOnScroll:I,panOnScrollSpeed:O,panOnScrollMode:H,panOnDrag:W,autoPanOnSelection:re,defaultViewport:$,translateExtent:F,minZoom:U,maxZoom:V,onSelectionContextMenu:f,preventScrolling:X,noDragClassName:ct,noWheelClassName:Kt,noPanClassName:Rt,disableKeyboardA11y:qe,onViewportChange:Pe,isControlledViewport:!!je,children:h.jsxs(qre,{children:[h.jsx(Pre,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:ut,onReconnectStart:Ke,onReconnectEnd:Ue,onlyRenderVisibleElements:D,onEdgeContextMenu:Ce,onEdgeMouseEnter:Le,onEdgeMouseMove:$e,onEdgeMouseLeave:Ge,reconnectRadius:Fe,defaultMarkerColor:Y,noPanClassName:Rt,disableKeyboardA11y:qe,rfId:ve}),h.jsx(Qre,{style:S,type:k,component:x,containerStyle:v}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(kre,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:m,nodeClickDistance:be,onlyRenderVisibleElements:D,noPanClassName:Rt,noDragClassName:ct,disableKeyboardA11y:qe,nodeExtent:nt,rfId:ve}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}wT.displayName="GraphView";const tie=R.memo(wT),nie=CA(),$8=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:d=2,nodeOrigin:m,nodeExtent:f,zIndexMode:g="basic"}={})=>{const b=new Map,k=new Map,S=new Map,x=new Map,v=r??t??[],w=n??e??[],y=m??[0,0],C=f??Xd;zA(S,x,v);const{nodesInitialized:N}=Jv(w,b,k,{nodeOrigin:y,nodeExtent:C,zIndexMode:g});let E=[0,0,1];if(o&&i&&a){const M=Eh(b,{filter:$=>!!(($.width||$.initialWidth)&&($.height||$.initialHeight))}),{x:T,y:D,zoom:z}=ux(M,i,a,c,d,(l==null?void 0:l.padding)??.1);E=[T,D,z]}return{rfId:"1",width:i??0,height:a??0,transform:E,nodes:w,nodesInitialized:N,nodeLookup:b,parentLookup:k,edges:v,edgeLookup:x,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:d,translateExtent:Xd,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:nu.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:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...vA},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:nie,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:bA,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},rie=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:m,nodeExtent:f,zIndexMode:g})=>fne((b,k)=>{async function S(){const{nodeLookup:x,panZoom:v,fitViewOptions:w,fitViewResolver:y,width:C,height:N,minZoom:E,maxZoom:M}=k();v&&(await cte({nodes:x,width:C,height:N,panZoom:v,minZoom:E,maxZoom:M},w),y==null||y.resolve(!0),b({fitViewResolver:null}))}return{...$8({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:m,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:x=>{const{nodeLookup:v,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:N,zIndexMode:E,nodesSelectionActive:M}=k(),{nodesInitialized:T,hasSelectedNodes:D}=Jv(x,v,w,{nodeOrigin:y,nodeExtent:f,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:E}),z=M&&D;N&&T?(S(),b({nodes:x,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:z})):b({nodes:x,nodesInitialized:T,nodesSelectionActive:z})},setEdges:x=>{const{connectionLookup:v,edgeLookup:w}=k();zA(v,w,x),b({edges:x})},setDefaultNodesAndEdges:(x,v)=>{if(x){const{setNodes:w}=k();w(x),b({hasDefaultNodes:!0})}if(v){const{setEdges:w}=k();w(v),b({hasDefaultEdges:!0})}},updateNodeInternals:x=>{const{triggerNodeChanges:v,nodeLookup:w,parentLookup:y,domNode:C,nodeOrigin:N,nodeExtent:E,debug:M,fitViewQueued:T,zIndexMode:D}=k(),{changes:z,updatedInternals:$}=Rte(x,w,y,C,N,E,D);$&&(Tte(w,y,{nodeOrigin:N,nodeExtent:E,zIndexMode:D}),T?(S(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),(z==null?void 0:z.length)>0&&(M&&console.log("React Flow: trigger node changes",z),v==null||v(z)))},updateNodePositions:(x,v=!1)=>{const w=[];let y=[];const{nodeLookup:C,triggerNodeChanges:N,connection:E,updateConnection:M,onNodesChangeMiddlewareMap:T}=k();for(const[D,z]of x){const $=C.get(D),F=!!($!=null&&$.expandParent&&($!=null&&$.parentId)&&(z!=null&&z.position)),U={id:D,type:"position",position:F?{x:Math.max(0,z.position.x),y:Math.max(0,z.position.y)}:z.position,dragging:v};if($&&E.inProgress&&E.fromNode.id===$.id){const V=zl($,E.fromHandle,at.Left,!0);M({...E,from:V})}F&&$.parentId&&w.push({id:D,parentId:$.parentId,rect:{...z.internals.positionAbsolute,width:z.measured.width??0,height:z.measured.height??0}}),y.push(U)}if(w.length>0){const{parentLookup:D,nodeOrigin:z}=k(),$=gx(w,C,D,z);y.push(...$)}for(const D of T.values())y=D(y);N(y)},triggerNodeChanges:x=>{const{onNodesChange:v,setNodes:w,nodes:y,hasDefaultNodes:C,debug:N}=k();if(x!=null&&x.length){if(C){const E=Lne(x,y);w(E)}N&&console.log("React Flow: trigger node changes",x),v==null||v(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:v,setEdges:w,edges:y,hasDefaultEdges:C,debug:N}=k();if(x!=null&&x.length){if(C){const E=One(x,y);w(E)}N&&console.log("React Flow: trigger edge changes",x),v==null||v(x)}},addSelectedNodes:x=>{const{multiSelectionActive:v,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:N}=k();if(v){const E=x.map(M=>xl(M,!0));C(E);return}C(Ic(y,new Set([...x]),!0)),N(Ic(w))},addSelectedEdges:x=>{const{multiSelectionActive:v,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:N}=k();if(v){const E=x.map(M=>xl(M,!0));N(E);return}N(Ic(w,new Set([...x]))),C(Ic(y,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:v}={})=>{const{edges:w,nodes:y,nodeLookup:C,triggerNodeChanges:N,triggerEdgeChanges:E}=k(),M=x||y,T=v||w,D=[];for(const $ of M){if(!$.selected)continue;const F=C.get($.id);F&&(F.selected=!1),D.push(xl($.id,!1))}const z=[];for(const $ of T)$.selected&&z.push(xl($.id,!1));N(D),E(z)},setMinZoom:x=>{const{panZoom:v,maxZoom:w}=k();v==null||v.setScaleExtent([x,w]),b({minZoom:x})},setMaxZoom:x=>{const{panZoom:v,minZoom:w}=k();v==null||v.setScaleExtent([w,x]),b({maxZoom:x})},setTranslateExtent:x=>{var v;(v=k().panZoom)==null||v.setTranslateExtent(x),b({translateExtent:x})},resetSelectedElements:()=>{const{edges:x,nodes:v,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:C}=k();if(!C)return;const N=v.reduce((M,T)=>T.selected?[...M,xl(T.id,!1)]:M,[]),E=x.reduce((M,T)=>T.selected?[...M,xl(T.id,!1)]:M,[]);w(N),y(E)},setNodeExtent:x=>{const{nodes:v,nodeLookup:w,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:N,nodeExtent:E,zIndexMode:M}=k();x[0][0]===E[0][0]&&x[0][1]===E[0][1]&&x[1][0]===E[1][0]&&x[1][1]===E[1][1]||(Jv(v,w,y,{nodeOrigin:C,nodeExtent:x,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:M}),b({nodeExtent:x}))},panBy:x=>{const{transform:v,width:w,height:y,panZoom:C,translateExtent:N}=k();return Dte({delta:x,panZoom:C,transform:v,translateExtent:N,width:w,height:y})},setCenter:async(x,v,w)=>{const{width:y,height:C,maxZoom:N,panZoom:E}=k();if(!E)return!1;const M=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:N;return await E.setViewport({x:y/2-x*M,y:C/2-v*M,zoom:M},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{b({connection:{...vA}})},updateConnection:x=>{b({connection:x})},reset:()=>b({...$8()})}},Object.is);function iie({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:d,nodeOrigin:m,nodeExtent:f,zIndexMode:g,children:b}){const[k]=R.useState(()=>rie({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:d,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:m,nodeExtent:f,zIndexMode:g}));return h.jsx(pne,{value:k,children:h.jsx(Fne,{children:h.jsx(nre,{children:b})})})}function sie({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:l,fitViewOptions:c,minZoom:d,maxZoom:m,nodeOrigin:f,nodeExtent:g,zIndexMode:b}){return R.useContext(im)?h.jsx(h.Fragment,{children:e}):h.jsx(iie,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:d,initialMaxZoom:m,nodeOrigin:f,nodeExtent:g,zIndexMode:b,children:e})}const aie={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function oie({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:d,onMove:m,onMoveStart:f,onMoveEnd:g,onConnect:b,onConnectStart:k,onConnectEnd:S,onClickConnectStart:x,onClickConnectEnd:v,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:N,onNodeDoubleClick:E,onNodeDragStart:M,onNodeDrag:T,onNodeDragStop:D,onNodesDelete:z,onEdgesDelete:$,onDelete:F,onSelectionChange:U,onSelectionDragStart:V,onSelectionDrag:X,onSelectionDragStop:Y,onSelectionContextMenu:Q,onSelectionStart:te,onSelectionEnd:I,onBeforeDelete:O,connectionMode:H,connectionLineType:G=Ro.Bezier,connectionLineStyle:W,connectionLineComponent:re,connectionLineContainerStyle:ce,deleteKeyCode:me="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:B=!1,selectionMode:se=Kd.Full,panActivationKeyCode:le="Space",multiSelectionKeyCode:_e=Qd()?"Meta":"Control",zoomActivationKeyCode:be=Qd()?"Meta":"Control",snapToGrid:Ce,snapGrid:Le,onlyRenderVisibleElements:$e=!1,selectNodesOnDrag:Ge,nodesDraggable:Fe,autoPanOnNodeFocus:ut,nodesConnectable:Ke,nodesFocusable:Ue,nodeOrigin:ct=KA,edgesFocusable:Kt,edgesReconnectable:Rt,elementsSelectable:qe=!0,defaultViewport:nt=Ane,minZoom:ve=.5,maxZoom:je=2,translateExtent:Pe=Xd,preventScrolling:Ze=!0,nodeExtent:De,defaultMarkerColor:et="#b1b1b7",zoomOnScroll:rt=!0,zoomOnPinch:At=!0,panOnScroll:xt=!1,panOnScrollSpeed:Xt=.5,panOnScrollMode:dt=Ml.Free,zoomOnDoubleClick:rn=!0,panOnDrag:mn=!0,onPaneClick:qn,onPaneMouseEnter:Ui,onPaneMouseMove:qi,onPaneMouseLeave:Ts,onPaneScroll:Tr,onPaneContextMenu:hi,paneClickDistance:pr=1,nodeClickDistance:Yo=0,children:Zr,onReconnect:Zt,onReconnectStart:ln,onReconnectEnd:fi,onEdgeContextMenu:oa,onEdgeDoubleClick:Ns,onEdgeMouseEnter:ls,onEdgeMouseMove:Nr,onEdgeMouseLeave:_r,reconnectRadius:xr=10,onNodesChange:pi,onEdgesChange:Mn,noDragClassName:ft="nodrag",noWheelClassName:vt="nowheel",noPanClassName:yn="nopan",fitView:Ve,fitViewOptions:wt,connectOnClick:la,attributionPosition:zn,proOptions:mi,defaultEdgeOptions:Ir,elevateNodesOnSelect:zr=!0,elevateEdgesOnSelect:jr=!1,disableKeyboardA11y:$t=!1,autoPanOnConnect:Gn,autoPanOnNodeDrag:Qt,autoPanOnSelection:ar=!0,autoPanSpeed:gi,connectionRadius:Br,isValidConnection:Qr,onError:cs,style:us,id:ca,nodeDragThreshold:Ya,connectionDragThreshold:Vn,viewport:bi,onViewportChange:mr,width:Rn,height:or,colorMode:Dn="light",debug:js,onScroll:Gi,ariaLabelConfig:Hr,zIndexMode:Xa="basic",...wn},Vi){const Jt=ca||"1",Ms=Mne(Dn),gn=R.useCallback(Wn=>{Wn.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Gi==null||Gi(Wn)},[Gi]);return h.jsx("div",{"data-testid":"rf__wrapper",...wn,onScroll:gn,style:{...us,...aie},ref:Vi,className:sr(["react-flow",i,Ms]),id:ca,role:"application",children:h.jsxs(sie,{nodes:e,edges:t,width:Rn,height:or,fitView:Ve,fitViewOptions:wt,minZoom:ve,maxZoom:je,nodeOrigin:ct,nodeExtent:De,zIndexMode:Xa,children:[h.jsx(jne,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:b,onConnectStart:k,onConnectEnd:S,onClickConnectStart:x,onClickConnectEnd:v,nodesDraggable:Fe,autoPanOnNodeFocus:ut,nodesConnectable:Ke,nodesFocusable:Ue,edgesFocusable:Kt,edgesReconnectable:Rt,elementsSelectable:qe,elevateNodesOnSelect:zr,elevateEdgesOnSelect:jr,minZoom:ve,maxZoom:je,nodeExtent:De,onNodesChange:pi,onEdgesChange:Mn,snapToGrid:Ce,snapGrid:Le,connectionMode:H,translateExtent:Pe,connectOnClick:la,defaultEdgeOptions:Ir,fitView:Ve,fitViewOptions:wt,onNodesDelete:z,onEdgesDelete:$,onDelete:F,onNodeDragStart:M,onNodeDrag:T,onNodeDragStop:D,onSelectionDrag:X,onSelectionDragStart:V,onSelectionDragStop:Y,onMove:m,onMoveStart:f,onMoveEnd:g,noPanClassName:yn,nodeOrigin:ct,rfId:Jt,autoPanOnConnect:Gn,autoPanOnNodeDrag:Qt,autoPanSpeed:gi,onError:cs,connectionRadius:Br,isValidConnection:Qr,selectNodesOnDrag:Ge,nodeDragThreshold:Ya,connectionDragThreshold:Vn,onBeforeDelete:O,debug:js,ariaLabelConfig:Hr,zIndexMode:Xa}),h.jsx(tie,{onInit:d,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:N,onNodeDoubleClick:E,nodeTypes:a,edgeTypes:o,connectionLineType:G,connectionLineStyle:W,connectionLineComponent:re,connectionLineContainerStyle:ce,selectionKeyCode:ne,selectionOnDrag:B,selectionMode:se,deleteKeyCode:me,multiSelectionKeyCode:_e,panActivationKeyCode:le,zoomActivationKeyCode:be,onlyRenderVisibleElements:$e,defaultViewport:nt,translateExtent:Pe,minZoom:ve,maxZoom:je,preventScrolling:Ze,zoomOnScroll:rt,zoomOnPinch:At,zoomOnDoubleClick:rn,panOnScroll:xt,panOnScrollSpeed:Xt,panOnScrollMode:dt,panOnDrag:mn,autoPanOnSelection:ar,onPaneClick:qn,onPaneMouseEnter:Ui,onPaneMouseMove:qi,onPaneMouseLeave:Ts,onPaneScroll:Tr,onPaneContextMenu:hi,paneClickDistance:pr,nodeClickDistance:Yo,onSelectionContextMenu:Q,onSelectionStart:te,onSelectionEnd:I,onReconnect:Zt,onReconnectStart:ln,onReconnectEnd:fi,onEdgeContextMenu:oa,onEdgeDoubleClick:Ns,onEdgeMouseEnter:ls,onEdgeMouseMove:Nr,onEdgeMouseLeave:_r,reconnectRadius:xr,defaultMarkerColor:et,noDragClassName:ft,noWheelClassName:vt,noPanClassName:yn,rfId:Jt,disableKeyboardA11y:$t,nodeExtent:De,viewport:bi,onViewportChange:mr}),h.jsx(Ene,{onSelectionChange:U}),Zr,h.jsx(yne,{proOptions:mi,position:zn}),h.jsx(xne,{rfId:Jt,disableKeyboardA11y:$t})]})})}var lie=QA(oie);function cie({dimensions:e,lineWidth:t,variant:n,className:r}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:sr(["react-flow__background-pattern",n,r])})}function uie({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:sr(["react-flow__background-pattern","dots",t])})}var Oa;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Oa||(Oa={}));const die={[Oa.Dots]:1,[Oa.Lines]:1,[Oa.Cross]:6},hie=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ST({id:e,variant:t=Oa.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:l,style:c,className:d,patternClassName:m}){const f=R.useRef(null),{transform:g,patternId:b}=Ht(hie,Tn),k=r||die[t],S=t===Oa.Dots,x=t===Oa.Cross,v=Array.isArray(n)?n:[n,n],w=[v[0]*g[2]||1,v[1]*g[2]||1],y=k*g[2],C=Array.isArray(a)?a:[a,a],N=x?[y,y]:w,E=[C[0]*g[2]||1+N[0]/2,C[1]*g[2]||1+N[1]/2],M=`${b}${e||""}`;return h.jsxs("svg",{className:sr(["react-flow__background",d]),style:{...c,...am,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:f,"data-testid":"rf__background",children:[h.jsx("pattern",{id:M,x:g[0]%w[0],y:g[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:S?h.jsx(uie,{radius:y/2,className:m}):h.jsx(cie,{dimensions:N,lineWidth:i,variant:t,className:m})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${M})`})]})}ST.displayName="Background";const fie=R.memo(ST);function pie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function mie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function gie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.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 bie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 vie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 of({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:sr(["react-flow__controls-button",t]),...n,children:e})}const _ie=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function kT({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:d,children:m,position:f="bottom-left",orientation:g="vertical","aria-label":b}){const k=jn(),{isInteractive:S,minZoomReached:x,maxZoomReached:v,ariaLabelConfig:w}=Ht(_ie,Tn),{zoomIn:y,zoomOut:C,fitView:N}=bx(),E=()=>{y(),a==null||a()},M=()=>{C(),o==null||o()},T=()=>{N(i),l==null||l()},D=()=>{k.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),c==null||c(!S)},z=g==="horizontal"?"horizontal":"vertical";return h.jsxs(sm,{className:sr(["react-flow__controls",z,d]),position:f,style:e,"data-testid":"rf__controls","aria-label":b??w["controls.ariaLabel"],children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(of,{onClick:E,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:v,children:h.jsx(pie,{})}),h.jsx(of,{onClick:M,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:x,children:h.jsx(mie,{})})]}),n&&h.jsx(of,{className:"react-flow__controls-fitview",onClick:T,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:h.jsx(gie,{})}),r&&h.jsx(of,{className:"react-flow__controls-interactive",onClick:D,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:S?h.jsx(vie,{}):h.jsx(bie,{})}),m]})}kT.displayName="Controls";R.memo(kT);function xie({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:l,strokeWidth:c,className:d,borderRadius:m,shapeRendering:f,selected:g,onClick:b}){const{background:k,backgroundColor:S}=a||{},x=o||k||S;return h.jsx("rect",{className:sr(["react-flow__minimap-node",{selected:g},d]),x:t,y:n,rx:m,ry:m,width:r,height:i,style:{fill:x,stroke:l,strokeWidth:c},shapeRendering:f,onClick:b?v=>b(v,e):void 0})}const yie=R.memo(xie),wie=e=>e.nodes.map(t=>t.id),Cb=e=>e instanceof Function?e:()=>e;function Sie({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=yie,onClick:o}){const l=Ht(wie,Tn),c=Cb(t),d=Cb(e),m=Cb(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:l.map(g=>h.jsx(Cie,{id:g,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:m,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:f},g))})}function kie({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:d,x:m,y:f,width:g,height:b}=Ht(k=>{const S=k.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const x=S.internals.userNode,{x:v,y:w}=S.internals.positionAbsolute,{width:y,height:C}=Wa(x);return{node:x,x:v,y:w,width:y,height:C}},Tn);return!d||d.hidden||!EA(d)?null:h.jsx(l,{x:m,y:f,width:g,height:b,style:d.style,selected:!!d.selected,className:r(d),color:t(d),borderRadius:i,strokeColor:n(d),strokeWidth:a,shapeRendering:o,onClick:c,id:d.id})}const Cie=R.memo(kie);var Eie=R.memo(Sie);const Aie=200,Tie=150,Nie=e=>!e.hidden,jie=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?SA(Eh(e.nodeLookup,{filter:Nie}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Mie="react-flow__minimap-desc";function CT({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:d,maskStrokeColor:m,maskStrokeWidth:f,position:g="bottom-right",onClick:b,onNodeClick:k,pannable:S=!1,zoomable:x=!1,ariaLabel:v,inversePan:w,zoomStep:y=1,offsetScale:C=5}){const N=jn(),E=R.useRef(null),{boundingRect:M,viewBB:T,rfId:D,panZoom:z,translateExtent:$,flowWidth:F,flowHeight:U,ariaLabelConfig:V}=Ht(jie,Tn),X=(e==null?void 0:e.width)??Aie,Y=(e==null?void 0:e.height)??Tie,Q=M.width/X,te=M.height/Y,I=Math.max(Q,te),O=I*X,H=I*Y,G=C*I,W=M.x-(O-M.width)/2-G,re=M.y-(H-M.height)/2-G,ce=O+G*2,me=H+G*2,ne=`${Mie}-${D}`,B=R.useRef(0),se=R.useRef();B.current=I,R.useEffect(()=>{if(E.current&&z)return se.current=Pte({domNode:E.current,panZoom:z,getTransform:()=>N.getState().transform,getViewScale:()=>B.current}),()=>{var Ce;(Ce=se.current)==null||Ce.destroy()}},[z]),R.useEffect(()=>{var Ce;(Ce=se.current)==null||Ce.update({translateExtent:$,width:F,height:U,inversePan:w,pannable:S,zoomStep:y,zoomable:x})},[S,x,w,y,$,F,U]);const le=b?Ce=>{var Ge;const[Le,$e]=((Ge=se.current)==null?void 0:Ge.pointer(Ce))||[0,0];b(Ce,{x:Le,y:$e})}:void 0,_e=k?R.useCallback((Ce,Le)=>{const $e=N.getState().nodeLookup.get(Le).internals.userNode;k(Ce,$e)},[]):void 0,be=v??V["minimap.ariaLabel"];return h.jsx(sm,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*I: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 o=="number"?o:void 0},className:sr(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:X,height:Y,viewBox:`${W} ${re} ${ce} ${me}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:E,onClick:le,children:[be&&h.jsx("title",{id:ne,children:be}),h.jsx(Eie,{onClick:_e,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:l}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-G},${re-G}h${ce+G*2}v${me+G*2}h${-ce-G*2}z + M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}CT.displayName="MiniMap";R.memo(CT);const Rie=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Die={[su.Line]:"right",[su.Handle]:"bottom-right"};function Lie({nodeId:e,position:t,variant:n=su.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:l=10,minHeight:c=10,maxWidth:d=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:g,autoScale:b=!0,shouldResize:k,onResizeStart:S,onResize:x,onResizeEnd:v}){const w=nT(),y=typeof e=="string"?e:w,C=jn(),N=R.useRef(null),E=n===su.Handle,M=Ht(R.useCallback(Rie(E&&b),[E,b]),Tn),T=R.useRef(null),D=t??Die[n];R.useEffect(()=>{if(!(!N.current||!y))return T.current||(T.current=tne({domNode:N.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:$,transform:F,snapGrid:U,snapToGrid:V,nodeOrigin:X,domNode:Y}=C.getState();return{nodeLookup:$,transform:F,snapGrid:U,snapToGrid:V,nodeOrigin:X,paneDomNode:Y}},onChange:($,F)=>{const{triggerNodeChanges:U,nodeLookup:V,parentLookup:X,nodeOrigin:Y}=C.getState(),Q=[],te={x:$.x,y:$.y},I=V.get(y);if(I&&I.expandParent&&I.parentId){const O=I.origin??Y,H=$.width??I.measured.width??0,G=$.height??I.measured.height??0,W={id:I.id,parentId:I.parentId,rect:{width:H,height:G,...AA({x:$.x??I.position.x,y:$.y??I.position.y},{width:H,height:G},I.parentId,V,O)}},re=gx([W],V,X,Y);Q.push(...re),te.x=$.x?Math.max(O[0]*H,$.x):void 0,te.y=$.y?Math.max(O[1]*G,$.y):void 0}if(te.x!==void 0&&te.y!==void 0){const O={id:y,type:"position",position:{...te}};Q.push(O)}if($.width!==void 0&&$.height!==void 0){const H={id:y,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:$.width,height:$.height}};Q.push(H)}for(const O of F){const H={...O,type:"position"};Q.push(H)}U(Q)},onEnd:({width:$,height:F})=>{const U={id:y,type:"dimensions",resizing:!1,dimensions:{width:$,height:F}};C.getState().triggerNodeChanges([U])}})),T.current.update({controlPosition:D,boundaries:{minWidth:l,minHeight:c,maxWidth:d,maxHeight:m},keepAspectRatio:f,resizeDirection:g,onResizeStart:S,onResize:x,onResizeEnd:v,shouldResize:k}),()=>{var $;($=T.current)==null||$.destroy()}},[D,l,c,d,m,f,S,x,v,k]);const z=D.split("-");return h.jsx("div",{className:sr(["react-flow__resize-control","nodrag",...z,n,r]),ref:N,style:{...i,scale:M,...o&&{[E?"backgroundColor":"borderColor"]:o}},children:a})}R.memo(Lie);function Oie(){const[e,t]=R.useState(0),[n,r]=R.useState(0);return{ref:R.useCallback(a=>{if(!a)return;function o(){t(a.offsetWidth),r(a.offsetHeight)}const l=new ResizeObserver(o),c=new MutationObserver(o);return l.observe(a),c.observe(a,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),o(),()=>{l.disconnect(),c.disconnect()}},[]),offsetWidth:e,offsetHeight:n}}const lf=8;function Iie(e,t){const{offsetWidth:n,offsetHeight:r}=t,[{viewHeight:i,viewWidth:a},o]=R.useState({viewWidth:0,viewHeight:0});R.useEffect(()=>{function m(){o({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",m),m(),()=>window.removeEventListener("resize",m)},[]);let l=0,c=0,d=0;if(e){const{distance:m}=e;switch(e.anchor){case"left":l=e.x-n-m,c=e.y+e.height/2-r/2;break;case"right":l=e.x+e.width+m,c=e.y+e.height/2-r/2;break;case"below":l=e.x+e.width/2-n/2,c=e.y+e.height+m;break;case"above":l=e.x+e.width/2-n/2,c=e.y-r-m;break}const f=l,g=c;l=Math.min(Math.max(l,lf),a-n-lf),c=Math.min(Math.max(c,lf),i-r-lf),d=e.anchor==="left"||e.anchor==="right"?g-c:f-l}return{x:l,y:c,arrowAdjustment:d}}const Eb=380,Ab=12,zie=350,Bie=150,n_=new EventTarget;function Hie(){n_.dispatchEvent(new Event("move"))}function $ie(e,t){const[n,r]=R.useState(null),i=R.useRef(void 0),a=R.useRef(void 0);R.useEffect(()=>{const d=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current),r(null)};return n_.addEventListener("move",d),()=>{n_.removeEventListener("move",d),window.clearTimeout(i.current),window.clearTimeout(a.current)}},[]),R.useEffect(()=>{r(d=>{var f;if(!d)return d;const m=((f=e.current)==null?void 0:f.getBoundingClientRect())??null;return m&&d.x===m.x&&d.y===m.y&&d.width===m.width&&d.height===m.height?d:m})},[e,t]);const o=R.useCallback(()=>{window.clearTimeout(a.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>{var d;r(((d=e.current)==null?void 0:d.getBoundingClientRect())??null)},zie)},[e]),l=R.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(a.current),a.current=window.setTimeout(()=>r(null),Bie)},[]),c=R.useCallback(()=>window.clearTimeout(a.current),[]);return{rect:n,onMouseEnter:o,onMouseLeave:l,keepOpen:c}}function Fie(e){const t=new Date(e),n=t.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return t.toLocaleDateString(void 0,n)}function Pie({exp:e,runs:t,latestRun:n,parentSlug:r,anchor:i,onOpenLogs:a,onOpenCode:o,onMouseEnter:l,onMouseLeave:c}){const d=Oie(),m=i.right+Ab+Eb<=window.innerWidth,f=i.x-Ab-Eb>=0,g=m?"right":f?"left":i.y>window.innerHeight/2?"above":"below",{x:b,y:k}=Iie({x:i.x,y:i.y,width:i.width,height:i.height,anchor:g,distance:Ab},d),[S,x]=R.useState(null),v=e.parentExperimentId&&(n!=null&&n.commitSha)?n.id:null;R.useEffect(()=>{if(x(null),!v)return;let $=!1;return BR(v).then(F=>{let U=F.diff;if(F.truncated){const Q=U.lastIndexOf(` diff --git `);U=Q!==-1?U.slice(0,Q+1):U.slice(0,U.lastIndexOf(` -`)+1)}let V=[];try{V=U.trim()?Av(U):[]}catch{return}if(F.truncated&&V.every(Q=>Q.hunks.length===0))return;let X=0,Y=0;for(const Q of V){const te=Y2(Q);X+=te.additions,Y+=te.deletions}$||x({fileCount:V.length,additions:X,deletions:Y,truncated:F.truncated})}).catch(()=>{}),()=>{$=!0}},[_]);const w={done:0,failed:0,cancelled:0,live:0};for(const $ of t)$.status==="done"?w.done+=1:$.status==="failed"?w.failed+=1:$.status==="cancelled"?w.cancelled+=1:w.live+=1;const y=n?Rf((n.endedAt??Date.now())-n.createdAt):null,C=(n==null?void 0:n.status)==="failed"&&n.resultMarkdown?n.resultMarkdown:null,T=e.description||(C?null:n==null?void 0:n.resultMarkdown)||null,E=R.useRef(null),[j,N]=R.useState(!1),[D,z]=R.useState(!1);return R.useEffect(()=>{N(!1)},[T]),R.useEffect(()=>{const $=E.current;$&&z($.scrollHeight>$.clientHeight+1)},[T,j]),RE.createPortal(h.jsxs("div",{ref:d.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] py-3.5 px-4 text-sm text-text [&_.hc-mono]:font-mono [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:font-mono [&_.hc-slug]:text-md [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-[color-mix(in_oklab,_var(--border)_55%,_var(--text))] [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-xs [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:font-mono [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-2xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-mono]:min-w-0 [&_.hc-foot_.hc-mono]:overflow-hidden [&_.hc-foot_.hc-mono]:text-ellipsis [&_.hc-foot_.hc-mono]:whitespace-nowrap",style:{width:Sb,left:b,top:k,visibility:d.offsetHeight===0?"hidden":void 0},onMouseEnter:l,onMouseLeave:u,children:[h.jsxs("div",{className:"hc-head",children:[h.jsx("span",{className:"hc-slug",children:e.slug}),h.jsx(La,{status:n?ls(n):"idle"})]}),e.title&&h.jsx("div",{className:"hc-title",children:e.title}),h.jsxs("div",{className:"hc-actions",children:[a&&h.jsxs("button",{type:"button",onClick:a,children:[h.jsx(Wc,{size:13}),"Logs"]}),h.jsxs("button",{type:"button",onClick:o,children:[h.jsx(ap,{size:13}),"Code"]})]}),T&&h.jsx("div",{className:`hc-body${j?" expanded":""}`,ref:E,children:T}),T&&(D||j)&&h.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>N($=>!$),children:j?"Show less":"Show more"}),C&&h.jsx("div",{className:"hc-failure",children:C}),h.jsxs("div",{className:"hc-stats",children:[h.jsxs("span",{children:[t.length===1?"1 run":`${t.length} runs`,w.done>0&&` · ${w.done} done`,w.failed>0&&` · ${w.failed} failed`,w.cancelled>0&&` · ${w.cancelled} cancelled`,w.live>0&&` · ${w.live} live`]}),n&&l_(n.backend)&&h.jsx(j2,{backend:n.backend}),y&&h.jsx("span",{children:y}),n&&h.jsx("span",{children:Zs(n.createdAt)})]}),h.jsxs("div",{className:"hc-git",children:[h.jsxs("div",{className:"hc-git-row",children:[h.jsxs("span",{className:"hc-branch",title:e.branchName,children:[h.jsx(oh,{size:12}),e.branchName]}),r&&h.jsxs("span",{children:["from ",h.jsx("span",{className:"hc-mono",children:r})]})]}),S&&S.fileCount>0&&h.jsx("div",{className:"hc-git-row",title:`Committed changes vs ${r??"parent"}${S.truncated?" (diff truncated — counts are lower bounds)":""}`,children:h.jsxs("span",{children:[S.truncated&&"≥ ",h.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",S.additions]})," ",h.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",S.deletions]})," · ",S.fileCount===1&&!S.truncated?"1 file":`${S.fileCount}${S.truncated?"+":""} files`]})})]}),h.jsxs("div",{className:"hc-foot",children:[h.jsxs("span",{className:"hc-mono",children:["$ ",e.runCommand]}),h.jsxs("span",{children:["created ",Lie(e.createdAt)]})]})]}),document.body)}const $8=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-md [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),Iie=264,F8=132,Cf=44,zie=72,Bie=148,Hie=44;function $ie(e){const t=new Map(e.map(a=>[a.id,{exp:a,children:[]}])),n=[];for(const a of e){const o=t.get(a.id),l=a.parentExperimentId?t.get(a.parentExperimentId):void 0;l?l.children.push(o):n.push(o)}const r=(a,o)=>a.exp.createdAt-o.exp.createdAt,i=a=>{a.children.sort(r),a.children.forEach(i)};return n.sort(r),n.forEach(i),n}function Fie(e,t){const n=new Map,r=l=>{const u=n.get(l)??1+l.children.reduce((d,m)=>d+r(m),0);return n.set(l,u),u},i=new Map,a=l=>{const u=i.get(l)??(t(l)||l.children.some(a));return i.set(l,u),u};function o(l){if(t(l)){const m=[];let f=0;for(const g of l.children)a(g)?m.push(...o(g)):f+=r(g);return f>0&&m.push({kind:"elided",id:`el-${l.exp.id}`,count:f,children:[]}),[{kind:"exp",exp:l.exp,children:m}]}if(!a(l))return[];let u=0;const d=[];return(function m(f){u+=1;for(const g of f.children)t(g)?d.push(...o(g)):a(g)?m(g):u+=r(g)})(l),[{kind:"elided",id:`el-${l.exp.id}`,count:u,children:d}]}return e.flatMap(o)}function e_(e){return e.kind==="exp"?Iie:Bie}function lf(e){return e.kind==="exp"?e.exp.id:e.id}function Ef(e){if(e.children.length===0)return e_(e);const t=e.children.reduce((n,r)=>n+Ef(r),0)+Cf*(e.children.length-1);return Math.max(e_(e),t)}function Pie(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const Uie=R.memo(function({data:t}){const{exp:n,latestRun:r,runs:i,isBaseline:a,parentSlug:o,githubOwner:l,githubRepo:u,onOpenView:d,onOpenCode:m}=t,f=r?ls(r):void 0,g=f==="running"||f==="starting"||f==="cancelling",b=a?"Baseline":g?"Running":"Experiment",k=i.slice(-8),S=R.useRef(null),x=Die(S,t);return h.jsxs("div",{ref:S,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-[0_1px_2px_rgba(0,_0,_0,_0.04)] text-md transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-[0_2px_8px_rgba(0,_0,_0,_0.08)] [&.live]:border-accent-teal [&.live]:shadow-[0_2px_12px_rgba(32,_154,_132,_0.2)] [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-left [&_.node-overview-link]:cursor-pointer [&_.node-overview-link:hover_.node-slug]:underline [&_.node-overview-link:hover_.node-slug]:underline-offset-[3px] [&_.node-overview-link:focus-visible]:outline-2 [&_.node-overview-link:focus-visible]:outline-solid [&_.node-overview-link:focus-visible]:outline-accent [&_.node-overview-link:focus-visible]:outline-offset-4 [&_.node-overview-link:focus-visible]:rounded-xs [&_.node-eyebrow]:flex [&_.node-eyebrow]:items-center [&_.node-eyebrow]:justify-between [&_.node-eyebrow]:gap-2 [&_.node-eyebrow]:mb-1.5 [&_.node-eyebrow]:text-2xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:font-mono [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-2xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-xs [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ml-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${g?"live":""}`,onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,children:[h.jsx(Po,{type:"target",position:at.Top}),h.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",onClick:()=>d(n.id,"overview"),onKeyDown:_=>{_.key!=="Enter"&&_.key!==" "||(_.preventDefault(),d(n.id,"overview"))},children:[h.jsxs("div",{className:"node-eyebrow",children:[h.jsx("span",{children:b}),h.jsx(La,{status:f??"idle"})]}),h.jsx("div",{className:"node-head",children:h.jsx("span",{className:"node-slug",children:n.slug})}),(n.title||n.description)&&h.jsx("div",{className:"node-title",children:n.title||n.description}),h.jsxs("div",{className:"node-meta",children:[h.jsx("span",{children:"Runs"}),k.length>0?h.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:k.map(_=>h.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-[color-mix(in_oklab,_var(--accent-red)_55%,_transparent)] [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${Pie(ls(_))}`,title:ls(_)},_.id))}):h.jsx("span",{children:"no runs"}),h.jsx("span",{style:{flex:1}}),r&&h.jsx("span",{children:Zs(r.createdAt)})]})]}),h.jsxs("div",{className:"node-actions",onClick:_=>_.stopPropagation(),children:[i.length>0&&h.jsxs("button",{className:"node-action",title:"Open logs",onClick:()=>d(n.id,"terminal"),children:[h.jsx(Wc,{size:13}),"Logs"]}),h.jsxs("button",{className:"node-action",title:`Browse code on ${n.branchName}`,onClick:()=>m(n.id,n.branchName,"files"),children:[h.jsx(ap,{size:13}),"Code"]}),l&&u&&h.jsx("a",{className:"node-action node-action-ext",title:`Open ${n.branchName} on GitHub`,"aria-label":`Open ${n.branchName} on GitHub`,href:cp(l,u,n.branchName),target:"_blank",rel:"noopener noreferrer",onClick:_=>_.stopPropagation(),children:h.jsx(Dp,{size:13})})]}),h.jsx(Po,{type:"source",position:at.Bottom}),x.rect&&h.jsx(Oie,{exp:n,runs:i,latestRun:r,parentSlug:o,anchor:x.rect,onOpenLogs:i.length>0?()=>d(n.id,"terminal"):void 0,onOpenCode:()=>m(n.id,n.branchName,"files"),onMouseEnter:x.keepOpen,onMouseLeave:x.onMouseLeave})]})}),qie=R.memo(function({data:t}){const{count:n,onShowProjectScope:r}=t;return h.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-[color-mix(in_oklab,_var(--text)_3%,_transparent)] text-muted text-2xs font-medium text-left transition-[border-color,color] duration-120 ease-standard [&:hover]:border-text [&:hover]:text-text [&_.elided-node-label]:flex [&_.elided-node-label]:flex-col [&_.elided-node-label]:leading-[1.3] [&_.elided-node-sub]:text-muted",role:"button",tabIndex:0,title:"Switch to Entire project to see all experiments",onClick:r,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),r())},children:[h.jsx(Po,{type:"target",position:at.Top}),h.jsx(eS,{size:14}),h.jsxs("span",{className:"elided-node-label",children:[n," ",n===1?"experiment":"experiments",h.jsx("span",{className:"elided-node-sub",children:"other tasks"})]}),h.jsx(Po,{type:"source",position:at.Bottom})]})}),Gie={exp:Uie,elided:qie},_T={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},Vie={..._T.style,strokeDasharray:"4 4"};function Wie({experiments:e,runs:t,project:n,onOpenView:r,onOpenCode:i,agentSessionId:a,onShowProjectScope:o}){const{nodes:l,edges:u}=R.useMemo(()=>{const d=new Map;for(const _ of t){const w=d.get(_.experimentId);w?w.push(_):d.set(_.experimentId,[_])}for(const _ of d.values())_.sort((w,y)=>w.createdAt-y.createdAt);const m=[],f=[],g=_=>!a||_.exp.chatSessionId===a,b=Fie($ie(e),g),k=new Map(e.map(_=>[_.id,_.slug]));function S(_,w,y){const C=w-e_(_)/2;if(_.kind==="exp"){const j=d.get(_.exp.id)??[];m.push({id:_.exp.id,type:"exp",position:{x:C,y},data:{exp:_.exp,latestRun:j[j.length-1]??null,runs:j,isBaseline:!_.exp.parentExperimentId,parentSlug:_.exp.parentExperimentId?k.get(_.exp.parentExperimentId)??null:null,githubOwner:n.githubEnabled?n.githubOwner:"",githubRepo:n.githubEnabled?n.githubRepo:"",onOpenView:r,onOpenCode:i}})}else m.push({id:_.id,type:"elided",position:{x:C,y:y+(F8-Hie)/2},data:{count:_.count,onShowProjectScope:o}});if(_.children.length===0)return;const T=_.children.reduce((j,N)=>j+Ef(N),0)+Cf*(_.children.length-1);let E=w-T/2;for(const j of _.children){const N=Ef(j),D=_.kind==="elided"||j.kind==="elided";f.push({id:`e-${lf(_)}-${lf(j)}`,source:lf(_),target:lf(j),...D?{style:Vie}:{}}),S(j,E+N/2,y+F8+zie),E+=N+Cf}}let x=0;for(const _ of b){const w=Ef(_);S(_,x+w/2,0),x+=w+Cf}return{nodes:m,edges:f}},[e,t,r,i,n.githubOwner,n.githubRepo,n.githubEnabled,a,o]);return e.length===0?h.jsxs("div",{className:$8,children:[h.jsx("p",{className:"empty-state-title",children:"No experiments yet"}),h.jsx("p",{className:"empty-state-hint",children:"Ask the agent in chat to create and run your first experiment."})]}):l.length===0&&a?h.jsxs("div",{className:$8,children:[h.jsx("p",{className:"empty-state-title",children:"No experiments from the current task yet"}),h.jsx("p",{className:"empty-state-hint",children:"Ask in this task to create one, or switch to Entire project to see all experiments."})]}):h.jsx(tie,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:l,edges:u,nodeTypes:Gie,defaultEdgeOptions:_T,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:Rie,minZoom:.15,fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},children:h.jsx(aie,{variant:Oa.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},a??"project")}const P8=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-md [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" "),Cb=(e,t)=>e.id===t.id&&e.view===t.view,pl=(e,t)=>e.path===t.path&&(e.source??"repo")===(t.source??"repo")&&e.sessionId===t.sessionId&&e.ref===t.ref,gx=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,ld=(e,t,n)=>`${e}:${t??""}:${gx(n)}`,xT=e=>({...e,lineScrollRequest:void 0});function cf(e){return typeof e=="object"&&"path"in e?xT(e):e}const Ac=(e,t)=>e.branch===t.branch;function pn(e){return typeof e=="string"?`home:${e}`:"code"in e?`code:${e.branch}`:"kind"in e?e.kind==="plan"?`plan:${e.promptId}`:`subagent:${e.spawnPartId}`:"path"in e?`file:${gx(e)}`:`experiment:${e.id}:${e.view}`}function uf(e,t){const n=e.filter(r=>pn(r)!==t);return n.length===e.length?e:n}function U8(e,t=!1){const n={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1};if(e===pd&&t){const r={path:Nf,source:"artifacts"};return{...n,rightTab:r,tabHistory:[r],fileTabs:[r],panelOpen:!0}}if(e===lS){const r=[{path:"nanochat-base-training-curves.svg",source:"artifacts"},{path:"nanochat-sft-training-curves.svg",source:"artifacts"},{path:"nanochat-training-throughput.svg",source:"artifacts"},{path:"nanochat-core-evaluation.svg",source:"artifacts"}];return{...n,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,panelOpen:!0}}if(e===cS){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...n,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,panelOpen:!0}}return n}function Yie(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xie(e,t,n,r,i){let a=e,o;const l=t==null?void 0:t.replace(/\/+$/,""),u=r==null?void 0:r.replace(/\/+$/,"");if(a.startsWith("artifacts/"))return a=a.slice(10),a?{path:a,source:"artifacts"}:null;if(a==="~"||a.startsWith("~/"))return{path:a,source:"abs"};const d=g=>{const b=x=>x.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[k,S]=[b(a),b(g)];return k===S?"":k.startsWith(`${S}/`)?k.slice(S.length).replace(/^\/+/,""):null},m=a.startsWith("/")&&u?d(u):null,f=a.startsWith("/")&&l?d(l):null;if(!a.startsWith("/"))o=n;else{if(m!==null)return m?{path:m,source:"artifacts"}:null;if(f!==null)a=f;else{const g=i?Yie(i):"[^/]+",b=a.match(new RegExp(`/files/${g}/(.+)$`)),k=b?null:a.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),S=b||k?null:a.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(b)return{path:b[1],source:"artifacts"};k?(o=k[1],a=k[2]):S&&(a=S[1])}}return a?a.startsWith("/")?{path:a,source:"abs"}:{path:a,sessionId:o}:null}function Kie(e,t){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??t}const t_="orx:panel-width",yT="orx:experiments-view";function Zie(){try{return localStorage.getItem(yT)==="tree"?"tree":"table"}catch{return"table"}}const Jd=360,Qie=10,Jie=272,ese=380,tse=Jie+56,nse=80,rse=48;function Af(){return Math.max(Jd,window.innerWidth-tse-ese)}function ise(){const e=Af();try{const t=Number(localStorage.getItem(t_));if(Number.isFinite(t)&&t>=Jd)return Math.min(t,e)}catch{}return Math.max(Jd,Math.min(760,e,Math.round(window.innerWidth*.42)))}function cd(e,t){const n=e.findIndex(i=>i.id===t.id);if(n<0)return[...e,t];const r=e.slice();return r[n]=t,r}function q8(e){const t=R.useRef(e);return t.current.size===e.size&&[...e].every(([r,i])=>t.current.get(r)===i)||(t.current=e),t.current}function sse(){var xe,Ae;const[e,t]=R.useState(null),[n,r]=R.useState(null),i=R.useRef(void 0);i.current=n==null?void 0:n.tourCompleted;const a=R.useRef(!1),[o,l]=R.useState(null),u=R.useRef(null),[d,m]=R.useState(null),[f,g]=R.useState([]),[b,k]=R.useState([]),S=R.useRef(b);S.current=b;const x=R.useRef(new Map),_=R.useRef(new Set),w=R.useRef(null),y=R.useRef(!1),C=R.useRef(new Map),T=R.useRef(new Map),E=R.useRef(0),j=R.useRef(f);j.current=f;const[N,D]=R.useState(null),[z,$]=R.useState(Zie),[F,U]=R.useState("project"),V=R.useRef(null),{open:X,setOpen:Y,ref:Q}=Go(V),[te,I]=R.useState(null),[O,H]=R.useState(!1),G=f.every(Z=>Z.chatSessionId),W=te&&G?F:"project",re=R.useMemo(()=>W!=="agent"?f:f.filter(Z=>Z.chatSessionId===te),[f,W,te]),ce=R.useMemo(()=>{if(W!=="agent")return b;const Z=new Set(re.map(le=>le.id));return b.filter(le=>Z.has(le.experimentId))},[b,re,W]);R.useEffect(()=>{try{localStorage.setItem(yT,z)}catch{}},[z]);const[pe,ne]=R.useState(null),[B,se]=R.useState("experiments"),[oe,_e]=R.useState([]),[be,Ce]=R.useState(!1),[Le,Fe]=R.useState(!1),[Ve,Pe]=R.useState(!1),[dt,Qe]=R.useState([]),[qe,ut]=R.useState([]),Zt=R.useRef(new Map),Dt=R.useRef(0),[Ge,rt]=R.useState([]),[ve,je]=R.useState([]),[Ue,Je]=R.useState([]),[De,tt]=R.useState(null),[it,Tt]=R.useState("files"),[yt,Xt]=R.useState(new Set),[ht,sn]=R.useState(!1),[mn,Un]=R.useState(!1),[Gi,Vi]=R.useState(ise),[Rs,Nr]=R.useState(!0),[pi,mr]=R.useState(!1),[Wo,Jr]=R.useState(!1),[Qt,cn]=R.useState("chat"),[mi,la]=R.useState(null),Ds=R.useRef(new Map),us=R.useRef(U8()),jr=R.useRef(null),xr=R.useRef(!1),yr=R.useRef(oe);yr.current=oe;const gi=R.useRef(null),Rn=R.useCallback(Z=>{gi.current=Z,tt(Z)},[]),pt=R.useCallback(Z=>{const le=pn(Z);Qe(Oe=>uf(Oe,le)),ut(Oe=>uf(Oe,le)),rt(Oe=>uf(Oe,le)),je(Oe=>uf(Oe,le));const me=qn.current;me&&typeof Z=="object"&&"path"in Z&&Zt.current.delete(ld(me,jr.current,Z));const Re=yr.current.filter(Oe=>pn(Oe)!==le);yr.current=Re,_e(Re)},[]),_t=R.useCallback((Z,le=!1)=>{xr.current=!1;const me=pn(Z),Re=yr.current.some(Ze=>pn(Ze)===me);if(le&&!Re){const Ze=gi.current;Ze&&pn(Ze)!==me&&pt(Ze),Rn(cf(Z))}const Oe=[...yr.current.filter(Ze=>pn(Ze)!==me),cf(Z)];yr.current=Oe,_e(Oe),se(Z)},[pt,Rn]),yn=R.useCallback(Z=>{const le=gi.current;le&&pn(le)===pn(Z)&&Rn(null)},[Rn]),We=R.useCallback((Z,le)=>{xr.current=!1;const me=pn(Z),Re=gi.current;Re&&pn(Re)===me&&Rn(null);const Oe=yr.current.filter(ot=>pn(ot)!==me);if(yr.current=Oe,_e(Oe),!le)return;const Ze=Oe[Oe.length-1];Ze?se(Ze):(sn(!1),Un(!1))},[Rn]),St=R.useCallback(Z=>{Z!=="chat"&&(xr.current=!1),cn(Z)},[]);us.current={rightTab:cf(B),tabHistory:oe,experimentsTabOpen:be,filesTabOpen:Le,artifactsTabOpen:Ve,expTabs:dt,fileTabs:qe,planTabs:Ge,subagentTabs:ve,codeTabs:Ue,previewTab:De,filesView:it,filesToggled:yt,selectedRunId:pe,scope:F,panelOpen:ht,panelMax:mn};const ca=R.useCallback(Z=>{const le=jr.current;if(le===Z)return;le&&Ds.current.set(le,us.current);let me=Z?Ds.current.get(Z):void 0;if(!me){const Re=Z===pd&&i.current===!1&&!a.current;Re&&(a.current=!0,H(!0)),me=U8(Z??void 0,Re)}if(Z&&xr.current){xr.current=!1;const Re="experiments";me={...me,rightTab:Re,tabHistory:[...me.tabHistory.filter(Oe=>pn(Oe)!==pn(Re)),Re],experimentsTabOpen:!0,panelOpen:!0}}se(me.rightTab),yr.current=me.tabHistory,_e(me.tabHistory),Ce(me.experimentsTabOpen),Fe(me.filesTabOpen),Pe(me.artifactsTabOpen),Qe(me.expTabs),ut(me.fileTabs),rt(me.planTabs),je(me.subagentTabs),Je(me.codeTabs),Rn(me.previewTab),Tt(me.filesView),Xt(me.filesToggled),ne(me.selectedRunId),U(me.scope),sn(me.panelOpen),Un(me.panelMax),jr.current=Z,I(Z)},[Rn]),zn=(n==null?void 0:n.onboardingCompleted)??!1,[bi,zr]=R.useState(!1),Br=R.useCallback(()=>zr(!0),[]),Mr=R.useCallback(async()=>{const Z=await i3({tourCompleted:!0});r(le=>le&&{...le,tourCompleted:Z.tourCompleted}),zr(!1)},[]),$t=R.useCallback(async()=>{await Mr(),Jr(!0)},[Mr]);R.useEffect(()=>{!d||!cg(d)||pi||!zn||n!=null&&n.tourCompleted||Br()},[d,pi,zn,Br,n==null?void 0:n.tourCompleted]);const qn=R.useRef(d);qn.current=d;const Jt=R.useCallback(()=>{cn("chat"),Ce(!0),_t("experiments"),sn(!0),jr.current||(xr.current=!0)},[_t]),ar=R.useCallback(()=>{l(null),t(null),r(null),Promise.allSettled([yR(),wR()]).then(([Z,le])=>{const me=[];Z.status==="fulfilled"?(t(Z.value),m(Re=>{var Oe;return Re&&Z.value.some(Ze=>Ze.id===Re)?Re:((Oe=Z.value[0])==null?void 0:Oe.id)??null})):me.push("projects"),le.status==="fulfilled"?(u.current=le.value.preferredAgent,r(le.value)):me.push("settings"),me.length>0&&l(`Couldn't load OpenResearch ${me.join(" and ")}.`)})},[]);R.useEffect(()=>{ar()},[ar]);const vi=R.useRef(Promise.resolve()),Hr=R.useRef(0),ei=R.useCallback(Z=>{const le=++Hr.current;r(Re=>Re&&{...Re,preferredAgent:Z});const me=vi.current.then(()=>i3({preferredAgent:Z})).then(Re=>{u.current=Re.preferredAgent,le===Hr.current&&r(Oe=>Oe&&{...Oe,preferredAgent:Re.preferredAgent})}).catch(Re=>{throw le===Hr.current&&r(Oe=>Oe&&{...Oe,preferredAgent:u.current}),Re});return vi.current=me.catch(()=>{}),me},[]);R.useEffect(()=>{const Z=()=>Vi(le=>Math.min(le,Af()));return window.addEventListener("resize",Z),()=>window.removeEventListener("resize",Z)},[]);const ds=R.useCallback(Z=>{y.current=!1,C.current.clear(),T.current.clear();const le=++E.current;RR(Z).then(me=>{if(qn.current!==Z||w.current!==Z||E.current!==le)return;C.current=new Map(me.map(Oe=>[Oe.id,Oe]));const Re=[...T.current.values()].some(Oe=>{const Ze=C.current.get(Oe.id);return!Ze||Ze.status!=="running"&&Ze.updatedAt<=Oe.updatedAt});T.current.clear();for(const Oe of me){const Ze=x.current.get(Oe.id);(!Ze||Ze.updatedAt{const Ze=new Map(me.map(ot=>[ot.id,ot]));for(const ot of Oe){const At=Ze.get(ot.id);(!At||At.updatedAt<=ot.updatedAt)&&Ze.set(ot.id,ot)}return[...Ze.values()]}),y.current=!0,Re&&Jt()}).catch(()=>{E.current===le&&T.current.clear()})},[Jt]);R.useEffect(()=>{if(!d)return;const Z=jr.current;Z&&Ds.current.set(Z,us.current),jr.current=null,xr.current=!1,I(null),w.current=d,x.current.clear(),_.current.clear(),NR(d).catch(()=>{}),g([]),k([]),D(null),ne(null),Qe([]),ut([]),H(!1),rt([]),je([]),Je([]),Rn(null),Tt("files"),Xt(new Set),yr.current=[],_e([]),se("experiments"),Ce(!1),Fe(!1),Pe(!1),sn(!1),Un(!1),U("project"),MR(d).then(g).catch(()=>{}),ds(d),a3(d).then(D).catch(()=>{})},[ds,d,Rn]);const hs=R.useCallback(()=>{const Z=qn.current;Z&&a3(Z).then(D).catch(()=>{})},[]),ua=R.useCallback(()=>{hs(),cn("chat"),Pe(!0),_t("artifacts"),sn(!0)},[hs,_t]);eL({onReconnect:()=>{const Z=qn.current;Z&&(w.current=Z,x.current.clear(),_.current.clear(),ds(Z))},onRun:Z=>{if(Z.projectId!==qn.current||Z.projectId!==w.current)return;const le=x.current.get(Z.id),me=_.current.has(Z.id);if(le&&le.updatedAt>Z.updatedAt||(x.current.set(Z.id,Z),_.current.add(Z.id),k(Ze=>cd(Ze,Z)),Z.status!=="running"||(le==null?void 0:le.status)==="running"))return;const Re=C.current.get(Z.id),Oe=y.current&&(!Re||Re.status!=="running"&&Re.updatedAt<=Z.updatedAt);me&&le||Oe?Jt():y.current||T.current.set(Z.id,Z)},onExperiment:Z=>{Z.projectId===qn.current&&g(le=>cd(le,Z))},onProject:Z=>{t(le=>le?cd(le,Z):[Z])},onArtifacts:Z=>{Z===qn.current&&hs()}});const Ya=R.useCallback(()=>U("project"),[]),Gn=R.useCallback((Z,le="overview",me=!1)=>{const Re={id:Z,view:le};Qe(Oe=>Oe.some(Ze=>Cb(Ze,Re))?Oe:[...Oe,Re]),_t(Re,me),sn(!0)},[_t]),_i=R.useCallback(Z=>{const le=S.current.filter(Re=>Re.id===Z||Re.id.startsWith(Z)),me=le.length===1?le[0]:null;me&&(ne(me.id),Gn(me.experimentId,"terminal",!0))},[Gn]),gr=R.useMemo(()=>new Map(f.map(Z=>{var le;return[Z.id,((le=Z.title)==null?void 0:le.trim())||Z.slug||"Experiment"]})),[f]),Dn=q8(gr),or=R.useMemo(()=>{const Z=new Map;for(const le of b)Z.set(le.id,Dn.get(le.experimentId)??"Experiment");return Z},[Dn,b]),Ln=q8(or),Ls=R.useCallback(Z=>{const le=Ln.get(Z);if(le)return le;const me=[...Ln].filter(([Re])=>Re.startsWith(Z));return me.length===1?me[0][1]:""},[Ln]),Wi=R.useCallback(Z=>{const le=Dn.get(Z);if(le)return le;const me=[...Dn].filter(([Re])=>Re.startsWith(Z));return me.length===1?me[0][1]:""},[Dn]),$r=R.useCallback(Z=>{const le=j.current.filter(me=>me.id===Z||me.id.startsWith(Z));le.length===1&&Gn(le[0].id,"overview",!0)},[Gn]),Xa=R.useCallback(Z=>{const le=dt.findIndex(me=>Cb(me,Z));le!==-1&&(Qe(me=>me.filter((Re,Oe)=>Oe!==le)),We(Z,pn(B)===pn(Z)))},[dt,We,B]),wn=R.useCallback((Z,le=!1)=>{const me=xT(Z);ut(Re=>{const Oe=Re.findIndex(ot=>pl(ot,Z));if(Oe===-1)return[...Re,me];const Ze=Re.slice();return Ze[Oe]=me,Ze}),_t(Z,le),sn(!0)},[_t]),Yi=R.useCallback((Z,le,me,Re,Oe,Ze)=>{const ot=e==null?void 0:e.find(Ur=>Ur.id===d),At=Xie(Z,ot==null?void 0:ot.repoPath,le,(ot==null?void 0:ot.artifactsDir)??(ot==null?void 0:ot.filesDir),ot==null?void 0:ot.slug);if(!At)return null;const Kt=Oe?j.current.find(Ur=>Ur.id===Oe||Oe.length>=6&&Ur.id.startsWith(Oe)):void 0,Pr=me??(Kt==null?void 0:Kt.branchName),Rr=At.source==null||At.source==="repo";return Pr&&Rr&&(At.ref=Pr),Ze&&!At.ref&&Rr&&(At.branchLabel=Ze),Re!=null&&(At.line=Re,At.lineScrollRequest=++Dt.current),At},[e,d]),en=R.useCallback((Z,le,me,Re,Oe,Ze)=>{const ot=Yi(Z,le,me,Re,Oe,Ze);ot&&wn(ot)},[wn,Yi]),Os=R.useCallback(Z=>wn({path:Z,source:"artifacts"}),[wn]),gn=R.useCallback((Z,le,me,Re,Oe)=>{const Ze=Yi(Z,le,Oe,me,Re);Ze&&wn(Ze,!0)},[wn,Yi]),Vn=R.useCallback((Z,le)=>{yn(Z),le()},[yn]),xi=R.useCallback(Z=>{const le=qe.findIndex(me=>pl(me,Z));le!==-1&&(ut(me=>me.filter((Re,Oe)=>Oe!==le)),d&&Zt.current.delete(ld(d,te,Z)),te===pd&&pl(Z,{path:Nf,source:"artifacts"})&&H(!1),We(Z,pn(B)===pn(Z)))},[te,qe,We,d,B]),fs=R.useCallback(Z=>{Z.lineScrollRequest!==void 0&&se(le=>typeof le!="object"||!("path"in le)||!pl(le,Z)||le.lineScrollRequest!==Z.lineScrollRequest?le:cf(le))},[]),Ul=R.useCallback((Z,le,me)=>{const Re={kind:"plan",sessionId:le,promptId:me,plan:Z};rt(Oe=>{const Ze=Oe.findIndex(At=>At.promptId===me);if(Ze===-1)return[...Oe,Re];const ot=Oe.slice();return ot[Ze]=Re,ot}),_t(Re,!0),sn(!0)},[_t]),ql=R.useCallback(Z=>{const le=Ge.findIndex(me=>me.promptId===Z.promptId);le!==-1&&(rt(me=>me.filter((Re,Oe)=>Oe!==le)),We(Z,pn(B)===pn(Z)))},[We,Ge,B]),Ka=R.useCallback((Z,le,me)=>{const Re={kind:"subagent",sessionId:Z,spawnPartId:le,label:me};je(Oe=>Oe.some(Ze=>Ze.spawnPartId===le)?Oe:[...Oe,Re]),_t(Re,!0),sn(!0)},[_t]),Is=R.useCallback(Z=>{const le=ve.findIndex(me=>me.spawnPartId===Z.spawnPartId);le!==-1&&(je(me=>me.filter((Re,Oe)=>Oe!==le)),We(Z,pn(B)===pn(Z)))},[We,B,ve]),[Gl,Vl]=R.useState({});R.useEffect(()=>{if(Vl(ot=>{const At=new Set(ve.map(Kt=>Kt.spawnPartId));return Object.keys(ot).every(Kt=>At.has(Kt))?ot:Object.fromEntries(Object.entries(ot).filter(([Kt])=>At.has(Kt)))}),ve.length===0)return;let Z=!0;const le=new Set,me=(ot,At,Kt)=>{Vl(Pr=>{var Ur;let Rr=Pr;for(const qr of At)if(!(Kt&&le.has(qr.spawnPartId)))for(const lr of ot){const wi=I2(lr.parts,qr.spawnPartId);if(!wi)continue;Kt||le.add(qr.spawnPartId);const eo={label:PV(wi),running:((Ur=wi.state)==null?void 0:Ur.status)==="running"},ms=Rr[qr.spawnPartId];(!ms||ms.label!==eo.label||ms.running!==eo.running)&&(Rr===Pr&&(Rr={...Pr}),Rr[qr.spawnPartId]=eo);break}return Rr})};let Re=0;const Oe=()=>{const ot=++Re;for(const At of new Set(ve.map(Kt=>Kt.sessionId)))md(At).then(({messages:Kt})=>{Z&&ot===Re&&me(Kt,ve.filter(Pr=>Pr.sessionId===At),!0)}).catch(()=>{})};Oe();const Ze=Ad(ot=>{if(ot.type==="reconnected"){le.clear(),Oe();return}if(ot.type!=="message")return;const At=ve.filter(Kt=>Kt.sessionId===ot.sessionId);At.length&&me([ot.message],At,!1)});return()=>{Z=!1,Ze()}},[ve]);const Xi=R.useCallback((Z,le,me="files")=>{const Re={code:!0,experimentId:Z,branch:le,view:me,toggled:new Set};Je(Oe=>Oe.some(Ze=>Ac(Ze,Re))?Oe.map(Ze=>Ac(Ze,Re)?{...Ze,experimentId:Z,view:me}:Ze):[...Oe,Re]),_t(Re),sn(!0)},[_t]),Fr=R.useCallback((Z,le)=>{Je(me=>me.map(Re=>Ac(Re,Z)?{...Re,...le}:Re))},[]),Za=R.useCallback(Z=>{const le=Ue.findIndex(me=>Ac(me,Z));le!==-1&&(Je(me=>me.filter((Re,Oe)=>Oe!==le)),We(Z,pn(B)===pn(Z)))},[Ue,We,B]),Yo=R.useCallback(()=>{cn("chat"),Fe(!0),_t("files"),sn(!0)},[_t]),Ki=R.useCallback(Z=>{Z==="experiments"?Ce(!1):Z==="files"?Fe(!1):Pe(!1),We(Z,B===Z)},[We,B]),zs=Z=>{Z.preventDefault(),Z.currentTarget.setPointerCapture(Z.pointerId);const me=document.body.style.userSelect;document.body.style.userSelect="none";const Re=mn,Oe=Z.clientX,Ze=Gi;let ot=!1;function At(){window.removeEventListener("pointermove",Kt),window.removeEventListener("pointerup",At),window.removeEventListener("pointercancel",At),document.body.style.userSelect=me}function Kt(Pr){if(Re){const lr=Pr.clientX-Oe;if(ot||lrUr+nse){Un(!0);return}Un(!1);const qr=Math.min(Math.max(Rr,Jd),Ur);Vi(qr);try{localStorage.setItem(t_,String(qr))}catch{}}window.addEventListener("pointermove",Kt),window.addEventListener("pointerup",At),window.addEventListener("pointercancel",At)},Bs=(Z,le)=>{t(me=>me?cd(me,Z):[Z]),m(Z.id),mr(!1),le&&(la({projectId:Z.id,message:le}),St("git"))},Qa=Z=>{t(le=>le&&le.filter(me=>me.id!==Z)),d===Z&&m(null)},yi=typeof B=="object"&&"id"in B?B:null,bn=typeof B=="object"&&"path"in B?B:null,Wn=te===pd&&O?qe.find(Z=>pl(Z,{path:Nf,source:"artifacts"})):void 0,Ja=Wn?[Wn]:[],Hs=Wn?qe.filter(Z=>!pl(Z,Wn)):qe,wr=typeof B=="object"&&"kind"in B&&B.kind==="plan"?B:null,br=typeof B=="object"&&"kind"in B&&B.kind==="subagent"?B:null,ps=typeof B=="object"&&"code"in B?B:null,Sr=ps?Ue.find(Z=>Ac(Z,ps))??null:null,Zi=Z=>De!==null&&pn(De)===pn(Z),$s=Z=>h.jsx(No,{active:bn!==null&&pl(bn,Z),label:Z.path.split("/").pop()||Z.path,icon:h.jsx(tS,{size:12,style:{flexShrink:0}}),preview:Zi(Z),onSelect:()=>_t(Z),onPromote:()=>yn(Z),onClose:()=>xi(Z)},`file:${gx(Z)}`),Ft=(e==null?void 0:e.find(Z=>Z.id===d))??null,Sn=yi?f.find(Z=>Z.id===yi.id)??null:null,ti=Sr?f.find(Z=>Z.id===Sr.experimentId)??null:null;if(o)return h.jsx("div",{className:"app flex flex-col h-full",children:h.jsxs("div",{className:P8,children:[h.jsx("p",{children:o}),h.jsx("button",{className:Zr,onClick:ar,children:"Retry"})]})});if(e===null||n===null)return h.jsx("div",{className:"app flex flex-col h-full",children:h.jsx("div",{className:P8,children:h.jsx("span",{className:Pt})})});if(e.length===0)return h.jsx("div",{className:"app flex flex-col h-full",children:zn?h.jsx(M7,{projects:e,onOpen:m,onCreated:Bs,onDeleted:Qa}):h.jsx(oZ,{preferredAgent:n.preferredAgent,onDone:(Z,le)=>{UG(),u.current=le,t([Z]),m(Z.id),r(me=>({...me??{tourCompleted:!1},onboardingCompleted:!0,preferredAgent:le}))}})});const ie=h.jsx(sZ,{projectName:((xe=e.find(Z=>Z.id===d))==null?void 0:xe.name)??"",onHome:()=>mr(!0),onNewProject:()=>Jr(!0),onRepository:()=>St("git"),onCollapse:()=>Nr(!1)});return h.jsxs("div",{className:"app flex flex-col h-full",children:[h.jsx(Cq,{}),pi?h.jsx(M7,{projects:e,onOpen:Z=>{m(Z),mr(!1)},onCreated:Bs,onDeleted:Qa}):h.jsxs("div",{className:"app-body flex flex-1 min-h-0 py-0 px-3.5",children:[d&&h.jsx(eW,{projectId:d,projectName:(Ft==null?void 0:Ft.name)??"",paperId:(Ae=e.find(Z=>Z.id===d))==null?void 0:Ae.paperId,railHeader:ie,railOpen:Rs,onShowRail:()=>Nr(!0),mainView:Qt,onSelectMainView:St,experimentsActive:Qt==="chat"&&ht&&B==="experiments",filesActive:Qt==="chat"&&ht&&B==="files",artifactsActive:Qt==="chat"&&ht&&B==="artifacts",onOpenExperiments:Jt,onOpenArtifacts:ua,onOpenFile:gn,onOpenRun:_i,runExperimentName:Ls,onOpenExperiment:$r,experimentName:Wi,onOpenPlan:Ul,onOpenSubagent:Ka,onOpenWorktree:Yo,onOpenDemoWelcome:Ft&&cg(Ft.id)?Br:void 0,onActiveSessionChange:ca,preferredAgent:n.preferredAgent,onPreferredAgentChange:ei,children:Qt==="skills"?h.jsx(VK,{project:Ft}):Qt!=="chat"?h.jsx(AG,{tab:Qt,project:Ft,githubPublicationError:mi&&mi.projectId===(Ft==null?void 0:Ft.id)?mi.message:null,onProjectUpdate:Z=>{t(le=>le?cd(le,Z):[Z]),Z.githubEnabled&&la(null)},onSelectTab:St}):null}),Qt==="chat"&&ht&&h.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-2.5 mr-0 mb-2.5 ml-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-[0_12px_40px_color-mix(in_oklab,_var(--text)_22%,_transparent)] floating-panel border border-border rounded-lg 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 ${mn?"max":""}`,style:mn?void 0:{width:Gi},"data-onboarding":"experiments",children:[h.jsx("div",{className:`panel-resizer absolute left-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] [&:active]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] ${mn?"cursor-e-resize":"cursor-col-resize"}`,title:mn?"Drag right to restore panel":"Drag to resize panel",onPointerDown:zs}),h.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pr-1.5 pb-0 pl-2 h-10 border-b border-b-border bg-background shrink-0",children:[h.jsxs("div",{className:"tab-strip flex items-end gap-0.5 flex-1 min-w-0 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[Ja.map($s),Le&&h.jsx(No,{active:B==="files",label:"Files",icon:h.jsx(Ed,{size:12,style:{flexShrink:0}}),onSelect:()=>_t("files"),onClose:()=>Ki("files")}),Ve&&h.jsx(No,{active:B==="artifacts",label:"Artifacts",icon:h.jsx(r_,{size:12,style:{flexShrink:0}}),onSelect:()=>_t("artifacts"),onClose:()=>Ki("artifacts")}),be&&h.jsx(No,{active:B==="experiments",label:"Experiments",icon:h.jsx(Eb,{size:12,style:{flexShrink:0}}),onSelect:()=>_t("experiments"),onClose:()=>Ki("experiments")}),dt.map(Z=>{const le=f.find(me=>me.id===Z.id);return h.jsx(No,{active:yi!==null&&Cb(yi,Z),label:le?le.title||le.slug:"…",icon:Z.view==="overview"?h.jsx(Y8,{size:12,style:{flexShrink:0}}):h.jsx(Wc,{size:12,style:{flexShrink:0}}),preview:Zi(Z),onSelect:()=>_t(Z),onPromote:()=>yn(Z),onClose:()=>Xa(Z)},`${Z.id}:${Z.view}`)}),Hs.map($s),Ge.map(Z=>h.jsx(No,{active:wr!==null&&wr.promptId===Z.promptId,label:"Plan",icon:h.jsx(s_,{size:12,style:{flexShrink:0}}),preview:Zi(Z),onSelect:()=>_t(Z),onPromote:()=>yn(Z),onClose:()=>ql(Z)},`plan:${Z.promptId}`)),ve.map(Z=>{var le,me;return h.jsx(No,{active:br!==null&&br.spawnPartId===Z.spawnPartId,label:((le=Gl[Z.spawnPartId])==null?void 0:le.label)??Z.label??"Sub-agent",shimmer:((me=Gl[Z.spawnPartId])==null?void 0:me.running)??!1,icon:h.jsx(oS,{size:12,style:{flexShrink:0}}),preview:Zi(Z),onSelect:()=>_t(Z),onPromote:()=>yn(Z),onClose:()=>Is(Z)},`subagent:${Z.spawnPartId}`)}),Ue.map(Z=>{const le=f.find(me=>me.id===Z.experimentId);return h.jsx(No,{active:Sr!==null&&Ac(Sr,Z),label:(le==null?void 0:le.slug)??Z.branch,icon:h.jsx(Ed,{size:12,style:{flexShrink:0}}),onSelect:()=>_t(Z),onClose:()=>Za(Z)},`code:${Z.branch}`)})]}),h.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[h.jsx("button",{className:nr,title:mn?"Restore panel":"Expand panel","aria-label":mn?"Restore panel":"Expand panel",onClick:()=>Un(Z=>!Z),children:mn?h.jsx(OM,{size:14}):h.jsx(RM,{size:14})}),h.jsx("button",{className:nr,title:"Close panel","aria-label":"Close panel",onClick:()=>{xr.current=!1,sn(!1),Un(!1)},children:h.jsx(Yr,{size:14})})]})]}),B==="artifacts"?h.jsx("div",{className:ja,children:Ft&&h.jsx($K,{project:Ft,artifacts:N,onChanged:hs,onOpenFile:Os,onOpenStorage:()=>St("storage")},Ft.id)}):B==="experiments"?h.jsxs("div",{className:ja,children:[h.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[h.jsx("span",{style:{flex:1}}),h.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[h.jsxs("div",{className:"option-picker relative inline-flex",ref:Q,children:[h.jsx("button",{ref:V,className:`${dh} experiment-scope-trigger w-6.5 h-6.5 rounded-sm${W==="agent"?" active":""}`,title:`Experiment filter: ${W==="agent"?"Current task":"Entire project"}`,"aria-label":"Filter experiments","aria-expanded":X,onClick:()=>Y(Z=>!Z),children:h.jsx(gM,{size:16,strokeWidth:2.5})}),X&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right experiment-scope-menu [&_.model-item]:whitespace-nowrap [&_.model-item:disabled]:text-muted [&_.model-item:disabled]:cursor-default [&_.model-item:disabled:hover]:bg-transparent",children:[h.jsxs("button",{className:ui,"aria-pressed":W==="agent",disabled:!te||!G,title:te?G?void 0:"Current task filtering is unavailable for unattributed experiments":"Open a task to filter to its experiments",onClick:()=>{U("agent"),Y(!1)},children:[h.jsx("span",{children:"Current task"}),W==="agent"&&h.jsx(Oi,{size:13})]}),h.jsxs("button",{className:ui,"aria-pressed":W==="project",onClick:()=>{U("project"),Y(!1)},children:[h.jsx("span",{children:"Entire project"}),W==="project"&&h.jsx(Oi,{size:13})]})]})]}),h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:font-semibold [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":"Experiment view",children:[h.jsx("button",{className:z==="table"?"active":"","aria-pressed":z==="table",onClick:()=>$("table"),children:"Table"}),h.jsx("button",{className:z==="tree"?"active":"","aria-pressed":z==="tree",onClick:()=>$("tree"),children:"Tree"})]})]})]}),h.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:z==="tree"?Ft&&h.jsx(Wie,{experiments:f,runs:ce,project:Ft,onOpenView:Gn,onOpenCode:Xi,agentSessionId:W==="agent"?te:null,onShowProjectScope:Ya}):h.jsx(bZ,{runs:ce,emptyHint:W==="agent"&&f.length>0?"No experiments from the current task yet. Switch to Entire project to see all experiments.":void 0,experiments:re,onOpen:Z=>{Gn(Z.id,"overview")},onOpenLogs:(Z,le)=>{ne(le),Gn(Z,"terminal")},onOpenCode:Z=>{const le=f.find(me=>me.id===Z);le&&Xi(le.id,le.branchName,"files")},onCancel:pS})})]}):B==="files"?h.jsx("div",{className:ja,children:Ft?h.jsx(NK,{sessionId:te??void 0,project:Ft,view:it,toggled:yt,onViewChange:Tt,onToggledChange:Xt,onOpenFile:en},`files:${te??`project:${Ft.id}`}`):h.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:h.jsx("div",{className:zc,children:h.jsxs("div",{className:"wt-empty flex flex-col items-center gap-2.5 py-12 px-6 text-center text-muted [&_>_svg]:text-subtext [&_p]:m-0 [&_p]:max-w-80 [&_p]:text-sm",children:[h.jsx(nS,{size:22}),h.jsx("p",{children:"Select a project to browse its files."})]})})})}):bn?h.jsx("div",{className:ja,children:d&&h.jsx(iZ,{projectId:d,path:bn.path,source:bn.source,sessionId:bn.source==="artifacts"?te??void 0:bn.sessionId,gitRef:bn.ref,line:bn.line,branchLabel:Kie(bn,Ft==null?void 0:Ft.baselineBranch),onOpenFile:(Z,le,me)=>Vn(bn,()=>en(Z,le,me)),scrollPosition:Zt.current.get(ld(d,te,bn)),onScrollPositionChange:Z=>{Zt.current.set(ld(d,te,bn),Z)},lineScrollRequest:bn.lineScrollRequest,onLineScrollRequestHandled:()=>fs(bn),onEdit:()=>yn(bn)},ld(d,te,bn))}):wr?h.jsx("div",{className:ja,children:h.jsx("div",{className:"pane-content flex-1 min-h-0 relative plan-tab-content overflow-y-auto bg-background py-4.5 px-6 [&_.md]:max-w-readable",children:h.jsx(za,{text:wr.plan,onOpenFile:Z=>Vn(wr,()=>en(Z,wr.sessionId))})})}):br?h.jsx(tW,{sessionId:br.sessionId,spawnPartId:br.spawnPartId,onOpenFile:Z=>Vn(br,()=>gn(Z,br.sessionId)),onOpenRun:Z=>Vn(br,()=>_i(Z)),runExperimentName:Ls,onOpenExperiment:Z=>Vn(br,()=>$r(Z)),experimentName:Wi,onOpenSubagent:(Z,le)=>Vn(br,()=>Ka(br.sessionId,Z,le))},br.spawnPartId):Sr?h.jsx("div",{className:ja,children:d&&Ft&&Sr&&ti&&h.jsx(AK,{projectId:d,project:Ft,experiment:ti,view:Sr.view,toggled:Sr.toggled,onViewChange:Z=>Fr(Sr,{view:Z}),onToggledChange:Z=>Fr(Sr,{toggled:Z}),onOpenFile:(Z,le,me)=>en(Z,le,me,void 0,void 0,ti.branchName)},`code:${Sr.branch}`)}):h.jsx("div",{className:ja,children:yi&&Sn&&Ft&&h.jsx(tZ,{experiment:Sn,project:Ft,view:yi.view,runs:b,selectedRunId:pe,onSelectRun:ne,parentExperiment:f.find(Z=>Z.id===Sn.parentExperimentId)??null,onOpenView:(Z,le)=>{le&&ne(le),Gn(Sn.id,Z)},onOpenCode:Z=>Xi(Sn.id,Sn.branchName,Z)},`${yi.id}:${yi.view}`)})]})]}),Wo&&h.jsx(ME,{onClose:()=>Jr(!1),onCreated:(Z,le)=>{Jr(!1),Bs(Z,le)}}),bi&&!pi&&Ft&&cg(Ft.id)&&h.jsx(vZ,{onClose:Mr,onCreateProject:$t})]})}bj.createRoot(document.getElementById("root")).render(h.jsx(R.StrictMode,{children:h.jsx(sse,{})})); +`)+1)}let V=[];try{V=U.trim()?jv(U):[]}catch{return}if(F.truncated&&V.every(Q=>Q.hunks.length===0))return;let X=0,Y=0;for(const Q of V){const te=Z2(Q);X+=te.additions,Y+=te.deletions}$||x({fileCount:V.length,additions:X,deletions:Y,truncated:F.truncated})}).catch(()=>{}),()=>{$=!0}},[v]);const w={done:0,failed:0,cancelled:0,live:0};for(const $ of t)$.status==="done"?w.done+=1:$.status==="failed"?w.failed+=1:$.status==="cancelled"?w.cancelled+=1:w.live+=1;const y=n?Df((n.endedAt??Date.now())-n.createdAt):null,C=(n==null?void 0:n.status)==="failed"&&n.resultMarkdown?n.resultMarkdown:null,N=e.description||(C?null:n==null?void 0:n.resultMarkdown)||null,E=R.useRef(null),[M,T]=R.useState(!1),[D,z]=R.useState(!1);return R.useEffect(()=>{T(!1)},[N]),R.useEffect(()=>{const $=E.current;$&&z($.scrollHeight>$.clientHeight+1)},[N,M]),HE.createPortal(h.jsxs("div",{ref:d.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] py-3.5 px-4 text-sm text-text [&_.hc-mono]:font-mono [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:font-mono [&_.hc-slug]:text-md [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-[color-mix(in_oklab,_var(--border)_55%,_var(--text))] [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-xs [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:font-mono [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-2xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-mono]:min-w-0 [&_.hc-foot_.hc-mono]:overflow-hidden [&_.hc-foot_.hc-mono]:text-ellipsis [&_.hc-foot_.hc-mono]:whitespace-nowrap",style:{width:Eb,left:b,top:k,visibility:d.offsetHeight===0?"hidden":void 0},onMouseEnter:l,onMouseLeave:c,children:[h.jsxs("div",{className:"hc-head",children:[h.jsx("span",{className:"hc-slug",children:e.slug}),h.jsx(La,{status:n?as(n):"idle"})]}),e.title&&h.jsx("div",{className:"hc-title",children:e.title}),h.jsxs("div",{className:"hc-actions",children:[a&&h.jsxs("button",{type:"button",onClick:a,children:[h.jsx(Wc,{size:13}),"Logs"]}),h.jsxs("button",{type:"button",onClick:o,children:[h.jsx(lp,{size:13}),"Code"]})]}),N&&h.jsx("div",{className:`hc-body${M?" expanded":""}`,ref:E,children:N}),N&&(D||M)&&h.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>T($=>!$),children:M?"Show less":"Show more"}),C&&h.jsx("div",{className:"hc-failure",children:C}),h.jsxs("div",{className:"hc-stats",children:[h.jsxs("span",{children:[t.length===1?"1 run":`${t.length} runs`,w.done>0&&` · ${w.done} done`,w.failed>0&&` · ${w.failed} failed`,w.cancelled>0&&` · ${w.cancelled} cancelled`,w.live>0&&` · ${w.live} live`]}),n&&h_(n.backend)&&h.jsx(D2,{backend:n.backend}),y&&h.jsx("span",{children:y}),n&&h.jsx("span",{children:Ks(n.createdAt)})]}),h.jsxs("div",{className:"hc-git",children:[h.jsxs("div",{className:"hc-git-row",children:[h.jsxs("span",{className:"hc-branch",title:e.branchName,children:[h.jsx(lh,{size:12}),e.branchName]}),r&&h.jsxs("span",{children:["from ",h.jsx("span",{className:"hc-mono",children:r})]})]}),S&&S.fileCount>0&&h.jsx("div",{className:"hc-git-row",title:`Committed changes vs ${r??"parent"}${S.truncated?" (diff truncated — counts are lower bounds)":""}`,children:h.jsxs("span",{children:[S.truncated&&"≥ ",h.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",S.additions]})," ",h.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",S.deletions]})," · ",S.fileCount===1&&!S.truncated?"1 file":`${S.fileCount}${S.truncated?"+":""} files`]})})]}),h.jsxs("div",{className:"hc-foot",children:[h.jsxs("span",{className:"hc-mono",children:["$ ",e.runCommand]}),h.jsxs("span",{children:["created ",Fie(e.createdAt)]})]})]}),document.body)}const F8=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-md [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),Uie=264,P8=132,Ef=44,qie=72,Gie=148,Vie=44;function Wie(e){const t=new Map(e.map(a=>[a.id,{exp:a,children:[]}])),n=[];for(const a of e){const o=t.get(a.id),l=a.parentExperimentId?t.get(a.parentExperimentId):void 0;l?l.children.push(o):n.push(o)}const r=(a,o)=>a.exp.createdAt-o.exp.createdAt,i=a=>{a.children.sort(r),a.children.forEach(i)};return n.sort(r),n.forEach(i),n}function Yie(e,t){const n=new Map,r=l=>{const c=n.get(l)??1+l.children.reduce((d,m)=>d+r(m),0);return n.set(l,c),c},i=new Map,a=l=>{const c=i.get(l)??(t(l)||l.children.some(a));return i.set(l,c),c};function o(l){if(t(l)){const m=[];let f=0;for(const g of l.children)a(g)?m.push(...o(g)):f+=r(g);return f>0&&m.push({kind:"elided",id:`el-${l.exp.id}`,count:f,children:[]}),[{kind:"exp",exp:l.exp,children:m}]}if(!a(l))return[];let c=0;const d=[];return(function m(f){c+=1;for(const g of f.children)t(g)?d.push(...o(g)):a(g)?m(g):c+=r(g)})(l),[{kind:"elided",id:`el-${l.exp.id}`,count:c,children:d}]}return e.flatMap(o)}function r_(e){return e.kind==="exp"?Uie:Gie}function cf(e){return e.kind==="exp"?e.exp.id:e.id}function Af(e){if(e.children.length===0)return r_(e);const t=e.children.reduce((n,r)=>n+Af(r),0)+Ef*(e.children.length-1);return Math.max(r_(e),t)}function Xie(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const Kie=R.memo(function({data:t}){const{exp:n,latestRun:r,runs:i,isBaseline:a,parentSlug:o,githubOwner:l,githubRepo:c,onOpenView:d,onOpenCode:m}=t,f=r?as(r):void 0,g=f==="running"||f==="starting"||f==="cancelling",b=a?"Baseline":g?"Running":"Experiment",k=i.slice(-8),S=R.useRef(null),x=$ie(S,t);return h.jsxs("div",{ref:S,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-[0_1px_2px_rgba(0,_0,_0,_0.04)] text-md transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-[0_2px_8px_rgba(0,_0,_0,_0.08)] [&.live]:border-accent-teal [&.live]:shadow-[0_2px_12px_rgba(32,_154,_132,_0.2)] [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-left [&_.node-overview-link]:cursor-pointer [&_.node-overview-link:hover_.node-slug]:underline [&_.node-overview-link:hover_.node-slug]:underline-offset-[3px] [&_.node-overview-link:focus-visible]:outline-2 [&_.node-overview-link:focus-visible]:outline-solid [&_.node-overview-link:focus-visible]:outline-accent [&_.node-overview-link:focus-visible]:outline-offset-4 [&_.node-overview-link:focus-visible]:rounded-xs [&_.node-eyebrow]:flex [&_.node-eyebrow]:items-center [&_.node-eyebrow]:justify-between [&_.node-eyebrow]:gap-2 [&_.node-eyebrow]:mb-1.5 [&_.node-eyebrow]:text-2xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:font-mono [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-2xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-xs [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ml-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${g?"live":""}`,onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,children:[h.jsx(Uo,{type:"target",position:at.Top}),h.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",onClick:()=>d(n.id,"overview"),onKeyDown:v=>{v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),d(n.id,"overview"))},children:[h.jsxs("div",{className:"node-eyebrow",children:[h.jsx("span",{children:b}),h.jsx(La,{status:f??"idle"})]}),h.jsx("div",{className:"node-head",children:h.jsx("span",{className:"node-slug",children:n.slug})}),(n.title||n.description)&&h.jsx("div",{className:"node-title",children:n.title||n.description}),h.jsxs("div",{className:"node-meta",children:[h.jsx("span",{children:"Runs"}),k.length>0?h.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:k.map(v=>h.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-[color-mix(in_oklab,_var(--accent-red)_55%,_transparent)] [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${Xie(as(v))}`,title:as(v)},v.id))}):h.jsx("span",{children:"no runs"}),h.jsx("span",{style:{flex:1}}),r&&h.jsx("span",{children:Ks(r.createdAt)})]})]}),h.jsxs("div",{className:"node-actions",onClick:v=>v.stopPropagation(),children:[i.length>0&&h.jsxs("button",{className:"node-action",title:"Open logs",onClick:()=>d(n.id,"terminal"),children:[h.jsx(Wc,{size:13}),"Logs"]}),h.jsxs("button",{className:"node-action",title:`Browse code on ${n.branchName}`,onClick:()=>m(n.id,n.branchName,"files"),children:[h.jsx(lp,{size:13}),"Code"]}),l&&c&&h.jsx("a",{className:"node-action node-action-ext",title:`Open ${n.branchName} on GitHub`,"aria-label":`Open ${n.branchName} on GitHub`,href:dp(l,c,n.branchName),target:"_blank",rel:"noopener noreferrer",onClick:v=>v.stopPropagation(),children:h.jsx(Op,{size:13})})]}),h.jsx(Uo,{type:"source",position:at.Bottom}),x.rect&&h.jsx(Pie,{exp:n,runs:i,latestRun:r,parentSlug:o,anchor:x.rect,onOpenLogs:i.length>0?()=>d(n.id,"terminal"):void 0,onOpenCode:()=>m(n.id,n.branchName,"files"),onMouseEnter:x.keepOpen,onMouseLeave:x.onMouseLeave})]})}),Zie=R.memo(function({data:t}){const{count:n,onShowProjectScope:r}=t;return h.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-[color-mix(in_oklab,_var(--text)_3%,_transparent)] text-muted text-2xs font-medium text-left transition-[border-color,color] duration-120 ease-standard [&:hover]:border-text [&:hover]:text-text [&_.elided-node-label]:flex [&_.elided-node-label]:flex-col [&_.elided-node-label]:leading-[1.3] [&_.elided-node-sub]:text-muted",role:"button",tabIndex:0,title:"Switch to Entire project to see all experiments",onClick:r,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),r())},children:[h.jsx(Uo,{type:"target",position:at.Top}),h.jsx(tS,{size:14}),h.jsxs("span",{className:"elided-node-label",children:[n," ",n===1?"experiment":"experiments",h.jsx("span",{className:"elided-node-sub",children:"other tasks"})]}),h.jsx(Uo,{type:"source",position:at.Bottom})]})}),Qie={exp:Kie,elided:Zie},ET={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},Jie={...ET.style,strokeDasharray:"4 4"};function ese({experiments:e,runs:t,project:n,onOpenView:r,onOpenCode:i,agentSessionId:a,onShowProjectScope:o}){const{nodes:l,edges:c}=R.useMemo(()=>{const d=new Map;for(const v of t){const w=d.get(v.experimentId);w?w.push(v):d.set(v.experimentId,[v])}for(const v of d.values())v.sort((w,y)=>w.createdAt-y.createdAt);const m=[],f=[],g=v=>!a||v.exp.chatSessionId===a,b=Yie(Wie(e),g),k=new Map(e.map(v=>[v.id,v.slug]));function S(v,w,y){const C=w-r_(v)/2;if(v.kind==="exp"){const M=d.get(v.exp.id)??[];m.push({id:v.exp.id,type:"exp",position:{x:C,y},data:{exp:v.exp,latestRun:M[M.length-1]??null,runs:M,isBaseline:!v.exp.parentExperimentId,parentSlug:v.exp.parentExperimentId?k.get(v.exp.parentExperimentId)??null:null,githubOwner:n.githubEnabled?n.githubOwner:"",githubRepo:n.githubEnabled?n.githubRepo:"",onOpenView:r,onOpenCode:i}})}else m.push({id:v.id,type:"elided",position:{x:C,y:y+(P8-Vie)/2},data:{count:v.count,onShowProjectScope:o}});if(v.children.length===0)return;const N=v.children.reduce((M,T)=>M+Af(T),0)+Ef*(v.children.length-1);let E=w-N/2;for(const M of v.children){const T=Af(M),D=v.kind==="elided"||M.kind==="elided";f.push({id:`e-${cf(v)}-${cf(M)}`,source:cf(v),target:cf(M),...D?{style:Jie}:{}}),S(M,E+T/2,y+P8+qie),E+=T+Ef}}let x=0;for(const v of b){const w=Af(v);S(v,x+w/2,0),x+=w+Ef}return{nodes:m,edges:f}},[e,t,r,i,n.githubOwner,n.githubRepo,n.githubEnabled,a,o]);return e.length===0?h.jsxs("div",{className:F8,children:[h.jsx("p",{className:"empty-state-title",children:"No experiments yet"}),h.jsx("p",{className:"empty-state-hint",children:"Ask the agent in chat to create and run your first experiment."})]}):l.length===0&&a?h.jsxs("div",{className:F8,children:[h.jsx("p",{className:"empty-state-title",children:"No experiments from the current task yet"}),h.jsx("p",{className:"empty-state-hint",children:"Ask in this task to create one, or switch to Entire project to see all experiments."})]}):h.jsx(lie,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:l,edges:c,nodeTypes:Qie,defaultEdgeOptions:ET,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:Hie,minZoom:.15,fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},children:h.jsx(fie,{variant:Oa.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},a??"project")}const U8=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-md [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" "),Tb=(e,t)=>e.id===t.id&&e.view===t.view,gl=(e,t)=>e.path===t.path&&(e.source??"repo")===(t.source??"repo")&&e.sessionId===t.sessionId&&e.ref===t.ref,_x=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,cd=(e,t,n)=>`${e}:${t??""}:${_x(n)}`,AT=e=>({...e,lineScrollRequest:void 0});function uf(e){return typeof e=="object"&&"path"in e?AT(e):e}const Ac=(e,t)=>e.branch===t.branch;function pn(e){return typeof e=="string"?`home:${e}`:"code"in e?`code:${e.branch}`:"kind"in e?e.kind==="plan"?`plan:${e.promptId}`:`subagent:${e.spawnPartId}`:"path"in e?`file:${_x(e)}`:`experiment:${e.id}:${e.view}`}function df(e,t){const n=e.filter(r=>pn(r)!==t);return n.length===e.length?e:n}function q8(e,t=!1){const n={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1};if(e===md&&t){const r={path:jf,source:"artifacts"};return{...n,rightTab:r,tabHistory:[r],fileTabs:[r],panelOpen:!0}}if(e===lS){const r=[{path:"nanochat-base-training-curves.svg",source:"artifacts"},{path:"nanochat-sft-training-curves.svg",source:"artifacts"},{path:"nanochat-training-throughput.svg",source:"artifacts"},{path:"nanochat-core-evaluation.svg",source:"artifacts"}];return{...n,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,panelOpen:!0}}if(e===cS){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...n,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,panelOpen:!0}}return n}function tse(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function nse(e,t,n,r,i){let a=e,o;const l=t==null?void 0:t.replace(/\/+$/,""),c=r==null?void 0:r.replace(/\/+$/,"");if(a.startsWith("artifacts/"))return a=a.slice(10),a?{path:a,source:"artifacts"}:null;if(a==="~"||a.startsWith("~/"))return{path:a,source:"abs"};const d=g=>{const b=x=>x.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[k,S]=[b(a),b(g)];return k===S?"":k.startsWith(`${S}/`)?k.slice(S.length).replace(/^\/+/,""):null},m=a.startsWith("/")&&c?d(c):null,f=a.startsWith("/")&&l?d(l):null;if(!a.startsWith("/"))o=n;else{if(m!==null)return m?{path:m,source:"artifacts"}:null;if(f!==null)a=f;else{const g=i?tse(i):"[^/]+",b=a.match(new RegExp(`/files/${g}/(.+)$`)),k=b?null:a.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),S=b||k?null:a.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(b)return{path:b[1],source:"artifacts"};k?(o=k[1],a=k[2]):S&&(a=S[1])}}return a?a.startsWith("/")?{path:a,source:"abs"}:{path:a,sessionId:o}:null}function rse(e,t){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??t}const i_="orx:panel-width",TT="orx:experiments-view";function ise(){try{return localStorage.getItem(TT)==="tree"?"tree":"table"}catch{return"table"}}const eh=360,sse=10,ase=272,ose=380,lse=ase+56,cse=80,use=48;function Tf(){return Math.max(eh,window.innerWidth-lse-ose)}function dse(){const e=Tf();try{const t=Number(localStorage.getItem(i_));if(Number.isFinite(t)&&t>=eh)return Math.min(t,e)}catch{}return Math.max(eh,Math.min(760,e,Math.round(window.innerWidth*.42)))}function ud(e,t){const n=e.findIndex(i=>i.id===t.id);if(n<0)return[...e,t];const r=e.slice();return r[n]=t,r}function G8(e){const t=R.useRef(e);return t.current.size===e.size&&[...e].every(([r,i])=>t.current.get(r)===i)||(t.current=e),t.current}function hse(){var ie,ye;const[e,t]=R.useState(null),[n,r]=R.useState(null),i=R.useRef(void 0);i.current=n==null?void 0:n.tourCompleted;const a=R.useRef(!1),[o,l]=R.useState(null),c=R.useRef(null),[d,m]=R.useState(null),[f,g]=R.useState([]),[b,k]=R.useState([]),S=R.useRef(b);S.current=b;const x=R.useRef(new Map),v=R.useRef(new Set),w=R.useRef(null),y=R.useRef(!1),C=R.useRef(new Map),N=R.useRef(new Map),E=R.useRef(0),M=R.useRef(f);M.current=f;const[T,D]=R.useState(null),[z,$]=R.useState(ise),[F,U]=R.useState("project"),V=R.useRef(null),{open:X,setOpen:Y,ref:Q}=Vo(V),[te,I]=R.useState(null),[O,H]=R.useState(!1),G=f.every(K=>K.chatSessionId),W=te&&G?F:"project",re=R.useMemo(()=>W!=="agent"?f:f.filter(K=>K.chatSessionId===te),[f,W,te]),ce=R.useMemo(()=>{if(W!=="agent")return b;const K=new Set(re.map(ae=>ae.id));return b.filter(ae=>K.has(ae.experimentId))},[b,re,W]);R.useEffect(()=>{try{localStorage.setItem(TT,z)}catch{}},[z]);const[me,ne]=R.useState(null),[B,se]=R.useState("experiments"),[le,_e]=R.useState([]),[be,Ce]=R.useState(!1),[Le,$e]=R.useState(!1),[Ge,Fe]=R.useState(!1),[ut,Ke]=R.useState([]),[Ue,ct]=R.useState([]),Kt=R.useRef(new Map),Rt=R.useRef(0),[qe,nt]=R.useState([]),[ve,je]=R.useState([]),[Pe,Ze]=R.useState([]),[De,et]=R.useState(null),[rt,At]=R.useState("files"),[xt,Xt]=R.useState(new Set),[dt,rn]=R.useState(!1),[mn,qn]=R.useState(!1),[Ui,qi]=R.useState(dse),[Ts,Tr]=R.useState(!0),[hi,pr]=R.useState(!1),[Yo,Zr]=R.useState(!1),[Zt,ln]=R.useState("chat"),[fi,oa]=R.useState(null),Ns=R.useRef(new Map),ls=R.useRef(q8()),Nr=R.useRef(null),_r=R.useRef(!1),xr=R.useRef(le);xr.current=le;const pi=R.useRef(null),Mn=R.useCallback(K=>{pi.current=K,et(K)},[]),ft=R.useCallback(K=>{const ae=pn(K);Ke(Me=>df(Me,ae)),ct(Me=>df(Me,ae)),nt(Me=>df(Me,ae)),je(Me=>df(Me,ae));const he=Gn.current;he&&typeof K=="object"&&"path"in K&&Kt.current.delete(cd(he,Nr.current,K));const Ee=xr.current.filter(Me=>pn(Me)!==ae);xr.current=Ee,_e(Ee)},[]),vt=R.useCallback((K,ae=!1)=>{_r.current=!1;const he=pn(K),Ee=xr.current.some(Qe=>pn(Qe)===he);if(ae&&!Ee){const Qe=pi.current;Qe&&pn(Qe)!==he&&ft(Qe),Mn(uf(K))}const Me=[...xr.current.filter(Qe=>pn(Qe)!==he),uf(K)];xr.current=Me,_e(Me),se(K)},[ft,Mn]),yn=R.useCallback(K=>{const ae=pi.current;ae&&pn(ae)===pn(K)&&Mn(null)},[Mn]),Ve=R.useCallback((K,ae)=>{_r.current=!1;const he=pn(K),Ee=pi.current;Ee&&pn(Ee)===he&&Mn(null);const Me=xr.current.filter(it=>pn(it)!==he);if(xr.current=Me,_e(Me),!ae)return;const Qe=Me[Me.length-1];Qe?se(Qe):(rn(!1),qn(!1))},[Mn]),wt=R.useCallback(K=>{K!=="chat"&&(_r.current=!1),ln(K)},[]);ls.current={rightTab:uf(B),tabHistory:le,experimentsTabOpen:be,filesTabOpen:Le,artifactsTabOpen:Ge,expTabs:ut,fileTabs:Ue,planTabs:qe,subagentTabs:ve,codeTabs:Pe,previewTab:De,filesView:rt,filesToggled:xt,selectedRunId:me,scope:F,panelOpen:dt,panelMax:mn};const la=R.useCallback(K=>{const ae=Nr.current;if(ae===K)return;ae&&Ns.current.set(ae,ls.current);let he=K?Ns.current.get(K):void 0;if(!he){const Ee=K===md&&i.current===!1&&!a.current;Ee&&(a.current=!0,H(!0)),he=q8(K??void 0,Ee)}if(K&&_r.current){_r.current=!1;const Ee="experiments";he={...he,rightTab:Ee,tabHistory:[...he.tabHistory.filter(Me=>pn(Me)!==pn(Ee)),Ee],experimentsTabOpen:!0,panelOpen:!0}}se(he.rightTab),xr.current=he.tabHistory,_e(he.tabHistory),Ce(he.experimentsTabOpen),$e(he.filesTabOpen),Fe(he.artifactsTabOpen),Ke(he.expTabs),ct(he.fileTabs),nt(he.planTabs),je(he.subagentTabs),Ze(he.codeTabs),Mn(he.previewTab),At(he.filesView),Xt(he.filesToggled),ne(he.selectedRunId),U(he.scope),rn(he.panelOpen),qn(he.panelMax),Nr.current=K,I(K)},[Mn]),zn=(n==null?void 0:n.onboardingCompleted)??!1,[mi,Ir]=R.useState(!1),zr=R.useCallback(()=>Ir(!0),[]),jr=R.useCallback(async()=>{const K=await o3({tourCompleted:!0});r(ae=>ae&&{...ae,tourCompleted:K.tourCompleted}),Ir(!1)},[]),$t=R.useCallback(async()=>{await jr(),Zr(!0)},[jr]);R.useEffect(()=>{!d||!dg(d)||hi||!zn||n!=null&&n.tourCompleted||zr()},[d,hi,zn,zr,n==null?void 0:n.tourCompleted]);const Gn=R.useRef(d);Gn.current=d;const Qt=R.useCallback(()=>{ln("chat"),Ce(!0),vt("experiments"),rn(!0),Nr.current||(_r.current=!0)},[vt]),ar=R.useCallback(()=>{l(null),t(null),r(null),Promise.allSettled([CR(),ER()]).then(([K,ae])=>{const he=[];K.status==="fulfilled"?(t(K.value),m(Ee=>{var Me;return Ee&&K.value.some(Qe=>Qe.id===Ee)?Ee:((Me=K.value[0])==null?void 0:Me.id)??null})):he.push("projects"),ae.status==="fulfilled"?(c.current=ae.value.preferredAgent,r(ae.value)):he.push("settings"),he.length>0&&l(`Couldn't load OpenResearch ${he.join(" and ")}.`)})},[]);R.useEffect(()=>{ar()},[ar]);const gi=R.useRef(Promise.resolve()),Br=R.useRef(0),Qr=R.useCallback(K=>{const ae=++Br.current;r(Ee=>Ee&&{...Ee,preferredAgent:K});const he=gi.current.then(()=>o3({preferredAgent:K})).then(Ee=>{c.current=Ee.preferredAgent,ae===Br.current&&r(Me=>Me&&{...Me,preferredAgent:Ee.preferredAgent})}).catch(Ee=>{throw ae===Br.current&&r(Me=>Me&&{...Me,preferredAgent:c.current}),Ee});return gi.current=he.catch(()=>{}),he},[]);R.useEffect(()=>{const K=()=>qi(ae=>Math.min(ae,Tf()));return window.addEventListener("resize",K),()=>window.removeEventListener("resize",K)},[]);const cs=R.useCallback(K=>{y.current=!1,C.current.clear(),N.current.clear();const ae=++E.current;IR(K).then(he=>{if(Gn.current!==K||w.current!==K||E.current!==ae)return;C.current=new Map(he.map(Me=>[Me.id,Me]));const Ee=[...N.current.values()].some(Me=>{const Qe=C.current.get(Me.id);return!Qe||Qe.status!=="running"&&Qe.updatedAt<=Me.updatedAt});N.current.clear();for(const Me of he){const Qe=x.current.get(Me.id);(!Qe||Qe.updatedAt{const Qe=new Map(he.map(it=>[it.id,it]));for(const it of Me){const St=Qe.get(it.id);(!St||St.updatedAt<=it.updatedAt)&&Qe.set(it.id,it)}return[...Qe.values()]}),y.current=!0,Ee&&Qt()}).catch(()=>{E.current===ae&&N.current.clear()})},[Qt]);R.useEffect(()=>{if(!d)return;const K=Nr.current;K&&Ns.current.set(K,ls.current),Nr.current=null,_r.current=!1,I(null),w.current=d,x.current.clear(),v.current.clear(),DR(d).catch(()=>{}),g([]),k([]),D(null),ne(null),Ke([]),ct([]),H(!1),nt([]),je([]),Ze([]),Mn(null),At("files"),Xt(new Set),xr.current=[],_e([]),se("experiments"),Ce(!1),$e(!1),Fe(!1),rn(!1),qn(!1),U("project"),OR(d).then(g).catch(()=>{}),cs(d),c3(d).then(D).catch(()=>{})},[cs,d,Mn]);const us=R.useCallback(()=>{const K=Gn.current;K&&c3(K).then(D).catch(()=>{})},[]),ca=R.useCallback(()=>{us(),ln("chat"),Fe(!0),vt("artifacts"),rn(!0)},[us,vt]);iL({onReconnect:()=>{const K=Gn.current;K&&(w.current=K,x.current.clear(),v.current.clear(),cs(K))},onRun:K=>{if(K.projectId!==Gn.current||K.projectId!==w.current)return;const ae=x.current.get(K.id),he=v.current.has(K.id);if(ae&&ae.updatedAt>K.updatedAt||(x.current.set(K.id,K),v.current.add(K.id),k(Qe=>ud(Qe,K)),K.status!=="running"||(ae==null?void 0:ae.status)==="running"))return;const Ee=C.current.get(K.id),Me=y.current&&(!Ee||Ee.status!=="running"&&Ee.updatedAt<=K.updatedAt);he&&ae||Me?Qt():y.current||N.current.set(K.id,K)},onExperiment:K=>{K.projectId===Gn.current&&g(ae=>ud(ae,K))},onProject:K=>{t(ae=>ae?ud(ae,K):[K])},onArtifacts:K=>{K===Gn.current&&us()}});const Ya=R.useCallback(()=>U("project"),[]),Vn=R.useCallback((K,ae="overview",he=!1)=>{const Ee={id:K,view:ae};Ke(Me=>Me.some(Qe=>Tb(Qe,Ee))?Me:[...Me,Ee]),vt(Ee,he),rn(!0)},[vt]),bi=R.useCallback(K=>{const ae=S.current.filter(Ee=>Ee.id===K||Ee.id.startsWith(K)),he=ae.length===1?ae[0]:null;he&&(ne(he.id),Vn(he.experimentId,"terminal",!0))},[Vn]),mr=R.useMemo(()=>new Map(f.map(K=>{var ae;return[K.id,((ae=K.title)==null?void 0:ae.trim())||K.slug||"Experiment"]})),[f]),Rn=G8(mr),or=R.useMemo(()=>{const K=new Map;for(const ae of b)K.set(ae.id,Rn.get(ae.experimentId)??"Experiment");return K},[Rn,b]),Dn=G8(or),js=R.useCallback(K=>{const ae=Dn.get(K);if(ae)return ae;const he=[...Dn].filter(([Ee])=>Ee.startsWith(K));return he.length===1?he[0][1]:""},[Dn]),Gi=R.useCallback(K=>{const ae=Rn.get(K);if(ae)return ae;const he=[...Rn].filter(([Ee])=>Ee.startsWith(K));return he.length===1?he[0][1]:""},[Rn]),Hr=R.useCallback(K=>{const ae=M.current.filter(he=>he.id===K||he.id.startsWith(K));ae.length===1&&Vn(ae[0].id,"overview",!0)},[Vn]),Xa=R.useCallback(K=>{const ae=ut.findIndex(he=>Tb(he,K));ae!==-1&&(Ke(he=>he.filter((Ee,Me)=>Me!==ae)),Ve(K,pn(B)===pn(K)))},[ut,Ve,B]),wn=R.useCallback((K,ae=!1)=>{const he=AT(K);ct(Ee=>{const Me=Ee.findIndex(it=>gl(it,K));if(Me===-1)return[...Ee,he];const Qe=Ee.slice();return Qe[Me]=he,Qe}),vt(K,ae),rn(!0)},[vt]),Vi=R.useCallback((K,ae,he,Ee,Me,Qe)=>{const it=e==null?void 0:e.find(Pr=>Pr.id===d),St=nse(K,it==null?void 0:it.repoPath,ae,(it==null?void 0:it.artifactsDir)??(it==null?void 0:it.filesDir),it==null?void 0:it.slug);if(!St)return null;const Bt=Me?M.current.find(Pr=>Pr.id===Me||Me.length>=6&&Pr.id.startsWith(Me)):void 0,wr=he??(Bt==null?void 0:Bt.branchName),Fr=St.source==null||St.source==="repo";return wr&&Fr&&(St.ref=wr),Qe&&!St.ref&&Fr&&(St.branchLabel=Qe),Ee!=null&&(St.line=Ee,St.lineScrollRequest=++Rt.current),St},[e,d]),Jt=R.useCallback((K,ae,he,Ee,Me,Qe)=>{const it=Vi(K,ae,he,Ee,Me,Qe);it&&wn(it)},[wn,Vi]),Ms=R.useCallback(K=>wn({path:K,source:"artifacts"}),[wn]),gn=R.useCallback((K,ae,he,Ee,Me)=>{const Qe=Vi(K,ae,Me,he,Ee);Qe&&wn(Qe,!0)},[wn,Vi]),Wn=R.useCallback((K,ae)=>{yn(K),ae()},[yn]),vi=R.useCallback(K=>{const ae=Ue.findIndex(he=>gl(he,K));ae!==-1&&(ct(he=>he.filter((Ee,Me)=>Me!==ae)),d&&Kt.current.delete(cd(d,te,K)),te===md&&gl(K,{path:jf,source:"artifacts"})&&H(!1),Ve(K,pn(B)===pn(K)))},[te,Ue,Ve,d,B]),ds=R.useCallback(K=>{K.lineScrollRequest!==void 0&&se(ae=>typeof ae!="object"||!("path"in ae)||!gl(ae,K)||ae.lineScrollRequest!==K.lineScrollRequest?ae:uf(ae))},[]),ql=R.useCallback((K,ae,he)=>{const Ee={kind:"plan",sessionId:ae,promptId:he,plan:K};nt(Me=>{const Qe=Me.findIndex(St=>St.promptId===he);if(Qe===-1)return[...Me,Ee];const it=Me.slice();return it[Qe]=Ee,it}),vt(Ee,!0),rn(!0)},[vt]),Gl=R.useCallback(K=>{const ae=qe.findIndex(he=>he.promptId===K.promptId);ae!==-1&&(nt(he=>he.filter((Ee,Me)=>Me!==ae)),Ve(K,pn(B)===pn(K)))},[Ve,qe,B]),Ka=R.useCallback((K,ae,he)=>{const Ee={kind:"subagent",sessionId:K,spawnPartId:ae,label:he};je(Me=>Me.some(Qe=>Qe.spawnPartId===ae)?Me:[...Me,Ee]),vt(Ee,!0),rn(!0)},[vt]),Rs=R.useCallback(K=>{const ae=ve.findIndex(he=>he.spawnPartId===K.spawnPartId);ae!==-1&&(je(he=>he.filter((Ee,Me)=>Me!==ae)),Ve(K,pn(B)===pn(K)))},[Ve,B,ve]),[Vl,Wl]=R.useState({});R.useEffect(()=>{if(Wl(it=>{const St=new Set(ve.map(Bt=>Bt.spawnPartId));return Object.keys(it).every(Bt=>St.has(Bt))?it:Object.fromEntries(Object.entries(it).filter(([Bt])=>St.has(Bt)))}),ve.length===0)return;let K=!0;const ae=new Set,he=(it,St,Bt)=>{Wl(wr=>{var Pr;let Fr=wr;for(const xi of St)if(!(Bt&&ae.has(xi.spawnPartId)))for(const zs of it){const Ln=H2(zs.parts,xi.spawnPartId);if(!Ln)continue;Bt||ae.add(xi.spawnPartId);const da={label:XV(Ln),running:((Pr=Ln.state)==null?void 0:Pr.status)==="running"},eo=Fr[xi.spawnPartId];(!eo||eo.label!==da.label||eo.running!==da.running)&&(Fr===wr&&(Fr={...wr}),Fr[xi.spawnPartId]=da);break}return Fr})};let Ee=0;const Me=()=>{const it=++Ee;for(const St of new Set(ve.map(Bt=>Bt.sessionId)))gd(St).then(({messages:Bt})=>{K&&it===Ee&&he(Bt,ve.filter(wr=>wr.sessionId===St),!0)}).catch(()=>{})};Me();const Qe=Td(it=>{if(it.type==="reconnected"){ae.clear(),Me();return}if(it.type!=="message")return;const St=ve.filter(Bt=>Bt.sessionId===it.sessionId);St.length&&he([it.message],St,!1)});return()=>{K=!1,Qe()}},[ve]);const Wi=R.useCallback((K,ae,he="files")=>{const Ee={code:!0,experimentId:K,branch:ae,view:he,toggled:new Set};Ze(Me=>Me.some(Qe=>Ac(Qe,Ee))?Me.map(Qe=>Ac(Qe,Ee)?{...Qe,experimentId:K,view:he}:Qe):[...Me,Ee]),vt(Ee),rn(!0)},[vt]),$r=R.useCallback((K,ae)=>{Ze(he=>he.map(Ee=>Ac(Ee,K)?{...Ee,...ae}:Ee))},[]),Za=R.useCallback(K=>{const ae=Pe.findIndex(he=>Ac(he,K));ae!==-1&&(Ze(he=>he.filter((Ee,Me)=>Me!==ae)),Ve(K,pn(B)===pn(K)))},[Pe,Ve,B]),Xo=R.useCallback(()=>{ln("chat"),$e(!0),vt("files"),rn(!0)},[vt]),Yi=R.useCallback(K=>{K==="experiments"?Ce(!1):K==="files"?$e(!1):Fe(!1),Ve(K,B===K)},[Ve,B]),Ds=K=>{K.preventDefault(),K.currentTarget.setPointerCapture(K.pointerId);const he=document.body.style.userSelect;document.body.style.userSelect="none";const Ee=mn,Me=K.clientX,Qe=Ui;let it=!1;function St(){window.removeEventListener("pointermove",Bt),window.removeEventListener("pointerup",St),window.removeEventListener("pointercancel",St),document.body.style.userSelect=he}function Bt(wr){if(Ee){const zs=wr.clientX-Me;if(it||zsPr+cse){qn(!0);return}qn(!1);const xi=Math.min(Math.max(Fr,eh),Pr);qi(xi);try{localStorage.setItem(i_,String(xi))}catch{}}window.addEventListener("pointermove",Bt),window.addEventListener("pointerup",St),window.addEventListener("pointercancel",St)},Ls=(K,ae)=>{t(he=>he?ud(he,K):[K]),m(K.id),pr(!1),ae&&(oa({projectId:K.id,message:ae}),wt("git"))},Qa=K=>{t(ae=>ae&&ae.filter(he=>he.id!==K)),d===K&&m(null)},_i=typeof B=="object"&&"id"in B?B:null,bn=typeof B=="object"&&"path"in B?B:null,Yn=te===md&&O?Ue.find(K=>gl(K,{path:jf,source:"artifacts"})):void 0,Ja=Yn?[Yn]:[],Os=Yn?Ue.filter(K=>!gl(K,Yn)):Ue,yr=typeof B=="object"&&"kind"in B&&B.kind==="plan"?B:null,gr=typeof B=="object"&&"kind"in B&&B.kind==="subagent"?B:null,hs=typeof B=="object"&&"code"in B?B:null,Mr=hs?Pe.find(K=>Ac(K,hs))??null:null,Xi=K=>De!==null&&pn(De)===pn(K),Is=K=>h.jsx(No,{active:bn!==null&&gl(bn,K),label:K.path.split("/").pop()||K.path,icon:h.jsx(nS,{size:12,style:{flexShrink:0}}),preview:Xi(K),onSelect:()=>vt(K),onPromote:()=>yn(K),onClose:()=>vi(K)},`file:${_x(K)}`),Ft=(e==null?void 0:e.find(K=>K.id===d))??null,Sn=_i?f.find(K=>K.id===_i.id)??null:null,Jr=Mr?f.find(K=>K.id===Mr.experimentId)??null:null;if(o)return h.jsx("div",{className:"app flex flex-col h-full",children:h.jsxs("div",{className:U8,children:[h.jsx("p",{children:o}),h.jsx("button",{className:Xr,onClick:ar,children:"Retry"})]})});if(e===null||n===null)return h.jsx("div",{className:"app flex flex-col h-full",children:h.jsx("div",{className:U8,children:h.jsx("span",{className:Pt})})});if(e.length===0)return h.jsx("div",{className:"app flex flex-col h-full",children:zn?h.jsx(R7,{projects:e,onOpen:m,onCreated:Ls,onDeleted:Qa}):h.jsx(pZ,{preferredAgent:n.preferredAgent,onDone:(K,ae)=>{YG(),c.current=ae,t([K]),m(K.id),r(he=>({...he??{tourCompleted:!1},onboardingCompleted:!0,preferredAgent:ae}))}})});const ua=h.jsx(hZ,{projectName:((ie=e.find(K=>K.id===d))==null?void 0:ie.name)??"",onHome:()=>pr(!0),onNewProject:()=>Zr(!0),onRepository:()=>wt("git"),onCollapse:()=>Tr(!1)});return h.jsxs("div",{className:"app flex flex-col h-full",children:[h.jsx(jq,{}),hi?h.jsx(R7,{projects:e,onOpen:K=>{m(K),pr(!1)},onCreated:Ls,onDeleted:Qa}):h.jsxs("div",{className:"app-body flex flex-1 min-h-0 py-0 px-3.5",children:[d&&h.jsx(oW,{projectId:d,projectName:(Ft==null?void 0:Ft.name)??"",paperId:(ye=e.find(K=>K.id===d))==null?void 0:ye.paperId,railHeader:ua,railOpen:Ts,onShowRail:()=>Tr(!0),mainView:Zt,onSelectMainView:wt,experimentsActive:Zt==="chat"&&dt&&B==="experiments",filesActive:Zt==="chat"&&dt&&B==="files",artifactsActive:Zt==="chat"&&dt&&B==="artifacts",onOpenExperiments:Qt,onOpenArtifacts:ca,onOpenFile:gn,onOpenRun:bi,runExperimentName:js,onOpenExperiment:Hr,experimentName:Gi,onOpenPlan:ql,onOpenSubagent:Ka,onOpenWorktree:Xo,onOpenDemoWelcome:Ft&&dg(Ft.id)?zr:void 0,onActiveSessionChange:la,preferredAgent:n.preferredAgent,onPreferredAgentChange:Qr,children:Zt==="skills"?h.jsx(JK,{project:Ft}):Zt!=="chat"?h.jsx(RG,{tab:Zt,project:Ft,githubPublicationError:fi&&fi.projectId===(Ft==null?void 0:Ft.id)?fi.message:null,onProjectUpdate:K=>{t(ae=>ae?ud(ae,K):[K]),K.githubEnabled&&oa(null)},onSelectTab:wt}):null}),Zt==="chat"&&dt&&h.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-2.5 mr-0 mb-2.5 ml-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-[0_12px_40px_color-mix(in_oklab,_var(--text)_22%,_transparent)] floating-panel border border-border rounded-lg 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 ${mn?"max":""}`,style:mn?void 0:{width:Ui},"data-onboarding":"experiments",children:[h.jsx("div",{className:`panel-resizer absolute left-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] [&:active]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] ${mn?"cursor-e-resize":"cursor-col-resize"}`,title:mn?"Drag right to restore panel":"Drag to resize panel",onPointerDown:Ds}),h.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pr-1.5 pb-0 pl-2 h-10 border-b border-b-border bg-background shrink-0",children:[h.jsxs("div",{className:"tab-strip flex items-end gap-0.5 flex-1 min-w-0 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[Ja.map(Is),Le&&h.jsx(No,{active:B==="files",label:"Files",icon:h.jsx(Ad,{size:12,style:{flexShrink:0}}),onSelect:()=>vt("files"),onClose:()=>Yi("files")}),Ge&&h.jsx(No,{active:B==="artifacts",label:"Artifacts",icon:h.jsx(a_,{size:12,style:{flexShrink:0}}),onSelect:()=>vt("artifacts"),onClose:()=>Yi("artifacts")}),be&&h.jsx(No,{active:B==="experiments",label:"Experiments",icon:h.jsx(Nb,{size:12,style:{flexShrink:0}}),onSelect:()=>vt("experiments"),onClose:()=>Yi("experiments")}),ut.map(K=>{const ae=f.find(he=>he.id===K.id);return h.jsx(No,{active:_i!==null&&Tb(_i,K),label:ae?ae.title||ae.slug:"…",icon:K.view==="overview"?h.jsx(X8,{size:12,style:{flexShrink:0}}):h.jsx(Wc,{size:12,style:{flexShrink:0}}),preview:Xi(K),onSelect:()=>vt(K),onPromote:()=>yn(K),onClose:()=>Xa(K)},`${K.id}:${K.view}`)}),Os.map(Is),qe.map(K=>h.jsx(No,{active:yr!==null&&yr.promptId===K.promptId,label:"Plan",icon:h.jsx(l_,{size:12,style:{flexShrink:0}}),preview:Xi(K),onSelect:()=>vt(K),onPromote:()=>yn(K),onClose:()=>Gl(K)},`plan:${K.promptId}`)),ve.map(K=>{var ae,he;return h.jsx(No,{active:gr!==null&&gr.spawnPartId===K.spawnPartId,label:((ae=Vl[K.spawnPartId])==null?void 0:ae.label)??K.label??"Sub-agent",shimmer:((he=Vl[K.spawnPartId])==null?void 0:he.running)??!1,icon:h.jsx(c_,{size:12,style:{flexShrink:0}}),preview:Xi(K),onSelect:()=>vt(K),onPromote:()=>yn(K),onClose:()=>Rs(K)},`subagent:${K.spawnPartId}`)}),Pe.map(K=>{const ae=f.find(he=>he.id===K.experimentId);return h.jsx(No,{active:Mr!==null&&Ac(Mr,K),label:(ae==null?void 0:ae.slug)??K.branch,icon:h.jsx(Ad,{size:12,style:{flexShrink:0}}),onSelect:()=>vt(K),onClose:()=>Za(K)},`code:${K.branch}`)})]}),h.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[h.jsx("button",{className:nr,title:mn?"Restore panel":"Expand panel","aria-label":mn?"Restore panel":"Expand panel",onClick:()=>qn(K=>!K),children:mn?h.jsx(FM,{size:14}):h.jsx(BM,{size:14})}),h.jsx("button",{className:nr,title:"Close panel","aria-label":"Close panel",onClick:()=>{_r.current=!1,rn(!1),qn(!1)},children:h.jsx(Vr,{size:14})})]})]}),B==="artifacts"?h.jsx("div",{className:ja,children:Ft&&h.jsx(WK,{project:Ft,artifacts:T,onChanged:us,onOpenFile:Ms,onOpenStorage:()=>wt("storage")},Ft.id)}):B==="experiments"?h.jsxs("div",{className:ja,children:[h.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[h.jsx("span",{style:{flex:1}}),h.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[h.jsxs("div",{className:"option-picker relative inline-flex",ref:Q,children:[h.jsx("button",{ref:V,className:`${hh} experiment-scope-trigger w-6.5 h-6.5 rounded-sm${W==="agent"?" active":""}`,title:`Experiment filter: ${W==="agent"?"Current task":"Entire project"}`,"aria-label":"Filter experiments","aria-expanded":X,onClick:()=>Y(K=>!K),children:h.jsx(wM,{size:16,strokeWidth:2.5})}),X&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right experiment-scope-menu [&_.model-item]:whitespace-nowrap [&_.model-item:disabled]:text-muted [&_.model-item:disabled]:cursor-default [&_.model-item:disabled:hover]:bg-transparent",children:[h.jsxs("button",{className:li,"aria-pressed":W==="agent",disabled:!te||!G,title:te?G?void 0:"Current task filtering is unavailable for unattributed experiments":"Open a task to filter to its experiments",onClick:()=>{U("agent"),Y(!1)},children:[h.jsx("span",{children:"Current task"}),W==="agent"&&h.jsx(Di,{size:13})]}),h.jsxs("button",{className:li,"aria-pressed":W==="project",onClick:()=>{U("project"),Y(!1)},children:[h.jsx("span",{children:"Entire project"}),W==="project"&&h.jsx(Di,{size:13})]})]})]}),h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:font-semibold [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":"Experiment view",children:[h.jsx("button",{className:z==="table"?"active":"","aria-pressed":z==="table",onClick:()=>$("table"),children:"Table"}),h.jsx("button",{className:z==="tree"?"active":"","aria-pressed":z==="tree",onClick:()=>$("tree"),children:"Tree"})]})]})]}),h.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:z==="tree"?Ft&&h.jsx(ese,{experiments:f,runs:ce,project:Ft,onOpenView:Vn,onOpenCode:Wi,agentSessionId:W==="agent"?te:null,onShowProjectScope:Ya}):h.jsx(kZ,{runs:ce,emptyHint:W==="agent"&&f.length>0?"No experiments from the current task yet. Switch to Entire project to see all experiments.":void 0,experiments:re,onOpen:K=>{Vn(K.id,"overview")},onOpenLogs:(K,ae)=>{ne(ae),Vn(K,"terminal")},onOpenCode:K=>{const ae=f.find(he=>he.id===K);ae&&Wi(ae.id,ae.branchName,"files")},onCancel:pS})})]}):B==="files"?h.jsx("div",{className:ja,children:Ft?h.jsx(IK,{sessionId:te??void 0,project:Ft,view:rt,toggled:xt,onViewChange:At,onToggledChange:Xt,onOpenFile:Jt},`files:${te??`project:${Ft.id}`}`):h.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:h.jsx("div",{className:zc,children:h.jsxs("div",{className:"wt-empty flex flex-col items-center gap-2.5 py-12 px-6 text-center text-muted [&_>_svg]:text-subtext [&_p]:m-0 [&_p]:max-w-80 [&_p]:text-sm",children:[h.jsx(rS,{size:22}),h.jsx("p",{children:"Select a project to browse its files."})]})})})}):bn?h.jsx("div",{className:ja,children:d&&h.jsx(dZ,{projectId:d,path:bn.path,source:bn.source,sessionId:bn.source==="artifacts"?te??void 0:bn.sessionId,gitRef:bn.ref,line:bn.line,branchLabel:rse(bn,Ft==null?void 0:Ft.baselineBranch),onOpenFile:(K,ae,he)=>Wn(bn,()=>Jt(K,ae,he)),scrollPosition:Kt.current.get(cd(d,te,bn)),onScrollPositionChange:K=>{Kt.current.set(cd(d,te,bn),K)},lineScrollRequest:bn.lineScrollRequest,onLineScrollRequestHandled:()=>ds(bn),onEdit:()=>yn(bn)},cd(d,te,bn))}):yr?h.jsx("div",{className:ja,children:h.jsx("div",{className:"pane-content flex-1 min-h-0 relative plan-tab-content overflow-y-auto bg-background py-4.5 px-6 [&_.md]:max-w-readable",children:h.jsx(za,{text:yr.plan,onOpenFile:K=>Wn(yr,()=>Jt(K,yr.sessionId))})})}):gr?h.jsx(lW,{sessionId:gr.sessionId,spawnPartId:gr.spawnPartId,onOpenFile:K=>Wn(gr,()=>gn(K,gr.sessionId)),onOpenRun:K=>Wn(gr,()=>bi(K)),runExperimentName:js,onOpenExperiment:K=>Wn(gr,()=>Hr(K)),experimentName:Gi,onOpenSubagent:(K,ae)=>Wn(gr,()=>Ka(gr.sessionId,K,ae))},gr.spawnPartId):Mr?h.jsx("div",{className:ja,children:d&&Ft&&Mr&&Jr&&h.jsx(LK,{projectId:d,project:Ft,experiment:Jr,view:Mr.view,toggled:Mr.toggled,onViewChange:K=>$r(Mr,{view:K}),onToggledChange:K=>$r(Mr,{toggled:K}),onOpenFile:(K,ae,he)=>Jt(K,ae,he,void 0,void 0,Jr.branchName)},`code:${Mr.branch}`)}):h.jsx("div",{className:ja,children:_i&&Sn&&Ft&&h.jsx(lZ,{experiment:Sn,project:Ft,view:_i.view,runs:b,selectedRunId:me,onSelectRun:ne,parentExperiment:f.find(K=>K.id===Sn.parentExperimentId)??null,onOpenView:(K,ae)=>{ae&&ne(ae),Vn(Sn.id,K)},onOpenCode:K=>Wi(Sn.id,Sn.branchName,K)},`${_i.id}:${_i.view}`)})]})]}),Yo&&h.jsx(BE,{onClose:()=>Zr(!1),onCreated:(K,ae)=>{Zr(!1),Ls(K,ae)}}),mi&&!hi&&Ft&&dg(Ft.id)&&h.jsx(CZ,{onClose:jr,onCreateProject:$t})]})}Sj.createRoot(document.getElementById("root")).render(h.jsx(R.StrictMode,{children:h.jsx(hse,{})})); diff --git a/ui/dist/assets/index-C_dWCzRy.css b/ui/dist/assets/index-DrR-RKJ6.css similarity index 67% rename from ui/dist/assets/index-C_dWCzRy.css rename to ui/dist/assets/index-DrR-RKJ6.css index de7f98fd..b533c780 100644 --- a/ui/dist/assets/index-C_dWCzRy.css +++ b/ui/dist/assets/index-DrR-RKJ6.css @@ -1 +1 @@ -/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-outline-style:solid;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}@layer theme{:root,:host{--spacing:.25rem;--container-2xl:42rem;--tracking-wide:.025em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:6px;--radius-md:8px;--radius-lg:10px;--radius-2xl:1rem;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer base{*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--base);color:var(--text);font-family:var(--sans);font-size:var(--fs-base);line-height:1.45;overflow:hidden}::selection{background:var(--highlight)}.chat-thread-inner ::selection{background:var(--chat-annotation-highlight)}::highlight(chat-annotations){background:var(--chat-annotation-highlight)}button{font:inherit;color:inherit;cursor:pointer;background:0 0;border:none;padding:0}input,textarea,select{font:inherit;color:var(--text);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-md);outline:none;padding:6px 10px}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:var(--radius-sm);background-clip:padding-box;border:2px solid #0000}::-webkit-scrollbar-track{background:0 0}}@layer vendor{.react-flow{--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:#ffffff80;--xy-minimap-background-color-default:#fff;--xy-minimap-mask-background-color-default:#f0f0f099;--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:#f0f0f040;--xy-node-boxshadow-hover-default:0 1px 4px 1px #00000014;--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:#0059dc14;--xy-selection-border-default:1px dotted #0059dccc;--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 #00000014;--xy-edge-label-background-color-default:#fff;--xy-edge-label-color-default:inherit;--xy-resize-background-color-default:#3367d9;direction:ltr}.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:#96969640;--xy-minimap-background-color-default:#141414;--xy-minimap-mask-background-color-default:#3c3c3c99;--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:#f0f0f040;--xy-node-boxshadow-hover-default:0 1px 4px 1px #ffffff14;--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:#c8c8dc14;--xy-selection-border-default:1px dotted #c8c8dccc;--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 #00000014;--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{width:100%;height:100%;position:absolute;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{pointer-events:none;position:absolute;overflow:visible}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.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;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:.5s linear infinite dashdraw}svg.react-flow__connectionline{z-index:1001;position:absolute;overflow:visible}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.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:0 0;pointer-events:none}.react-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.react-flow__handle{pointer-events:none;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%;width:6px;min-width:5px;height:6px;min-height:5px;position:absolute}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;bottom:0;left:50%;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{z-index:5;margin:15px;position:absolute}.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{background:var(--xy-attribution-background-color,var(--xy-attribution-background-color-default));margin:0;padding:2px 3px;font-size:10px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.react-flow__edgelabel-renderer{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__viewport-portal{-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.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{box-shadow:var(--xy-controls-box-shadow,var(--xy-controls-box-shadow-default));flex-direction:column;display:flex}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{background:var(--xy-controls-button-background-color,var(--xy-controls-button-background-color-default));border:none;border-bottom:1px solid var(--xy-controls-button-border-color-props,var(--xy-controls-button-border-color,var(--xy-controls-button-border-color-default)));width:26px;height:26px;color:var(--xy-controls-button-color-props,var(--xy-controls-button-color,var(--xy-controls-button-color-default)));cursor:pointer;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;padding:4px;display:flex}.react-flow__controls-button svg{fill:currentColor;width:100%;max-width:12px;max-height:12px}.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{border-radius:var(--xy-node-border-radius,var(--xy-node-border-radius-default));width:150px;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));padding:10px;font-size:12px}.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{background-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border:1px solid #fff;border-radius:1px;width:5px;height:5px;translate:-50% -50%}.react-flow__resize-control.handle.left{top:50%;left:0}.react-flow__resize-control.handle.right{top:50%;left:100%}.react-flow__resize-control.handle.top{top:0;left:50%}.react-flow__resize-control.handle.bottom{top:100%;left:50%}.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-style:solid;border-width:0}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;height:100%;top:0;transform:translate(-50%)}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{width:100%;height:1px;left:0;transform:translateY(-50%)}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.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))}.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;top:0;right:0;bottom:0;left:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.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{z-index:10;color:#0000;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;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;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2)format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff)format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2)format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff)format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2)format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff)format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2)format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff)format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2)format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff)format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2)format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff)format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2)format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff)format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2)format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff)format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2)format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff)format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2)format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff)format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2)format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff)format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff)format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff)format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff)format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2)format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff)format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2)format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff)format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2)format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff)format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC)format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff)format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2)format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff)format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2)format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff)format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf)format("truetype")}.katex{text-indent:0;text-rendering:auto;font:1.21em/1.2 KaTeX_Main,Times New Roman,serif;position:relative}.katex *{border-color:currentColor;-ms-high-contrast-adjust:none!important}.katex .katex-version:after{content:"0.16.47"}.katex .katex-mathml{clip-path:inset(50%);border:0;width:1px;height:1px;padding:0;position:absolute;overflow:hidden}.katex .katex-html>.newline{display:block}.katex .base{white-space:nowrap;width:min-content;position:relative}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;table-layout:fixed;display:inline-table}.katex .vlist-r{display:table-row}.katex .vlist{vertical-align:bottom;display:table-cell;position:relative}.katex .vlist>span{height:0;display:block;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{width:0;overflow:hidden}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{vertical-align:bottom;width:2px;min-width:2px;font-size:1px;display:table-cell}.katex .vbox{flex-direction:column;align-items:baseline;display:inline-flex}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{flex-direction:row;display:inline-flex}.katex .thinbox{width:0;max-width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .smash{line-height:0;display:inline}.katex .clap,.katex .llap,.katex .rlap{width:0;position:relative}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .hdashline{border-bottom-style:dashed;width:100%;display:inline-block}.katex .sqrt>.root{margin-left:.277778em;margin-right:-.555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.833333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.714286em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.857143em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14286em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71429em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96286em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55429em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.416667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.583333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.833333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.347222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.416667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.486111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.694444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.833333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44028em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.289352em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.347222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.405093em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.520833em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.578704em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.694444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.833333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.289296em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.385728em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.433944em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.578592em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.694311em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.833173em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.200965em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.241158em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.281351em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.321543em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.361736em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.401929em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.482315em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.694534em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.833601em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{width:.12em;display:inline-block}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{min-width:1px;display:inline-block}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;height:inherit;width:100%;display:block;position:absolute}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;min-width:0;max-width:none;min-height:0;max-height:none}.katex .stretchy{width:100%;display:block;position:relative;overflow:hidden}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{width:100%;position:relative;overflow:hidden}.katex .halfarrow-left{width:50.2%;position:absolute;left:0;overflow:hidden}.katex .halfarrow-right{width:50.2%;position:absolute;right:0;overflow:hidden}.katex .brace-left{width:25.1%;position:absolute;left:0;overflow:hidden}.katex .brace-center{width:50%;position:absolute;left:25%;overflow:hidden}.katex .brace-right{width:25.1%;position:absolute;right:0;overflow:hidden}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{box-sizing:border-box;border:.04em solid}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{box-sizing:border-box;border-top:.049em solid;border-right:.049em solid;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{text-align:left;display:inline-block;position:absolute;right:calc(50% + .3em)}.katex .cd-label-right{text-align:right;display:inline-block;position:absolute;left:calc(50% + .3em)}.katex-display{text-align:center;margin:1em 0;display:block}.katex-display>.katex{text-align:center;white-space:nowrap;display:block}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{text-align:left;padding-left:2em}body{counter-reset:katexEqnNo mmlEqnNo}: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::selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-selection-text-color)}.diff td{vertical-align:top;padding-top:0;padding-bottom:0}.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;text-align:right;-webkit-user-select:none;user-select:none;padding:0 1ch}.diff-gutter-insert{background-color:#d6fedb;background-color:var(--diff-gutter-insert-background-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-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-gutter-selected-text-color)}.diff-code{word-wrap:break-word;white-space:pre-wrap;word-break:break-all;padding:0 0 0 .5em}.diff-code-edit{color:inherit}.diff-code-insert{background-color:#eaffee;background-color:var(--diff-code-insert-background-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-code-insert-edit-text-color)}.diff-code-delete{background-color:#fdeff0;background-color:var(--diff-code-delete-background-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-code-delete-edit-text-color)}.diff-code-selected{background-color:#fffce0;background-color:var(--diff-code-selected-background-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:" ";white-space:pre;width:2px;height:100%;margin-left:4.6ch;display:block;overflow:hidden}.diff-decoration{-webkit-user-select:none;user-select:none;line-height:1.5}.diff-decoration-content{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);padding:0}}@layer components;@layer utilities{.\@container{container-type:inline-size}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.\!absolute{position:absolute!important}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.-inset-14{inset:calc(var(--spacing) * -14)}.inset-0{top:0;right:0;bottom:0;left:0}.top-0{top:0}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-3\.5{top:calc(var(--spacing) * 3.5)}.top-\[9px\]{top:9px}.top-\[calc\(100\%_\+_6px\)\]{top:calc(100% + 6px)}.-right-\[3px\]{right:-3px}.right-0{right:0}.right-1\.5{right:calc(var(--spacing) * 1.5)}.right-3\.5{right:calc(var(--spacing) * 3.5)}.bottom-0{bottom:0}.bottom-\[calc\(100\%_\+_4px\)\]{bottom:calc(100% + 4px)}.bottom-\[calc\(100\%_\+_8px\)\]{bottom:calc(100% + 8px)}.left-0{left:0}.left-3{left:calc(var(--spacing) * 3)}.z-1{z-index:1}.z-4{z-index:4}.z-6{z-index:6}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.z-60{z-index:60}.z-100{z-index:100}.z-200{z-index:200}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-0{margin-inline:0}.mx-1{margin-inline:var(--spacing)}.mx-auto{margin-inline:auto}.my-0{margin-block:0}.my-2{margin-block:calc(var(--spacing) * 2)}.my-2\.5{margin-block:calc(var(--spacing) * 2.5)}.my-3{margin-block:calc(var(--spacing) * 3)}.my-3\.5{margin-block:calc(var(--spacing) * 3.5)}.my-\[5px\]{margin-block:5px}.mt-0{margin-top:0}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-3\.5{margin-top:calc(var(--spacing) * 3.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-4\.5{margin-top:calc(var(--spacing) * 4.5)}.mt-5\.5{margin-top:calc(var(--spacing) * 5.5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-7{margin-top:calc(var(--spacing) * 7)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-19{margin-top:calc(var(--spacing) * 19)}.mt-\[5px\]{margin-top:5px}.mt-\[9px\]{margin-top:9px}.mt-\[13px\]{margin-top:13px}.mr-0{margin-right:0}.mr-1{margin-right:var(--spacing)}.mr-3\.5{margin-right:calc(var(--spacing) * 3.5)}.mb-0{margin-bottom:0}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:var(--spacing)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-3\.5{margin-bottom:calc(var(--spacing) * 3.5)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-4\.5{margin-bottom:calc(var(--spacing) * 4.5)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-5\.5{margin-bottom:calc(var(--spacing) * 5.5)}.mb-6\.5{margin-bottom:calc(var(--spacing) * 6.5)}.mb-9{margin-bottom:calc(var(--spacing) * 9)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.ml-0{margin-left:0}.ml-1{margin-left:var(--spacing)}.ml-3\.5{margin-left:calc(var(--spacing) * 3.5)}.ml-6{margin-left:calc(var(--spacing) * 6)}.ml-auto{margin-left:auto}.box-border{box-sizing:border-box}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.field-sizing-content{field-sizing:content}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.h-2{height:calc(var(--spacing) * 2)}.h-4{height:calc(var(--spacing) * 4)}.h-4\.5{height:calc(var(--spacing) * 4.5)}.h-5\.5{height:calc(var(--spacing) * 5.5)}.h-6{height:calc(var(--spacing) * 6)}.h-6\.5{height:calc(var(--spacing) * 6.5)}.h-7{height:calc(var(--spacing) * 7)}.h-7\.5{height:calc(var(--spacing) * 7.5)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-10\.5{height:calc(var(--spacing) * 10.5)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-\[7px\]{height:7px}.h-\[9px\]{height:9px}.h-\[13px\]{height:13px}.h-\[15px\]{height:15px}.h-full{height:100%}.h-px{height:1px}.max-h-36{max-height:calc(var(--spacing) * 36)}.max-h-50{max-height:calc(var(--spacing) * 50)}.max-h-65{max-height:calc(var(--spacing) * 65)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-85{max-height:calc(var(--spacing) * 85)}.max-h-95{max-height:calc(var(--spacing) * 95)}.max-h-100{max-height:calc(var(--spacing) * 100)}.max-h-\[calc\(100vh_-_40px\)\]{max-height:calc(100vh - 40px)}.max-h-\[calc\(100vh_-_var\(--modal-top\)_-_48px\)\]{max-height:calc(100vh - var(--modal-top) - 48px)}.max-h-\[min\(70vh\,_720px\)\]{max-height:min(70vh,720px)}.max-h-full{max-height:100%}.min-h-0{min-height:0}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-16{min-height:calc(var(--spacing) * 16)}.min-h-19\.5{min-height:calc(var(--spacing) * 19.5)}.min-h-28{min-height:calc(var(--spacing) * 28)}.min-h-dvh{min-height:100dvh}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-4{width:calc(var(--spacing) * 4)}.w-4\.5{width:calc(var(--spacing) * 4.5)}.w-6{width:calc(var(--spacing) * 6)}.w-6\.5{width:calc(var(--spacing) * 6.5)}.w-7{width:calc(var(--spacing) * 7)}.w-7\.5{width:calc(var(--spacing) * 7.5)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-9\.5{width:calc(var(--spacing) * 9.5)}.w-10\.5{width:calc(var(--spacing) * 10.5)}.w-37{width:calc(var(--spacing) * 37)}.w-66{width:calc(var(--spacing) * 66)}.w-68{width:calc(var(--spacing) * 68)}.w-70{width:calc(var(--spacing) * 70)}.w-72{width:calc(var(--spacing) * 72)}.w-110{width:calc(var(--spacing) * 110)}.w-120{width:calc(var(--spacing) * 120)}.w-\[7px\]{width:7px}.w-\[9px\]{width:9px}.w-\[13px\]{width:13px}.w-\[15px\]{width:15px}.w-\[min\(100\%\,_620px\)\]{width:min(100%,620px)}.w-\[min\(440px\,_calc\(100vw_-_48px\)\)\]{width:min(440px,100vw - 48px)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-36{max-width:calc(var(--spacing) * 36)}.max-w-55{max-width:calc(var(--spacing) * 55)}.max-w-60{max-width:calc(var(--spacing) * 60)}.max-w-65{max-width:calc(var(--spacing) * 65)}.max-w-68{max-width:calc(var(--spacing) * 68)}.max-w-72{max-width:calc(var(--spacing) * 72)}.max-w-120{max-width:calc(var(--spacing) * 120)}.max-w-155{max-width:calc(var(--spacing) * 155)}.max-w-160{max-width:calc(var(--spacing) * 160)}.max-w-230{max-width:calc(var(--spacing) * 230)}.max-w-\[88\%\]{max-width:88%}.max-w-\[94vw\]{max-width:94vw}.max-w-full{max-width:100%}.max-w-readable{max-width:var(--readable-col)}.min-w-0{min-width:0}.min-w-24{min-width:calc(var(--spacing) * 24)}.min-w-47\.5{min-width:calc(var(--spacing) * 47.5)}.min-w-55{min-width:calc(var(--spacing) * 55)}.min-w-57\.5{min-width:calc(var(--spacing) * 57.5)}.min-w-80{min-width:calc(var(--spacing) * 80)}.min-w-85{min-width:calc(var(--spacing) * 85)}.flex-1{flex:1}.flex-none{flex:none}.shrink-0{flex-shrink:0}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\[settings-spin_0\.9s_linear_infinite\]{animation:.9s linear infinite settings-spin}.animate-\[spin_0\.8s_linear_infinite\]{animation:.8s linear infinite spin}.animate-\[title-char-in_240ms_ease-out_both\]{animation:.24s ease-out both title-char-in}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-e-resize{cursor:e-resize}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.\[scrollbar-width\:none\]{scrollbar-width:none}.\[scrollbar-gutter\:stable\]{scrollbar-gutter:stable}.\[scrollbar-gutter\:stable_both-edges\]{scrollbar-gutter:stable both-edges}.list-none{list-style-type:none}.grid-cols-\[24px_minmax\(0\,_1fr\)\]{grid-template-columns:24px minmax(0,1fr)}.grid-cols-\[24px_minmax\(0\,_1fr\)_24px\]{grid-template-columns:24px minmax(0,1fr) 24px}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[minmax\(0\,_1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.grid-cols-\[minmax\(180px\,_260px\)_minmax\(0\,_1fr\)\]{grid-template-columns:minmax(180px,260px) minmax(0,1fr)}.grid-cols-\[repeat\(2\,_minmax\(0\,_1fr\)\)\]{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0{gap:0}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-4\.5{gap:calc(var(--spacing) * 4.5)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-\[0\.4em\]{gap:.4em}.gap-\[3px\]{gap:3px}.gap-\[5px\]{gap:5px}.gap-\[7px\]{gap:7px}.gap-\[9px\]{gap:9px}.gap-px{gap:1px}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-3\.5{column-gap:calc(var(--spacing) * 3.5)}.gap-x-4\.5{column-gap:calc(var(--spacing) * 4.5)}.gap-x-8{column-gap:calc(var(--spacing) * 8)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2\.5{row-gap:calc(var(--spacing) * 2.5)}.gap-y-\[3px\]{row-gap:3px}.gap-y-\[7px\]{row-gap:7px}.gap-y-\[9px\]{row-gap:9px}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.\!rounded-lg{border-radius:10px!important}.\!rounded-none{border-radius:0!important}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\[3px\]{border-radius:3px}.rounded-\[16px\]{border-radius:16px}.rounded-\[inherit\]{border-radius:inherit}.rounded-\[var\(--radius-md\)_var\(--radius-md\)_0_0\]{border-radius:var(--radius-md) var(--radius-md) 0 0}.rounded-full{border-radius:999px}.rounded-lg{border-radius:10px}.rounded-md{border-radius:8px}.rounded-sm{border-radius:6px}.rounded-xl{border-radius:12px}.rounded-xs{border-radius:4px}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\[1\.5px\]{border-style:var(--tw-border-style);border-width:1.5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-\[3px\]{border-left-style:var(--tw-border-style);border-left-width:3px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-solid{--tw-border-style:solid;border-style:solid}.border-accent-amber{border-color:var(--accent-amber)}.border-border{border-color:var(--border)}.border-border-variant{border-color:var(--border-variant)}.border-primary{border-color:var(--primary)}.border-text{border-color:var(--text)}.border-transparent{border-color:#0000}.border-t-border{border-top-color:var(--border)}.border-t-border-variant{border-top-color:var(--border-variant)}.border-t-primary{border-top-color:var(--primary)}.border-r-border-variant{border-right-color:var(--border-variant)}.border-b-\[color-mix\(in_oklab\,_var\(--text\)_7\%\,_transparent\)\]{border-bottom-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.border-b-\[color-mix\(in_oklab\,_var\(--text\)_7\%\,_transparent\)\]{border-bottom-color:color-mix(in oklab,var(--text) 7%,transparent)}}.border-b-border{border-bottom-color:var(--border)}.border-b-border-variant{border-bottom-color:var(--border-variant)}.border-l-accent-blue{border-left-color:var(--accent-blue)}.border-l-border{border-left-color:var(--border)}.border-l-border-variant{border-left-color:var(--border-variant)}.\!bg-transparent{background-color:#0000!important}.bg-\[color-mix\(in_oklab\,_var\(--text\)_3\%\,_transparent\)\]{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_oklab\,_var\(--text\)_3\%\,_transparent\)\]{background-color:color-mix(in oklab,var(--text) 3%,transparent)}}.bg-\[color-mix\(in_oklab\,_var\(--text\)_8\%\,_transparent\)\]{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_oklab\,_var\(--text\)_8\%\,_transparent\)\]{background-color:color-mix(in oklab,var(--text) 8%,transparent)}}.bg-\[color-mix\(in_oklab\,_var\(--text\)_10\%\,_transparent\)\]{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_oklab\,_var\(--text\)_10\%\,_transparent\)\]{background-color:color-mix(in oklab,var(--text) 10%,transparent)}}.bg-\[color-mix\(in_srgb\,_var\(--primary\)_16\%\,_transparent\)\]{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_srgb\,_var\(--primary\)_16\%\,_transparent\)\]{background-color:color-mix(in srgb,var(--primary) 16%,transparent)}}.bg-\[rgba\(29\,_27\,_26\,_0\.4\)\]{background-color:#1d1b1a66}.bg-\[rgba\(29\,_27\,_26\,_0\.42\)\]{background-color:#1d1b1a6b}.bg-\[var\(--term-bg\)\]{background-color:var(--term-bg)}.bg-accent{background-color:var(--accent)}.bg-accent-amber-subtle{background-color:var(--accent-amber-subtle)}.bg-background{background-color:var(--base)}.bg-border-variant{background-color:var(--border-variant)}.bg-canvas{background-color:var(--canvas)}.bg-muted{background-color:var(--muted)}.bg-primary{background-color:var(--primary)}.bg-primary-subtle{background-color:var(--primary-subtle)}.bg-surface{background-color:var(--surface)}.bg-text{background-color:var(--text)}.bg-transparent{background-color:#0000}.bg-white{background-color:#fff}.bg-none{background-image:none}.\!p-0{padding:0!important}.p-0{padding:0}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-\[1\.5px\]{padding:1.5px}.p-\[3px\]{padding:3px}.p-\[5px\]{padding:5px}.p-px{padding:1px}.\!px-7{padding-inline:calc(var(--spacing) * 7)!important}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-4\.5{padding-inline:calc(var(--spacing) * 4.5)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-7{padding-inline:calc(var(--spacing) * 7)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-\[7px\]{padding-inline:7px}.px-\[9px\]{padding-inline:9px}.px-\[11px\]{padding-inline:11px}.px-\[13px\]{padding-inline:13px}.px-\[15px\]{padding-inline:15px}.\!py-3\.5{padding-block:calc(var(--spacing) * 3.5)!important}.py-0{padding-block:0}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-4\.5{padding-block:calc(var(--spacing) * 4.5)}.py-6\.5{padding-block:calc(var(--spacing) * 6.5)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-\[3px\]{padding-block:3px}.py-\[5px\]{padding-block:5px}.py-\[7px\]{padding-block:7px}.py-\[9px\]{padding-block:9px}.py-\[11px\]{padding-block:11px}.py-px{padding-block:1px}.pt-0{padding-top:0}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-1\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-3\.5{padding-top:calc(var(--spacing) * 3.5)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-4\.5{padding-top:calc(var(--spacing) * 4.5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-6\.5{padding-top:calc(var(--spacing) * 6.5)}.pt-12{padding-top:calc(var(--spacing) * 12)}.pt-\[var\(--modal-top\)\]{padding-top:var(--modal-top)}.pr-0{padding-right:0}.pr-1{padding-right:var(--spacing)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-\[1ch\]{padding-right:1ch}.pb-0{padding-bottom:0}.pb-1{padding-bottom:var(--spacing)}.pb-1\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-8{padding-bottom:calc(var(--spacing) * 8)}.pb-10{padding-bottom:calc(var(--spacing) * 10)}.pb-15{padding-bottom:calc(var(--spacing) * 15)}.pb-16{padding-bottom:calc(var(--spacing) * 16)}.pl-1\.5{padding-left:calc(var(--spacing) * 1.5)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4\.5{padding-left:calc(var(--spacing) * 4.5)}.pl-\[2ch\]{padding-left:2ch}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-\[-0\.15em\]{vertical-align:-.15em}.align-baseline{vertical-align:baseline}.font-\[inherit\]{font-family:inherit}.font-mono{font-family:var(--mono)}.font-sans{font-family:var(--sans)}.\!text-xl{font-size:var(--fs-xl)!important}.text-2xl{font-size:var(--fs-2xl)}.text-2xs{font-size:var(--fs-2xs)}.text-3xl{font-size:var(--fs-3xl)}.text-4xl{font-size:var(--fs-4xl)}.text-\[2\.5rem\]{font-size:2.5rem}.text-\[4rem\]{font-size:4rem}.text-\[length\:inherit\]{font-size:inherit}.text-base{font-size:var(--fs-base)}.text-lg{font-size:var(--fs-lg)}.text-md{font-size:var(--fs-md)}.text-sm{font-size:var(--fs-sm)}.text-xl{font-size:var(--fs-xl)}.text-xs{font-size:var(--fs-xs)}.leading-\[1\.3\]{--tw-leading:1.3;line-height:1.3}.leading-\[1\.4\]{--tw-leading:1.4;line-height:1.4}.leading-\[1\.6\]{--tw-leading:1.6;line-height:1.6}.leading-\[1\.08\]{--tw-leading:1.08;line-height:1.08}.leading-\[1\.35\]{--tw-leading:1.35;line-height:1.35}.leading-\[1\.45\]{--tw-leading:1.45;line-height:1.45}.leading-\[1\.55\]{--tw-leading:1.55;line-height:1.55}.leading-\[1\.62\]{--tw-leading:1.62;line-height:1.62}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-\[375\]{--tw-font-weight:375;font-weight:375}.font-display{--tw-font-weight:var(--fw-display);font-weight:var(--fw-display)}.font-medium{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.font-normal{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.font-semibold{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.tracking-\[-0\.01em\]{--tw-tracking:-.01em;letter-spacing:-.01em}.tracking-\[-0\.02em\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\[-0\.015em\]{--tw-tracking:-.015em;letter-spacing:-.015em}.tracking-\[-0\.035em\]{--tw-tracking:-.035em;letter-spacing:-.035em}.tracking-\[0\.08em\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.wrap-anywhere{overflow-wrap:anywhere}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.\[tab-size\:4\]{-moz-tab-size:4;tab-size:4}.\!text-text{color:var(--text)!important}.text-\[\#d97757\]{color:#d97757}.text-accent-amber{color:var(--accent-amber)}.text-accent-blue{color:var(--accent-blue)}.text-accent-green{color:var(--accent-green)}.text-accent-red{color:var(--accent-red)}.text-background{color:var(--base)}.text-inherit{color:inherit}.text-muted{color:var(--muted)}.text-primary{color:var(--primary)}.text-subtext{color:var(--subtext)}.text-text{color:var(--text)}.text-transparent{color:#0000}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.decoration-border-strong{-webkit-text-decoration-color:var(--border-strong);text-decoration-color:var(--border-strong)}.underline-offset-3{text-underline-offset:3px}.caret-\[var\(--text\)\]{caret-color:var(--text)}.opacity-0{opacity:0}.opacity-35{opacity:.35}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-100{opacity:1}.\!shadow-none{--tw-shadow:0 0 #0000!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.shadow-\[0_0_0_1px_rgba\(0\,_0\,_0\,_0\.08\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_1px_2px_rgb\(0_0_0_\/_4\%\)\],.shadow-\[0_1px_2px_rgba\(0\,_0\,_0\,_0\.04\)\]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\]{--tw-shadow:0 1px 3px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\]{--tw-shadow:0 1px 3px var(--tw-shadow-color,color-mix(in oklab, var(--text) 5%, transparent))}}.shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\]{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_8px_rgba\(0\,_0\,_0\,_0\.10\)\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_10px_rgb\(0_0_0_\/_6\%\)\]{--tw-shadow:0 2px 10px var(--tw-shadow-color,#0000000f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(0\,_0\,_0\,_0\.10\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_6px_20px_rgb\(0_0_0_\/_12\%\)\]{--tw-shadow:0 6px 20px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_6px_24px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\,_0_1px_4px_color-mix\(in_oklab\,_var\(--text\)_4\%\,_transparent\)\]{--tw-shadow:0 6px 24px var(--tw-shadow-color,var(--text)), 0 1px 4px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.shadow-\[0_6px_24px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\,_0_1px_4px_color-mix\(in_oklab\,_var\(--text\)_4\%\,_transparent\)\]{--tw-shadow:0 6px 24px var(--tw-shadow-color,color-mix(in oklab, var(--text) 5%, transparent)), 0 1px 4px var(--tw-shadow-color,color-mix(in oklab, var(--text) 4%, transparent))}}.shadow-\[0_6px_24px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\,_0_1px_4px_color-mix\(in_oklab\,_var\(--text\)_4\%\,_transparent\)\]{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_10px_26px_rgba\(0\,_0\,_0\,_0\.16\)\]{--tw-shadow:0 10px 26px var(--tw-shadow-color,#00000029);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_12px_32px_rgba\(0\,_0\,_0\,_0\.18\)\]{--tw-shadow:0 12px 32px var(--tw-shadow-color,#0000002e);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_14px_36px_color-mix\(in_oklab\,_var\(--text\)_6\%\,_transparent\)\]{--tw-shadow:0 14px 36px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.shadow-\[0_14px_36px_color-mix\(in_oklab\,_var\(--text\)_6\%\,_transparent\)\]{--tw-shadow:0 14px 36px var(--tw-shadow-color,color-mix(in oklab, var(--text) 6%, transparent))}}.shadow-\[0_14px_36px_color-mix\(in_oklab\,_var\(--text\)_6\%\,_transparent\)\]{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_24px_60px_rgba\(0\,_0\,_0\,_0\.22\)\]{--tw-shadow:0 24px 60px var(--tw-shadow-color,#00000038);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_2px_0_0_var\(--primary\)\]{--tw-shadow:inset 2px 0 0 var(--tw-shadow-color,var(--primary));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\[background\,border-color\,color\]{transition-property:background,border-color,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background\,border-color\]{transition-property:background,border-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background\,color\]{transition-property:background,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background\,opacity\]{transition-property:background,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background\]{transition-property:background;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[border-color\,background\,translate\]{transition-property:border-color,background,translate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[border-color\,background\]{transition-property:border-color,background;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[border-color\,box-shadow\]{transition-property:border-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[border-color\,color\]{transition-property:border-color,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[box-shadow\]{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[opacity\,color\]{transition-property:opacity,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[transform\,color\]{transition-property:transform,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-80{--tw-duration:80ms;transition-duration:80ms}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-120{--tw-duration:.12s;transition-duration:.12s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-standard{--tw-ease:ease;transition-timing-function:ease}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\[font\:inherit\]{font:inherit}.\[grid-area\:actions\]{grid-area:actions}.\[grid-area\:meta\]{grid-area:meta}.\[grid-area\:name\]{grid-area:name}.\[grid-template-areas\:\'name_meta\'_\'actions_actions\'\]{grid-template-areas:"name meta""actions actions"}.group-focus-within\/turn\:opacity-100:is(:where(.group\/turn):focus-within *){opacity:1}@media(hover:hover){.group-hover\:opacity-0:is(:where(.group):hover *){opacity:0}.group-hover\:opacity-100:is(:where(.group):hover *),.group-hover\/turn\:opacity-100:is(:where(.group\/turn):hover *){opacity:1}}.group-focus-visible\:opacity-0:is(:where(.group):focus-visible *){opacity:0}.group-focus-visible\:opacity-100:is(:where(.group):focus-visible *){opacity:1}.before\:content-\[attr\(data-line\)\]:before{--tw-content:attr(data-line);content:var(--tw-content)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:top-full:after{content:var(--tw-content);top:100%}.after\:right-0:after{content:var(--tw-content);right:0}.after\:left-0:after{content:var(--tw-content);left:0}.after\:h-2:after{content:var(--tw-content);height:calc(var(--spacing) * 2)}.after\:content-\[\'\'\]:after{--tw-content:"";content:var(--tw-content)}.first\:border-t-0:first-child{border-top-style:var(--tw-border-style);border-top-width:0}@media(hover:hover){.hover\:bg-highlight:hover{background-color:var(--highlight)}.hover\:bg-surface:hover{background-color:var(--surface)}.hover\:text-text:hover{color:var(--text)}.hover\:decoration-primary:hover{-webkit-text-decoration-color:var(--primary);text-decoration-color:var(--primary)}.hover\:opacity-85:hover{opacity:.85}}.focus-visible\:text-text:focus-visible{color:var(--text)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:1120px){.min-\[1120px\]\:col-start-1{grid-column-start:1}.min-\[1120px\]\:col-start-2{grid-column-start:2}.min-\[1120px\]\:row-start-1{grid-row-start:1}.min-\[1120px\]\:row-start-2{grid-row-start:2}.min-\[1120px\]\:mt-0{margin-top:0}.min-\[1120px\]\:grid{display:grid}.min-\[1120px\]\:grid-cols-\[minmax\(0\,_1\.1fr\)_minmax\(28rem\,_1fr\)\]{grid-template-columns:minmax(0,1.1fr) minmax(28rem,1fr)}.min-\[1120px\]\:grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.min-\[1120px\]\:content-center{align-content:center}.min-\[1120px\]\:gap-x-20{column-gap:calc(var(--spacing) * 20)}.min-\[1120px\]\:gap-y-10{row-gap:calc(var(--spacing) * 10)}.min-\[1120px\]\:self-end{align-self:flex-end}.min-\[1120px\]\:self-start{align-self:flex-start}}@media(min-width:40rem){.sm\:px-12{padding-inline:calc(var(--spacing) * 12)}}.\[\&_\+_\.settings-stack-section\]\:mt-6+.settings-stack-section{margin-top:calc(var(--spacing) * 6)}.\[\&_\.actions\]\:mt-1\.5 .actions{margin-top:calc(var(--spacing) * 1.5)}.\[\&_\.actions\]\:flex .actions{display:flex}.\[\&_\.actions\]\:justify-end .actions{justify-content:flex-end}.\[\&_\.actions\]\:gap-2\.5 .actions{gap:calc(var(--spacing) * 2.5)}.\[\&_\.artifact-img\]\:mx-0 .artifact-img{margin-inline:0}.\[\&_\.artifact-img\]\:my-3 .artifact-img{margin-block:calc(var(--spacing) * 3)}.\[\&_\.artifact-img\]\:block .artifact-img{display:block}.\[\&_\.artifact-img_img\]\:h-auto .artifact-img img{height:auto}.\[\&_\.artifact-img_img\]\:max-w-full .artifact-img img{max-width:100%}.\[\&_\.artifact-img_img\]\:rounded-sm .artifact-img img{border-radius:6px}.\[\&_\.artifact-img_img\]\:border .artifact-img img{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.artifact-img_img\]\:border-border .artifact-img img{border-color:var(--border)}.\[\&_\.artifact-img-caption\]\:mt-1 .artifact-img-caption{margin-top:var(--spacing)}.\[\&_\.artifact-img-caption\]\:block .artifact-img-caption{display:block}.\[\&_\.artifact-img-caption\]\:text-center .artifact-img-caption{text-align:center}.\[\&_\.artifact-img-caption\]\:text-sm .artifact-img-caption{font-size:var(--fs-sm)}.\[\&_\.artifact-img-caption\]\:text-subtext .artifact-img-caption{color:var(--subtext)}.\[\&_\.backend-badge\]\:text-text .backend-badge{color:var(--text)}.\[\&_\.backend-detail\]\:text-muted .backend-detail{color:var(--muted)}.\[\&_\.backend-name\]\:font-medium .backend-name{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.badge\]\:ml-2 .badge{margin-left:calc(var(--spacing) * 2)}.\[\&_\.badge\]\:flex-none .badge{flex:none}.\[\&_\.brand\]\:flex .brand{display:flex}.\[\&_\.brand\]\:h-full .brand{height:100%}.\[\&_\.brand\]\:w-full .brand{width:100%}.\[\&_\.brand\]\:min-w-0 .brand{min-width:0}.\[\&_\.brand\]\:items-center .brand{align-items:center}.\[\&_\.brand\]\:justify-between .brand{justify-content:space-between}.\[\&_\.brand\]\:gap-2 .brand{gap:calc(var(--spacing) * 2)}.\[\&_\.brand\]\:rounded-sm .brand{border-radius:6px}.\[\&_\.brand\]\:border .brand{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.brand\]\:border-transparent .brand{border-color:#0000}.\[\&_\.brand\]\:px-1\.5 .brand{padding-inline:calc(var(--spacing) * 1.5)}.\[\&_\.brand\]\:py-1 .brand{padding-block:var(--spacing)}.\[\&_\.brand\]\:text-base .brand{font-size:var(--fs-base)}.\[\&_\.brand\]\:font-semibold .brand{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.brand\]\:text-text .brand{color:var(--text)}.\[\&_\.brand_\.brand-project\]\:min-w-0 .brand .brand-project{min-width:0}.\[\&_\.brand_\.brand-project\]\:overflow-hidden .brand .brand-project{overflow:hidden}.\[\&_\.brand_\.brand-project\]\:text-2xl .brand .brand-project{font-size:var(--fs-2xl)}.\[\&_\.brand_\.brand-project\]\:text-ellipsis .brand .brand-project{text-overflow:ellipsis}.\[\&_\.brand_\.brand-project\]\:whitespace-nowrap .brand .brand-project{white-space:nowrap}.\[\&_\.brand_svg\]\:shrink-0 .brand svg{flex-shrink:0}.\[\&_\.brand-project-copy\]\:flex .brand-project-copy{display:flex}.\[\&_\.brand-project-copy\]\:min-w-0 .brand-project-copy{min-width:0}.\[\&_\.brand-project-copy\]\:flex-col .brand-project-copy{flex-direction:column}.\[\&_\.brand-project-copy\]\:gap-\[3px\] .brand-project-copy{gap:3px}.\[\&_\.brand-project-copy\]\:text-left .brand-project-copy{text-align:left}.\[\&_\.brand-project-copy\]\:leading-\[1\.15\] .brand-project-copy{--tw-leading:1.15;line-height:1.15}.\[\&_\.brand-project-label\]\:text-2xs .brand-project-label{font-size:var(--fs-2xs)}.\[\&_\.brand-project-label\]\:font-medium .brand-project-label{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.brand-project-label\]\:tracking-\[0\.04em\] .brand-project-label{--tw-tracking:.04em;letter-spacing:.04em}.\[\&_\.brand-project-label\]\:text-muted .brand-project-label{color:var(--muted)}.\[\&_\.brand-project-label\]\:uppercase .brand-project-label{text-transform:uppercase}.\[\&_\.brand\.open\]\:border-border .brand.open{border-color:var(--border)}.\[\&_\.brand\.open\]\:bg-surface .brand.open{background-color:var(--surface)}.\[\&_\.brand\.open_\.project-chevron\]\:rotate-180 .brand.open .project-chevron{rotate:180deg}.\[\&_\.brand\.open_\.project-chevron\]\:opacity-100 .brand.open .project-chevron{opacity:1}.\[\&_\.brand\:hover\]\:border-border .brand:hover{border-color:var(--border)}.\[\&_\.brand\:hover\]\:bg-surface .brand:hover{background-color:var(--surface)}.\[\&_\.brand\:hover_\.project-chevron\]\:opacity-100 .brand:hover .project-chevron{opacity:1}.\[\&_\.btn\]\:inline-flex .btn{display:inline-flex}.\[\&_\.btn\]\:items-center .btn{align-items:center}.\[\&_\.btn\]\:gap-\[5px\] .btn{gap:5px}.\[\&_\.btn-ghost\]\:inline-flex .btn-ghost{display:inline-flex}.\[\&_\.btn-ghost\]\:cursor-pointer .btn-ghost{cursor:pointer}.\[\&_\.btn-ghost\]\:items-center .btn-ghost{align-items:center}.\[\&_\.btn-ghost\]\:gap-1\.5 .btn-ghost{gap:calc(var(--spacing) * 1.5)}.\[\&_\.btn-ghost\]\:rounded-sm .btn-ghost{border-radius:6px}.\[\&_\.btn-ghost\]\:border .btn-ghost{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.btn-ghost\]\:border-border .btn-ghost{border-color:var(--border)}.\[\&_\.btn-ghost\]\:border-text .btn-ghost{border-color:var(--text)}.\[\&_\.btn-ghost\]\:border-transparent .btn-ghost{border-color:#0000}.\[\&_\.btn-ghost\]\:bg-transparent .btn-ghost{background-color:#0000}.\[\&_\.btn-ghost\]\:px-\[13px\] .btn-ghost{padding-inline:13px}.\[\&_\.btn-ghost\]\:py-1\.5 .btn-ghost{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\.btn-ghost\]\:font-\[inherit\] .btn-ghost{font-family:inherit}.\[\&_\.btn-ghost\]\:text-sm .btn-ghost{font-size:var(--fs-sm)}.\[\&_\.btn-ghost\]\:font-semibold .btn-ghost{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.btn-ghost\]\:text-subtext .btn-ghost{color:var(--subtext)}.\[\&_\.btn-ghost\]\:text-text .btn-ghost{color:var(--text)}.\[\&_\.btn-ghost\]\:transition-\[background\,border-color\] .btn-ghost{transition-property:background,border-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_\.btn-ghost\]\:duration-80 .btn-ghost{--tw-duration:80ms;transition-duration:80ms}.\[\&_\.btn-ghost\]\:ease-standard .btn-ghost{--tw-ease:ease;transition-timing-function:ease}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:border-border-strong .btn-ghost:hover:not(:disabled){border-color:var(--border-strong)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:border-text .btn-ghost:hover:not(:disabled){border-color:var(--text)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:bg-\[var\(--surface-2\,_rgb\(0_0_0_\/_5\%\)\)\] .btn-ghost:hover:not(:disabled){background-color:var(--surface-2,#0000000d)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:bg-surface .btn-ghost:hover:not(:disabled){background-color:var(--surface)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:text-text .btn-ghost:hover:not(:disabled){color:var(--text)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:opacity-100 .btn-ghost:hover:not(:disabled){opacity:1}.\[\&_\.btn-primary\]\:inline-flex .btn-primary{display:inline-flex}.\[\&_\.btn-primary\]\:cursor-pointer .btn-primary{cursor:pointer}.\[\&_\.btn-primary\]\:items-center .btn-primary{align-items:center}.\[\&_\.btn-primary\]\:gap-1\.5 .btn-primary{gap:calc(var(--spacing) * 1.5)}.\[\&_\.btn-primary\]\:rounded-sm .btn-primary{border-radius:6px}.\[\&_\.btn-primary\]\:border .btn-primary{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.btn-primary\]\:border-text .btn-primary{border-color:var(--text)}.\[\&_\.btn-primary\]\:border-transparent .btn-primary{border-color:#0000}.\[\&_\.btn-primary\]\:bg-primary .btn-primary{background-color:var(--primary)}.\[\&_\.btn-primary\]\:bg-transparent .btn-primary{background-color:#0000}.\[\&_\.btn-primary\]\:px-\[13px\] .btn-primary{padding-inline:13px}.\[\&_\.btn-primary\]\:py-1\.5 .btn-primary{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\.btn-primary\]\:font-\[inherit\] .btn-primary{font-family:inherit}.\[\&_\.btn-primary\]\:text-sm .btn-primary{font-size:var(--fs-sm)}.\[\&_\.btn-primary\]\:font-semibold .btn-primary{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.btn-primary\]\:text-background .btn-primary{color:var(--base)}.\[\&_\.btn-primary\]\:text-text .btn-primary{color:var(--text)}.\[\&_\.btn-primary\]\:transition-\[background\,border-color\] .btn-primary{transition-property:background,border-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_\.btn-primary\]\:duration-80 .btn-primary{--tw-duration:80ms;transition-duration:80ms}.\[\&_\.btn-primary\]\:ease-standard .btn-primary{--tw-ease:ease;transition-timing-function:ease}.\[\&_\.btn-primary\:first-child\]\:rounded-tr-none .btn-primary:first-child{border-top-right-radius:0}.\[\&_\.btn-primary\:first-child\]\:rounded-br-none .btn-primary:first-child{border-bottom-right-radius:0}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:border-text .btn-primary:hover:not(:disabled){border-color:var(--text)}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:bg-\[var\(--surface-2\,_rgb\(0_0_0_\/_5\%\)\)\] .btn-primary:hover:not(:disabled){background-color:var(--surface-2,#0000000d)}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:text-text .btn-primary:hover:not(:disabled){color:var(--text)}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:opacity-90 .btn-primary:hover:not(:disabled){opacity:.9}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:opacity-100 .btn-primary:hover:not(:disabled){opacity:1}.\[\&_\.busy-dot\]\:h-\[7px\] .busy-dot{height:7px}.\[\&_\.busy-dot\]\:w-\[7px\] .busy-dot{width:7px}.\[\&_\.busy-dot\]\:shrink-0 .busy-dot{flex-shrink:0}.\[\&_\.busy-dot\]\:animate-\[or-pulse_1\.2s_infinite\] .busy-dot{animation:1.2s infinite or-pulse}.\[\&_\.busy-dot\]\:rounded-full .busy-dot{border-radius:999px}.\[\&_\.busy-dot\]\:bg-primary .busy-dot{background-color:var(--primary)}.\[\&_\.busy-dot\.waiting\]\:animate-none .busy-dot.waiting{animation:none}.\[\&_\.chev\]\:w-3 .chev{width:calc(var(--spacing) * 3)}.\[\&_\.chev\]\:shrink-0 .chev{flex-shrink:0}.\[\&_\.chev\]\:text-2xs .chev{font-size:var(--fs-2xs)}.\[\&_\.chev\]\:text-muted .chev{color:var(--muted)}.\[\&_\.count-badge\]\:inline-flex .count-badge{display:inline-flex}.\[\&_\.count-badge\]\:h-4\.5 .count-badge{height:calc(var(--spacing) * 4.5)}.\[\&_\.count-badge\]\:min-w-4\.5 .count-badge{min-width:calc(var(--spacing) * 4.5)}.\[\&_\.count-badge\]\:items-center .count-badge{align-items:center}.\[\&_\.count-badge\]\:justify-center .count-badge{justify-content:center}.\[\&_\.count-badge\]\:rounded-md .count-badge{border-radius:8px}.\[\&_\.count-badge\]\:border .count-badge{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.count-badge\]\:border-border .count-badge{border-color:var(--border)}.\[\&_\.count-badge\]\:bg-canvas .count-badge{background-color:var(--canvas)}.\[\&_\.count-badge\]\:px-\[5px\] .count-badge{padding-inline:5px}.\[\&_\.count-badge\]\:py-0 .count-badge{padding-block:0}.\[\&_\.count-badge\]\:text-xs .count-badge{font-size:var(--fs-xs)}.\[\&_\.count-badge\]\:font-medium .count-badge{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.count-badge\]\:text-text .count-badge{color:var(--text)}.\[\&_\.dot\]\:h-\[7px\] .dot{height:7px}.\[\&_\.dot\]\:w-\[7px\] .dot{width:7px}.\[\&_\.dot\]\:shrink-0 .dot{flex-shrink:0}.\[\&_\.dot\]\:rounded-full .dot{border-radius:999px}.\[\&_\.dot\]\:bg-current .dot{background-color:currentColor}.\[\&_\.elided-node-label\]\:flex .elided-node-label{display:flex}.\[\&_\.elided-node-label\]\:flex-col .elided-node-label{flex-direction:column}.\[\&_\.elided-node-label\]\:leading-\[1\.3\] .elided-node-label{--tw-leading:1.3;line-height:1.3}.\[\&_\.elided-node-sub\]\:text-muted .elided-node-sub{color:var(--muted)}.\[\&_\.error\]\:basis-full .error{flex-basis:100%}.\[\&_\.error\]\:text-md .error{font-size:var(--fs-md)}.\[\&_\.error\]\:text-sm .error{font-size:var(--fs-sm)}.\[\&_\.error\]\:whitespace-pre-wrap .error{white-space:pre-wrap}.\[\&_\.error\]\:text-accent-red .error{color:var(--accent-red)}.\[\&_\.file-chip\]\:mx-px .file-chip{margin-inline:1px}.\[\&_\.file-chip\]\:my-0 .file-chip{margin-block:0}.\[\&_\.file-chip\]\:inline-flex .file-chip{display:inline-flex}.\[\&_\.file-chip\]\:max-w-full .file-chip{max-width:100%}.\[\&_\.file-chip\]\:cursor-pointer .file-chip{cursor:pointer}.\[\&_\.file-chip\]\:items-center .file-chip{align-items:center}.\[\&_\.file-chip\]\:gap-1 .file-chip{gap:var(--spacing)}.\[\&_\.file-chip\]\:rounded-xs .file-chip{border-radius:4px}.\[\&_\.file-chip\]\:border .file-chip{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.file-chip\]\:border-border-variant .file-chip{border-color:var(--border-variant)}.\[\&_\.file-chip\]\:bg-panel .file-chip{background-color:var(--panel)}.\[\&_\.file-chip\]\:px-1\.5 .file-chip{padding-inline:calc(var(--spacing) * 1.5)}.\[\&_\.file-chip\]\:py-0 .file-chip{padding-block:0}.\[\&_\.file-chip\]\:align-baseline .file-chip{vertical-align:baseline}.\[\&_\.file-chip\]\:font-mono .file-chip{font-family:var(--mono)}.\[\&_\.file-chip\]\:text-\[0\.9em\] .file-chip{font-size:.9em}.\[\&_\.file-chip\]\:font-medium .file-chip{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.file-chip\]\:text-text .file-chip{color:var(--text)}.\[\&_\.file-chip_svg\]\:flex-none .file-chip svg{flex:none}.\[\&_\.file-chip_svg\]\:opacity-60 .file-chip svg{opacity:.6}.\[\&_\.file-chip-label\]\:max-w-65 .file-chip-label{max-width:calc(var(--spacing) * 65)}.\[\&_\.file-chip-label\]\:overflow-hidden .file-chip-label{overflow:hidden}.\[\&_\.file-chip-label\]\:text-ellipsis .file-chip-label{text-overflow:ellipsis}.\[\&_\.file-chip-label\]\:whitespace-nowrap .file-chip-label{white-space:nowrap}.\[\&_\.file-chip\:hover\:not\(\:disabled\)\]\:bg-surface .file-chip:hover:not(:disabled){background-color:var(--surface)}.\[\&_\.file-chip\:hover\:not\(\:disabled\)\]\:text-primary .file-chip:hover:not(:disabled){color:var(--primary)}.\[\&_\.files-pill\]\:rounded-sm .files-pill{border-radius:6px}.\[\&_\.files-pill\]\:px-2 .files-pill{padding-inline:calc(var(--spacing) * 2)}.\[\&_\.files-pill\]\:py-\[5px\] .files-pill{padding-block:5px}.\[\&_\.files-pill_code\]\:text-xs .files-pill code{font-size:var(--fs-xs)}.\[\&_\.folder-picker-chevron\]\:flex-none .folder-picker-chevron{flex:none}.\[\&_\.folder-picker-chevron\]\:text-muted .folder-picker-chevron{color:var(--muted)}.\[\&_\.folder-picker-control\]\:flex .folder-picker-control{display:flex}.\[\&_\.folder-picker-control\]\:w-full .folder-picker-control{width:100%}.\[\&_\.folder-picker-control\]\:min-w-0 .folder-picker-control{min-width:0}.\[\&_\.folder-picker-control\]\:cursor-pointer .folder-picker-control{cursor:pointer}.\[\&_\.folder-picker-control\]\:items-center .folder-picker-control{align-items:center}.\[\&_\.folder-picker-control\]\:gap-\[9px\] .folder-picker-control{gap:9px}.\[\&_\.folder-picker-control\]\:overflow-hidden .folder-picker-control{overflow:hidden}.\[\&_\.folder-picker-control\]\:rounded-md .folder-picker-control{border-radius:8px}.\[\&_\.folder-picker-control\]\:border .folder-picker-control{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.folder-picker-control\]\:border-border .folder-picker-control{border-color:var(--border)}.\[\&_\.folder-picker-control\]\:bg-background .folder-picker-control{background-color:var(--base)}.\[\&_\.folder-picker-control\]\:px-2\.5 .folder-picker-control{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_\.folder-picker-control\]\:py-2 .folder-picker-control{padding-block:calc(var(--spacing) * 2)}.\[\&_\.folder-picker-control\]\:text-left .folder-picker-control{text-align:left}.\[\&_\.folder-picker-control\]\:transition-\[border-color\,box-shadow\] .folder-picker-control{transition-property:border-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_\.folder-picker-control\]\:duration-120 .folder-picker-control{--tw-duration:.12s;transition-duration:.12s}.\[\&_\.folder-picker-control\]\:ease-standard .folder-picker-control{--tw-ease:ease;transition-timing-function:ease}.\[\&_\.folder-picker-control_\.placeholder\]\:text-muted .folder-picker-control .placeholder{color:var(--muted)}.\[\&_\.folder-picker-control_span\]\:min-w-0 .folder-picker-control span{min-width:0}.\[\&_\.folder-picker-control_span\]\:flex-1 .folder-picker-control span{flex:1}.\[\&_\.folder-picker-control_span\]\:overflow-hidden .folder-picker-control span{overflow:hidden}.\[\&_\.folder-picker-control_span\]\:text-ellipsis .folder-picker-control span{text-overflow:ellipsis}.\[\&_\.folder-picker-control_span\]\:whitespace-nowrap .folder-picker-control span{white-space:nowrap}.\[\&_\.folder-picker-control\:disabled\]\:cursor-default .folder-picker-control:disabled{cursor:default}.\[\&_\.folder-picker-control\:disabled\]\:opacity-65 .folder-picker-control:disabled{opacity:.65}.\[\&_\.folder-picker-control\:focus-visible\]\:outline-2 .folder-picker-control:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.\[\&_\.folder-picker-control\:focus-visible\]\:outline-offset-2 .folder-picker-control:focus-visible{outline-offset:2px}.\[\&_\.folder-picker-control\:focus-visible\]\:outline-text .folder-picker-control:focus-visible{outline-color:var(--text)}.\[\&_\.folder-picker-control\:focus-visible\]\:outline-solid .folder-picker-control:focus-visible{--tw-outline-style:solid;outline-style:solid}.\[\&_\.folder-picker-control\:hover\:not\(\:disabled\)\]\:border-muted .folder-picker-control:hover:not(:disabled){border-color:var(--muted)}.\[\&_\.folder-picker-control\:hover\:not\(\:disabled\)\]\:shadow-\[0_2px_8px_rgb\(0_0_0_\/_5\%\)\] .folder-picker-control:hover:not(:disabled){--tw-shadow:0 2px 8px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&_\.folder-picker-control\:hover\:not\(\:disabled\)_\.folder-picker-chevron\]\:text-subtext .folder-picker-control:hover:not(:disabled) .folder-picker-chevron{color:var(--subtext)}.\[\&_\.folder-picker-hint\]\:text-sm .folder-picker-hint{font-size:var(--fs-sm)}.\[\&_\.folder-picker-hint\]\:leading-\[1\.4\] .folder-picker-hint{--tw-leading:1.4;line-height:1.4}.\[\&_\.folder-picker-hint\]\:font-normal .folder-picker-hint{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_\.folder-picker-hint\]\:text-subtext .folder-picker-hint{color:var(--subtext)}.\[\&_\.folder-picker-icon\]\:flex-none .folder-picker-icon{flex:none}.\[\&_\.folder-picker-icon\]\:text-current .folder-picker-icon{color:currentColor}.\[\&_\.form-seg\]\:mb-0\.5 .form-seg{margin-bottom:calc(var(--spacing) * .5)}.\[\&_\.form-seg\]\:self-start .form-seg{align-self:flex-start}.\[\&_\.form-seg_button\]\:px-3 .form-seg button{padding-inline:calc(var(--spacing) * 3)}.\[\&_\.form-seg_button\]\:py-\[5px\] .form-seg button{padding-block:5px}.\[\&_\.ftree-footer\]\:mt-2\.5 .ftree-footer{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.ftree-footer\]\:max-w-full .ftree-footer{max-width:100%}.\[\&_\.ftree-footer\]\:rounded-md .ftree-footer{border-radius:8px}.\[\&_\.ftree-footer\]\:border .ftree-footer{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.ftree-footer\]\:border-border .ftree-footer{border-color:var(--border)}.\[\&_\.ftree-footer\]\:bg-background .ftree-footer{background-color:var(--base)}.\[\&_\.ftree-footer\]\:px-2\.5 .ftree-footer{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_\.ftree-footer\]\:py-1\.5 .ftree-footer{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\.ftree-footer_code\]\:max-w-95 .ftree-footer code{max-width:calc(var(--spacing) * 95)}.\[\&_\.hc-actions\]\:mt-2\.5 .hc-actions{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-actions\]\:flex .hc-actions{display:flex}.\[\&_\.hc-actions\]\:items-center .hc-actions{align-items:center}.\[\&_\.hc-actions\]\:gap-1\.5 .hc-actions{gap:calc(var(--spacing) * 1.5)}.\[\&_\.hc-actions_button\]\:inline-flex .hc-actions button{display:inline-flex}.\[\&_\.hc-actions_button\]\:min-w-21 .hc-actions button{min-width:calc(var(--spacing) * 21)}.\[\&_\.hc-actions_button\]\:items-center .hc-actions button{align-items:center}.\[\&_\.hc-actions_button\]\:justify-center .hc-actions button{justify-content:center}.\[\&_\.hc-actions_button\]\:gap-\[5px\] .hc-actions button{gap:5px}.\[\&_\.hc-actions_button\]\:rounded-md .hc-actions button{border-radius:8px}.\[\&_\.hc-actions_button\]\:border .hc-actions button{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.hc-actions_button\]\:border-border .hc-actions button{border-color:var(--border)}.\[\&_\.hc-actions_button\]\:bg-background .hc-actions button{background-color:var(--base)}.\[\&_\.hc-actions_button\]\:px-2\.5 .hc-actions button{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_\.hc-actions_button\]\:py-1\.5 .hc-actions button{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\.hc-actions_button\]\:text-sm .hc-actions button{font-size:var(--fs-sm)}.\[\&_\.hc-actions_button\]\:font-medium .hc-actions button{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.hc-actions_button\]\:text-text .hc-actions button{color:var(--text)}.\[\&_\.hc-actions_button\:hover\]\:border-\[color-mix\(in_oklab\,_var\(--border\)_55\%\,_var\(--text\)\)\] .hc-actions button:hover{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.hc-actions_button\:hover\]\:border-\[color-mix\(in_oklab\,_var\(--border\)_55\%\,_var\(--text\)\)\] .hc-actions button:hover{border-color:color-mix(in oklab,var(--border) 55%,var(--text))}}.\[\&_\.hc-actions_button\:hover\]\:bg-canvas .hc-actions button:hover{background-color:var(--canvas)}.\[\&_\.hc-body\]\:mt-2\.5 .hc-body{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-body\]\:line-clamp-10 .hc-body{-webkit-line-clamp:10;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&_\.hc-body\]\:border-t .hc-body{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.hc-body\]\:border-t-border-variant .hc-body{border-top-color:var(--border-variant)}.\[\&_\.hc-body\]\:pt-2\.5 .hc-body{padding-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-body\]\:leading-\[1\.6\] .hc-body{--tw-leading:1.6;line-height:1.6}.\[\&_\.hc-body\]\:whitespace-pre-line .hc-body{white-space:pre-line}.\[\&_\.hc-body\.expanded\]\:line-clamp-none .hc-body.expanded{-webkit-line-clamp:unset;-webkit-box-orient:horizontal;display:block;overflow:visible}.\[\&_\.hc-body\.expanded\]\:block .hc-body.expanded{display:block}.\[\&_\.hc-body\.expanded\]\:max-h-\[45vh\] .hc-body.expanded{max-height:45vh}.\[\&_\.hc-body\.expanded\]\:overflow-x-hidden .hc-body.expanded{overflow-x:hidden}.\[\&_\.hc-body\.expanded\]\:overflow-y-auto .hc-body.expanded{overflow-y:auto}.\[\&_\.hc-body\.expanded\]\:pb-1 .hc-body.expanded{padding-bottom:var(--spacing)}.\[\&_\.hc-branch\]\:inline-flex .hc-branch{display:inline-flex}.\[\&_\.hc-branch\]\:min-w-0 .hc-branch{min-width:0}.\[\&_\.hc-branch\]\:items-center .hc-branch{align-items:center}.\[\&_\.hc-branch\]\:gap-1 .hc-branch{gap:var(--spacing)}.\[\&_\.hc-branch\]\:overflow-hidden .hc-branch{overflow:hidden}.\[\&_\.hc-branch\]\:font-mono .hc-branch{font-family:var(--mono)}.\[\&_\.hc-branch\]\:text-ellipsis .hc-branch{text-overflow:ellipsis}.\[\&_\.hc-branch\]\:whitespace-nowrap .hc-branch{white-space:nowrap}.\[\&_\.hc-failure\]\:mt-2 .hc-failure{margin-top:calc(var(--spacing) * 2)}.\[\&_\.hc-failure\]\:line-clamp-3 .hc-failure{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&_\.hc-failure\]\:text-accent-red .hc-failure{color:var(--accent-red)}.\[\&_\.hc-foot\]\:mt-2 .hc-foot{margin-top:calc(var(--spacing) * 2)}.\[\&_\.hc-foot\]\:flex .hc-foot{display:flex}.\[\&_\.hc-foot\]\:items-center .hc-foot{align-items:center}.\[\&_\.hc-foot\]\:justify-between .hc-foot{justify-content:space-between}.\[\&_\.hc-foot\]\:gap-2\.5 .hc-foot{gap:calc(var(--spacing) * 2.5)}.\[\&_\.hc-foot\]\:text-2xs .hc-foot{font-size:var(--fs-2xs)}.\[\&_\.hc-foot\]\:text-muted .hc-foot{color:var(--muted)}.\[\&_\.hc-foot_\.hc-mono\]\:min-w-0 .hc-foot .hc-mono{min-width:0}.\[\&_\.hc-foot_\.hc-mono\]\:overflow-hidden .hc-foot .hc-mono{overflow:hidden}.\[\&_\.hc-foot_\.hc-mono\]\:text-ellipsis .hc-foot .hc-mono{text-overflow:ellipsis}.\[\&_\.hc-foot_\.hc-mono\]\:whitespace-nowrap .hc-foot .hc-mono{white-space:nowrap}.\[\&_\.hc-git\]\:mt-2\.5 .hc-git{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-git\]\:flex .hc-git{display:flex}.\[\&_\.hc-git\]\:flex-col .hc-git{flex-direction:column}.\[\&_\.hc-git\]\:gap-1 .hc-git{gap:var(--spacing)}.\[\&_\.hc-git\]\:border-t .hc-git{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.hc-git\]\:border-t-border-variant .hc-git{border-top-color:var(--border-variant)}.\[\&_\.hc-git\]\:pt-2 .hc-git{padding-top:calc(var(--spacing) * 2)}.\[\&_\.hc-git\]\:text-xs .hc-git{font-size:var(--fs-xs)}.\[\&_\.hc-git\]\:text-text .hc-git{color:var(--text)}.\[\&_\.hc-git-row\]\:flex .hc-git-row{display:flex}.\[\&_\.hc-git-row\]\:min-w-0 .hc-git-row{min-width:0}.\[\&_\.hc-git-row\]\:flex-wrap .hc-git-row{flex-wrap:wrap}.\[\&_\.hc-git-row\]\:items-center .hc-git-row{align-items:center}.\[\&_\.hc-git-row\]\:gap-2\.5 .hc-git-row{gap:calc(var(--spacing) * 2.5)}.\[\&_\.hc-head\]\:flex .hc-head{display:flex}.\[\&_\.hc-head\]\:items-baseline .hc-head{align-items:baseline}.\[\&_\.hc-head\]\:justify-between .hc-head{justify-content:space-between}.\[\&_\.hc-head\]\:gap-2\.5 .hc-head{gap:calc(var(--spacing) * 2.5)}.\[\&_\.hc-mono\]\:font-mono .hc-mono{font-family:var(--mono)}.\[\&_\.hc-slug\]\:min-w-0 .hc-slug{min-width:0}.\[\&_\.hc-slug\]\:overflow-hidden .hc-slug{overflow:hidden}.\[\&_\.hc-slug\]\:font-mono .hc-slug{font-family:var(--mono)}.\[\&_\.hc-slug\]\:text-md .hc-slug{font-size:var(--fs-md)}.\[\&_\.hc-slug\]\:font-semibold .hc-slug{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.hc-slug\]\:text-ellipsis .hc-slug{text-overflow:ellipsis}.\[\&_\.hc-slug\]\:whitespace-nowrap .hc-slug{white-space:nowrap}.\[\&_\.hc-stats\]\:mt-2\.5 .hc-stats{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-stats\]\:flex .hc-stats{display:flex}.\[\&_\.hc-stats\]\:flex-wrap .hc-stats{flex-wrap:wrap}.\[\&_\.hc-stats\]\:items-center .hc-stats{align-items:center}.\[\&_\.hc-stats\]\:gap-3 .hc-stats{gap:calc(var(--spacing) * 3)}.\[\&_\.hc-stats\]\:border-t .hc-stats{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.hc-stats\]\:border-t-border-variant .hc-stats{border-top-color:var(--border-variant)}.\[\&_\.hc-stats\]\:pt-2\.5 .hc-stats{padding-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-stats\]\:text-xs .hc-stats{font-size:var(--fs-xs)}.\[\&_\.hc-stats\]\:text-text .hc-stats{color:var(--text)}.\[\&_\.hc-title\]\:mt-\[3px\] .hc-title{margin-top:3px}.\[\&_\.hc-title\]\:text-text .hc-title{color:var(--text)}.\[\&_\.hc-toggle\]\:mt-1 .hc-toggle{margin-top:var(--spacing)}.\[\&_\.hc-toggle\]\:text-xs .hc-toggle{font-size:var(--fs-xs)}.\[\&_\.hc-toggle\]\:font-medium .hc-toggle{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.hc-toggle\]\:text-muted .hc-toggle{color:var(--muted)}.\[\&_\.hc-toggle\:hover\]\:text-text .hc-toggle:hover{color:var(--text)}.\[\&_\.home-inner\]\:max-w-140 .home-inner{max-width:calc(var(--spacing) * 140)}.\[\&_\.home-inner\]\:max-w-300 .home-inner{max-width:calc(var(--spacing) * 300)}.\[\&_\.home-inner\]\:pt-0 .home-inner{padding-top:0}.\[\&_\.home-inner\]\:pt-24 .home-inner{padding-top:calc(var(--spacing) * 24)}.\[\&_\.home-inner\]\:pb-0 .home-inner{padding-bottom:0}.\[\&_\.icon-btn\]\:ml-2 .icon-btn{margin-left:calc(var(--spacing) * 2)}.\[\&_\.icon-btn\]\:h-5\.5 .icon-btn{height:calc(var(--spacing) * 5.5)}.\[\&_\.icon-btn\]\:w-5\.5 .icon-btn{width:calc(var(--spacing) * 5.5)}.\[\&_\.icon-btn\]\:align-middle .icon-btn{vertical-align:middle}.\[\&_\.icon-btn\:hover\]\:text-accent-red .icon-btn:hover{color:var(--accent-red)}.\[\&_\.id\]\:font-mono .id{font-family:var(--mono)}.\[\&_\.id\]\:text-xs .id{font-size:var(--fs-xs)}.\[\&_\.id\]\:text-muted .id{color:var(--muted)}.\[\&_\.k\]\:text-subtext .k{color:var(--subtext)}.\[\&_\.katex\]\:text-\[1\.05em\] .katex{font-size:1.05em}.\[\&_\.katex-display\]\:mx-0 .katex-display{margin-inline:0}.\[\&_\.katex-display\]\:my-3 .katex-display{margin-block:calc(var(--spacing) * 3)}.\[\&_\.katex-display\]\:overflow-x-auto .katex-display{overflow-x:auto}.\[\&_\.katex-display\]\:overflow-y-hidden .katex-display{overflow-y:hidden}.\[\&_\.katex-display\]\:px-0 .katex-display{padding-inline:0}.\[\&_\.katex-display\]\:py-0\.5 .katex-display{padding-block:calc(var(--spacing) * .5)}.\[\&_\.kv\]\:grid-cols-\[132px_minmax\(0\,_1fr\)\] .kv{grid-template-columns:132px minmax(0,1fr)}.\[\&_\.kv\]\:items-center .kv{align-items:center}.\[\&_\.kv\]\:gap-x-4\.5 .kv{column-gap:calc(var(--spacing) * 4.5)}.\[\&_\.kv\]\:gap-y-1\.5 .kv{row-gap:calc(var(--spacing) * 1.5)}.\[\&_\.kv\]\:gap-y-\[9px\] .kv{row-gap:9px}.\[\&_\.kv_\.k\]\:text-sm .kv .k{font-size:var(--fs-sm)}.\[\&_\.kv_\.k\.mono\]\:font-mono .kv .k.mono{font-family:var(--mono)}.\[\&_\.kv_\.k\.mono\]\:text-sm .kv .k.mono{font-size:var(--fs-sm)}.\[\&_\.kv_\.v\]\:flex .kv .v{display:flex}.\[\&_\.kv_\.v\]\:min-w-0 .kv .v{min-width:0}.\[\&_\.kv_\.v\]\:flex-wrap .kv .v{flex-wrap:wrap}.\[\&_\.kv_\.v\]\:items-center .kv .v{align-items:center}.\[\&_\.kv_\.v\]\:gap-\[7px\] .kv .v{gap:7px}.\[\&_\.kv_\.v\]\:font-sans .kv .v{font-family:var(--sans)}.\[\&_\.kv_\.v\]\:text-md .kv .v{font-size:var(--fs-md)}.\[\&_\.kv_\.v\]\:break-normal .kv .v{overflow-wrap:normal;word-break:normal}.\[\&_\.kv_\.v_\.mono\]\:font-mono .kv .v .mono{font-family:var(--mono)}.\[\&_\.kv_\.v_\.mono\]\:text-sm .kv .v .mono{font-size:var(--fs-sm)}.\[\&_\.kv_\.v\.mono\]\:font-mono .kv .v.mono{font-family:var(--mono)}.\[\&_\.kv_\.v\.mono\]\:text-sm .kv .v.mono{font-size:var(--fs-sm)}.\[\&_\.md\]\:max-w-readable .md{max-width:var(--readable-col)}.\[\&_\.md\]\:text-base .md{font-size:var(--fs-base)}.\[\&_\.md\]\:leading-\[1\.65\] .md{--tw-leading:1.65;line-height:1.65}.\[\&_\.md\]\:text-text .md{color:var(--text)}.\[\&_\.md_h1\]\:mx-0 .md h1{margin-inline:0}.\[\&_\.md_h1\]\:mt-4\.5 .md h1{margin-top:calc(var(--spacing) * 4.5)}.\[\&_\.md_h1\]\:mb-2 .md h1{margin-bottom:calc(var(--spacing) * 2)}.\[\&_\.md_h1\]\:text-\[1\.5em\] .md h1{font-size:1.5em}.\[\&_\.md_h2\]\:mx-0 .md h2{margin-inline:0}.\[\&_\.md_h2\]\:mt-4 .md h2{margin-top:calc(var(--spacing) * 4)}.\[\&_\.md_h2\]\:mb-2 .md h2{margin-bottom:calc(var(--spacing) * 2)}.\[\&_\.md_h2\]\:text-\[1\.25em\] .md h2{font-size:1.25em}.\[\&_\.md_h3\]\:text-\[1\.1em\] .md h3{font-size:1.1em}.\[\&_\.model-id\]\:block .model-id{display:block}.\[\&_\.model-id\]\:font-mono .model-id{font-family:var(--mono)}.\[\&_\.model-id\]\:text-2xs .model-id{font-size:var(--fs-2xs)}.\[\&_\.model-id\]\:text-muted .model-id{color:var(--muted)}.\[\&_\.model-item\]\:pl-6 .model-item{padding-left:calc(var(--spacing) * 6)}.\[\&_\.model-item\]\:whitespace-nowrap .model-item{white-space:nowrap}.\[\&_\.model-item\:disabled\]\:cursor-default .model-item:disabled{cursor:default}.\[\&_\.model-item\:disabled\]\:text-muted .model-item:disabled{color:var(--muted)}.\[\&_\.model-item\:disabled\:hover\]\:bg-transparent .model-item:disabled:hover{background-color:#0000}.\[\&_\.name\]\:text-base .name{font-size:var(--fs-base)}.\[\&_\.name\]\:font-semibold .name{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.new-project-actions\]\:mt-2\.5 .new-project-actions{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.new-project-actions\]\:justify-start .new-project-actions{justify-content:flex-start}.\[\&_\.new-project-actions_\.primary\]\:ml-auto .new-project-actions .primary{margin-left:auto}.\[\&_\.node-action\]\:inline-flex .node-action{display:inline-flex}.\[\&_\.node-action\]\:items-center .node-action{align-items:center}.\[\&_\.node-action\]\:gap-\[5px\] .node-action{gap:5px}.\[\&_\.node-action\]\:rounded-sm .node-action{border-radius:6px}.\[\&_\.node-action\]\:px-1\.5 .node-action{padding-inline:calc(var(--spacing) * 1.5)}.\[\&_\.node-action\]\:py-\[3px\] .node-action{padding-block:3px}.\[\&_\.node-action\]\:text-xs .node-action{font-size:var(--fs-xs)}.\[\&_\.node-action\]\:font-medium .node-action{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.node-action\]\:text-text .node-action{color:var(--text)}.\[\&_\.node-action\]\:no-underline .node-action{text-decoration-line:none}.\[\&_\.node-action-ext\]\:ml-auto .node-action-ext{margin-left:auto}.\[\&_\.node-action-ext\]\:px-\[5px\] .node-action-ext{padding-inline:5px}.\[\&_\.node-action-ext\]\:py-\[3px\] .node-action-ext{padding-block:3px}.\[\&_\.node-action\:hover\]\:bg-surface .node-action:hover{background-color:var(--surface)}.\[\&_\.node-action\:hover\]\:text-text .node-action:hover{color:var(--text)}.\[\&_\.node-actions\]\:mt-2 .node-actions{margin-top:calc(var(--spacing) * 2)}.\[\&_\.node-actions\]\:flex .node-actions{display:flex}.\[\&_\.node-actions\]\:items-center .node-actions{align-items:center}.\[\&_\.node-actions\]\:gap-\[3px\] .node-actions{gap:3px}.\[\&_\.node-actions\]\:border-t .node-actions{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.node-actions\]\:border-t-border-variant .node-actions{border-top-color:var(--border-variant)}.\[\&_\.node-actions\]\:pt-1\.5 .node-actions{padding-top:calc(var(--spacing) * 1.5)}.\[\&_\.node-eyebrow\]\:mb-1\.5 .node-eyebrow{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_\.node-eyebrow\]\:flex .node-eyebrow{display:flex}.\[\&_\.node-eyebrow\]\:items-center .node-eyebrow{align-items:center}.\[\&_\.node-eyebrow\]\:justify-between .node-eyebrow{justify-content:space-between}.\[\&_\.node-eyebrow\]\:gap-2 .node-eyebrow{gap:calc(var(--spacing) * 2)}.\[\&_\.node-eyebrow\]\:text-2xs .node-eyebrow{font-size:var(--fs-2xs)}.\[\&_\.node-eyebrow\]\:font-medium .node-eyebrow{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.node-eyebrow\]\:text-muted .node-eyebrow{color:var(--muted)}.\[\&_\.node-head\]\:flex .node-head{display:flex}.\[\&_\.node-head\]\:min-w-0 .node-head{min-width:0}.\[\&_\.node-head\]\:items-center .node-head{align-items:center}.\[\&_\.node-head\]\:gap-\[7px\] .node-head{gap:7px}.\[\&_\.node-meta\]\:mt-2 .node-meta{margin-top:calc(var(--spacing) * 2)}.\[\&_\.node-meta\]\:flex .node-meta{display:flex}.\[\&_\.node-meta\]\:items-center .node-meta{align-items:center}.\[\&_\.node-meta\]\:gap-2 .node-meta{gap:calc(var(--spacing) * 2)}.\[\&_\.node-meta\]\:text-2xs .node-meta{font-size:var(--fs-2xs)}.\[\&_\.node-meta\]\:text-muted .node-meta{color:var(--muted)}.\[\&_\.node-overview-link\]\:block .node-overview-link{display:block}.\[\&_\.node-overview-link\]\:w-full .node-overview-link{width:100%}.\[\&_\.node-overview-link\]\:cursor-pointer .node-overview-link{cursor:pointer}.\[\&_\.node-overview-link\]\:border-0 .node-overview-link{border-style:var(--tw-border-style);border-width:0}.\[\&_\.node-overview-link\]\:bg-transparent .node-overview-link{background-color:#0000}.\[\&_\.node-overview-link\]\:p-0 .node-overview-link{padding:0}.\[\&_\.node-overview-link\]\:text-left .node-overview-link{text-align:left}.\[\&_\.node-overview-link\]\:text-inherit .node-overview-link{color:inherit}.\[\&_\.node-overview-link\]\:\[font\:inherit\] .node-overview-link{font:inherit}.\[\&_\.node-overview-link\:focus-visible\]\:rounded-xs .node-overview-link:focus-visible{border-radius:4px}.\[\&_\.node-overview-link\:focus-visible\]\:outline-2 .node-overview-link:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.\[\&_\.node-overview-link\:focus-visible\]\:outline-offset-4 .node-overview-link:focus-visible{outline-offset:4px}.\[\&_\.node-overview-link\:focus-visible\]\:outline-accent .node-overview-link:focus-visible{outline-color:var(--accent)}.\[\&_\.node-overview-link\:focus-visible\]\:outline-solid .node-overview-link:focus-visible{--tw-outline-style:solid;outline-style:solid}.\[\&_\.node-overview-link\:hover_\.node-slug\]\:underline .node-overview-link:hover .node-slug{text-decoration-line:underline}.\[\&_\.node-overview-link\:hover_\.node-slug\]\:underline-offset-\[3px\] .node-overview-link:hover .node-slug{text-underline-offset:3px}.\[\&_\.node-slug\]\:min-w-0 .node-slug{min-width:0}.\[\&_\.node-slug\]\:flex-1 .node-slug{flex:1}.\[\&_\.node-slug\]\:overflow-hidden .node-slug{overflow:hidden}.\[\&_\.node-slug\]\:font-mono .node-slug{font-family:var(--mono)}.\[\&_\.node-slug\]\:text-sm .node-slug{font-size:var(--fs-sm)}.\[\&_\.node-slug\]\:font-semibold .node-slug{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.node-slug\]\:text-ellipsis .node-slug{text-overflow:ellipsis}.\[\&_\.node-slug\]\:whitespace-nowrap .node-slug{white-space:nowrap}.\[\&_\.node-slug\]\:text-text .node-slug{color:var(--text)}.\[\&_\.node-status\]\:h-2 .node-status{height:calc(var(--spacing) * 2)}.\[\&_\.node-status\]\:w-2 .node-status{width:calc(var(--spacing) * 2)}.\[\&_\.node-status\]\:shrink-0 .node-status{flex-shrink:0}.\[\&_\.node-status\]\:rounded-full .node-status{border-radius:999px}.\[\&_\.node-title\]\:mt-1 .node-title{margin-top:var(--spacing)}.\[\&_\.node-title\]\:line-clamp-2 .node-title{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&_\.node-title\]\:text-sm .node-title{font-size:var(--fs-sm)}.\[\&_\.node-title\]\:text-text .node-title{color:var(--text)}.\[\&_\.onb-token-form\]\:mt-2\.5 .onb-token-form{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.openresearch-diff-file\]\:w-full .openresearch-diff-file{width:100%}.\[\&_\.openresearch-diff-file\]\:text-sm .openresearch-diff-file{font-size:var(--fs-sm)}.\[\&_\.openresearch-diff-file\]\:leading-\[1\.55\] .openresearch-diff-file{--tw-leading:1.55;line-height:1.55}.\[\&_\.openresearch-diff-file\]\:\[--diff-background-color\:var\(--base\)\] .openresearch-diff-file{--diff-background-color:var(--base)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-background-color\:var\(--openresearch-diff-delete-code-background-color\)\] .openresearch-diff-file{--diff-code-delete-background-color:var(--openresearch-diff-delete-code-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-edit-background-color\:var\(--openresearch-diff-delete-edit-background-color\)\] .openresearch-diff-file{--diff-code-delete-edit-background-color:var(--openresearch-diff-delete-edit-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-edit-text-color\:var\(--diff-text-color\)\] .openresearch-diff-file{--diff-code-delete-edit-text-color:var(--diff-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-text-color\:var\(--diff-text-color\)\] .openresearch-diff-file{--diff-code-delete-text-color:var(--diff-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-background-color\:var\(--openresearch-diff-insert-code-background-color\)\] .openresearch-diff-file{--diff-code-insert-background-color:var(--openresearch-diff-insert-code-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-edit-background-color\:var\(--openresearch-diff-insert-edit-background-color\)\] .openresearch-diff-file{--diff-code-insert-edit-background-color:var(--openresearch-diff-insert-edit-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-edit-text-color\:var\(--diff-text-color\)\] .openresearch-diff-file{--diff-code-insert-edit-text-color:var(--diff-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-text-color\:var\(--diff-text-color\)\] .openresearch-diff-file{--diff-code-insert-text-color:var(--diff-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-selected-background-color\:var\(--diff-selection-background-color\)\] .openresearch-diff-file{--diff-code-selected-background-color:var(--diff-selection-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-selected-text-color\:var\(--diff-selection-text-color\)\] .openresearch-diff-file{--diff-code-selected-text-color:var(--diff-selection-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-font-family\:var\(--mono\)\] .openresearch-diff-file{--diff-font-family:var(--mono)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-delete-background-color\:var\(--openresearch-diff-delete-gutter-background-color\)\] .openresearch-diff-file{--diff-gutter-delete-background-color:var(--openresearch-diff-delete-gutter-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-delete-text-color\:var\(--accent-red\)\] .openresearch-diff-file{--diff-gutter-delete-text-color:var(--accent-red)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-insert-background-color\:var\(--openresearch-diff-insert-gutter-background-color\)\] .openresearch-diff-file{--diff-gutter-insert-background-color:var(--openresearch-diff-insert-gutter-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-insert-text-color\:var\(--accent-green\)\] .openresearch-diff-file{--diff-gutter-insert-text-color:var(--accent-green)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-selected-background-color\:var\(--openresearch-diff-gutter-selection-background-color\)\] .openresearch-diff-file{--diff-gutter-selected-background-color:var(--openresearch-diff-gutter-selection-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-selected-text-color\:var\(--diff-selection-text-color\)\] .openresearch-diff-file{--diff-gutter-selected-text-color:var(--diff-selection-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-omit-gutter-line-color\:var\(--openresearch-diff-omit-gutter-line-color\)\] .openresearch-diff-file{--diff-omit-gutter-line-color:var(--openresearch-diff-omit-gutter-line-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-selection-background-color\:var\(--openresearch-diff-selection-background-color\)\] .openresearch-diff-file{--diff-selection-background-color:var(--openresearch-diff-selection-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-selection-text-color\:var\(--primary\)\] .openresearch-diff-file{--diff-selection-text-color:var(--primary)}.\[\&_\.openresearch-diff-file\]\:\[--diff-text-color\:var\(--text\)\] .openresearch-diff-file{--diff-text-color:var(--text)}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-code-background-color\:color-mix\(_in_oklab\,_var\(--base\)_92\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-code-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-code-background-color\:color-mix\(_in_oklab\,_var\(--base\)_92\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-code-background-color:color-mix(in oklab, var(--base) 92%, var(--accent-red))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-edit-background-color\:color-mix\(_in_oklab\,_var\(--base\)_78\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-edit-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-edit-background-color\:color-mix\(_in_oklab\,_var\(--base\)_78\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-edit-background-color:color-mix(in oklab, var(--base) 78%, var(--accent-red))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-gutter-background-color\:color-mix\(_in_oklab\,_var\(--base\)_86\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-gutter-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-gutter-background-color\:color-mix\(_in_oklab\,_var\(--base\)_86\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-gutter-background-color:color-mix(in oklab, var(--base) 86%, var(--accent-red))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-divider-color\:var\(--border\)\] .openresearch-diff-file{--openresearch-diff-divider-color:var(--border)}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-gutter-selection-background-color\:color-mix\(_in_oklab\,_var\(--surface\)_68\%\,_var\(--primary\)_\)\] .openresearch-diff-file{--openresearch-diff-gutter-selection-background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-gutter-selection-background-color\:color-mix\(_in_oklab\,_var\(--surface\)_68\%\,_var\(--primary\)_\)\] .openresearch-diff-file{--openresearch-diff-gutter-selection-background-color:color-mix(in oklab, var(--surface) 68%, var(--primary))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-code-background-color\:color-mix\(_in_oklab\,_var\(--base\)_91\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-code-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-code-background-color\:color-mix\(_in_oklab\,_var\(--base\)_91\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-code-background-color:color-mix(in oklab, var(--base) 91%, var(--accent-green))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-edit-background-color\:color-mix\(_in_oklab\,_var\(--base\)_72\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-edit-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-edit-background-color\:color-mix\(_in_oklab\,_var\(--base\)_72\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-edit-background-color:color-mix(in oklab, var(--base) 72%, var(--accent-green))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-gutter-background-color\:color-mix\(_in_oklab\,_var\(--base\)_84\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-gutter-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-gutter-background-color\:color-mix\(_in_oklab\,_var\(--base\)_84\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-gutter-background-color:color-mix(in oklab, var(--base) 84%, var(--accent-green))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-omit-gutter-line-color\:color-mix\(in_oklab\,_var\(--base\)_86\%\,_var\(--text\)\)\] .openresearch-diff-file{--openresearch-diff-omit-gutter-line-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-omit-gutter-line-color\:color-mix\(in_oklab\,_var\(--base\)_86\%\,_var\(--text\)\)\] .openresearch-diff-file{--openresearch-diff-omit-gutter-line-color:color-mix(in oklab, var(--base) 86%, var(--text))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-selection-background-color\:color-mix\(_in_oklab\,_var\(--surface\)_76\%\,_var\(--primary\)_\)\] .openresearch-diff-file{--openresearch-diff-selection-background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-selection-background-color\:color-mix\(_in_oklab\,_var\(--surface\)_76\%\,_var\(--primary\)_\)\] .openresearch-diff-file{--openresearch-diff-selection-background-color:color-mix(in oklab, var(--surface) 76%, var(--primary))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-unified-gutter-text-color\:color-mix\(in_oklab\,_var\(--text\)_45\%\,_var\(--base\)\)\] .openresearch-diff-file{--openresearch-diff-unified-gutter-text-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-unified-gutter-text-color\:color-mix\(in_oklab\,_var\(--text\)_45\%\,_var\(--base\)\)\] .openresearch-diff-file{--openresearch-diff-unified-gutter-text-color:color-mix(in oklab, var(--text) 45%, var(--base))}}.\[\&_\.openresearch-diff-file_\.diff-code\]\:px-4 .openresearch-diff-file .diff-code{padding-inline:calc(var(--spacing) * 4)}.\[\&_\.openresearch-diff-file_\.diff-code\]\:py-0 .openresearch-diff-file .diff-code{padding-block:0}.\[\&_\.openresearch-diff-file_\.diff-code\]\:break-normal .openresearch-diff-file .diff-code{overflow-wrap:normal;word-break:normal}.\[\&_\.openresearch-diff-file_\.diff-code\]\:wrap-normal .openresearch-diff-file .diff-code{overflow-wrap:normal}.\[\&_\.openresearch-diff-file_\.diff-code\]\:whitespace-pre .openresearch-diff-file .diff-code{white-space:pre}.\[\&_\.openresearch-diff-file_\.diff-hunk_\+_\.diff-hunk_\.diff-line\:first-child_\>_td\]\:border-t .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.openresearch-diff-file_\.diff-hunk_\+_\.diff-hunk_\.diff-line\:first-child_\>_td\]\:border-t-\[var\(--openresearch-diff-divider-color\)\] .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top-color:var(--openresearch-diff-divider-color)}.\[\&_\.openresearch-diff-file_\.diff-line\]\:leading-\[1\.55\] .openresearch-diff-file .diff-line{--tw-leading:1.55;line-height:1.55}.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-delete\)\]\:bg-\[var\(--openresearch-diff-delete-code-background-color\)\] .openresearch-diff-file .diff-line:has(.diff-code-delete){background-color:var(--openresearch-diff-delete-code-background-color)}.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-insert\)\]\:bg-\[var\(--openresearch-diff-insert-code-background-color\)\] .openresearch-diff-file .diff-line:has(.diff-code-insert){background-color:var(--openresearch-diff-insert-code-background-color)}.\[\&_\.openresearch-diff-file\.diff-unified\]\:table-auto .openresearch-diff-file.diff-unified{table-layout:auto}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:first-child\]\:hidden .openresearch-diff-file.diff-unified .diff-line>td:first-child{display:none}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:sticky .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){position:sticky}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:left-0 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){left:0}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:z-1 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){z-index:1}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:w-\[1\%\] .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){width:1%}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:cursor-default .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){cursor:default}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:border-r .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){border-right-style:var(--tw-border-style);border-right-width:1px}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:border-r-\[var\(--openresearch-diff-divider-color\)\] .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){border-right-color:var(--openresearch-diff-divider-color)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pt-0 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-top:0}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pr-2\.5 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-right:calc(var(--spacing) * 2.5)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pb-0 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-bottom:0}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pl-3\.5 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-left:calc(var(--spacing) * 3.5)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:text-right .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){text-align:right}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:whitespace-nowrap .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){white-space:nowrap}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:text-\[var\(--openresearch-diff-unified-gutter-text-color\)\] .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){color:var(--openresearch-diff-unified-gutter-text-color)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:select-none .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){-webkit-user-select:none;user-select:none}.\[\&_\.openresearch-diff-file\.diff-unified_col\.diff-gutter-col\:first-child\]\:collapse .openresearch-diff-file.diff-unified col.diff-gutter-col:first-child{visibility:collapse}.\[\&_\.openresearch-diff-file\.diff-unified_col\.diff-gutter-col\:first-child\]\:w-0 .openresearch-diff-file.diff-unified col.diff-gutter-col:first-child{width:0}.\[\&_\.openresearch-diff-file\.diff-unified_col\.diff-gutter-col\:nth-child\(2\)\]\:w-\[1\%\] .openresearch-diff-file.diff-unified col.diff-gutter-col:nth-child(2){width:1%}.\[\&_\.paper\]\:text-xs .paper{font-size:var(--fs-xs)}.\[\&_\.paper\]\:text-muted .paper{color:var(--muted)}.\[\&_\.paper-destination\]\:flex .paper-destination{display:flex}.\[\&_\.paper-destination\]\:items-center .paper-destination{align-items:center}.\[\&_\.paper-destination\]\:gap-2\.5 .paper-destination{gap:calc(var(--spacing) * 2.5)}.\[\&_\.paper-destination\]\:rounded-md .paper-destination{border-radius:8px}.\[\&_\.paper-destination\]\:border .paper-destination{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.paper-destination\]\:border-border .paper-destination{border-color:var(--border)}.\[\&_\.paper-destination\]\:bg-background .paper-destination{background-color:var(--base)}.\[\&_\.paper-destination\]\:pt-2 .paper-destination{padding-top:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pr-2 .paper-destination{padding-right:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pb-2 .paper-destination{padding-bottom:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pl-3 .paper-destination{padding-left:calc(var(--spacing) * 3)}.\[\&_\.paper-destination_\.btn\]\:flex-none .paper-destination .btn{flex:none}.\[\&_\.paper-destination_code\]\:min-w-0 .paper-destination code{min-width:0}.\[\&_\.paper-destination_code\]\:flex-1 .paper-destination code{flex:1}.\[\&_\.paper-destination_code\]\:overflow-hidden .paper-destination code{overflow:hidden}.\[\&_\.paper-destination_code\]\:text-sm .paper-destination code{font-size:var(--fs-sm)}.\[\&_\.paper-destination_code\]\:font-normal .paper-destination code{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_\.paper-destination_code\]\:text-ellipsis .paper-destination code{text-overflow:ellipsis}.\[\&_\.paper-destination_code\]\:whitespace-nowrap .paper-destination code{white-space:nowrap}.\[\&_\.paper-destination_code\]\:text-text .paper-destination code{color:var(--text)}.\[\&_\.paper-pick\]\:flex .paper-pick{display:flex}.\[\&_\.paper-pick\]\:items-center .paper-pick{align-items:center}.\[\&_\.paper-pick\]\:justify-between .paper-pick{justify-content:space-between}.\[\&_\.paper-pick\]\:gap-2\.5 .paper-pick{gap:calc(var(--spacing) * 2.5)}.\[\&_\.paper-pick\]\:rounded-md .paper-pick{border-radius:8px}.\[\&_\.paper-pick\]\:border .paper-pick{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.paper-pick\]\:border-border .paper-pick{border-color:var(--border)}.\[\&_\.paper-pick\]\:bg-surface .paper-pick{background-color:var(--surface)}.\[\&_\.paper-pick\]\:px-3 .paper-pick{padding-inline:calc(var(--spacing) * 3)}.\[\&_\.paper-pick\]\:py-2\.5 .paper-pick{padding-block:calc(var(--spacing) * 2.5)}.\[\&_\.paper-pick_\.id\]\:font-mono .paper-pick .id{font-family:var(--mono)}.\[\&_\.paper-pick_\.id\]\:text-xs .paper-pick .id{font-size:var(--fs-xs)}.\[\&_\.paper-pick_\.id\]\:text-muted .paper-pick .id{color:var(--muted)}.\[\&_\.paper-pick_\.meta\]\:min-w-0 .paper-pick .meta{min-width:0}.\[\&_\.paper-pick_\.title\]\:text-md .paper-pick .title{font-size:var(--fs-md)}.\[\&_\.paper-pick_\.title\]\:font-semibold .paper-pick .title{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.paper-results\]\:flex .paper-results{display:flex}.\[\&_\.paper-results\]\:max-h-60 .paper-results{max-height:calc(var(--spacing) * 60)}.\[\&_\.paper-results\]\:flex-col .paper-results{flex-direction:column}.\[\&_\.paper-results\]\:overflow-y-auto .paper-results{overflow-y:auto}.\[\&_\.paper-results\]\:rounded-md .paper-results{border-radius:8px}.\[\&_\.paper-results\]\:border .paper-results{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.paper-results\]\:border-border .paper-results{border-color:var(--border)}.\[\&_\.paper-results_\.id\]\:font-mono .paper-results .id{font-family:var(--mono)}.\[\&_\.paper-results_\.id\]\:text-xs .paper-results .id{font-size:var(--fs-xs)}.\[\&_\.paper-results_\.id\]\:text-muted .paper-results .id{color:var(--muted)}.\[\&_\.paper-results_\.title\]\:text-md .paper-results .title{font-size:var(--fs-md)}.\[\&_\.paper-results_\.title\]\:font-medium .paper-results .title{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.paper-results_button\]\:flex .paper-results button{display:flex}.\[\&_\.paper-results_button\]\:cursor-pointer .paper-results button{cursor:pointer}.\[\&_\.paper-results_button\]\:flex-col .paper-results button{flex-direction:column}.\[\&_\.paper-results_button\]\:items-start .paper-results button{align-items:flex-start}.\[\&_\.paper-results_button\]\:gap-0\.5 .paper-results button{gap:calc(var(--spacing) * .5)}.\[\&_\.paper-results_button\]\:border-0 .paper-results button{border-style:var(--tw-border-style);border-width:0}.\[\&_\.paper-results_button\]\:border-b .paper-results button{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_\.paper-results_button\]\:border-b-border-variant .paper-results button{border-bottom-color:var(--border-variant)}.\[\&_\.paper-results_button\]\:bg-transparent .paper-results button{background-color:#0000}.\[\&_\.paper-results_button\]\:bg-none .paper-results button{background-image:none}.\[\&_\.paper-results_button\]\:px-2\.5 .paper-results button{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_\.paper-results_button\]\:py-2 .paper-results button{padding-block:calc(var(--spacing) * 2)}.\[\&_\.paper-results_button\]\:text-left .paper-results button{text-align:left}.\[\&_\.paper-results_button\]\:text-text .paper-results button{color:var(--text)}.\[\&_\.paper-results_button\]\:\[font\:inherit\] .paper-results button{font:inherit}.\[\&_\.paper-results_button\:hover\]\:bg-surface .paper-results button:hover{background-color:var(--surface)}.\[\&_\.paper-results_button\:last-child\]\:border-b-0 .paper-results button:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&_\.path\]\:flex .path{display:flex}.\[\&_\.path\]\:min-w-0 .path{min-width:0}.\[\&_\.path\]\:flex-1 .path{flex:1}.\[\&_\.path\]\:items-center .path{align-items:center}.\[\&_\.path\]\:gap-2 .path{gap:calc(var(--spacing) * 2)}.\[\&_\.path_code\]\:min-w-0 .path code{min-width:0}.\[\&_\.path_code\]\:flex-1 .path code{flex:1}.\[\&_\.path_code\]\:overflow-hidden .path code{overflow:hidden}.\[\&_\.path_code\]\:font-mono .path code{font-family:var(--mono)}.\[\&_\.path_code\]\:text-xs .path code{font-size:var(--fs-xs)}.\[\&_\.path_code\]\:font-semibold .path code{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.path_code\]\:text-ellipsis .path code{text-overflow:ellipsis}.\[\&_\.path_code\]\:whitespace-nowrap .path code{white-space:nowrap}.\[\&_\.path_code\]\:text-text .path code{color:var(--text)}.\[\&_\.plan-strip-caret\]\:flex .plan-strip-caret{display:flex}.\[\&_\.plan-strip-caret\]\:items-center .plan-strip-caret{align-items:center}.\[\&_\.plan-strip-caret\]\:rounded-tl-none .plan-strip-caret{border-top-left-radius:0}.\[\&_\.plan-strip-caret\]\:rounded-bl-none .plan-strip-caret{border-bottom-left-radius:0}.\[\&_\.plan-strip-caret\]\:border-l .plan-strip-caret{border-left-style:var(--tw-border-style);border-left-width:1px}.\[\&_\.plan-strip-caret\]\:border-l-\[color-mix\(in_oklab\,_var\(--base\)_35\%\,_var\(--text\)\)\] .plan-strip-caret{border-left-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.plan-strip-caret\]\:border-l-\[color-mix\(in_oklab\,_var\(--base\)_35\%\,_var\(--text\)\)\] .plan-strip-caret{border-left-color:color-mix(in oklab,var(--base) 35%,var(--text))}}.\[\&_\.plan-strip-caret\]\:px-1\.5 .plan-strip-caret{padding-inline:calc(var(--spacing) * 1.5)}.\[\&_\.plan-strip-caret\]\:py-0 .plan-strip-caret{padding-block:0}.\[\&_\.plan-strip-primary\]\:border-text .plan-strip-primary{border-color:var(--text)}.\[\&_\.plan-strip-primary\]\:bg-text .plan-strip-primary{background-color:var(--text)}.\[\&_\.plan-strip-primary\]\:text-background .plan-strip-primary{color:var(--base)}.\[\&_\.plan-strip-primary\:hover\:not\(\:disabled\)\]\:border-text .plan-strip-primary:hover:not(:disabled){border-color:var(--text)}.\[\&_\.plan-strip-primary\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_85\%\,_var\(--base\)\)\] .plan-strip-primary:hover:not(:disabled){background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.plan-strip-primary\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_85\%\,_var\(--base\)\)\] .plan-strip-primary:hover:not(:disabled){background-color:color-mix(in oklab,var(--text) 85%,var(--base))}}.\[\&_\.plan-strip-primary\:hover\:not\(\:disabled\)\]\:text-background .plan-strip-primary:hover:not(:disabled){color:var(--base)}.\[\&_\.progress\]\:mx-0 .progress{margin-inline:0}.\[\&_\.progress\]\:mt-2 .progress{margin-top:calc(var(--spacing) * 2)}.\[\&_\.progress\]\:mb-0 .progress{margin-bottom:0}.\[\&_\.progress-track\]\:h-\[5px\] .progress-track{height:5px}.\[\&_\.progress-track\]\:border-0 .progress-track{border-style:var(--tw-border-style);border-width:0}.\[\&_\.progress-track\]\:bg-border .progress-track{background-color:var(--border)}.\[\&_\.project-back\]\:shrink-0 .project-back{flex-shrink:0}.\[\&_\.project-chevron\]\:text-muted .project-chevron{color:var(--muted)}.\[\&_\.project-chevron\]\:opacity-0 .project-chevron{opacity:0}.\[\&_\.project-chevron\]\:transition-transform .project-chevron{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_\.project-chevron\]\:duration-120 .project-chevron{--tw-duration:.12s;transition-duration:.12s}.\[\&_\.project-chevron\]\:ease-standard .project-chevron{--tw-ease:ease;transition-timing-function:ease}.\[\&_\.project-delete\]\:absolute .project-delete{position:absolute}.\[\&_\.project-delete\]\:top-2\.5 .project-delete{top:calc(var(--spacing) * 2.5)}.\[\&_\.project-delete\]\:right-2\.5 .project-delete{right:calc(var(--spacing) * 2.5)}.\[\&_\.project-delete\]\:z-2 .project-delete{z-index:2}.\[\&_\.project-delete\]\:hidden .project-delete{display:none}.\[\&_\.project-delete\]\:rounded-sm .project-delete{border-radius:6px}.\[\&_\.project-delete\]\:p-\[5px\] .project-delete{padding:5px}.\[\&_\.project-delete\]\:leading-\[0\] .project-delete{--tw-leading:0;line-height:0}.\[\&_\.project-delete\]\:text-muted .project-delete{color:var(--muted)}.\[\&_\.project-field-label\]\:text-base .project-field-label{font-size:var(--fs-base)}.\[\&_\.project-field-label\]\:font-semibold .project-field-label{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.project-field-label\]\:text-text .project-field-label{color:var(--text)}.\[\&_\.project-location-field\]\:flex .project-location-field{display:flex}.\[\&_\.project-location-field\]\:flex-col .project-location-field{flex-direction:column}.\[\&_\.project-location-field\]\:gap-2 .project-location-field{gap:calc(var(--spacing) * 2)}.\[\&_\.project-location-label\]\:text-base .project-location-label{font-size:var(--fs-base)}.\[\&_\.project-location-label\]\:font-semibold .project-location-label{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.project-location-label\]\:text-text .project-location-label{color:var(--text)}.\[\&_\.project-menu\]\:left-0 .project-menu{left:0}.\[\&_\.project-menu\]\:z-70 .project-menu{z-index:70}.\[\&_\.project-menu\]\:w-52\.5 .project-menu{width:calc(var(--spacing) * 52.5)}.\[\&_\.project-path-notice\]\:rounded-sm .project-path-notice{border-radius:6px}.\[\&_\.project-path-notice\]\:border .project-path-notice{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.project-path-notice\]\:border-border-variant .project-path-notice{border-color:var(--border-variant)}.\[\&_\.project-path-notice\]\:bg-surface .project-path-notice{background-color:var(--surface)}.\[\&_\.project-path-notice\]\:px-\[11px\] .project-path-notice{padding-inline:11px}.\[\&_\.project-path-notice\]\:py-\[9px\] .project-path-notice{padding-block:9px}.\[\&_\.project-path-notice\]\:text-sm .project-path-notice{font-size:var(--fs-sm)}.\[\&_\.project-path-notice\]\:leading-\[1\.4\] .project-path-notice{--tw-leading:1.4;line-height:1.4}.\[\&_\.project-path-notice\]\:text-subtext .project-path-notice{color:var(--subtext)}.\[\&_\.project-path-notice\.error\]\:border-\[color-mix\(in_srgb\,_var\(--accent-red\)_35\%\,_var\(--border-variant\)\)\] .project-path-notice.error{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.project-path-notice\.error\]\:border-\[color-mix\(in_srgb\,_var\(--accent-red\)_35\%\,_var\(--border-variant\)\)\] .project-path-notice.error{border-color:color-mix(in srgb,var(--accent-red) 35%,var(--border-variant))}}.\[\&_\.project-switcher\]\:relative .project-switcher{position:relative}.\[\&_\.project-switcher\]\:min-w-0 .project-switcher{min-width:0}.\[\&_\.project-switcher\]\:flex-1 .project-switcher{flex:1}.\[\&_\.project-switcher\]\:self-stretch .project-switcher{align-self:stretch}.\[\&_\.rail-body\]\:min-h-0 .rail-body{min-height:0}.\[\&_\.rail-body\]\:flex-1 .rail-body{flex:1}.\[\&_\.rail-body\]\:overflow-y-auto .rail-body{overflow-y:auto}.\[\&_\.rail-body\]\:px-2 .rail-body{padding-inline:calc(var(--spacing) * 2)}.\[\&_\.rail-body\]\:py-1 .rail-body{padding-block:var(--spacing)}.\[\&_\.react-flow\\_\\_attribution\]\:hidden\! .react-flow__attribution{display:none!important}.\[\&_\.react-flow\\_\\_handle\]\:pointer-events-none .react-flow__handle{pointer-events:none}.\[\&_\.react-flow\\_\\_handle\]\:opacity-0 .react-flow__handle{opacity:0}.\[\&_\.react-flow\\_\\_node\.react-flow\\_\\_node-elided\.selectable\]\:cursor-pointer .react-flow__node.react-flow__node-elided.selectable{cursor:pointer}.\[\&_\.react-flow\\_\\_node\.react-flow\\_\\_node-exp\.selectable\]\:cursor-default .react-flow__node.react-flow__node-exp.selectable{cursor:default}.\[\&_\.repo-hint\]\:font-mono .repo-hint{font-family:var(--mono)}.\[\&_\.repo-hint\]\:text-xs .repo-hint{font-size:var(--fs-xs)}.\[\&_\.repo-hint\]\:font-normal .repo-hint{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_\.repo-hint\]\:text-muted .repo-hint{color:var(--muted)}.\[\&_\.repo-hint\.ok\]\:text-accent-teal .repo-hint.ok{color:var(--accent-teal)}.\[\&_\.row2\]\:grid .row2{display:grid}.\[\&_\.row2\]\:grid-cols-2 .row2{grid-template-columns:repeat(2,minmax(0,1fr))}.\[\&_\.row2\]\:gap-2\.5 .row2{gap:calc(var(--spacing) * 2.5)}.\[\&_\.run-chip_svg\]\:text-primary .run-chip svg{color:var(--primary)}.\[\&_\.run-chip_svg\]\:opacity-100 .run-chip svg{opacity:1}.\[\&_\.run-label\]\:text-sm .run-label{font-size:var(--fs-sm)}.\[\&_\.run-label\]\:font-semibold .run-label,.\[\&_\.sel\]\:font-semibold .sel{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.sel\]\:text-text .sel{color:var(--text)}.\[\&_\.session-dot\]\:inline-flex .session-dot{display:inline-flex}.\[\&_\.session-dot\]\:w-3\.5 .session-dot{width:calc(var(--spacing) * 3.5)}.\[\&_\.session-dot\]\:shrink-0 .session-dot{flex-shrink:0}.\[\&_\.session-dot\]\:items-center .session-dot{align-items:center}.\[\&_\.session-dot\]\:justify-center .session-dot{justify-content:center}.\[\&_\.session-menu-btn\]\:mx-0 .session-menu-btn{margin-inline:0}.\[\&_\.session-menu-btn\]\:-my-0\.5 .session-menu-btn{margin-block:calc(var(--spacing) * -.5)}.\[\&_\.session-menu-btn\]\:hidden .session-menu-btn{display:none}.\[\&_\.session-menu-btn\]\:h-4 .session-menu-btn{height:calc(var(--spacing) * 4)}.\[\&_\.session-menu-btn\]\:w-4 .session-menu-btn{width:calc(var(--spacing) * 4)}.\[\&_\.session-menu-btn\]\:shrink-0 .session-menu-btn{flex-shrink:0}.\[\&_\.session-menu-btn\]\:items-center .session-menu-btn{align-items:center}.\[\&_\.session-menu-btn\]\:justify-center .session-menu-btn{justify-content:center}.\[\&_\.session-menu-btn\]\:rounded-sm .session-menu-btn{border-radius:6px}.\[\&_\.session-menu-btn\]\:text-muted .session-menu-btn{color:var(--muted)}.\[\&_\.session-menu-btn\:hover\]\:bg-panel .session-menu-btn:hover{background-color:var(--panel)}.\[\&_\.session-menu-btn\:hover\]\:text-text .session-menu-btn:hover{color:var(--text)}.\[\&_\.session-time\]\:shrink-0 .session-time{flex-shrink:0}.\[\&_\.session-time\]\:text-2xs .session-time{font-size:var(--fs-2xs)}.\[\&_\.session-time\]\:text-muted .session-time{color:var(--muted)}.\[\&_\.session-title\]\:min-w-0 .session-title{min-width:0}.\[\&_\.session-title\]\:flex-1 .session-title{flex:1}.\[\&_\.session-title\]\:overflow-hidden .session-title{overflow:hidden}.\[\&_\.session-title\]\:text-ellipsis .session-title{text-overflow:ellipsis}.\[\&_\.session-title\]\:whitespace-nowrap .session-title{white-space:nowrap}.\[\&_\.session-title-input\]\:mx-0 .session-title-input{margin-inline:0}.\[\&_\.session-title-input\]\:-my-0\.5 .session-title-input{margin-block:calc(var(--spacing) * -.5)}.\[\&_\.session-title-input\]\:min-w-0 .session-title-input{min-width:0}.\[\&_\.session-title-input\]\:flex-1 .session-title-input{flex:1}.\[\&_\.session-title-input\]\:rounded-sm .session-title-input{border-radius:6px}.\[\&_\.session-title-input\]\:border .session-title-input{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.session-title-input\]\:border-primary .session-title-input{border-color:var(--primary)}.\[\&_\.session-title-input\]\:bg-background .session-title-input{background-color:var(--base)}.\[\&_\.session-title-input\]\:px-\[5px\] .session-title-input{padding-inline:5px}.\[\&_\.session-title-input\]\:py-px .session-title-input{padding-block:1px}.\[\&_\.session-title-input\]\:text-text .session-title-input{color:var(--text)}.\[\&_\.session-title-input\]\:outline-none .session-title-input{--tw-outline-style:none;outline-style:none}.\[\&_\.session-title-input\]\:\[font\:inherit\] .session-title-input{font:inherit}.\[\&_\.settings-card\]\:mt-3\.5 .settings-card{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\.settings-card\]\:mb-0 .settings-card,.\[\&_\.settings-card-head\]\:mb-0 .settings-card-head{margin-bottom:0}.\[\&_\.settings-card-head\]\:justify-between .settings-card-head{justify-content:space-between}.\[\&_\.settings-card-head\]\:pb-3 .settings-card-head{padding-bottom:calc(var(--spacing) * 3)}.\[\&_\.settings-card-head_h3\]\:m-0 .settings-card-head h3{margin:0}.\[\&_\.settings-sub\]\:mb-3 .settings-sub{margin-bottom:calc(var(--spacing) * 3)}.\[\&_\.skill-chip\]\:mr-0\.5 .skill-chip{margin-right:calc(var(--spacing) * .5)}.\[\&_\.skill-chip\]\:align-baseline .skill-chip{vertical-align:baseline}.\[\&_\.skill-desc\]\:text-sm .skill-desc{font-size:var(--fs-sm)}.\[\&_\.skill-desc\]\:text-subtext .skill-desc{color:var(--subtext)}.\[\&_\.skill-hint\]\:text-muted .skill-hint{color:var(--muted)}.\[\&_\.skill-name\]\:text-md .skill-name{font-size:var(--fs-md)}.\[\&_\.spinner\]\:h-5\.5 .spinner{height:calc(var(--spacing) * 5.5)}.\[\&_\.spinner\]\:w-5\.5 .spinner{width:calc(var(--spacing) * 5.5)}.\[\&_\.spinner\]\:border-\[3px\] .spinner{border-style:var(--tw-border-style);border-width:3px}.\[\&_\.stats\]\:flex .stats{display:flex}.\[\&_\.stats\]\:shrink-0 .stats{flex-shrink:0}.\[\&_\.stats\]\:items-center .stats{align-items:center}.\[\&_\.stats\]\:gap-2 .stats{gap:calc(var(--spacing) * 2)}.\[\&_\.stats\]\:font-mono .stats{font-family:var(--mono)}.\[\&_\.stats\]\:text-2xs .stats{font-size:var(--fs-2xs)}.\[\&_\.stats\]\:font-medium .stats{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.stats\]\:tabular-nums .stats{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.\[\&_\.status-badge\]\:text-text .status-badge{color:var(--text)}.\[\&_\.tab-close\]\:inline-flex .tab-close{display:inline-flex}.\[\&_\.tab-close\]\:h-3\.5 .tab-close{height:calc(var(--spacing) * 3.5)}.\[\&_\.tab-close\]\:w-3\.5 .tab-close{width:calc(var(--spacing) * 3.5)}.\[\&_\.tab-close\]\:shrink-0 .tab-close{flex-shrink:0}.\[\&_\.tab-close\]\:items-center .tab-close{align-items:center}.\[\&_\.tab-close\]\:justify-center .tab-close{justify-content:center}.\[\&_\.tab-close\]\:rounded-xs .tab-close{border-radius:4px}.\[\&_\.tab-close\]\:text-muted .tab-close{color:var(--muted)}.\[\&_\.tab-close\:hover\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_15\%\,_transparent\)\] .tab-close:hover{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.tab-close\:hover\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_15\%\,_transparent\)\] .tab-close:hover{background-color:color-mix(in oklab,var(--text) 15%,transparent)}}.\[\&_\.tab-close\:hover\]\:text-text .tab-close:hover{color:var(--text)}.\[\&_\.tab-label\]\:grid .tab-label{display:grid}.\[\&_\.tab-label\]\:min-w-0 .tab-label{min-width:0}.\[\&_\.tab-label\]\:grid-cols-\[minmax\(0\,_1fr\)\] .tab-label{grid-template-columns:minmax(0,1fr)}.\[\&_\.tab-label\]\:overflow-hidden .tab-label,.\[\&_\.tab-label_\>_span\]\:overflow-hidden .tab-label>span{overflow:hidden}.\[\&_\.tab-label_\>_span\]\:text-ellipsis .tab-label>span{text-overflow:ellipsis}.\[\&_\.tab-label_\>_span\]\:whitespace-nowrap .tab-label>span{white-space:nowrap}.\[\&_\.tab-label_\>_span\]\:\[grid-area\:1_\/_1\] .tab-label>span{grid-area:1/1}.\[\&_\.tab-label\:\:after\]\:invisible .tab-label:after{visibility:hidden}.\[\&_\.tab-label\:\:after\]\:overflow-hidden .tab-label:after{overflow:hidden}.\[\&_\.tab-label\:\:after\]\:font-medium .tab-label:after{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.tab-label\:\:after\]\:text-ellipsis .tab-label:after{text-overflow:ellipsis}.\[\&_\.tab-label\:\:after\]\:whitespace-nowrap .tab-label:after{white-space:nowrap}.\[\&_\.tab-label\:\:after\]\:content-\[attr\(data-label\)\] .tab-label:after{--tw-content:attr(data-label);content:var(--tw-content)}.\[\&_\.tab-label\:\:after\]\:\[grid-area\:1_\/_1\] .tab-label:after{grid-area:1/1}.\[\&_\.time\]\:text-xs .time{font-size:var(--fs-xs)}.\[\&_\.time\]\:text-muted .time{color:var(--muted)}.\[\&_\.title\]\:max-w-60 .title{max-width:calc(var(--spacing) * 60)}.\[\&_\.title\]\:overflow-hidden .title{overflow:hidden}.\[\&_\.title\]\:text-md .title{font-size:var(--fs-md)}.\[\&_\.title\]\:font-medium .title{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.title\]\:text-ellipsis .title{text-overflow:ellipsis}.\[\&_\.title\]\:whitespace-nowrap .title{white-space:nowrap}.\[\&_\.tool-line\]\:text-lg .tool-line{font-size:var(--fs-lg)}.\[\&_\.unread-dot\]\:h-\[7px\] .unread-dot{height:7px}.\[\&_\.unread-dot\]\:w-\[7px\] .unread-dot{width:7px}.\[\&_\.unread-dot\]\:shrink-0 .unread-dot{flex-shrink:0}.\[\&_\.unread-dot\]\:rounded-full .unread-dot{border-radius:999px}.\[\&_\.unread-dot\]\:bg-primary .unread-dot{background-color:var(--primary)}.\[\&_\.v\]\:font-mono .v{font-family:var(--mono)}.\[\&_\.v\]\:text-sm .v{font-size:var(--fs-sm)}.\[\&_\.v\]\:break-all .v{word-break:break-all}.\[\&_\.when\]\:ml-auto .when{margin-left:auto}.\[\&_\.when\]\:text-xs .when{font-size:var(--fs-xs)}.\[\&_\.when\]\:text-muted .when{color:var(--muted)}.\[\&_\:where\(\[data-tip-align\=\'end\'\]\)\:\:after\]\:right-0 :where([data-tip-align=end]):after{right:0}.\[\&_\:where\(\[data-tip-align\=\'end\'\]\)\:\:after\]\:left-auto :where([data-tip-align=end]):after{left:auto}.\[\&_\:where\(\[data-tip-align\=\'end\'\]\)\:\:after\]\:translate-none :where([data-tip-align=end]):after{translate:none}.\[\&_\:where\(\[data-tip-align\=\'start\'\]\)\:\:after\]\:left-0 :where([data-tip-align=start]):after{left:0}.\[\&_\:where\(\[data-tip-align\=\'start\'\]\)\:\:after\]\:translate-none :where([data-tip-align=start]):after{translate:none}.\[\&_\:where\(\[data-tip\]\)\]\:relative :where([data-tip]){position:relative}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:pointer-events-none :where([data-tip]):after{pointer-events:none}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:invisible :where([data-tip]):after{visibility:hidden}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:absolute :where([data-tip]):after{position:absolute}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:top-\[calc\(100\%_\+_6px\)\] :where([data-tip]):after{top:calc(100% + 6px)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:left-1\/2 :where([data-tip]):after{left:50%}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:z-\[9999\] :where([data-tip]):after{z-index:9999}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:w-max :where([data-tip]):after{width:max-content}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:max-w-none :where([data-tip]):after{max-width:none}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:-translate-x-1\/2 :where([data-tip]):after{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:rounded-sm :where([data-tip]):after{border-radius:6px}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:bg-text :where([data-tip]):after{background-color:var(--text)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:px-2 :where([data-tip]):after{padding-inline:calc(var(--spacing) * 2)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:py-\[5px\] :where([data-tip]):after{padding-block:5px}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:text-xs :where([data-tip]):after{font-size:var(--fs-xs)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:leading-none :where([data-tip]):after{--tw-leading:1;line-height:1}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:font-medium :where([data-tip]):after{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:whitespace-nowrap :where([data-tip]):after{white-space:nowrap}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:text-background :where([data-tip]):after{color:var(--base)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:opacity-0 :where([data-tip]):after{opacity:0}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:content-\[attr\(data-tip\)\] :where([data-tip]):after{--tw-content:attr(data-tip);content:var(--tw-content)}.\[\&_\:where\(\[data-tip\]\)\:is\(\:hover\,\:focus-visible\)\:\:after\]\:visible :where([data-tip]):is(:hover,:focus-visible):after{visibility:visible}.\[\&_\:where\(\[data-tip\]\)\:is\(\:hover\,\:focus-visible\)\:\:after\]\:opacity-100 :where([data-tip]):is(:hover,:focus-visible):after{opacity:1}.\[\&_\>_\*\:first-child\]\:mt-0>:first-child{margin-top:0}.\[\&_\>_\*\:last-child\]\:mb-0>:last-child{margin-bottom:0}.\[\&_\>_\.changes-note\]\:mx-4>.changes-note{margin-inline:calc(var(--spacing) * 4)}.\[\&_\>_\.changes-note\]\:my-3\.5>.changes-note{margin-block:calc(var(--spacing) * 3.5)}.\[\&_\>_\.diff-explorer\]\:mx-4>.diff-explorer{margin-inline:calc(var(--spacing) * 4)}.\[\&_\>_\.diff-explorer\]\:mt-3\.5>.diff-explorer{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\.diff-explorer\]\:mb-0>.diff-explorer{margin-bottom:0}.\[\&_\>_\.error\]\:mx-0>.error{margin-inline:0}.\[\&_\>_\.error\]\:mt-0>.error{margin-top:0}.\[\&_\>_\.error\]\:mt-3\.5>.error{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\.error\]\:mb-3>.error{margin-bottom:calc(var(--spacing) * 3)}.\[\&_\>_\.error\]\:text-md>.error{font-size:var(--fs-md)}.\[\&_\>_\.error\]\:whitespace-pre-wrap>.error{white-space:pre-wrap}.\[\&_\>_\.error\]\:text-accent-red>.error{color:var(--accent-red)}.\[\&_\>_\.openresearch-diff\]\:mx-4>.openresearch-diff{margin-inline:calc(var(--spacing) * 4)}.\[\&_\>_\.openresearch-diff\]\:mt-3\.5>.openresearch-diff{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\.openresearch-diff\]\:mb-0>.openresearch-diff{margin-bottom:0}.\[\&_\>_\.project-default-row\:first-child\]\:border-t-0>.project-default-row:first-child{border-top-style:var(--tw-border-style);border-top-width:0}.\[\&_\>_\.project-default-row\:first-child\]\:pt-0>.project-default-row:first-child{padding-top:0}.\[\&_\>_\.seg\]\:rounded-sm>.seg{border-radius:6px}.\[\&_\>_\.seg\]\:p-0\.5>.seg{padding:calc(var(--spacing) * .5)}.\[\&_\>_\.seg_button\]\:px-2>.seg button{padding-inline:calc(var(--spacing) * 2)}.\[\&_\>_\.seg_button\]\:py-0\.5>.seg button{padding-block:calc(var(--spacing) * .5)}.\[\&_\>_\.seg_button\]\:text-sm>.seg button{font-size:var(--fs-sm)}.\[\&_\>_\.seg_button\]\:font-medium>.seg button{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\>_\.truncated-notice\]\:mx-4>.truncated-notice{margin-inline:calc(var(--spacing) * 4)}.\[\&_\>_\.truncated-notice\]\:mt-3\.5>.truncated-notice{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\.truncated-notice\]\:mb-0>.truncated-notice{margin-bottom:0}.\[\&_\>_\:first-child\]\:mt-3\.5>:first-child{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\:last-child\]\:mb-0>:last-child{margin-bottom:0}.\[\&_\>_\:not\(\.project-card-open\,_\.project-delete\)\]\:pointer-events-none>:not(.project-card-open,.project-delete){pointer-events:none}.\[\&_\>_\:not\(\.project-card-open\,_\.project-delete\)\]\:relative>:not(.project-card-open,.project-delete){position:relative}.\[\&_\>_\:not\(\.project-card-open\,_\.project-delete\)\]\:z-1>:not(.project-card-open,.project-delete){z-index:1}.\[\&_\>_h2\]\:mx-0>h2{margin-inline:0}.\[\&_\>_h2\]\:mt-0>h2{margin-top:0}.\[\&_\>_h2\]\:mb-1\.5>h2{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_\>_h2\]\:text-xl>h2{font-size:var(--fs-xl)}.\[\&_\>_label\]\:gap-2>label{gap:calc(var(--spacing) * 2)}.\[\&_\>_p\]\:m-0>p{margin:0}.\[\&_\>_p\]\:text-md>p{font-size:var(--fs-md)}.\[\&_\>_p\]\:leading-normal>p{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.\[\&_\>_p\]\:text-muted>p{color:var(--muted)}.\[\&_\>_span\]\:inline-flex>span{display:inline-flex}.\[\&_\>_span\]\:items-center>span{align-items:center}.\[\&_\>_span\]\:gap-\[5px\]>span{gap:5px}.\[\&_\>_svg\]\:shrink-0>svg{flex-shrink:0}.\[\&_\>_svg\]\:text-muted>svg{color:var(--muted)}.\[\&_\>_svg\]\:text-subtext>svg{color:var(--subtext)}.\[\&_\>_svg\.file-tree-chevron\]\:text-muted>svg.file-tree-chevron{color:var(--muted)}.\[\&_a\]\:pointer-events-auto a{pointer-events:auto}.\[\&_a\]\:inline-flex a{display:inline-flex}.\[\&_a\]\:text-sm a{font-size:var(--fs-sm)}.\[\&_a\]\:whitespace-nowrap a{white-space:nowrap}.\[\&_a\]\:text-primary a{color:var(--primary)}.\[\&_a\]\:text-subtext a{color:var(--subtext)}.\[\&_a\:hover\]\:text-text a:hover{color:var(--text)}.\[\&_blockquote\]\:mx-0 blockquote{margin-inline:0}.\[\&_blockquote\]\:my-1\.5 blockquote{margin-block:calc(var(--spacing) * 1.5)}.\[\&_blockquote\]\:border-l-\[3px\] blockquote{border-left-style:var(--tw-border-style);border-left-width:3px}.\[\&_blockquote\]\:border-l-border blockquote{border-left-color:var(--border)}.\[\&_blockquote\]\:pt-0\.5 blockquote{padding-top:calc(var(--spacing) * .5)}.\[\&_blockquote\]\:pr-0 blockquote{padding-right:0}.\[\&_blockquote\]\:pb-0\.5 blockquote{padding-bottom:calc(var(--spacing) * .5)}.\[\&_blockquote\]\:pl-2\.5 blockquote{padding-left:calc(var(--spacing) * 2.5)}.\[\&_blockquote\]\:text-subtext blockquote{color:var(--subtext)}.\[\&_button\]\:absolute button{position:absolute}.\[\&_button\]\:-top-\[5px\] button{top:-5px}.\[\&_button\]\:-right-\[5px\] button{right:-5px}.\[\&_button\]\:-mb-px button{margin-bottom:-1px}.\[\&_button\]\:flex button{display:flex}.\[\&_button\]\:grid button{display:grid}.\[\&_button\]\:inline-flex button{display:inline-flex}.\[\&_button\]\:h-4 button{height:calc(var(--spacing) * 4)}.\[\&_button\]\:w-4 button{width:calc(var(--spacing) * 4)}.\[\&_button\]\:w-full button{width:100%}.\[\&_button\]\:cursor-pointer button{cursor:pointer}.\[\&_button\]\:grid-cols-\[18px_minmax\(0\,_1fr\)_auto_auto\] button{grid-template-columns:18px minmax(0,1fr) auto auto}.\[\&_button\]\:grid-cols-\[minmax\(72px\,_0\.7fr\)_minmax\(100px\,_1fr\)_minmax\(70px\,_0\.7fr\)_60px_16px\] button{grid-template-columns:minmax(72px,.7fr) minmax(100px,1fr) minmax(70px,.7fr) 60px 16px}.\[\&_button\]\:flex-col button{flex-direction:column}.\[\&_button\]\:items-center button{align-items:center}.\[\&_button\]\:items-start button{align-items:flex-start}.\[\&_button\]\:justify-center button{justify-content:center}.\[\&_button\]\:gap-0\.5 button{gap:calc(var(--spacing) * .5)}.\[\&_button\]\:gap-3\.5 button{gap:calc(var(--spacing) * 3.5)}.\[\&_button\]\:gap-\[7px\] button{gap:7px}.\[\&_button\]\:rounded-full button{border-radius:999px}.\[\&_button\]\:rounded-sm button{border-radius:6px}.\[\&_button\]\:rounded-xs button{border-radius:4px}.\[\&_button\]\:border button{border-style:var(--tw-border-style);border-width:1px}.\[\&_button\]\:border-0 button{border-style:var(--tw-border-style);border-width:0}.\[\&_button\]\:border-b button{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_button\]\:border-b-2 button{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.\[\&_button\]\:border-border button{border-color:var(--border)}.\[\&_button\]\:border-b-border-variant button{border-bottom-color:var(--border-variant)}.\[\&_button\]\:border-b-transparent button{border-bottom-color:#0000}.\[\&_button\]\:bg-surface button{background-color:var(--surface)}.\[\&_button\]\:bg-transparent button{background-color:#0000}.\[\&_button\]\:bg-none button{background-image:none}.\[\&_button\]\:p-0 button{padding:0}.\[\&_button\]\:p-0\.5 button{padding:calc(var(--spacing) * .5)}.\[\&_button\]\:px-0 button{padding-inline:0}.\[\&_button\]\:px-0\.5 button{padding-inline:calc(var(--spacing) * .5)}.\[\&_button\]\:px-2 button{padding-inline:calc(var(--spacing) * 2)}.\[\&_button\]\:px-2\.5 button{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_button\]\:px-3 button{padding-inline:calc(var(--spacing) * 3)}.\[\&_button\]\:px-\[9px\] button{padding-inline:9px}.\[\&_button\]\:py-0\.5 button{padding-block:calc(var(--spacing) * .5)}.\[\&_button\]\:py-2 button{padding-block:calc(var(--spacing) * 2)}.\[\&_button\]\:py-\[3px\] button{padding-block:3px}.\[\&_button\]\:py-\[7px\] button{padding-block:7px}.\[\&_button\]\:py-\[11px\] button{padding-block:11px}.\[\&_button\]\:text-left button{text-align:left}.\[\&_button\]\:text-md button{font-size:var(--fs-md)}.\[\&_button\]\:text-sm button{font-size:var(--fs-sm)}.\[\&_button\]\:text-xs button{font-size:var(--fs-xs)}.\[\&_button\]\:font-medium button{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_button\]\:font-semibold button{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_button\]\:text-muted button{color:var(--muted)}.\[\&_button\]\:text-text button{color:var(--text)}.\[\&_button\]\:\[font\:inherit\] button{font:inherit}.\[\&_button\.active\]\:border-b-primary button.active{border-bottom-color:var(--primary)}.\[\&_button\.active\]\:bg-background button.active{background-color:var(--base)}.\[\&_button\.active\]\:bg-surface button.active{background-color:var(--surface)}.\[\&_button\.active\]\:shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_25\%\,_transparent\)\] button.active{--tw-shadow:0 1px 3px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.\[\&_button\.active\]\:shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_25\%\,_transparent\)\] button.active{--tw-shadow:0 1px 3px var(--tw-shadow-color,color-mix(in oklab, var(--text) 25%, transparent))}}.\[\&_button\.active\]\:shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_25\%\,_transparent\)\] button.active{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&_button\.active\]\:shadow-\[inset_2px_0_0_var\(--text\)\] button.active{--tw-shadow:inset 2px 0 0 var(--tw-shadow-color,var(--text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&_button\:disabled\]\:cursor-default button:disabled{cursor:default}.\[\&_button\:disabled\]\:text-muted button:disabled{color:var(--muted)}.\[\&_button\:disabled\]\:opacity-50 button:disabled{opacity:.5}.\[\&_button\:hover\]\:bg-\[var\(--surface-2\,_rgb\(0_0_0_\/_5\%\)\)\] button:hover{background-color:var(--surface-2,#0000000d)}.\[\&_button\:hover\]\:bg-panel button:hover{background-color:var(--panel)}.\[\&_button\:hover\]\:bg-surface button:hover{background-color:var(--surface)}.\[\&_button\:hover\]\:bg-text button:hover{background-color:var(--text)}.\[\&_button\:hover\]\:text-background button:hover{color:var(--base)}.\[\&_button\:hover\]\:text-text button:hover{color:var(--text)}.\[\&_button\:hover\]\:underline button:hover{text-decoration-line:underline}.\[\&_button\:hover\]\:underline-offset-2 button:hover{text-underline-offset:2px}.\[\&_button\:last-child\]\:border-b-0 button:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&_button\:not\(\:disabled\)\:hover\]\:text-text button:not(:disabled):hover{color:var(--text)}.\[\&_code\]\:min-w-0 code{min-width:0}.\[\&_code\]\:flex-1 code{flex:1}.\[\&_code\]\:overflow-hidden code{overflow:hidden}.\[\&_code\]\:rounded-xs code{border-radius:4px}.\[\&_code\]\:border code{border-style:var(--tw-border-style);border-width:1px}.\[\&_code\]\:border-border-variant code{border-color:var(--border-variant)}.\[\&_code\]\:bg-panel code{background-color:var(--panel)}.\[\&_code\]\:px-\[5px\] code{padding-inline:5px}.\[\&_code\]\:py-px code{padding-block:1px}.\[\&_code\]\:text-left code{text-align:left}.\[\&_code\]\:font-mono code{font-family:var(--mono)}.\[\&_code\]\:text-\[0\.9em\] code{font-size:.9em}.\[\&_code\]\:text-\[0\.92em\] code{font-size:.92em}.\[\&_code\]\:text-sm code{font-size:var(--fs-sm)}.\[\&_code\]\:text-xs code{font-size:var(--fs-xs)}.\[\&_code\]\:font-medium code{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_code\]\:text-ellipsis code{text-overflow:ellipsis}.\[\&_code\]\:whitespace-nowrap code{white-space:nowrap}.\[\&_code\]\:text-inherit code{color:inherit}.\[\&_code\]\:text-muted code{color:var(--muted)}.\[\&_code\]\:text-primary code{color:var(--primary)}.\[\&_code\]\:text-text code{color:var(--text)}.\[\&_code\]\:\[direction\:rtl\] code{direction:rtl}.\[\&_h1\]\:m-0 h1{margin:0}.\[\&_h1\]\:mx-0 h1{margin-inline:0}.\[\&_h1\]\:mt-0 h1{margin-top:0}.\[\&_h1\]\:mt-3 h1{margin-top:calc(var(--spacing) * 3)}.\[\&_h1\]\:mt-7 h1{margin-top:calc(var(--spacing) * 7)}.\[\&_h1\]\:mb-1\.5 h1{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_h1\]\:mb-3\.5 h1{margin-bottom:calc(var(--spacing) * 3.5)}.\[\&_h1\]\:text-3xl h1{font-size:var(--fs-3xl)}.\[\&_h1\]\:text-\[1\.05em\] h1{font-size:1.05em}.\[\&_h1\]\:text-\[2em\] h1{font-size:2em}.\[\&_h1\]\:text-\[22px\] h1{font-size:22px}.\[\&_h1\]\:leading-\[1\.18\] h1{--tw-leading:1.18;line-height:1.18}.\[\&_h1\]\:leading-tight h1{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.\[\&_h1\]\:font-semibold h1{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_h1\]\:text-text h1{color:var(--text)}.\[\&_h2\]\:m-0 h2{margin:0}.\[\&_h2\]\:mx-0 h2{margin-inline:0}.\[\&_h2\]\:mt-0 h2{margin-top:0}.\[\&_h2\]\:mt-3 h2{margin-top:calc(var(--spacing) * 3)}.\[\&_h2\]\:mt-7 h2{margin-top:calc(var(--spacing) * 7)}.\[\&_h2\]\:mb-1\.5 h2{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_h2\]\:mb-2\.5 h2{margin-bottom:calc(var(--spacing) * 2.5)}.\[\&_h2\]\:mb-3\.5 h2{margin-bottom:calc(var(--spacing) * 3.5)}.\[\&_h2\]\:flex h2{display:flex}.\[\&_h2\]\:items-center h2{align-items:center}.\[\&_h2\]\:gap-2 h2{gap:calc(var(--spacing) * 2)}.\[\&_h2\]\:text-2xl h2{font-size:var(--fs-2xl)}.\[\&_h2\]\:text-5xl h2{font-size:var(--fs-5xl)}.\[\&_h2\]\:text-\[1\.05em\] h2{font-size:1.05em}.\[\&_h2\]\:text-\[1\.5em\] h2{font-size:1.5em}.\[\&_h2\]\:text-lg h2{font-size:var(--fs-lg)}.\[\&_h2\]\:text-md h2{font-size:var(--fs-md)}.\[\&_h2\]\:text-xl h2{font-size:var(--fs-xl)}.\[\&_h2\]\:leading-tight h2{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.\[\&_h2\]\:font-medium h2{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_h2\]\:font-semibold h2{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_h2\]\:tracking-\[-0\.01em\] h2{--tw-tracking:-.01em;letter-spacing:-.01em}.\[\&_h2\]\:tracking-\[-0\.015em\] h2{--tw-tracking:-.015em;letter-spacing:-.015em}.\[\&_h2\]\:text-text h2{color:var(--text)}.\[\&_h3\]\:mx-0 h3{margin-inline:0}.\[\&_h3\]\:mt-0 h3{margin-top:0}.\[\&_h3\]\:mt-1\.5 h3{margin-top:calc(var(--spacing) * 1.5)}.\[\&_h3\]\:mt-3 h3{margin-top:calc(var(--spacing) * 3)}.\[\&_h3\]\:mt-5\.5 h3{margin-top:calc(var(--spacing) * 5.5)}.\[\&_h3\]\:mb-0 h3{margin-bottom:0}.\[\&_h3\]\:mb-1\.5 h3{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_h3\]\:mb-2 h3{margin-bottom:calc(var(--spacing) * 2)}.\[\&_h3\]\:mb-2\.5 h3{margin-bottom:calc(var(--spacing) * 2.5)}.\[\&_h3\]\:mb-3 h3{margin-bottom:calc(var(--spacing) * 3)}.\[\&_h3\]\:text-\[1\.2em\] h3{font-size:1.2em}.\[\&_h3\]\:text-\[1\.05em\] h3{font-size:1.05em}.\[\&_h3\]\:text-base h3{font-size:var(--fs-base)}.\[\&_h3\]\:text-sm h3{font-size:var(--fs-sm)}.\[\&_h3\]\:leading-\[1\.35\] h3{--tw-leading:1.35;line-height:1.35}.\[\&_h3\]\:font-semibold h3{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_h3\]\:text-text h3{color:var(--text)}.\[\&_h4\]\:mx-0 h4{margin-inline:0}.\[\&_h4\]\:mt-0 h4{margin-top:0}.\[\&_h4\]\:mt-3 h4{margin-top:calc(var(--spacing) * 3)}.\[\&_h4\]\:mt-4\.5 h4{margin-top:calc(var(--spacing) * 4.5)}.\[\&_h4\]\:mb-1 h4{margin-bottom:var(--spacing)}.\[\&_h4\]\:mb-1\.5 h4{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_h4\]\:text-\[1\.05em\] h4{font-size:1.05em}.\[\&_h4\]\:text-\[1em\] h4{font-size:1em}.\[\&_h4\]\:text-md h4{font-size:var(--fs-md)}.\[\&_h4\]\:leading-\[1\.4\] h4{--tw-leading:1.4;line-height:1.4}.\[\&_h4\]\:font-semibold h4{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_h4\]\:text-accent-amber h4{color:var(--accent-amber)}.\[\&_h4\]\:text-text h4{color:var(--text)}.\[\&_img\]\:block img{display:block}.\[\&_img\]\:h-13 img{height:calc(var(--spacing) * 13)}.\[\&_img\]\:h-auto img{height:auto}.\[\&_img\]\:max-h-40 img{max-height:calc(var(--spacing) * 40)}.\[\&_img\]\:w-13 img{width:calc(var(--spacing) * 13)}.\[\&_img\]\:max-w-55 img{max-width:calc(var(--spacing) * 55)}.\[\&_img\]\:max-w-full img{max-width:100%}.\[\&_img\]\:rounded-sm img{border-radius:6px}.\[\&_img\]\:rounded-xs img{border-radius:4px}.\[\&_img\]\:border img{border-style:var(--tw-border-style);border-width:1px}.\[\&_img\]\:border-border img{border-color:var(--border)}.\[\&_img\]\:border-border-variant img{border-color:var(--border-variant)}.\[\&_img\]\:object-cover img{object-fit:cover}.\[\&_input\]\:m-0 input{margin:0}.\[\&_input\]\:w-full input{width:100%}.\[\&_input\]\:min-w-55 input{min-width:calc(var(--spacing) * 55)}.\[\&_input\]\:flex-1 input{flex:1}.\[\&_input\]\:rounded-none input{border-radius:0}.\[\&_input\]\:border-0 input{border-style:var(--tw-border-style);border-width:0}.\[\&_input\]\:border-b input{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_input\]\:border-b-border-variant input{border-bottom-color:var(--border-variant)}.\[\&_input\]\:bg-transparent input{background-color:#0000}.\[\&_input\]\:bg-none input{background-image:none}.\[\&_input\]\:p-0 input{padding:0}.\[\&_input\]\:px-2\.5 input{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_input\]\:py-2 input{padding-block:calc(var(--spacing) * 2)}.\[\&_input\]\:font-mono input{font-family:var(--mono)}.\[\&_input\]\:text-sm input{font-size:var(--fs-sm)}.\[\&_input\]\:outline-none input{--tw-outline-style:none;outline-style:none}.\[\&_input\:focus\]\:shadow-\[0_1px_0_0_var\(--text\)\] input:focus{--tw-shadow:0 1px 0 0 var(--tw-shadow-color,var(--text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&_label\]\:flex label{display:flex}.\[\&_label\]\:max-w-80 label{max-width:calc(var(--spacing) * 80)}.\[\&_label\]\:flex-col label{flex-direction:column}.\[\&_label\]\:gap-1 label{gap:var(--spacing)}.\[\&_label\]\:text-xs label{font-size:var(--fs-xs)}.\[\&_label\]\:font-medium label{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_label\]\:text-text label{color:var(--text)}.\[\&_legend\]\:mb-1\.5 legend{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_legend\]\:text-base legend{font-size:var(--fs-base)}.\[\&_legend\]\:font-semibold legend{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_li\:\:marker\]\:text-primary li::marker{color:var(--primary)}.\[\&_ol\]\:mx-0 ol{margin-inline:0}.\[\&_ol\]\:my-1\.5 ol{margin-block:calc(var(--spacing) * 1.5)}.\[\&_ol\]\:pl-5\.5 ol{padding-left:calc(var(--spacing) * 5.5)}.\[\&_p\]\:m-0 p{margin:0}.\[\&_p\]\:mx-0 p{margin-inline:0}.\[\&_p\]\:my-2\.5 p{margin-block:calc(var(--spacing) * 2.5)}.\[\&_p\]\:mt-\[3px\] p{margin-top:3px}.\[\&_p\]\:mb-0 p{margin-bottom:0}.\[\&_p\]\:max-w-80 p{max-width:calc(var(--spacing) * 80)}.\[\&_p\]\:max-w-105 p{max-width:calc(var(--spacing) * 105)}.\[\&_p\]\:max-w-\[46ch\] p{max-width:46ch}.\[\&_p\]\:text-2xl p{font-size:var(--fs-2xl)}.\[\&_p\]\:text-md p{font-size:var(--fs-md)}.\[\&_p\]\:text-sm p{font-size:var(--fs-sm)}.\[\&_p\]\:leading-\[1\.55\] p{--tw-leading:1.55;line-height:1.55}.\[\&_p\]\:leading-normal p{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.\[\&_p\]\:text-balance p{text-wrap:balance}.\[\&_p\]\:text-muted p{color:var(--muted)}.\[\&_p\]\:text-subtext p{color:var(--subtext)}.\[\&_p_\+_p\]\:mt-3 p+p{margin-top:calc(var(--spacing) * 3)}.\[\&_p\.empty-state-hint\]\:text-lg p.empty-state-hint{font-size:var(--fs-lg)}.\[\&_p\.empty-state-hint\]\:text-subtext p.empty-state-hint{color:var(--subtext)}.\[\&_p\.empty-state-title\]\:text-2xl p.empty-state-title{font-size:var(--fs-2xl)}.\[\&_p\.empty-state-title\]\:font-normal p.empty-state-title{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_p\.empty-state-title\]\:text-text p.empty-state-title{color:var(--text)}.\[\&_pre\]\:m-0 pre{margin:0}.\[\&_pre\]\:overflow-x-auto pre{overflow-x:auto}.\[\&_pre\]\:rounded-md pre{border-radius:8px}.\[\&_pre\]\:border pre{border-style:var(--tw-border-style);border-width:1px}.\[\&_pre\]\:border-\[color-mix\(in_oklab\,_var\(--border\)_50\%\,_transparent\)\] pre{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.\[\&_pre\]\:border-\[color-mix\(in_oklab\,_var\(--border\)_50\%\,_transparent\)\] pre{border-color:color-mix(in oklab,var(--border) 50%,transparent)}}.\[\&_pre\]\:bg-surface pre{background-color:var(--surface)}.\[\&_pre\]\:px-3 pre{padding-inline:calc(var(--spacing) * 3)}.\[\&_pre\]\:py-2 pre{padding-block:calc(var(--spacing) * 2)}.\[\&_pre\]\:text-sm pre{font-size:var(--fs-sm)}.\[\&_pre\]\:text-text pre{color:var(--text)}.\[\&_pre_code\]\:border-0 pre code{border-style:var(--tw-border-style);border-width:0}.\[\&_pre_code\]\:bg-transparent pre code{background-color:#0000}.\[\&_pre_code\]\:bg-none pre code{background-image:none}.\[\&_pre_code\]\:p-0 pre code{padding:0}.\[\&_pre_code\]\:font-normal pre code{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_pre_code\]\:text-inherit pre code{color:inherit}.\[\&_span\]\:absolute span{position:absolute}.\[\&_span\]\:top-\[3px\] span{top:3px}.\[\&_span\]\:left-\[3px\] span{left:3px}.\[\&_span\]\:h-3\.5 span{height:calc(var(--spacing) * 3.5)}.\[\&_span\]\:w-3\.5 span{width:calc(var(--spacing) * 3.5)}.\[\&_span\]\:overflow-hidden span{overflow:hidden}.\[\&_span\]\:rounded-full span{border-radius:999px}.\[\&_span\]\:bg-muted span{background-color:var(--muted)}.\[\&_span\]\:text-ellipsis span{text-overflow:ellipsis}.\[\&_span\]\:whitespace-nowrap span{white-space:nowrap}.\[\&_span\]\:transition-\[translate\,background\] span{transition-property:translate,background;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_span\]\:duration-120 span{--tw-duration:.12s;transition-duration:.12s}.\[\&_span\]\:ease-standard span{--tw-ease:ease;transition-timing-function:ease}.\[\&_strong\]\:font-medium strong{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_strong\]\:font-semibold strong{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_strong\]\:text-accent-amber strong{color:var(--accent-amber)}.\[\&_strong\]\:text-text strong{color:var(--text)}.\[\&_summary\]\:flex summary{display:flex}.\[\&_summary\]\:w-fit summary{width:fit-content}.\[\&_summary\]\:max-w-full summary{max-width:100%}.\[\&_summary\]\:cursor-pointer summary{cursor:pointer}.\[\&_summary\]\:list-none summary{list-style-type:none}.\[\&_summary\]\:items-center summary{align-items:center}.\[\&_summary\]\:gap-2 summary{gap:calc(var(--spacing) * 2)}.\[\&_summary\]\:rounded-sm summary{border-radius:6px}.\[\&_summary\]\:px-1 summary{padding-inline:var(--spacing)}.\[\&_summary\]\:py-\[3px\] summary{padding-block:3px}.\[\&_summary\]\:select-none summary{-webkit-user-select:none;user-select:none}.\[\&_summary_\.plan-chevron\]\:transition-transform summary .plan-chevron{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_summary_\.plan-chevron\]\:duration-120 summary .plan-chevron{--tw-duration:.12s;transition-duration:.12s}.\[\&_summary_\.plan-chevron\]\:ease-standard summary .plan-chevron{--tw-ease:ease;transition-timing-function:ease}.\[\&_summary\:\:-webkit-details-marker\]\:hidden summary::-webkit-details-marker{display:none}.\[\&_summary\:\:after\]\:text-muted summary:after{color:var(--muted)}.\[\&_summary\:\:after\]\:transition-transform summary:after{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_summary\:\:after\]\:duration-80 summary:after{--tw-duration:80ms;transition-duration:80ms}.\[\&_summary\:\:after\]\:ease-standard summary:after{--tw-ease:ease;transition-timing-function:ease}.\[\&_summary\:\:after\]\:content-\[\'›\'\] summary:after{--tw-content:"›";content:var(--tw-content)}.\[\&_summary\:hover\]\:bg-surface summary:hover{background-color:var(--surface)}.\[\&_svg\]\:mt-px svg{margin-top:1px}.\[\&_svg\]\:block svg{display:block}.\[\&_svg\]\:h-\[1em\] svg{height:1em}.\[\&_svg\]\:h-full svg{height:100%}.\[\&_svg\]\:w-\[1em\] svg{width:1em}.\[\&_svg\]\:w-full svg{width:100%}.\[\&_svg\]\:flex-none svg{flex:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\]\:text-muted svg{color:var(--muted)}.\[\&_table\]\:mx-0 table{margin-inline:0}.\[\&_table\]\:my-2\.5 table{margin-block:calc(var(--spacing) * 2.5)}.\[\&_table\]\:block table{display:block}.\[\&_table\]\:w-max table{width:max-content}.\[\&_table\]\:max-w-full table{max-width:100%}.\[\&_table\]\:border-collapse table{border-collapse:collapse}.\[\&_table\]\:overflow-x-auto table{overflow-x:auto}.\[\&_table\]\:rounded-md table{border-radius:8px}.\[\&_table\]\:border table{border-style:var(--tw-border-style);border-width:1px}.\[\&_table\]\:border-border table{border-color:var(--border)}.\[\&_table\]\:text-md table{font-size:var(--fs-md)}.\[\&_tbody_tr\:hover_td\]\:bg-surface-bright tbody tr:hover td{background-color:var(--surface-bright)}.\[\&_td\]\:h-9 td{height:calc(var(--spacing) * 9)}.\[\&_td\]\:border-b td{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_td\]\:border-b-\[color-mix\(in_oklab\,_var\(--text\)_6\%\,_transparent\)\] td{border-bottom-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_td\]\:border-b-\[color-mix\(in_oklab\,_var\(--text\)_6\%\,_transparent\)\] td{border-bottom-color:color-mix(in oklab,var(--text) 6%,transparent)}}.\[\&_td\]\:border-b-border-variant td{border-bottom-color:var(--border-variant)}.\[\&_td\]\:px-3 td{padding-inline:calc(var(--spacing) * 3)}.\[\&_td\]\:px-3\.5 td{padding-inline:calc(var(--spacing) * 3.5)}.\[\&_td\]\:py-2 td{padding-block:calc(var(--spacing) * 2)}.\[\&_td\]\:pt-0 td{padding-top:0}.\[\&_td\]\:pt-\[5px\] td{padding-top:5px}.\[\&_td\]\:pr-2\.5 td{padding-right:calc(var(--spacing) * 2.5)}.\[\&_td\]\:pb-0 td{padding-bottom:0}.\[\&_td\]\:pb-\[5px\] td{padding-bottom:5px}.\[\&_td\]\:pl-0 td{padding-left:0}.\[\&_td\]\:text-left td{text-align:left}.\[\&_td\]\:align-middle td{vertical-align:middle}.\[\&_td\]\:break-normal td{overflow-wrap:normal;word-break:normal}.\[\&_td\]\:break-words td{overflow-wrap:break-word}.\[\&_td\]\:wrap-anywhere td{overflow-wrap:anywhere}.\[\&_td\]\:whitespace-nowrap td{white-space:nowrap}.\[\&_td\]\:text-text td{color:var(--text)}.\[\&_td\:first-child\]\:w-\[32\%\] td:first-child{width:32%}.\[\&_td\:first-child\]\:wrap-anywhere td:first-child{overflow-wrap:anywhere}.\[\&_td\:last-child\]\:w-29 td:last-child{width:calc(var(--spacing) * 29)}.\[\&_td\:last-child\]\:pr-0 td:last-child{padding-right:0}.\[\&_td\:last-child\]\:text-right td:last-child{text-align:right}.\[\&_td\:last-child\]\:whitespace-nowrap td:last-child{white-space:nowrap}.\[\&_td\[colspan\]\]\:text-left td[colspan]{text-align:left}.\[\&_td\[colspan\]\]\:whitespace-normal td[colspan]{white-space:normal}.\[\&_textarea\]\:field-sizing-content textarea{field-sizing:content}.\[\&_textarea\]\:max-h-45 textarea{max-height:calc(var(--spacing) * 45)}.\[\&_textarea\]\:min-h-18 textarea{min-height:calc(var(--spacing) * 18)}.\[\&_textarea\]\:flex-1 textarea{flex:1}.\[\&_textarea\]\:resize-none textarea{resize:none}.\[\&_textarea\]\:border-0 textarea{border-style:var(--tw-border-style);border-width:0}.\[\&_textarea\]\:bg-transparent textarea{background-color:#0000}.\[\&_textarea\]\:bg-none textarea{background-image:none}.\[\&_textarea\]\:px-3 textarea{padding-inline:calc(var(--spacing) * 3)}.\[\&_textarea\]\:pt-2\.5 textarea{padding-top:calc(var(--spacing) * 2.5)}.\[\&_textarea\]\:pb-1 textarea{padding-bottom:var(--spacing)}.\[\&_textarea\]\:text-base textarea{font-size:var(--fs-base)}.\[\&_th\]\:sticky th{position:sticky}.\[\&_th\]\:top-0 th{top:0}.\[\&_th\]\:z-1 th{z-index:1}.\[\&_th\]\:border-b th{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_th\]\:border-b-border th{border-bottom-color:var(--border)}.\[\&_th\]\:border-b-border-variant th{border-bottom-color:var(--border-variant)}.\[\&_th\]\:bg-background th{background-color:var(--base)}.\[\&_th\]\:px-3 th{padding-inline:calc(var(--spacing) * 3)}.\[\&_th\]\:px-3\.5 th{padding-inline:calc(var(--spacing) * 3.5)}.\[\&_th\]\:py-2 th{padding-block:calc(var(--spacing) * 2)}.\[\&_th\]\:pt-\[5px\] th{padding-top:5px}.\[\&_th\]\:pr-2\.5 th{padding-right:calc(var(--spacing) * 2.5)}.\[\&_th\]\:pb-\[5px\] th{padding-bottom:5px}.\[\&_th\]\:pl-0 th{padding-left:0}.\[\&_th\]\:text-left th{text-align:left}.\[\&_th\]\:text-xs th{font-size:var(--fs-xs)}.\[\&_th\]\:font-medium th{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_th\]\:font-semibold th{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_th\]\:break-normal th{overflow-wrap:normal;word-break:normal}.\[\&_th\]\:break-words th{overflow-wrap:break-word}.\[\&_th\]\:text-text th{color:var(--text)}.\[\&_th\:nth-child\(1\)\]\:w-\[20\%\] th:first-child{width:20%}.\[\&_th\:nth-child\(2\)\]\:w-\[26\%\] th:nth-child(2){width:26%}.\[\&_th\:nth-child\(4\)\]\:w-27 th:nth-child(4){width:calc(var(--spacing) * 27)}.\[\&_th\:nth-child\(5\)\]\:w-13 th:nth-child(5){width:calc(var(--spacing) * 13)}.\[\&_thead_th\]\:border-b thead th{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_thead_th\]\:border-b-border thead th{border-bottom-color:var(--border)}.\[\&_thead_th\]\:bg-surface thead th{background-color:var(--surface)}.\[\&_thead_th\]\:font-medium thead th{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_thead_th\]\:text-text thead th{color:var(--text)}.\[\&_tr\.clickable\]\:cursor-pointer tr.clickable{cursor:pointer}.\[\&_tr\.clickable\:hover_td\]\:bg-canvas tr.clickable:hover td{background-color:var(--canvas)}.\[\&_tr\:last-child_td\]\:border-b-0 tr:last-child td{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&_ul\]\:mx-0 ul{margin-inline:0}.\[\&_ul\]\:my-1\.5 ul{margin-block:calc(var(--spacing) * 1.5)}.\[\&_ul\]\:pl-5\.5 ul{padding-left:calc(var(--spacing) * 5.5)}.\[\&\+\&\]\:border-t+.\[\&\+\&\]\:border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&\+\&\]\:border-border-variant+.\[\&\+\&\]\:border-border-variant{border-color:var(--border-variant)}.\[\&\.active\]\:border-border.active{border-color:var(--border)}.\[\&\.active\]\:bg-background.active{background-color:var(--base)}.\[\&\.active\]\:bg-panel.active{background-color:var(--panel)}.\[\&\.active\]\:bg-surface.active{background-color:var(--surface)}.\[\&\.active\]\:font-medium.active{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&\.active\]\:font-semibold.active{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&\.active\]\:text-primary.active{color:var(--primary)}.\[\&\.active\]\:text-text.active{color:var(--text)}.\[\&\.active\:\:after\]\:absolute.active:after{position:absolute}.\[\&\.active\:\:after\]\:right-0.active:after{right:0}.\[\&\.active\:\:after\]\:-bottom-px.active:after{bottom:-1px}.\[\&\.active\:\:after\]\:left-0.active:after{left:0}.\[\&\.active\:\:after\]\:h-px.active:after{height:1px}.\[\&\.active\:\:after\]\:bg-background.active:after{background-color:var(--base)}.\[\&\.active\:\:after\]\:content-\[\'\'\].active:after{--tw-content:"";content:var(--tw-content)}.\[\&\.align-right\]\:right-0.align-right{right:0}.\[\&\.align-right\]\:left-auto.align-right{left:auto}.\[\&\.approved\]\:text-accent-green.approved{color:var(--accent-green)}.\[\&\.approved\:\:before\]\:content-\[\'✓_\'\].approved:before{--tw-content:"✓ ";content:var(--tw-content)}.\[\&\.archive\]\:text-accent-amber.archive{color:var(--accent-amber)}.\[\&\.awaiting\]\:italic.awaiting{font-style:italic}.\[\&\.blue_svg\]\:text-accent-blue.blue svg{color:var(--accent-blue)}.\[\&\.chosen\]\:text-accent-green.chosen{color:var(--accent-green)}.\[\&\.chosen\:\:before\]\:content-\[\'✓_\'\].chosen:before{--tw-content:"✓ ";content:var(--tw-content)}.\[\&\.clamped\]\:relative.clamped{position:relative}.\[\&\.clamped\]\:max-h-\[9\.5em\].clamped{max-height:9.5em}.\[\&\.clamped\]\:overflow-hidden.clamped{overflow:hidden}.\[\&\.clamped\:\:after\]\:pointer-events-none.clamped:after{pointer-events:none}.\[\&\.clamped\:\:after\]\:absolute.clamped:after{position:absolute}.\[\&\.clamped\:\:after\]\:inset-x-0.clamped:after{inset-inline:0}.\[\&\.clamped\:\:after\]\:top-auto.clamped:after{top:auto}.\[\&\.clamped\:\:after\]\:bottom-0.clamped:after{bottom:0}.\[\&\.clamped\:\:after\]\:h-8\.5.clamped:after{height:calc(var(--spacing) * 8.5)}.\[\&\.clamped\:\:after\]\:bg-\[linear-gradient\(to_bottom\,_transparent\,_var\(--surface\)\)\].clamped:after{background-image:linear-gradient(to bottom,transparent,var(--surface))}.\[\&\.clamped\:\:after\]\:content-\[\'\'\].clamped:after{--tw-content:"";content:var(--tw-content)}.\[\&\.closable\]\:max-w-60.closable{max-width:calc(var(--spacing) * 60)}.\[\&\.closable\]\:pr-0\.5.closable{padding-right:calc(var(--spacing) * .5)}.\[\&\.code\]\:text-accent-orange.code{color:var(--accent-orange)}.\[\&\.context-ring\]\:mr-2.context-ring{margin-right:calc(var(--spacing) * 2)}.\[\&\.context-ring\]\:inline-flex.context-ring{display:inline-flex}.\[\&\.context-ring\]\:items-center.context-ring{align-items:center}.\[\&\.danger\]\:border-\[color-mix\(in_oklab\,_var\(--accent-red\)_42\%\,_var\(--border\)\)\].danger{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.danger\]\:border-\[color-mix\(in_oklab\,_var\(--accent-red\)_42\%\,_var\(--border\)\)\].danger{border-color:color-mix(in oklab,var(--accent-red) 42%,var(--border))}}.\[\&\.danger\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_6\%\,_var\(--base\)\)\].danger{background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.danger\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_6\%\,_var\(--base\)\)\].danger{background-color:color-mix(in oklab,var(--accent-red) 6%,var(--base))}}.\[\&\.danger\]\:text-accent-red.danger{color:var(--accent-red)}.\[\&\.danger\:active\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_14\%\,_transparent\)\].danger:active:not(:disabled){background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.danger\:active\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_14\%\,_transparent\)\].danger:active:not(:disabled){background-color:color-mix(in oklab,var(--accent-red) 14%,transparent)}}.\[\&\.danger\:hover\]\:text-accent-red.danger:hover{color:var(--accent-red)}.\[\&\.danger\:hover\:not\(\:disabled\)\]\:border-accent-red.danger:hover:not(:disabled){border-color:var(--accent-red)}.\[\&\.danger\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_8\%\,_transparent\)\].danger:hover:not(:disabled){background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.danger\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_8\%\,_transparent\)\].danger:hover:not(:disabled){background-color:color-mix(in oklab,var(--accent-red) 8%,transparent)}}.\[\&\.danger\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_10\%\,_var\(--base\)\)\].danger:hover:not(:disabled){background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.danger\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_10\%\,_var\(--base\)\)\].danger:hover:not(:disabled){background-color:color-mix(in oklab,var(--accent-red) 10%,var(--base))}}.\[\&\.disabled\]\:opacity-52.disabled{opacity:.52}.\[\&\.disabled_\.compute-row-head\]\:cursor-default.disabled .compute-row-head{cursor:default}.\[\&\.doc\]\:px-7.doc{padding-inline:calc(var(--spacing) * 7)}.\[\&\.doc\]\:pt-4\.5.doc{padding-top:calc(var(--spacing) * 4.5)}.\[\&\.doc\]\:pb-12.doc{padding-bottom:calc(var(--spacing) * 12)}.\[\&\.doc_\.artifact-md\]\:mx-auto.doc .artifact-md{margin-inline:auto}.\[\&\.doc_\.artifact-md\]\:my-0.doc .artifact-md{margin-block:0}.\[\&\.doc_\.artifact-md\]\:max-w-readable.doc .artifact-md{max-width:var(--readable-col)}.\[\&\.document\]\:text-subtext.document{color:var(--subtext)}.\[\&\.drop-down\]\:top-\[calc\(100\%_\+_4px\)\].drop-down{top:calc(100% + 4px)}.\[\&\.drop-down\]\:bottom-auto.drop-down{bottom:auto}.\[\&\.editing\]\:cursor-default.editing{cursor:default}.\[\&\.editing\]\:bg-surface.editing{background-color:var(--surface)}.\[\&\.editing_\.session-menu-btn\]\:hidden.editing .session-menu-btn,.\[\&\.editing_\.session-time\]\:hidden.editing .session-time{display:none}.\[\&\.err\]\:border-accent-red.err{border-color:var(--accent-red)}.\[\&\.err\]\:bg-accent-red.err{background-color:var(--accent-red)}.\[\&\.err\]\:bg-accent-red-subtle.err{background-color:var(--accent-red-subtle)}.\[\&\.err\]\:text-accent-red.err{color:var(--accent-red)}.\[\&\.expanded_\.diff-file-header\]\:border-b.expanded .diff-file-header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&\.expanded_\.diff-file-header\]\:border-b-border.expanded .diff-file-header{border-bottom-color:var(--border)}.\[\&\.fail\]\:border-\[1\.5px\].fail{border-style:var(--tw-border-style);border-width:1.5px}.\[\&\.fail\]\:border-\[color-mix\(in_oklab\,_var\(--accent-red\)_55\%\,_transparent\)\].fail{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.fail\]\:border-\[color-mix\(in_oklab\,_var\(--accent-red\)_55\%\,_transparent\)\].fail{border-color:color-mix(in oklab,var(--accent-red) 55%,transparent)}}.\[\&\.failed\]\:text-accent-red.failed{color:var(--accent-red)}.\[\&\.ghost\]\:border-transparent.ghost{border-color:#0000}.\[\&\.ghost\]\:text-text.ghost{color:var(--text)}.\[\&\.ghost\:hover\:not\(\:disabled\)\]\:bg-surface.ghost:hover:not(:disabled){background-color:var(--surface)}.\[\&\.ghost\:hover\:not\(\:disabled\)\]\:text-text.ghost:hover:not(:disabled){color:var(--text)}.\[\&\.green_svg\]\:text-accent-green.green svg{color:var(--accent-green)}.\[\&\.image\]\:text-accent-purple.image{color:var(--accent-purple)}.\[\&\.live\]\:animate-\[or-pulse_1\.2s_ease-in-out_infinite\].live{animation:1.2s ease-in-out infinite or-pulse}.\[\&\.live\]\:border-accent-teal.live{border-color:var(--accent-teal)}.\[\&\.live\]\:bg-accent-teal.live{background-color:var(--accent-teal)}.\[\&\.live\]\:shadow-\[0_2px_12px_rgba\(32\,_154\,_132\,_0\.2\)\].live{--tw-shadow:0 2px 12px var(--tw-shadow-color,#209a8433);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&\.live_\.dot\]\:animate-\[or-pulse_1\.2s_ease-in-out_infinite\].live .dot{animation:1.2s ease-in-out infinite or-pulse}.\[\&\.markdown\]\:text-accent-blue.markdown{color:var(--accent-blue)}.\[\&\.max\]\:fixed.max{position:fixed}.\[\&\.max\]\:inset-2\.5.max{inset:calc(var(--spacing) * 2.5)}.\[\&\.max\]\:z-60.max{z-index:60}.\[\&\.max\]\:m-0.max{margin:0}.\[\&\.max\]\:shadow-\[0_12px_40px_color-mix\(in_oklab\,_var\(--text\)_22\%\,_transparent\)\].max{--tw-shadow:0 12px 40px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.\[\&\.max\]\:shadow-\[0_12px_40px_color-mix\(in_oklab\,_var\(--text\)_22\%\,_transparent\)\].max{--tw-shadow:0 12px 40px var(--tw-shadow-color,color-mix(in oklab, var(--text) 22%, transparent))}}.\[\&\.max\]\:shadow-\[0_12px_40px_color-mix\(in_oklab\,_var\(--text\)_22\%\,_transparent\)\].max{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&\.menu-open_\.session-menu-btn\]\:inline-flex.menu-open .session-menu-btn{display:inline-flex}.\[\&\.menu-open_\.session-time\]\:hidden.menu-open .session-time{display:none}.\[\&\.muted\]\:text-muted.muted{color:var(--muted)}.\[\&\.ok\]\:border-accent-green.ok{border-color:var(--accent-green)}.\[\&\.ok\]\:bg-accent-green.ok{background-color:var(--accent-green)}.\[\&\.ok\]\:bg-accent-green-subtle.ok{background-color:var(--accent-green-subtle)}.\[\&\.ok\]\:text-accent-green.ok{color:var(--accent-green)}.\[\&\.on\]\:border-primary.on{border-color:var(--primary)}.\[\&\.on\]\:bg-primary.on{background-color:var(--primary)}.\[\&\.on\]\:text-background.on{color:var(--base)}.\[\&\.on_span\]\:translate-x-4.on span{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\.on_span\]\:bg-background.on span{background-color:var(--base)}.\[\&\.open\]\:rotate-90.open{rotate:90deg}.\[\&\.open_\.compute-row-head\:hover\]\:rounded-\[var\(--radius-lg\)_var\(--radius-lg\)_0_0\].open .compute-row-head:hover{border-radius:var(--radius-lg) var(--radius-lg) 0 0}.\[\&\.orange_svg\]\:text-accent-orange.orange svg{color:var(--accent-orange)}.\[\&\.other\]\:border-\[1\.5px\].other{border-style:var(--tw-border-style);border-width:1.5px}.\[\&\.other\]\:border-border.other{border-color:var(--border)}.\[\&\.pass\]\:bg-accent-green.pass{background-color:var(--accent-green)}.\[\&\.pdf\]\:text-accent-red.pdf{color:var(--accent-red)}.\[\&\.permission\]\:border-l-accent-amber.permission{border-left-color:var(--accent-amber)}.\[\&\.plan\]\:border-l-accent-blue.plan{border-left-color:var(--accent-blue)}.\[\&\.primary\]\:border-primary.primary{border-color:var(--primary)}.\[\&\.primary\]\:bg-primary.primary{background-color:var(--primary)}.\[\&\.primary\]\:text-background.primary{color:var(--base)}.\[\&\.primary\:active\:not\(\:disabled\)\]\:border-\[color-mix\(in_oklab\,_var\(--primary\)_80\%\,_var\(--text\)\)\].primary:active:not(:disabled){border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\.primary\:active\:not\(\:disabled\)\]\:border-\[color-mix\(in_oklab\,_var\(--primary\)_80\%\,_var\(--text\)\)\].primary:active:not(:disabled){border-color:color-mix(in oklab,var(--primary) 80%,var(--text))}}.\[\&\.primary\:active\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_80\%\,_var\(--text\)\)\].primary:active:not(:disabled){background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\.primary\:active\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_80\%\,_var\(--text\)\)\].primary:active:not(:disabled){background-color:color-mix(in oklab,var(--primary) 80%,var(--text))}}.\[\&\.primary\:hover\:not\(\:disabled\)\]\:border-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\].primary:hover:not(:disabled){border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\.primary\:hover\:not\(\:disabled\)\]\:border-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\].primary:hover:not(:disabled){border-color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.\[\&\.primary\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\].primary:hover:not(:disabled){background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\.primary\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\].primary:hover:not(:disabled){background-color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.\[\&\.purple_svg\]\:text-accent-purple.purple svg{color:var(--accent-purple)}.\[\&\.question\]\:border-l-accent-purple.question{border-left-color:var(--accent-purple)}.\[\&\.rail-hidden\]\:max-w-none.rail-hidden{max-width:none}.\[\&\.rail-hidden\]\:px-0\.5.rail-hidden{padding-inline:calc(var(--spacing) * .5)}.\[\&\.rail-hidden\]\:py-0.rail-hidden{padding-block:0}.\[\&\.readonly\]\:opacity-60.readonly{opacity:.6}.\[\&\.rejected\]\:text-accent-amber.rejected,.\[\&\.revised\]\:text-accent-amber.revised{color:var(--accent-amber)}.\[\&\.sel\]\:border-primary.sel{border-color:var(--primary)}.\[\&\.sel\]\:bg-primary-subtle.sel{background-color:var(--primary-subtle)}.\[\&\.selected\]\:border-accent.selected{border-color:var(--accent)}.\[\&\.selected\]\:bg-panel.selected{background-color:var(--panel)}.\[\&\.selected\]\:shadow-\[0_0_0_1px_var\(--accent\)\].selected{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--accent));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&\.selected\:hover\]\:bg-panel.selected:hover{background-color:var(--panel)}.\[\&\.session-menu\]\:top-\[calc\(100\%_-_2px\)\].session-menu{top:calc(100% - 2px)}.\[\&\.session-menu\]\:right-1\.5.session-menu{right:calc(var(--spacing) * 1.5)}.\[\&\.session-menu\]\:left-auto.session-menu{left:auto}.\[\&\.session-menu\]\:min-w-35.session-menu{min-width:calc(var(--spacing) * 35)}.\[\&\.sm\]\:rounded-sm.sm{border-radius:6px}.\[\&\.sm\]\:px-\[9px\].sm{padding-inline:9px}.\[\&\.sm\]\:py-\[3px\].sm{padding-block:3px}.\[\&\.sm\]\:text-xs.sm{font-size:var(--fs-xs)}.\[\&\.spreadsheet\]\:text-accent-green.spreadsheet{color:var(--accent-green)}.\[\&\.st-cancelled_\.dot\]\:text-accent-orange.st-cancelled .dot,.\[\&\.st-cancelling_\.dot\]\:text-accent-orange.st-cancelling .dot{color:var(--accent-orange)}.\[\&\.st-done_\.dot\]\:text-accent-green.st-done .dot,.\[\&\.st-done_\>_svg\]\:text-accent-green.st-done>svg{color:var(--accent-green)}.\[\&\.st-editing_\.dot\]\:text-accent-purple.st-editing .dot{color:var(--accent-purple)}.\[\&\.st-failed_\.dot\]\:text-accent-red.st-failed .dot{color:var(--accent-red)}.\[\&\.st-idle_\.dot\]\:text-muted.st-idle .dot{color:var(--muted)}.\[\&\.st-running_\.dot\]\:text-accent-teal.st-running .dot{color:var(--accent-teal)}.\[\&\.st-starting_\.dot\]\:text-accent-amber.st-starting .dot{color:var(--accent-amber)}.\[\&\.status-add\]\:text-accent-green.status-add{color:var(--accent-green)}.\[\&\.status-copy\]\:text-accent-blue.status-copy{color:var(--accent-blue)}.\[\&\.status-delete\]\:text-accent-red.status-delete{color:var(--accent-red)}.\[\&\.status-rename\]\:text-accent-blue.status-rename{color:var(--accent-blue)}.\[\&\.stop\]\:bg-surface.stop{background-color:var(--surface)}.\[\&\.stop\]\:text-text.stop{color:var(--text)}.\[\&\.stop\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--surface\)_88\%\,_var\(--text\)\)\].stop:hover:not(:disabled){background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.\[\&\.stop\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--surface\)_88\%\,_var\(--text\)\)\].stop:hover:not(:disabled){background-color:color-mix(in oklab,var(--surface) 88%,var(--text))}}.\[\&\.unread_\.session-title\]\:font-semibold.unread .session-title{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&\.warn\]\:border-accent-amber.warn{border-color:var(--accent-amber)}.\[\&\.warn\]\:bg-accent-amber.warn{background-color:var(--accent-amber)}.\[\&\.warn\]\:bg-accent-amber-subtle.warn{background-color:var(--accent-amber-subtle)}.\[\&\.warn\]\:text-accent-amber.warn{color:var(--accent-amber)}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}.\[\&\:\:after\]\:absolute:after{position:absolute}.\[\&\:\:after\]\:top-full:after{top:100%}.\[\&\:\:after\]\:right-0:after{right:0}.\[\&\:\:after\]\:left-0:after{left:0}.\[\&\:\:after\]\:h-6:after{height:calc(var(--spacing) * 6)}.\[\&\:\:after\]\:bg-\[linear-gradient\(to_bottom\,_var\(--base\)\,_transparent\)\]:after{background-image:linear-gradient(to bottom,var(--base),transparent)}.\[\&\:\:after\]\:content-\[\'\'\]:after{--tw-content:"";content:var(--tw-content)}.\[\&\:\:before\]\:pointer-events-none:before{pointer-events:none}.\[\&\:\:before\]\:absolute:before{position:absolute}.\[\&\:\:before\]\:right-0:before{right:0}.\[\&\:\:before\]\:bottom-full:before{bottom:100%}.\[\&\:\:before\]\:left-0:before{left:0}.\[\&\:\:before\]\:h-6:before{height:calc(var(--spacing) * 6)}.\[\&\:\:before\]\:bg-\[linear-gradient\(to_top\,_var\(--base\)\,_transparent\)\]:before{background-image:linear-gradient(to top,var(--base),transparent)}.\[\&\:\:before\]\:content-\[\'\'\]:before{--tw-content:"";content:var(--tw-content)}.\[\&\:active\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_12\%\,_transparent\)\]:active{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\:active\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_12\%\,_transparent\)\]:active{background-color:color-mix(in oklab,var(--text) 12%,transparent)}}.\[\&\:active\:not\(\:disabled\)\]\:bg-highlight:active:not(:disabled){background-color:var(--highlight)}.\[\&\:disabled\]\:cursor-default:disabled{cursor:default}.\[\&\:disabled\]\:text-muted:disabled{color:var(--muted)}.\[\&\:disabled\]\:opacity-40:disabled{opacity:.4}.\[\&\:disabled\]\:opacity-45:disabled{opacity:.45}.\[\&\:disabled\]\:opacity-50:disabled{opacity:.5}.\[\&\:disabled\:hover\]\:bg-transparent:disabled:hover{background-color:#0000}.\[\&\:disabled\:hover\]\:text-subtext:disabled:hover{color:var(--subtext)}.\[\&\:focus\]\:border-accent-blue:focus{border-color:var(--accent-blue)}.\[\&\:focus-visible\]\:opacity-100:focus-visible{opacity:1}.\[\&\:focus-visible\]\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.\[\&\:focus-visible\]\:outline-offset-2:focus-visible{outline-offset:2px}.\[\&\:focus-visible\]\:outline-text:focus-visible{outline-color:var(--text)}.\[\&\:focus-visible\]\:outline-solid:focus-visible{--tw-outline-style:solid;outline-style:solid}.\[\&\:focus-within_\.session-menu-btn\]\:inline-flex:focus-within .session-menu-btn{display:inline-flex}.\[\&\:focus-within_\.session-time\]\:hidden:focus-within .session-time{display:none}.\[\&\:has\(input\:checked\)\]\:border-accent:has(input:checked){border-color:var(--accent)}.\[\&\:has\(input\:checked\)\]\:bg-primary-subtle:has(input:checked){background-color:var(--primary-subtle)}.\[\&\:hover\]\:-translate-y-px:hover{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\:hover\]\:rounded-lg:hover{border-radius:10px}.\[\&\:hover\]\:border-\[color-mix\(in_oklab\,_var\(--text\)_34\%\,_var\(--border\)\)\]:hover{border-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\]\:border-\[color-mix\(in_oklab\,_var\(--text\)_34\%\,_var\(--border\)\)\]:hover{border-color:color-mix(in oklab,var(--text) 34%,var(--border))}}.\[\&\:hover\]\:border-muted:hover{border-color:var(--muted)}.\[\&\:hover\]\:border-primary:hover{border-color:var(--primary)}.\[\&\:hover\]\:border-text:hover{border-color:var(--text)}.\[\&\:hover\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_12\%\,_transparent\)\]:hover{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_12\%\,_transparent\)\]:hover{background-color:color-mix(in oklab,var(--text) 12%,transparent)}}.\[\&\:hover\]\:bg-\[var\(--overlay\,_rgba\(0\,_0\,_0\,_0\.05\)\)\]:hover{background-color:var(--overlay,#0000000d)}.\[\&\:hover\]\:bg-canvas:hover{background-color:var(--canvas)}.\[\&\:hover\]\:bg-panel:hover{background-color:var(--panel)}.\[\&\:hover\]\:bg-surface:hover{background-color:var(--surface)}.\[\&\:hover\]\:bg-text:hover{background-color:var(--text)}.\[\&\:hover\]\:text-\[var\(--danger\,_\#d33\)\]:hover{color:var(--danger,#d33)}.\[\&\:hover\]\:text-background:hover{color:var(--base)}.\[\&\:hover\]\:text-text:hover{color:var(--text)}.\[\&\:hover\]\:underline:hover{text-decoration-line:underline}.\[\&\:hover\]\:shadow-\[0_2px_8px_rgba\(0\,_0\,_0\,_0\.08\)\]:hover{--tw-shadow:0 2px 8px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&\:hover\]\:shadow-\[0_3px_12px_color-mix\(in_srgb\,_var\(--text\)_8\%\,_transparent\)\]:hover{--tw-shadow:0 3px 12px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\]\:shadow-\[0_3px_12px_color-mix\(in_srgb\,_var\(--text\)_8\%\,_transparent\)\]:hover{--tw-shadow:0 3px 12px var(--tw-shadow-color,color-mix(in srgb, var(--text) 8%, transparent))}}.\[\&\:hover\]\:shadow-\[0_3px_12px_color-mix\(in_srgb\,_var\(--text\)_8\%\,_transparent\)\]:hover{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&\:hover_\.ft-row-delete\]\:opacity-100:hover .ft-row-delete,.\[\&\:hover_\.md-code-copy\]\:opacity-100:hover .md-code-copy{opacity:1}.\[\&\:hover_\.session-menu-btn\]\:inline-flex:hover .session-menu-btn{display:inline-flex}.\[\&\:hover_\.session-time\]\:hidden:hover .session-time{display:none}.\[\&\:hover\:not\(\.on\)\]\:bg-highlight:hover:not(.on){background-color:var(--highlight)}.\[\&\:hover\:not\(\.on\)\]\:text-text:hover:not(.on){color:var(--text)}.\[\&\:hover\:not\(\:disabled\)\]\:border-border-strong:hover:not(:disabled){border-color:var(--border-strong)}.\[\&\:hover\:not\(\:disabled\)\]\:border-border-variant:hover:not(:disabled){border-color:var(--border-variant)}.\[\&\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\]:hover:not(:disabled){background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\]:hover:not(:disabled){background-color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.\[\&\:hover\:not\(\:disabled\)\]\:bg-surface:hover:not(:disabled){background-color:var(--surface)}.\[\&\:is\(\:hover\,_\:focus-within\)_\.project-delete\]\:block:is(:hover,:focus-within) .project-delete{display:block}.\[\&\:last-child\]\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:absolute:not(.active)+.tab:not(.active):before{position:absolute}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:top-2\.5:not(.active)+.tab:not(.active):before{top:calc(var(--spacing) * 2.5)}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:bottom-2\.5:not(.active)+.tab:not(.active):before{bottom:calc(var(--spacing) * 2.5)}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:-left-px:not(.active)+.tab:not(.active):before{left:-1px}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:w-px:not(.active)+.tab:not(.active):before{width:1px}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:bg-border:not(.active)+.tab:not(.active):before{background-color:var(--border)}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:content-\[\'\'\]:not(.active)+.tab:not(.active):before{--tw-content:"";content:var(--tw-content)}.\[\&\[data-tip\]\:\:after\]\:top-auto[data-tip]:after{top:auto}.\[\&\[data-tip\]\:\:after\]\:bottom-\[calc\(100\%_\+_6px\)\][data-tip]:after{bottom:calc(100% + 6px)}.\[\&\[open\]_summary_\.plan-chevron\]\:rotate-90[open] summary .plan-chevron,.\[\&\[open\]_summary\:\:after\]\:rotate-90[open] summary:after{rotate:90deg}.chat-header .\[\.chat-header_\&\]\:min-w-0{min-width:0}.chat-header .\[\.chat-header_\&\]\:flex-1{flex:1}.chat-header .\[\.chat-header_\&\]\:overflow-hidden{overflow:hidden}.chat-header .\[\.chat-header_\&\]\:text-base{font-size:var(--fs-base)}.chat-header .\[\.chat-header_\&\]\:font-semibold{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.chat-header .\[\.chat-header_\&\]\:text-ellipsis{text-overflow:ellipsis}.chat-header .\[\.chat-header_\&\]\:whitespace-nowrap{white-space:nowrap}.chat-header .\[\.chat-header_\&\]\:text-text{color:var(--text)}.chat-header.rail-hidden>.\[\.chat-header\.rail-hidden_\>_\&\:first-child\]\:mr-3:first-child{margin-right:calc(var(--spacing) * 3)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.atrule\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.atrule{color:var(--syntax-orange)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.attr-name\]\:text-syntax-green,.openresearch-diff,.file-view) .token.attr-name{color:var(--syntax-green)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.attr-value\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.attr-value,:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.boolean\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.boolean{color:var(--syntax-orange)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.builtin\]\:text-syntax-yellow,.openresearch-diff,.file-view) .token.builtin{color:var(--syntax-yellow)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.cdata\]\:text-syntax-comment,.openresearch-diff,.file-view) .token.cdata{color:var(--syntax-comment)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.cdata\]\:italic,.openresearch-diff,.file-view) .token.cdata{font-style:italic}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.char\]\:text-syntax-green,.openresearch-diff,.file-view) .token.char{color:var(--syntax-green)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.class-name\]\:text-syntax-yellow,.openresearch-diff,.file-view) .token.class-name{color:var(--syntax-yellow)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.comment\]\:text-syntax-comment,.openresearch-diff,.file-view) .token.comment{color:var(--syntax-comment)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.comment\]\:italic,.openresearch-diff,.file-view) .token.comment{font-style:italic}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.constant\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.constant{color:var(--syntax-orange)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.decorator\]\:text-syntax-blue,.openresearch-diff,.file-view) .token.decorator,:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.def\]\:text-syntax-blue,.openresearch-diff,.file-view) .token.def{color:var(--syntax-blue)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.deleted\]\:text-syntax-red,.openresearch-diff,.file-view) .token.deleted{color:var(--syntax-red)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.entity\]\:text-syntax-cyan,.openresearch-diff,.file-view) .token.entity{color:var(--syntax-cyan)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.function\]\:text-syntax-blue,.openresearch-diff,.file-view) .token.function{color:var(--syntax-blue)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.important\]\:text-syntax-red,.openresearch-diff,.file-view) .token.important{color:var(--syntax-red)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.inserted\]\:text-syntax-green,.openresearch-diff,.file-view) .token.inserted{color:var(--syntax-green)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.keyword\]\:text-syntax-purple,.openresearch-diff,.file-view) .token.keyword{color:var(--syntax-purple)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.namespace\]\:text-syntax-yellow,.openresearch-diff,.file-view) .token.namespace{color:var(--syntax-yellow)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.number\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.number{color:var(--syntax-orange)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.operator\]\:text-syntax-cyan,.openresearch-diff,.file-view) .token.operator{color:var(--syntax-cyan)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.parameter\]\:text-syntax-text,.openresearch-diff,.file-view) .token.parameter{color:var(--syntax-text)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.prolog\]\:text-syntax-comment,.openresearch-diff,.file-view) .token.prolog{color:var(--syntax-comment)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.prolog\]\:italic,.openresearch-diff,.file-view) .token.prolog{font-style:italic}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.property\]\:text-syntax-red,.openresearch-diff,.file-view) .token.property{color:var(--syntax-red)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.punctuation\]\:text-syntax-text,.openresearch-diff,.file-view) .token.punctuation{color:var(--syntax-text)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.regex\]\:text-syntax-green,.openresearch-diff,.file-view) .token.regex,:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.selector\]\:text-syntax-green,.openresearch-diff,.file-view) .token.selector,:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.string\]\:text-syntax-green,.openresearch-diff,.file-view) .token.string{color:var(--syntax-green)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.symbol\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.symbol{color:var(--syntax-orange)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.tag\]\:text-syntax-red,.openresearch-diff,.file-view) .token.tag{color:var(--syntax-red)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.url\]\:text-syntax-cyan,.openresearch-diff,.file-view) .token.url{color:var(--syntax-cyan)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.variable\]\:text-syntax-red,.openresearch-diff,.file-view) .token.variable{color:var(--syntax-red)}@container (max-width:400px){.\[\@container\(\(max-width\:_400px\)\)\]\:grid-cols-\[minmax\(0\,_1fr\)\]{grid-template-columns:minmax(0,1fr)}.\[\@container\(\(max-width\:_400px\)\)\]\:\!flex-row{flex-direction:row!important}.\[\@container\(\(max-width\:_400px\)\)\]\:flex-wrap{flex-wrap:wrap}.\[\@container\(\(max-width\:_400px\)\)\]\:\!items-center{align-items:center!important}.\[\@container\(\(max-width\:_400px\)\)\]\:justify-start{justify-content:flex-start}.\[\@container\(\(max-width\:_400px\)\)\]\:gap-3{gap:calc(var(--spacing) * 3)}.\[\@container\(\(max-width\:_400px\)\)\]\:\[grid-template-areas\:\'name\'_\'meta\'_\'actions\'\]{grid-template-areas:"name""meta""actions"}}@container (max-width:560px){.\[\@container\(\(max-width\:_560px\)\)\]\:grid-cols-\[minmax\(0\,_1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.\[\@container\(\(max-width\:_560px\)\)\]\:flex-col{flex-direction:column}.\[\@container\(\(max-width\:_560px\)\)\]\:items-end{align-items:flex-end}.\[\@container\(\(max-width\:_560px\)\)\]\:gap-1\.5{gap:calc(var(--spacing) * 1.5)}.\[\@container\(\(max-width\:_560px\)\)\]\:gap-x-3\.5{column-gap:calc(var(--spacing) * 3.5)}.\[\@container\(\(max-width\:_560px\)\)\]\:gap-y-\[9px\]{row-gap:9px}.\[\@container\(\(max-width\:_560px\)\)\]\:\[\&\.danger\]\:ml-auto.danger{margin-left:auto}}@container (max-width:960px){.\[\@container\(\(max-width\:_960px\)\)\]\:static{position:static}.\[\@container\(\(max-width\:_960px\)\)\]\:max-h-55{max-height:calc(var(--spacing) * 55)}.\[\@container\(\(max-width\:_960px\)\)\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@container (min-width:500px){.\[\@container\(\(min-width\:_500px\)\)\]\:w-\[min\(100\%\,_720px\)\]{width:min(100%,720px)}.\[\@container\(\(min-width\:_500px\)\)\]\:grid-cols-\[repeat\(4\,_minmax\(0\,_1fr\)\)\]{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(max-width:640px){.\[\@media\(\(max-width\:_640px\)\)\]\:flex-col{flex-direction:column}.\[\@media\(\(max-width\:_640px\)\)\]\:items-stretch{align-items:stretch}.\[\@media\(\(max-width\:_640px\)\)\]\:justify-start{justify-content:flex-start}.\[\@media\(\(max-width\:_640px\)\)\]\:\[\&_\.kv\]\:grid-cols-1 .kv{grid-template-columns:repeat(1,minmax(0,1fr))}.\[\@media\(\(max-width\:_640px\)\)\]\:\[\&_\.kv\]\:gap-\[3px\] .kv{gap:3px}.\[\@media\(\(max-width\:_640px\)\)\]\:\[\&_\.kv_\.v_\+_\.k\]\:mt-\[7px\] .kv .v+.k{margin-top:7px}}@media(max-width:720px){.\[\@media\(\(max-width\:_720px\)\)\]\:flex-wrap{flex-wrap:wrap}.\[\@media\(\(max-width\:_720px\)\)\]\:px-4\.5{padding-inline:calc(var(--spacing) * 4.5)}.\[\@media\(\(max-width\:_720px\)\)\]\:pt-5{padding-top:calc(var(--spacing) * 5)}.\[\@media\(\(max-width\:_720px\)\)\]\:pb-8{padding-bottom:calc(var(--spacing) * 8)}.\[\@media\(\(max-width\:_720px\)\)\]\:\[\&_button\]\:grid-cols-\[65px_1fr_60px_16px\] button{grid-template-columns:65px 1fr 60px 16px}.\[\@media\(\(max-width\:_720px\)\)\]\:\[\&_button_\>_\:nth-child\(3\)\]\:hidden button>:nth-child(3){display:none}}@media(prefers-reduced-motion:reduce){.\[\@media\(\(prefers-reduced-motion\:_reduce\)\)\]\:animate-none{animation:none}}a.\[a\&\:hover\]\:border-muted:hover{border-color:var(--muted)}button.\[button\&\]\:inline-flex{display:inline-flex}button.\[button\&\]\:h-\[13px\]{height:13px}button.\[button\&\]\:w-\[13px\]{width:13px}button.\[button\&\]\:cursor-pointer{cursor:pointer}button.\[button\&\]\:items-center{align-items:center}button.\[button\&\]\:justify-center{justify-content:center}button.\[button\&\]\:border-0{border-style:var(--tw-border-style);border-width:0}button.\[button\&\]\:bg-transparent{background-color:#0000}button.\[button\&\]\:p-0{padding:0}button.\[button\&_\>_svg\]\:transition-transform>svg{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}button.\[button\&_\>_svg\]\:duration-120>svg{--tw-duration:.12s;transition-duration:.12s}button.\[button\&_\>_svg\]\:ease-standard>svg{--tw-ease:ease;transition-timing-function:ease}button.\[button\&_\>_svg\.open\]\:rotate-90>svg.open{rotate:90deg}button.\[button\&\:hover\]\:border-muted:hover{border-color:var(--muted)}}:root{--base:#fff;--canvas:#faf8f4;--panel:#f3f0ea;--surface:#faf7f2;--surface-bright:#fdfbfb;--highlight:#fdf3f1;--chat-annotation-highlight:#b8d4ff;--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;--fs-2xs:10px;--fs-xs:11px;--fs-sm:13px;--fs-md:14px;--fs-base:15px;--fs-lg:16px;--fs-xl:16px;--fs-2xl:18px;--fs-3xl:22px;--fs-4xl:28px;--fs-5xl:34px;--fw-regular:400;--fw-medium:500;--fw-semibold:600;--fw-display:700;--modal-top:min(30vh, 260px);--term-bg:#1a1a1a;--readable-col:840px;--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);--syntax-comment:#a0a1a7;--syntax-text:#383a42;--syntax-red:#e45649;--syntax-orange:#986801;--syntax-green:#50a14f;--syntax-yellow:#c18401;--syntax-cyan:#56b6c2;--syntax-purple:#a626a4;--syntax-blue:#4078f2;color-scheme:light}:root[data-theme=dark]{--base:#0e0c0c;--canvas:#141110;--panel:#221f1e;--surface:#1d1b1a;--surface-bright:#130f0f;--highlight:#393433;--chat-annotation-highlight:#244e7a;--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:#555;--syntax-comment:#7f848e;--syntax-text:#abb2bf;--syntax-red:#e06c75;--syntax-orange:#d19a66;--syntax-green:#98c379;--syntax-yellow:#e5c07b;--syntax-purple:#c678dd;--syntax-blue:#61afef;color-scheme:dark}@keyframes or-pulse{50%{opacity:.35}}@keyframes tool-target-reveal{0%{opacity:0;filter:blur(1.5px)}to{opacity:1;filter:blur()}}@keyframes tool-running-shimmer{0%{background-position:200% 0}to{background-position:-100% 0}}@keyframes tool-running-shimmer-icon{0%,to{color:var(--muted);opacity:.35}50%{color:color-mix(in srgb,var(--text) 58%,var(--subtext));opacity:1}}.tool-running-shimmer{color:#0000;background:linear-gradient(100deg,var(--muted) 12%,var(--subtext) 34%,var(--text) 50%,var(--subtext) 66%,var(--muted) 88%)}@supports (color:color-mix(in lab,red,red)){.tool-running-shimmer{background:linear-gradient(100deg,var(--muted) 12%,var(--subtext) 34%,color-mix(in srgb,var(--text) 58%,var(--subtext)) 50%,var(--subtext) 66%,var(--muted) 88%)}}.tool-running-shimmer{-webkit-text-fill-color:transparent;background-size:300% 100%;-webkit-background-clip:text;background-clip:text;animation:1.75s linear infinite tool-running-shimmer}.tool-running-shimmer::selection{color:var(--text);-webkit-text-fill-color:var(--text)}.tool-running-shimmer-icon{color:var(--muted);animation:1.75s ease-in-out infinite tool-running-shimmer-icon}.tool-active-label{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.tool-group-summary .tool-group-label{transition:color .12s;transform:translateY(-1px)}.tool-group-summary:hover .tool-group-label,.tool-group-summary:hover .tool-chevron{color:var(--text)}.tool-group-disclosure{grid-template-rows:0fr;transition:grid-template-rows .22s cubic-bezier(.2,.75,.25,1);display:grid}.tool-group-disclosure.open{grid-template-rows:1fr}.tool-group-disclosure-inner{min-height:0;position:relative;overflow:hidden}.tool-target-reveal{animation:.18s cubic-bezier(.2,.75,.25,1) tool-target-reveal}.tool-target,.tool-target-more{color:inherit;font-weight:inherit;text-underline-offset:3px;-webkit-text-decoration-skip-ink:auto;text-decoration-skip-ink:auto;text-decoration-line:underline;text-decoration-thickness:.6px;transition:color .14s,text-decoration-color .14s}.tool-line,.tool-group-summary{font-weight:375}.tool-group-rows .tool-line{font-size:var(--fs-md)}.msg-assistant .md table{margin-block:14px;margin-inline:auto}.msg-assistant .md th,.msg-assistant .md td{padding-block:10px}.msg-assistant .md figure{width:fit-content;max-width:100%;margin-inline:auto}.msg-assistant .md img{max-width:100%;height:auto;margin-inline:auto;display:block}.md[data-streaming=true] .katex-error{visibility:hidden}.tool-target{-webkit-text-decoration-color:var(--border-strong);text-decoration-color:var(--border-strong)}.tool-target-more{text-decoration-color:#0000}.tool-target:hover,.tool-target-more:hover{color:var(--primary);-webkit-text-decoration-color:var(--border-strong);text-decoration-color:var(--border-strong)}.tool-target:focus-visible,.tool-target-more:focus-visible{color:var(--primary);-webkit-text-decoration-color:var(--border-strong);text-decoration-color:var(--border-strong);outline:1px solid var(--border-strong);outline-offset:2px}@media(prefers-reduced-motion:reduce){.tool-group-disclosure{transition:none}.tool-target-reveal{animation:none}.tool-running-shimmer{color:var(--subtext);-webkit-text-fill-color:currentColor;background:0 0;animation:none}.tool-running-shimmer-icon{animation:none}}@media(forced-colors:active){.tool-running-shimmer{color:canvastext;-webkit-text-fill-color:currentColor;background:0 0;animation:none}.tool-running-shimmer::selection{color:highlighttext;-webkit-text-fill-color:HighlightText}.tool-running-shimmer-icon{color:canvastext;animation:none}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes title-char-in{0%{opacity:0;filter:blur(4px);transform:translateY(.15em)}}@keyframes settings-spin{to{transform:rotate(360deg)}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0} +/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-outline-style:solid;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}@layer theme{:root,:host{--spacing:.25rem;--container-2xl:42rem;--tracking-wide:.025em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:6px;--radius-md:8px;--radius-lg:10px;--radius-2xl:1rem;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer base{*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--base);color:var(--text);font-family:var(--sans);font-size:var(--fs-base);line-height:1.45;overflow:hidden}::selection{background:var(--highlight)}.chat-thread-inner ::selection{background:var(--chat-annotation-highlight)}::highlight(chat-annotations){background:var(--chat-annotation-highlight)}button{font:inherit;color:inherit;cursor:pointer;background:0 0;border:none;padding:0}input,textarea,select{font:inherit;color:var(--text);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-md);outline:none;padding:6px 10px}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:var(--radius-sm);background-clip:padding-box;border:2px solid #0000}::-webkit-scrollbar-track{background:0 0}}@layer vendor{.react-flow{--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:#ffffff80;--xy-minimap-background-color-default:#fff;--xy-minimap-mask-background-color-default:#f0f0f099;--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:#f0f0f040;--xy-node-boxshadow-hover-default:0 1px 4px 1px #00000014;--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:#0059dc14;--xy-selection-border-default:1px dotted #0059dccc;--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 #00000014;--xy-edge-label-background-color-default:#fff;--xy-edge-label-color-default:inherit;--xy-resize-background-color-default:#3367d9;direction:ltr}.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:#96969640;--xy-minimap-background-color-default:#141414;--xy-minimap-mask-background-color-default:#3c3c3c99;--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:#f0f0f040;--xy-node-boxshadow-hover-default:0 1px 4px 1px #ffffff14;--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:#c8c8dc14;--xy-selection-border-default:1px dotted #c8c8dccc;--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 #00000014;--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{width:100%;height:100%;position:absolute;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{pointer-events:none;position:absolute;overflow:visible}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.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;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:.5s linear infinite dashdraw}svg.react-flow__connectionline{z-index:1001;position:absolute;overflow:visible}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.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:0 0;pointer-events:none}.react-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.react-flow__handle{pointer-events:none;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%;width:6px;min-width:5px;height:6px;min-height:5px;position:absolute}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;bottom:0;left:50%;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{z-index:5;margin:15px;position:absolute}.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{background:var(--xy-attribution-background-color,var(--xy-attribution-background-color-default));margin:0;padding:2px 3px;font-size:10px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.react-flow__edgelabel-renderer{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__viewport-portal{-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.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{box-shadow:var(--xy-controls-box-shadow,var(--xy-controls-box-shadow-default));flex-direction:column;display:flex}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{background:var(--xy-controls-button-background-color,var(--xy-controls-button-background-color-default));border:none;border-bottom:1px solid var(--xy-controls-button-border-color-props,var(--xy-controls-button-border-color,var(--xy-controls-button-border-color-default)));width:26px;height:26px;color:var(--xy-controls-button-color-props,var(--xy-controls-button-color,var(--xy-controls-button-color-default)));cursor:pointer;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;padding:4px;display:flex}.react-flow__controls-button svg{fill:currentColor;width:100%;max-width:12px;max-height:12px}.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{border-radius:var(--xy-node-border-radius,var(--xy-node-border-radius-default));width:150px;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));padding:10px;font-size:12px}.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{background-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border:1px solid #fff;border-radius:1px;width:5px;height:5px;translate:-50% -50%}.react-flow__resize-control.handle.left{top:50%;left:0}.react-flow__resize-control.handle.right{top:50%;left:100%}.react-flow__resize-control.handle.top{top:0;left:50%}.react-flow__resize-control.handle.bottom{top:100%;left:50%}.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-style:solid;border-width:0}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;height:100%;top:0;transform:translate(-50%)}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{width:100%;height:1px;left:0;transform:translateY(-50%)}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.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))}.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;top:0;right:0;bottom:0;left:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.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{z-index:10;color:#0000;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;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;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2)format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff)format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2)format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff)format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2)format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff)format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2)format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff)format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2)format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff)format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2)format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff)format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2)format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff)format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2)format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff)format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2)format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff)format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2)format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff)format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2)format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff)format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff)format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff)format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff)format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2)format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff)format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2)format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff)format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2)format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff)format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC)format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff)format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2)format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff)format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2)format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff)format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf)format("truetype")}.katex{text-indent:0;text-rendering:auto;font:1.21em/1.2 KaTeX_Main,Times New Roman,serif;position:relative}.katex *{border-color:currentColor;-ms-high-contrast-adjust:none!important}.katex .katex-version:after{content:"0.16.47"}.katex .katex-mathml{clip-path:inset(50%);border:0;width:1px;height:1px;padding:0;position:absolute;overflow:hidden}.katex .katex-html>.newline{display:block}.katex .base{white-space:nowrap;width:min-content;position:relative}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;table-layout:fixed;display:inline-table}.katex .vlist-r{display:table-row}.katex .vlist{vertical-align:bottom;display:table-cell;position:relative}.katex .vlist>span{height:0;display:block;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{width:0;overflow:hidden}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{vertical-align:bottom;width:2px;min-width:2px;font-size:1px;display:table-cell}.katex .vbox{flex-direction:column;align-items:baseline;display:inline-flex}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{flex-direction:row;display:inline-flex}.katex .thinbox{width:0;max-width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .smash{line-height:0;display:inline}.katex .clap,.katex .llap,.katex .rlap{width:0;position:relative}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .hdashline{border-bottom-style:dashed;width:100%;display:inline-block}.katex .sqrt>.root{margin-left:.277778em;margin-right:-.555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.833333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.714286em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.857143em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14286em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71429em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96286em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55429em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.416667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.583333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.833333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.347222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.416667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.486111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.694444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.833333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44028em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.289352em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.347222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.405093em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.520833em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.578704em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.694444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.833333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.289296em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.385728em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.433944em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.578592em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.694311em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.833173em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.200965em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.241158em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.281351em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.321543em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.361736em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.401929em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.482315em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.694534em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.833601em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{width:.12em;display:inline-block}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{min-width:1px;display:inline-block}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;height:inherit;width:100%;display:block;position:absolute}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;min-width:0;max-width:none;min-height:0;max-height:none}.katex .stretchy{width:100%;display:block;position:relative;overflow:hidden}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{width:100%;position:relative;overflow:hidden}.katex .halfarrow-left{width:50.2%;position:absolute;left:0;overflow:hidden}.katex .halfarrow-right{width:50.2%;position:absolute;right:0;overflow:hidden}.katex .brace-left{width:25.1%;position:absolute;left:0;overflow:hidden}.katex .brace-center{width:50%;position:absolute;left:25%;overflow:hidden}.katex .brace-right{width:25.1%;position:absolute;right:0;overflow:hidden}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{box-sizing:border-box;border:.04em solid}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{box-sizing:border-box;border-top:.049em solid;border-right:.049em solid;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{text-align:left;display:inline-block;position:absolute;right:calc(50% + .3em)}.katex .cd-label-right{text-align:right;display:inline-block;position:absolute;left:calc(50% + .3em)}.katex-display{text-align:center;margin:1em 0;display:block}.katex-display>.katex{text-align:center;white-space:nowrap;display:block}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{text-align:left;padding-left:2em}body{counter-reset:katexEqnNo mmlEqnNo}: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::selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-selection-text-color)}.diff td{vertical-align:top;padding-top:0;padding-bottom:0}.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;text-align:right;-webkit-user-select:none;user-select:none;padding:0 1ch}.diff-gutter-insert{background-color:#d6fedb;background-color:var(--diff-gutter-insert-background-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-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-gutter-selected-text-color)}.diff-code{word-wrap:break-word;white-space:pre-wrap;word-break:break-all;padding:0 0 0 .5em}.diff-code-edit{color:inherit}.diff-code-insert{background-color:#eaffee;background-color:var(--diff-code-insert-background-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-code-insert-edit-text-color)}.diff-code-delete{background-color:#fdeff0;background-color:var(--diff-code-delete-background-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-code-delete-edit-text-color)}.diff-code-selected{background-color:#fffce0;background-color:var(--diff-code-selected-background-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:" ";white-space:pre;width:2px;height:100%;margin-left:4.6ch;display:block;overflow:hidden}.diff-decoration{-webkit-user-select:none;user-select:none;line-height:1.5}.diff-decoration-content{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);padding:0}}@layer components;@layer utilities{.\@container{container-type:inline-size}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.\!absolute{position:absolute!important}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.-inset-14{inset:calc(var(--spacing) * -14)}.inset-0{top:0;right:0;bottom:0;left:0}.top-0{top:0}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-3\.5{top:calc(var(--spacing) * 3.5)}.top-\[9px\]{top:9px}.top-\[calc\(100\%_\+_6px\)\]{top:calc(100% + 6px)}.-right-\[3px\]{right:-3px}.right-0{right:0}.right-1\.5{right:calc(var(--spacing) * 1.5)}.right-3\.5{right:calc(var(--spacing) * 3.5)}.bottom-0{bottom:0}.bottom-\[calc\(100\%_\+_4px\)\]{bottom:calc(100% + 4px)}.bottom-\[calc\(100\%_\+_8px\)\]{bottom:calc(100% + 8px)}.left-0{left:0}.left-3{left:calc(var(--spacing) * 3)}.z-1{z-index:1}.z-4{z-index:4}.z-6{z-index:6}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.z-60{z-index:60}.z-100{z-index:100}.z-200{z-index:200}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-0{margin-inline:0}.mx-1{margin-inline:var(--spacing)}.mx-auto{margin-inline:auto}.my-0{margin-block:0}.my-2{margin-block:calc(var(--spacing) * 2)}.my-2\.5{margin-block:calc(var(--spacing) * 2.5)}.my-3{margin-block:calc(var(--spacing) * 3)}.my-3\.5{margin-block:calc(var(--spacing) * 3.5)}.my-\[5px\]{margin-block:5px}.mt-0{margin-top:0}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-3\.5{margin-top:calc(var(--spacing) * 3.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-4\.5{margin-top:calc(var(--spacing) * 4.5)}.mt-5\.5{margin-top:calc(var(--spacing) * 5.5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-7{margin-top:calc(var(--spacing) * 7)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-19{margin-top:calc(var(--spacing) * 19)}.mt-\[5px\]{margin-top:5px}.mt-\[9px\]{margin-top:9px}.mt-\[13px\]{margin-top:13px}.mr-0{margin-right:0}.mr-1{margin-right:var(--spacing)}.mr-3\.5{margin-right:calc(var(--spacing) * 3.5)}.mb-0{margin-bottom:0}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:var(--spacing)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-3\.5{margin-bottom:calc(var(--spacing) * 3.5)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-4\.5{margin-bottom:calc(var(--spacing) * 4.5)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-5\.5{margin-bottom:calc(var(--spacing) * 5.5)}.mb-6\.5{margin-bottom:calc(var(--spacing) * 6.5)}.mb-9{margin-bottom:calc(var(--spacing) * 9)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.ml-0{margin-left:0}.ml-1{margin-left:var(--spacing)}.ml-3\.5{margin-left:calc(var(--spacing) * 3.5)}.ml-6{margin-left:calc(var(--spacing) * 6)}.ml-auto{margin-left:auto}.box-border{box-sizing:border-box}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.field-sizing-content{field-sizing:content}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.h-2{height:calc(var(--spacing) * 2)}.h-4{height:calc(var(--spacing) * 4)}.h-4\.5{height:calc(var(--spacing) * 4.5)}.h-5\.5{height:calc(var(--spacing) * 5.5)}.h-6{height:calc(var(--spacing) * 6)}.h-6\.5{height:calc(var(--spacing) * 6.5)}.h-7{height:calc(var(--spacing) * 7)}.h-7\.5{height:calc(var(--spacing) * 7.5)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-10\.5{height:calc(var(--spacing) * 10.5)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-\[7px\]{height:7px}.h-\[9px\]{height:9px}.h-\[13px\]{height:13px}.h-\[15px\]{height:15px}.h-full{height:100%}.h-px{height:1px}.max-h-36{max-height:calc(var(--spacing) * 36)}.max-h-50{max-height:calc(var(--spacing) * 50)}.max-h-65{max-height:calc(var(--spacing) * 65)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-85{max-height:calc(var(--spacing) * 85)}.max-h-95{max-height:calc(var(--spacing) * 95)}.max-h-100{max-height:calc(var(--spacing) * 100)}.max-h-\[calc\(100vh_-_40px\)\]{max-height:calc(100vh - 40px)}.max-h-\[calc\(100vh_-_var\(--modal-top\)_-_48px\)\]{max-height:calc(100vh - var(--modal-top) - 48px)}.max-h-\[min\(70vh\,_720px\)\]{max-height:min(70vh,720px)}.max-h-full{max-height:100%}.min-h-0{min-height:0}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-16{min-height:calc(var(--spacing) * 16)}.min-h-19\.5{min-height:calc(var(--spacing) * 19.5)}.min-h-28{min-height:calc(var(--spacing) * 28)}.min-h-dvh{min-height:100dvh}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-4{width:calc(var(--spacing) * 4)}.w-4\.5{width:calc(var(--spacing) * 4.5)}.w-6{width:calc(var(--spacing) * 6)}.w-6\.5{width:calc(var(--spacing) * 6.5)}.w-7{width:calc(var(--spacing) * 7)}.w-7\.5{width:calc(var(--spacing) * 7.5)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-9\.5{width:calc(var(--spacing) * 9.5)}.w-10\.5{width:calc(var(--spacing) * 10.5)}.w-37{width:calc(var(--spacing) * 37)}.w-66{width:calc(var(--spacing) * 66)}.w-68{width:calc(var(--spacing) * 68)}.w-70{width:calc(var(--spacing) * 70)}.w-72{width:calc(var(--spacing) * 72)}.w-110{width:calc(var(--spacing) * 110)}.w-120{width:calc(var(--spacing) * 120)}.w-\[7px\]{width:7px}.w-\[9px\]{width:9px}.w-\[13px\]{width:13px}.w-\[15px\]{width:15px}.w-\[min\(100\%\,_620px\)\]{width:min(100%,620px)}.w-\[min\(440px\,_calc\(100vw_-_48px\)\)\]{width:min(440px,100vw - 48px)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-36{max-width:calc(var(--spacing) * 36)}.max-w-55{max-width:calc(var(--spacing) * 55)}.max-w-60{max-width:calc(var(--spacing) * 60)}.max-w-65{max-width:calc(var(--spacing) * 65)}.max-w-68{max-width:calc(var(--spacing) * 68)}.max-w-72{max-width:calc(var(--spacing) * 72)}.max-w-120{max-width:calc(var(--spacing) * 120)}.max-w-155{max-width:calc(var(--spacing) * 155)}.max-w-160{max-width:calc(var(--spacing) * 160)}.max-w-230{max-width:calc(var(--spacing) * 230)}.max-w-\[88\%\]{max-width:88%}.max-w-\[94vw\]{max-width:94vw}.max-w-full{max-width:100%}.max-w-readable{max-width:var(--readable-col)}.min-w-0{min-width:0}.min-w-24{min-width:calc(var(--spacing) * 24)}.min-w-47\.5{min-width:calc(var(--spacing) * 47.5)}.min-w-55{min-width:calc(var(--spacing) * 55)}.min-w-57\.5{min-width:calc(var(--spacing) * 57.5)}.min-w-80{min-width:calc(var(--spacing) * 80)}.min-w-85{min-width:calc(var(--spacing) * 85)}.flex-1{flex:1}.flex-none{flex:none}.shrink-0{flex-shrink:0}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\[settings-spin_0\.9s_linear_infinite\]{animation:.9s linear infinite settings-spin}.animate-\[spin_0\.8s_linear_infinite\]{animation:.8s linear infinite spin}.animate-\[title-char-in_240ms_ease-out_both\]{animation:.24s ease-out both title-char-in}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-e-resize{cursor:e-resize}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.\[scrollbar-width\:none\]{scrollbar-width:none}.\[scrollbar-gutter\:stable\]{scrollbar-gutter:stable}.\[scrollbar-gutter\:stable_both-edges\]{scrollbar-gutter:stable both-edges}.list-none{list-style-type:none}.grid-cols-\[24px_minmax\(0\,_1fr\)\]{grid-template-columns:24px minmax(0,1fr)}.grid-cols-\[24px_minmax\(0\,_1fr\)_24px\]{grid-template-columns:24px minmax(0,1fr) 24px}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[minmax\(0\,_1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.grid-cols-\[minmax\(180px\,_260px\)_minmax\(0\,_1fr\)\]{grid-template-columns:minmax(180px,260px) minmax(0,1fr)}.grid-cols-\[repeat\(2\,_minmax\(0\,_1fr\)\)\]{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0{gap:0}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-4\.5{gap:calc(var(--spacing) * 4.5)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-\[0\.4em\]{gap:.4em}.gap-\[3px\]{gap:3px}.gap-\[5px\]{gap:5px}.gap-\[7px\]{gap:7px}.gap-\[9px\]{gap:9px}.gap-px{gap:1px}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-3\.5{column-gap:calc(var(--spacing) * 3.5)}.gap-x-4\.5{column-gap:calc(var(--spacing) * 4.5)}.gap-x-8{column-gap:calc(var(--spacing) * 8)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2\.5{row-gap:calc(var(--spacing) * 2.5)}.gap-y-\[3px\]{row-gap:3px}.gap-y-\[7px\]{row-gap:7px}.gap-y-\[9px\]{row-gap:9px}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.\!rounded-lg{border-radius:10px!important}.\!rounded-none{border-radius:0!important}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\[3px\]{border-radius:3px}.rounded-\[16px\]{border-radius:16px}.rounded-\[inherit\]{border-radius:inherit}.rounded-\[var\(--radius-md\)_var\(--radius-md\)_0_0\]{border-radius:var(--radius-md) var(--radius-md) 0 0}.rounded-full{border-radius:999px}.rounded-lg{border-radius:10px}.rounded-md{border-radius:8px}.rounded-sm{border-radius:6px}.rounded-xl{border-radius:12px}.rounded-xs{border-radius:4px}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\[1\.5px\]{border-style:var(--tw-border-style);border-width:1.5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-\[3px\]{border-left-style:var(--tw-border-style);border-left-width:3px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-solid{--tw-border-style:solid;border-style:solid}.border-accent-amber{border-color:var(--accent-amber)}.border-border{border-color:var(--border)}.border-border-variant{border-color:var(--border-variant)}.border-primary{border-color:var(--primary)}.border-text{border-color:var(--text)}.border-transparent{border-color:#0000}.border-t-border{border-top-color:var(--border)}.border-t-border-variant{border-top-color:var(--border-variant)}.border-t-primary{border-top-color:var(--primary)}.border-r-border-variant{border-right-color:var(--border-variant)}.border-b-\[color-mix\(in_oklab\,_var\(--text\)_7\%\,_transparent\)\]{border-bottom-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.border-b-\[color-mix\(in_oklab\,_var\(--text\)_7\%\,_transparent\)\]{border-bottom-color:color-mix(in oklab,var(--text) 7%,transparent)}}.border-b-border{border-bottom-color:var(--border)}.border-b-border-variant{border-bottom-color:var(--border-variant)}.border-l-accent-blue{border-left-color:var(--accent-blue)}.border-l-border{border-left-color:var(--border)}.border-l-border-variant{border-left-color:var(--border-variant)}.\!bg-transparent{background-color:#0000!important}.bg-\[color-mix\(in_oklab\,_var\(--text\)_3\%\,_transparent\)\]{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_oklab\,_var\(--text\)_3\%\,_transparent\)\]{background-color:color-mix(in oklab,var(--text) 3%,transparent)}}.bg-\[color-mix\(in_oklab\,_var\(--text\)_8\%\,_transparent\)\]{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_oklab\,_var\(--text\)_8\%\,_transparent\)\]{background-color:color-mix(in oklab,var(--text) 8%,transparent)}}.bg-\[color-mix\(in_oklab\,_var\(--text\)_10\%\,_transparent\)\]{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_oklab\,_var\(--text\)_10\%\,_transparent\)\]{background-color:color-mix(in oklab,var(--text) 10%,transparent)}}.bg-\[color-mix\(in_srgb\,_var\(--primary\)_16\%\,_transparent\)\]{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_srgb\,_var\(--primary\)_16\%\,_transparent\)\]{background-color:color-mix(in srgb,var(--primary) 16%,transparent)}}.bg-\[rgba\(29\,_27\,_26\,_0\.4\)\]{background-color:#1d1b1a66}.bg-\[rgba\(29\,_27\,_26\,_0\.42\)\]{background-color:#1d1b1a6b}.bg-\[var\(--term-bg\)\]{background-color:var(--term-bg)}.bg-accent{background-color:var(--accent)}.bg-accent-amber-subtle{background-color:var(--accent-amber-subtle)}.bg-background{background-color:var(--base)}.bg-border-variant{background-color:var(--border-variant)}.bg-canvas{background-color:var(--canvas)}.bg-muted{background-color:var(--muted)}.bg-primary{background-color:var(--primary)}.bg-primary-subtle{background-color:var(--primary-subtle)}.bg-surface{background-color:var(--surface)}.bg-text{background-color:var(--text)}.bg-transparent{background-color:#0000}.bg-white{background-color:#fff}.bg-none{background-image:none}.\!p-0{padding:0!important}.p-0{padding:0}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-\[1\.5px\]{padding:1.5px}.p-\[3px\]{padding:3px}.p-\[5px\]{padding:5px}.p-px{padding:1px}.\!px-7{padding-inline:calc(var(--spacing) * 7)!important}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-4\.5{padding-inline:calc(var(--spacing) * 4.5)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-7{padding-inline:calc(var(--spacing) * 7)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-\[7px\]{padding-inline:7px}.px-\[9px\]{padding-inline:9px}.px-\[11px\]{padding-inline:11px}.px-\[13px\]{padding-inline:13px}.px-\[15px\]{padding-inline:15px}.\!py-3\.5{padding-block:calc(var(--spacing) * 3.5)!important}.py-0{padding-block:0}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-4\.5{padding-block:calc(var(--spacing) * 4.5)}.py-6\.5{padding-block:calc(var(--spacing) * 6.5)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-\[3px\]{padding-block:3px}.py-\[5px\]{padding-block:5px}.py-\[7px\]{padding-block:7px}.py-\[9px\]{padding-block:9px}.py-\[11px\]{padding-block:11px}.py-px{padding-block:1px}.pt-0{padding-top:0}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-1\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-3\.5{padding-top:calc(var(--spacing) * 3.5)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-4\.5{padding-top:calc(var(--spacing) * 4.5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-6\.5{padding-top:calc(var(--spacing) * 6.5)}.pt-12{padding-top:calc(var(--spacing) * 12)}.pt-\[var\(--modal-top\)\]{padding-top:var(--modal-top)}.pr-0{padding-right:0}.pr-1{padding-right:var(--spacing)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-\[1ch\]{padding-right:1ch}.pb-0{padding-bottom:0}.pb-1{padding-bottom:var(--spacing)}.pb-1\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-8{padding-bottom:calc(var(--spacing) * 8)}.pb-10{padding-bottom:calc(var(--spacing) * 10)}.pb-15{padding-bottom:calc(var(--spacing) * 15)}.pb-16{padding-bottom:calc(var(--spacing) * 16)}.pl-1\.5{padding-left:calc(var(--spacing) * 1.5)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4\.5{padding-left:calc(var(--spacing) * 4.5)}.pl-\[2ch\]{padding-left:2ch}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-\[-0\.15em\]{vertical-align:-.15em}.align-baseline{vertical-align:baseline}.font-\[inherit\]{font-family:inherit}.font-mono{font-family:var(--mono)}.font-sans{font-family:var(--sans)}.\!text-xl{font-size:var(--fs-xl)!important}.text-2xl{font-size:var(--fs-2xl)}.text-2xs{font-size:var(--fs-2xs)}.text-3xl{font-size:var(--fs-3xl)}.text-4xl{font-size:var(--fs-4xl)}.text-\[2\.5rem\]{font-size:2.5rem}.text-\[4rem\]{font-size:4rem}.text-\[length\:inherit\]{font-size:inherit}.text-base{font-size:var(--fs-base)}.text-lg{font-size:var(--fs-lg)}.text-md{font-size:var(--fs-md)}.text-sm{font-size:var(--fs-sm)}.text-xl{font-size:var(--fs-xl)}.text-xs{font-size:var(--fs-xs)}.leading-\[1\.3\]{--tw-leading:1.3;line-height:1.3}.leading-\[1\.4\]{--tw-leading:1.4;line-height:1.4}.leading-\[1\.6\]{--tw-leading:1.6;line-height:1.6}.leading-\[1\.08\]{--tw-leading:1.08;line-height:1.08}.leading-\[1\.35\]{--tw-leading:1.35;line-height:1.35}.leading-\[1\.45\]{--tw-leading:1.45;line-height:1.45}.leading-\[1\.55\]{--tw-leading:1.55;line-height:1.55}.leading-\[1\.62\]{--tw-leading:1.62;line-height:1.62}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-\[375\]{--tw-font-weight:375;font-weight:375}.font-display{--tw-font-weight:var(--fw-display);font-weight:var(--fw-display)}.font-medium{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.font-normal{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.font-semibold{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.tracking-\[-0\.01em\]{--tw-tracking:-.01em;letter-spacing:-.01em}.tracking-\[-0\.02em\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\[-0\.015em\]{--tw-tracking:-.015em;letter-spacing:-.015em}.tracking-\[-0\.035em\]{--tw-tracking:-.035em;letter-spacing:-.035em}.tracking-\[0\.08em\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.wrap-anywhere{overflow-wrap:anywhere}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.\[tab-size\:4\]{-moz-tab-size:4;tab-size:4}.\!text-text{color:var(--text)!important}.text-\[\#d97757\]{color:#d97757}.text-accent-amber{color:var(--accent-amber)}.text-accent-blue{color:var(--accent-blue)}.text-accent-green{color:var(--accent-green)}.text-accent-red{color:var(--accent-red)}.text-background{color:var(--base)}.text-inherit{color:inherit}.text-muted{color:var(--muted)}.text-primary{color:var(--primary)}.text-subtext{color:var(--subtext)}.text-text{color:var(--text)}.text-transparent{color:#0000}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.decoration-border-strong{-webkit-text-decoration-color:var(--border-strong);text-decoration-color:var(--border-strong)}.underline-offset-3{text-underline-offset:3px}.caret-\[var\(--text\)\]{caret-color:var(--text)}.opacity-0{opacity:0}.opacity-35{opacity:.35}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-100{opacity:1}.\!shadow-none{--tw-shadow:0 0 #0000!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.shadow-\[0_0_0_1px_rgba\(0\,_0\,_0\,_0\.08\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_1px_2px_rgb\(0_0_0_\/_4\%\)\],.shadow-\[0_1px_2px_rgba\(0\,_0\,_0\,_0\.04\)\]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\]{--tw-shadow:0 1px 3px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\]{--tw-shadow:0 1px 3px var(--tw-shadow-color,color-mix(in oklab, var(--text) 5%, transparent))}}.shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\]{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_8px_rgba\(0\,_0\,_0\,_0\.10\)\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_10px_rgb\(0_0_0_\/_6\%\)\]{--tw-shadow:0 2px 10px var(--tw-shadow-color,#0000000f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(0\,_0\,_0\,_0\.10\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_6px_20px_rgb\(0_0_0_\/_12\%\)\]{--tw-shadow:0 6px 20px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_6px_24px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\,_0_1px_4px_color-mix\(in_oklab\,_var\(--text\)_4\%\,_transparent\)\]{--tw-shadow:0 6px 24px var(--tw-shadow-color,var(--text)), 0 1px 4px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.shadow-\[0_6px_24px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\,_0_1px_4px_color-mix\(in_oklab\,_var\(--text\)_4\%\,_transparent\)\]{--tw-shadow:0 6px 24px var(--tw-shadow-color,color-mix(in oklab, var(--text) 5%, transparent)), 0 1px 4px var(--tw-shadow-color,color-mix(in oklab, var(--text) 4%, transparent))}}.shadow-\[0_6px_24px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\,_0_1px_4px_color-mix\(in_oklab\,_var\(--text\)_4\%\,_transparent\)\]{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_10px_26px_rgba\(0\,_0\,_0\,_0\.16\)\]{--tw-shadow:0 10px 26px var(--tw-shadow-color,#00000029);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_12px_32px_rgba\(0\,_0\,_0\,_0\.18\)\]{--tw-shadow:0 12px 32px var(--tw-shadow-color,#0000002e);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_14px_36px_color-mix\(in_oklab\,_var\(--text\)_6\%\,_transparent\)\]{--tw-shadow:0 14px 36px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.shadow-\[0_14px_36px_color-mix\(in_oklab\,_var\(--text\)_6\%\,_transparent\)\]{--tw-shadow:0 14px 36px var(--tw-shadow-color,color-mix(in oklab, var(--text) 6%, transparent))}}.shadow-\[0_14px_36px_color-mix\(in_oklab\,_var\(--text\)_6\%\,_transparent\)\]{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_24px_60px_rgba\(0\,_0\,_0\,_0\.22\)\]{--tw-shadow:0 24px 60px var(--tw-shadow-color,#00000038);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_2px_0_0_var\(--primary\)\]{--tw-shadow:inset 2px 0 0 var(--tw-shadow-color,var(--primary));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\[background\,border-color\,color\]{transition-property:background,border-color,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background\,border-color\]{transition-property:background,border-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background\,color\]{transition-property:background,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background\,opacity\]{transition-property:background,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background\]{transition-property:background;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[border-color\,background\,translate\]{transition-property:border-color,background,translate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[border-color\,background\]{transition-property:border-color,background;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[border-color\,box-shadow\]{transition-property:border-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[border-color\,color\]{transition-property:border-color,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[box-shadow\]{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[opacity\,color\]{transition-property:opacity,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[transform\,color\]{transition-property:transform,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-80{--tw-duration:80ms;transition-duration:80ms}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-120{--tw-duration:.12s;transition-duration:.12s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-standard{--tw-ease:ease;transition-timing-function:ease}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\[font\:inherit\]{font:inherit}.\[grid-area\:actions\]{grid-area:actions}.\[grid-area\:meta\]{grid-area:meta}.\[grid-area\:name\]{grid-area:name}.\[grid-template-areas\:\'name_meta\'_\'actions_actions\'\]{grid-template-areas:"name meta""actions actions"}.group-focus-within\/turn\:opacity-100:is(:where(.group\/turn):focus-within *){opacity:1}@media(hover:hover){.group-hover\:opacity-0:is(:where(.group):hover *){opacity:0}.group-hover\:opacity-100:is(:where(.group):hover *),.group-hover\/turn\:opacity-100:is(:where(.group\/turn):hover *){opacity:1}}.group-focus-visible\:opacity-0:is(:where(.group):focus-visible *){opacity:0}.group-focus-visible\:opacity-100:is(:where(.group):focus-visible *){opacity:1}.before\:content-\[attr\(data-line\)\]:before{--tw-content:attr(data-line);content:var(--tw-content)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:top-full:after{content:var(--tw-content);top:100%}.after\:right-0:after{content:var(--tw-content);right:0}.after\:left-0:after{content:var(--tw-content);left:0}.after\:h-2:after{content:var(--tw-content);height:calc(var(--spacing) * 2)}.after\:content-\[\'\'\]:after{--tw-content:"";content:var(--tw-content)}.first\:border-t-0:first-child{border-top-style:var(--tw-border-style);border-top-width:0}@media(hover:hover){.hover\:bg-highlight:hover{background-color:var(--highlight)}.hover\:bg-surface:hover{background-color:var(--surface)}.hover\:text-text:hover{color:var(--text)}.hover\:decoration-primary:hover{-webkit-text-decoration-color:var(--primary);text-decoration-color:var(--primary)}.hover\:opacity-85:hover{opacity:.85}}.focus-visible\:text-text:focus-visible{color:var(--text)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:1120px){.min-\[1120px\]\:col-start-1{grid-column-start:1}.min-\[1120px\]\:col-start-2{grid-column-start:2}.min-\[1120px\]\:row-start-1{grid-row-start:1}.min-\[1120px\]\:row-start-2{grid-row-start:2}.min-\[1120px\]\:mt-0{margin-top:0}.min-\[1120px\]\:grid{display:grid}.min-\[1120px\]\:grid-cols-\[minmax\(0\,_1\.1fr\)_minmax\(28rem\,_1fr\)\]{grid-template-columns:minmax(0,1.1fr) minmax(28rem,1fr)}.min-\[1120px\]\:grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.min-\[1120px\]\:content-center{align-content:center}.min-\[1120px\]\:gap-x-20{column-gap:calc(var(--spacing) * 20)}.min-\[1120px\]\:gap-y-10{row-gap:calc(var(--spacing) * 10)}.min-\[1120px\]\:self-end{align-self:flex-end}.min-\[1120px\]\:self-start{align-self:flex-start}}@media(min-width:40rem){.sm\:px-12{padding-inline:calc(var(--spacing) * 12)}}.\[\&_\+_\.settings-stack-section\]\:mt-6+.settings-stack-section{margin-top:calc(var(--spacing) * 6)}.\[\&_\.actions\]\:mt-1\.5 .actions{margin-top:calc(var(--spacing) * 1.5)}.\[\&_\.actions\]\:flex .actions{display:flex}.\[\&_\.actions\]\:justify-end .actions{justify-content:flex-end}.\[\&_\.actions\]\:gap-2\.5 .actions{gap:calc(var(--spacing) * 2.5)}.\[\&_\.artifact-img\]\:mx-0 .artifact-img{margin-inline:0}.\[\&_\.artifact-img\]\:my-3 .artifact-img{margin-block:calc(var(--spacing) * 3)}.\[\&_\.artifact-img\]\:block .artifact-img{display:block}.\[\&_\.artifact-img_img\]\:h-auto .artifact-img img{height:auto}.\[\&_\.artifact-img_img\]\:max-w-full .artifact-img img{max-width:100%}.\[\&_\.artifact-img_img\]\:rounded-sm .artifact-img img{border-radius:6px}.\[\&_\.artifact-img_img\]\:border .artifact-img img{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.artifact-img_img\]\:border-border .artifact-img img{border-color:var(--border)}.\[\&_\.artifact-img-caption\]\:mt-1 .artifact-img-caption{margin-top:var(--spacing)}.\[\&_\.artifact-img-caption\]\:block .artifact-img-caption{display:block}.\[\&_\.artifact-img-caption\]\:text-center .artifact-img-caption{text-align:center}.\[\&_\.artifact-img-caption\]\:text-sm .artifact-img-caption{font-size:var(--fs-sm)}.\[\&_\.artifact-img-caption\]\:text-subtext .artifact-img-caption{color:var(--subtext)}.\[\&_\.backend-badge\]\:text-text .backend-badge{color:var(--text)}.\[\&_\.backend-detail\]\:text-muted .backend-detail{color:var(--muted)}.\[\&_\.backend-name\]\:font-medium .backend-name{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.badge\]\:ml-2 .badge{margin-left:calc(var(--spacing) * 2)}.\[\&_\.badge\]\:flex-none .badge{flex:none}.\[\&_\.brand\]\:flex .brand{display:flex}.\[\&_\.brand\]\:h-full .brand{height:100%}.\[\&_\.brand\]\:w-full .brand{width:100%}.\[\&_\.brand\]\:min-w-0 .brand{min-width:0}.\[\&_\.brand\]\:items-center .brand{align-items:center}.\[\&_\.brand\]\:justify-between .brand{justify-content:space-between}.\[\&_\.brand\]\:gap-2 .brand{gap:calc(var(--spacing) * 2)}.\[\&_\.brand\]\:rounded-sm .brand{border-radius:6px}.\[\&_\.brand\]\:border .brand{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.brand\]\:border-transparent .brand{border-color:#0000}.\[\&_\.brand\]\:px-1\.5 .brand{padding-inline:calc(var(--spacing) * 1.5)}.\[\&_\.brand\]\:py-1 .brand{padding-block:var(--spacing)}.\[\&_\.brand\]\:text-base .brand{font-size:var(--fs-base)}.\[\&_\.brand\]\:font-semibold .brand{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.brand\]\:text-text .brand{color:var(--text)}.\[\&_\.brand_\.brand-project\]\:min-w-0 .brand .brand-project{min-width:0}.\[\&_\.brand_\.brand-project\]\:overflow-hidden .brand .brand-project{overflow:hidden}.\[\&_\.brand_\.brand-project\]\:text-2xl .brand .brand-project{font-size:var(--fs-2xl)}.\[\&_\.brand_\.brand-project\]\:text-ellipsis .brand .brand-project{text-overflow:ellipsis}.\[\&_\.brand_\.brand-project\]\:whitespace-nowrap .brand .brand-project{white-space:nowrap}.\[\&_\.brand_svg\]\:shrink-0 .brand svg{flex-shrink:0}.\[\&_\.brand-project-copy\]\:flex .brand-project-copy{display:flex}.\[\&_\.brand-project-copy\]\:min-w-0 .brand-project-copy{min-width:0}.\[\&_\.brand-project-copy\]\:flex-col .brand-project-copy{flex-direction:column}.\[\&_\.brand-project-copy\]\:gap-\[3px\] .brand-project-copy{gap:3px}.\[\&_\.brand-project-copy\]\:text-left .brand-project-copy{text-align:left}.\[\&_\.brand-project-copy\]\:leading-\[1\.15\] .brand-project-copy{--tw-leading:1.15;line-height:1.15}.\[\&_\.brand-project-label\]\:text-2xs .brand-project-label{font-size:var(--fs-2xs)}.\[\&_\.brand-project-label\]\:font-medium .brand-project-label{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.brand-project-label\]\:tracking-\[0\.04em\] .brand-project-label{--tw-tracking:.04em;letter-spacing:.04em}.\[\&_\.brand-project-label\]\:text-muted .brand-project-label{color:var(--muted)}.\[\&_\.brand-project-label\]\:uppercase .brand-project-label{text-transform:uppercase}.\[\&_\.brand\.open\]\:border-border .brand.open{border-color:var(--border)}.\[\&_\.brand\.open\]\:bg-surface .brand.open{background-color:var(--surface)}.\[\&_\.brand\.open_\.project-chevron\]\:rotate-180 .brand.open .project-chevron{rotate:180deg}.\[\&_\.brand\.open_\.project-chevron\]\:opacity-100 .brand.open .project-chevron{opacity:1}.\[\&_\.brand\:hover\]\:border-border .brand:hover{border-color:var(--border)}.\[\&_\.brand\:hover\]\:bg-surface .brand:hover{background-color:var(--surface)}.\[\&_\.brand\:hover_\.project-chevron\]\:opacity-100 .brand:hover .project-chevron{opacity:1}.\[\&_\.btn\]\:inline-flex .btn{display:inline-flex}.\[\&_\.btn\]\:items-center .btn{align-items:center}.\[\&_\.btn\]\:gap-\[5px\] .btn{gap:5px}.\[\&_\.btn-ghost\]\:inline-flex .btn-ghost{display:inline-flex}.\[\&_\.btn-ghost\]\:cursor-pointer .btn-ghost{cursor:pointer}.\[\&_\.btn-ghost\]\:items-center .btn-ghost{align-items:center}.\[\&_\.btn-ghost\]\:gap-1\.5 .btn-ghost{gap:calc(var(--spacing) * 1.5)}.\[\&_\.btn-ghost\]\:rounded-sm .btn-ghost{border-radius:6px}.\[\&_\.btn-ghost\]\:border .btn-ghost{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.btn-ghost\]\:border-border .btn-ghost{border-color:var(--border)}.\[\&_\.btn-ghost\]\:border-text .btn-ghost{border-color:var(--text)}.\[\&_\.btn-ghost\]\:border-transparent .btn-ghost{border-color:#0000}.\[\&_\.btn-ghost\]\:bg-transparent .btn-ghost{background-color:#0000}.\[\&_\.btn-ghost\]\:px-\[13px\] .btn-ghost{padding-inline:13px}.\[\&_\.btn-ghost\]\:py-1\.5 .btn-ghost{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\.btn-ghost\]\:font-\[inherit\] .btn-ghost{font-family:inherit}.\[\&_\.btn-ghost\]\:text-sm .btn-ghost{font-size:var(--fs-sm)}.\[\&_\.btn-ghost\]\:font-semibold .btn-ghost{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.btn-ghost\]\:text-subtext .btn-ghost{color:var(--subtext)}.\[\&_\.btn-ghost\]\:text-text .btn-ghost{color:var(--text)}.\[\&_\.btn-ghost\]\:transition-\[background\,border-color\] .btn-ghost{transition-property:background,border-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_\.btn-ghost\]\:duration-80 .btn-ghost{--tw-duration:80ms;transition-duration:80ms}.\[\&_\.btn-ghost\]\:ease-standard .btn-ghost{--tw-ease:ease;transition-timing-function:ease}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:border-border-strong .btn-ghost:hover:not(:disabled){border-color:var(--border-strong)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:border-text .btn-ghost:hover:not(:disabled){border-color:var(--text)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:bg-\[var\(--surface-2\,_rgb\(0_0_0_\/_5\%\)\)\] .btn-ghost:hover:not(:disabled){background-color:var(--surface-2,#0000000d)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:bg-surface .btn-ghost:hover:not(:disabled){background-color:var(--surface)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:text-text .btn-ghost:hover:not(:disabled){color:var(--text)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:opacity-100 .btn-ghost:hover:not(:disabled){opacity:1}.\[\&_\.btn-primary\]\:inline-flex .btn-primary{display:inline-flex}.\[\&_\.btn-primary\]\:cursor-pointer .btn-primary{cursor:pointer}.\[\&_\.btn-primary\]\:items-center .btn-primary{align-items:center}.\[\&_\.btn-primary\]\:gap-1\.5 .btn-primary{gap:calc(var(--spacing) * 1.5)}.\[\&_\.btn-primary\]\:rounded-sm .btn-primary{border-radius:6px}.\[\&_\.btn-primary\]\:border .btn-primary{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.btn-primary\]\:border-text .btn-primary{border-color:var(--text)}.\[\&_\.btn-primary\]\:border-transparent .btn-primary{border-color:#0000}.\[\&_\.btn-primary\]\:bg-primary .btn-primary{background-color:var(--primary)}.\[\&_\.btn-primary\]\:bg-transparent .btn-primary{background-color:#0000}.\[\&_\.btn-primary\]\:px-\[13px\] .btn-primary{padding-inline:13px}.\[\&_\.btn-primary\]\:py-1\.5 .btn-primary{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\.btn-primary\]\:font-\[inherit\] .btn-primary{font-family:inherit}.\[\&_\.btn-primary\]\:text-sm .btn-primary{font-size:var(--fs-sm)}.\[\&_\.btn-primary\]\:font-semibold .btn-primary{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.btn-primary\]\:text-background .btn-primary{color:var(--base)}.\[\&_\.btn-primary\]\:text-text .btn-primary{color:var(--text)}.\[\&_\.btn-primary\]\:transition-\[background\,border-color\] .btn-primary{transition-property:background,border-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_\.btn-primary\]\:duration-80 .btn-primary{--tw-duration:80ms;transition-duration:80ms}.\[\&_\.btn-primary\]\:ease-standard .btn-primary{--tw-ease:ease;transition-timing-function:ease}.\[\&_\.btn-primary\:first-child\]\:rounded-tr-none .btn-primary:first-child{border-top-right-radius:0}.\[\&_\.btn-primary\:first-child\]\:rounded-br-none .btn-primary:first-child{border-bottom-right-radius:0}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:border-text .btn-primary:hover:not(:disabled){border-color:var(--text)}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:bg-\[var\(--surface-2\,_rgb\(0_0_0_\/_5\%\)\)\] .btn-primary:hover:not(:disabled){background-color:var(--surface-2,#0000000d)}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:text-text .btn-primary:hover:not(:disabled){color:var(--text)}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:opacity-90 .btn-primary:hover:not(:disabled){opacity:.9}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:opacity-100 .btn-primary:hover:not(:disabled){opacity:1}.\[\&_\.busy-dot\]\:h-\[7px\] .busy-dot{height:7px}.\[\&_\.busy-dot\]\:w-\[7px\] .busy-dot{width:7px}.\[\&_\.busy-dot\]\:shrink-0 .busy-dot{flex-shrink:0}.\[\&_\.busy-dot\]\:animate-\[or-pulse_1\.2s_infinite\] .busy-dot{animation:1.2s infinite or-pulse}.\[\&_\.busy-dot\]\:rounded-full .busy-dot{border-radius:999px}.\[\&_\.busy-dot\]\:bg-primary .busy-dot{background-color:var(--primary)}.\[\&_\.busy-dot\.waiting\]\:animate-none .busy-dot.waiting{animation:none}.\[\&_\.chev\]\:w-3 .chev{width:calc(var(--spacing) * 3)}.\[\&_\.chev\]\:shrink-0 .chev{flex-shrink:0}.\[\&_\.chev\]\:text-2xs .chev{font-size:var(--fs-2xs)}.\[\&_\.chev\]\:text-muted .chev{color:var(--muted)}.\[\&_\.count-badge\]\:inline-flex .count-badge{display:inline-flex}.\[\&_\.count-badge\]\:h-4\.5 .count-badge{height:calc(var(--spacing) * 4.5)}.\[\&_\.count-badge\]\:min-w-4\.5 .count-badge{min-width:calc(var(--spacing) * 4.5)}.\[\&_\.count-badge\]\:items-center .count-badge{align-items:center}.\[\&_\.count-badge\]\:justify-center .count-badge{justify-content:center}.\[\&_\.count-badge\]\:rounded-md .count-badge{border-radius:8px}.\[\&_\.count-badge\]\:border .count-badge{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.count-badge\]\:border-border .count-badge{border-color:var(--border)}.\[\&_\.count-badge\]\:bg-canvas .count-badge{background-color:var(--canvas)}.\[\&_\.count-badge\]\:px-\[5px\] .count-badge{padding-inline:5px}.\[\&_\.count-badge\]\:py-0 .count-badge{padding-block:0}.\[\&_\.count-badge\]\:text-xs .count-badge{font-size:var(--fs-xs)}.\[\&_\.count-badge\]\:font-medium .count-badge{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.count-badge\]\:text-text .count-badge{color:var(--text)}.\[\&_\.dot\]\:h-\[7px\] .dot{height:7px}.\[\&_\.dot\]\:w-\[7px\] .dot{width:7px}.\[\&_\.dot\]\:shrink-0 .dot{flex-shrink:0}.\[\&_\.dot\]\:rounded-full .dot{border-radius:999px}.\[\&_\.dot\]\:bg-current .dot{background-color:currentColor}.\[\&_\.elided-node-label\]\:flex .elided-node-label{display:flex}.\[\&_\.elided-node-label\]\:flex-col .elided-node-label{flex-direction:column}.\[\&_\.elided-node-label\]\:leading-\[1\.3\] .elided-node-label{--tw-leading:1.3;line-height:1.3}.\[\&_\.elided-node-sub\]\:text-muted .elided-node-sub{color:var(--muted)}.\[\&_\.error\]\:basis-full .error{flex-basis:100%}.\[\&_\.error\]\:text-md .error{font-size:var(--fs-md)}.\[\&_\.error\]\:text-sm .error{font-size:var(--fs-sm)}.\[\&_\.error\]\:whitespace-pre-wrap .error{white-space:pre-wrap}.\[\&_\.error\]\:text-accent-red .error{color:var(--accent-red)}.\[\&_\.file-chip\]\:mx-px .file-chip{margin-inline:1px}.\[\&_\.file-chip\]\:my-0 .file-chip{margin-block:0}.\[\&_\.file-chip\]\:inline-flex .file-chip{display:inline-flex}.\[\&_\.file-chip\]\:max-w-full .file-chip{max-width:100%}.\[\&_\.file-chip\]\:cursor-pointer .file-chip{cursor:pointer}.\[\&_\.file-chip\]\:items-center .file-chip{align-items:center}.\[\&_\.file-chip\]\:gap-1 .file-chip{gap:var(--spacing)}.\[\&_\.file-chip\]\:rounded-xs .file-chip{border-radius:4px}.\[\&_\.file-chip\]\:border .file-chip{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.file-chip\]\:border-border-variant .file-chip{border-color:var(--border-variant)}.\[\&_\.file-chip\]\:bg-panel .file-chip{background-color:var(--panel)}.\[\&_\.file-chip\]\:px-1\.5 .file-chip{padding-inline:calc(var(--spacing) * 1.5)}.\[\&_\.file-chip\]\:py-0 .file-chip{padding-block:0}.\[\&_\.file-chip\]\:align-baseline .file-chip{vertical-align:baseline}.\[\&_\.file-chip\]\:font-mono .file-chip{font-family:var(--mono)}.\[\&_\.file-chip\]\:text-\[0\.9em\] .file-chip{font-size:.9em}.\[\&_\.file-chip\]\:font-medium .file-chip{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.file-chip\]\:text-text .file-chip{color:var(--text)}.\[\&_\.file-chip_svg\]\:flex-none .file-chip svg{flex:none}.\[\&_\.file-chip_svg\]\:opacity-60 .file-chip svg{opacity:.6}.\[\&_\.file-chip-label\]\:max-w-65 .file-chip-label{max-width:calc(var(--spacing) * 65)}.\[\&_\.file-chip-label\]\:overflow-hidden .file-chip-label{overflow:hidden}.\[\&_\.file-chip-label\]\:text-ellipsis .file-chip-label{text-overflow:ellipsis}.\[\&_\.file-chip-label\]\:whitespace-nowrap .file-chip-label{white-space:nowrap}.\[\&_\.file-chip\:hover\:not\(\:disabled\)\]\:bg-surface .file-chip:hover:not(:disabled){background-color:var(--surface)}.\[\&_\.file-chip\:hover\:not\(\:disabled\)\]\:text-primary .file-chip:hover:not(:disabled){color:var(--primary)}.\[\&_\.files-pill\]\:rounded-sm .files-pill{border-radius:6px}.\[\&_\.files-pill\]\:px-2 .files-pill{padding-inline:calc(var(--spacing) * 2)}.\[\&_\.files-pill\]\:py-\[5px\] .files-pill{padding-block:5px}.\[\&_\.files-pill_code\]\:text-xs .files-pill code{font-size:var(--fs-xs)}.\[\&_\.folder-picker-chevron\]\:flex-none .folder-picker-chevron{flex:none}.\[\&_\.folder-picker-chevron\]\:text-muted .folder-picker-chevron{color:var(--muted)}.\[\&_\.folder-picker-control\]\:flex .folder-picker-control{display:flex}.\[\&_\.folder-picker-control\]\:w-full .folder-picker-control{width:100%}.\[\&_\.folder-picker-control\]\:min-w-0 .folder-picker-control{min-width:0}.\[\&_\.folder-picker-control\]\:cursor-pointer .folder-picker-control{cursor:pointer}.\[\&_\.folder-picker-control\]\:items-center .folder-picker-control{align-items:center}.\[\&_\.folder-picker-control\]\:gap-\[9px\] .folder-picker-control{gap:9px}.\[\&_\.folder-picker-control\]\:overflow-hidden .folder-picker-control{overflow:hidden}.\[\&_\.folder-picker-control\]\:rounded-md .folder-picker-control{border-radius:8px}.\[\&_\.folder-picker-control\]\:border .folder-picker-control{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.folder-picker-control\]\:border-border .folder-picker-control{border-color:var(--border)}.\[\&_\.folder-picker-control\]\:bg-background .folder-picker-control{background-color:var(--base)}.\[\&_\.folder-picker-control\]\:px-2\.5 .folder-picker-control{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_\.folder-picker-control\]\:py-2 .folder-picker-control{padding-block:calc(var(--spacing) * 2)}.\[\&_\.folder-picker-control\]\:text-left .folder-picker-control{text-align:left}.\[\&_\.folder-picker-control\]\:transition-\[border-color\,box-shadow\] .folder-picker-control{transition-property:border-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_\.folder-picker-control\]\:duration-120 .folder-picker-control{--tw-duration:.12s;transition-duration:.12s}.\[\&_\.folder-picker-control\]\:ease-standard .folder-picker-control{--tw-ease:ease;transition-timing-function:ease}.\[\&_\.folder-picker-control_\.placeholder\]\:text-muted .folder-picker-control .placeholder{color:var(--muted)}.\[\&_\.folder-picker-control_span\]\:min-w-0 .folder-picker-control span{min-width:0}.\[\&_\.folder-picker-control_span\]\:flex-1 .folder-picker-control span{flex:1}.\[\&_\.folder-picker-control_span\]\:overflow-hidden .folder-picker-control span{overflow:hidden}.\[\&_\.folder-picker-control_span\]\:text-ellipsis .folder-picker-control span{text-overflow:ellipsis}.\[\&_\.folder-picker-control_span\]\:whitespace-nowrap .folder-picker-control span{white-space:nowrap}.\[\&_\.folder-picker-control\:disabled\]\:cursor-default .folder-picker-control:disabled{cursor:default}.\[\&_\.folder-picker-control\:disabled\]\:opacity-65 .folder-picker-control:disabled{opacity:.65}.\[\&_\.folder-picker-control\:focus-visible\]\:outline-2 .folder-picker-control:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.\[\&_\.folder-picker-control\:focus-visible\]\:outline-offset-2 .folder-picker-control:focus-visible{outline-offset:2px}.\[\&_\.folder-picker-control\:focus-visible\]\:outline-text .folder-picker-control:focus-visible{outline-color:var(--text)}.\[\&_\.folder-picker-control\:focus-visible\]\:outline-solid .folder-picker-control:focus-visible{--tw-outline-style:solid;outline-style:solid}.\[\&_\.folder-picker-control\:hover\:not\(\:disabled\)\]\:border-muted .folder-picker-control:hover:not(:disabled){border-color:var(--muted)}.\[\&_\.folder-picker-control\:hover\:not\(\:disabled\)\]\:shadow-\[0_2px_8px_rgb\(0_0_0_\/_5\%\)\] .folder-picker-control:hover:not(:disabled){--tw-shadow:0 2px 8px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&_\.folder-picker-control\:hover\:not\(\:disabled\)_\.folder-picker-chevron\]\:text-subtext .folder-picker-control:hover:not(:disabled) .folder-picker-chevron{color:var(--subtext)}.\[\&_\.folder-picker-hint\]\:text-sm .folder-picker-hint{font-size:var(--fs-sm)}.\[\&_\.folder-picker-hint\]\:leading-\[1\.4\] .folder-picker-hint{--tw-leading:1.4;line-height:1.4}.\[\&_\.folder-picker-hint\]\:font-normal .folder-picker-hint{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_\.folder-picker-hint\]\:text-subtext .folder-picker-hint{color:var(--subtext)}.\[\&_\.folder-picker-icon\]\:flex-none .folder-picker-icon{flex:none}.\[\&_\.folder-picker-icon\]\:text-current .folder-picker-icon{color:currentColor}.\[\&_\.form-seg\]\:mb-0\.5 .form-seg{margin-bottom:calc(var(--spacing) * .5)}.\[\&_\.form-seg\]\:self-start .form-seg{align-self:flex-start}.\[\&_\.form-seg_button\]\:px-3 .form-seg button{padding-inline:calc(var(--spacing) * 3)}.\[\&_\.form-seg_button\]\:py-\[5px\] .form-seg button{padding-block:5px}.\[\&_\.ftree-footer\]\:mt-2\.5 .ftree-footer{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.ftree-footer\]\:max-w-full .ftree-footer{max-width:100%}.\[\&_\.ftree-footer\]\:rounded-md .ftree-footer{border-radius:8px}.\[\&_\.ftree-footer\]\:border .ftree-footer{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.ftree-footer\]\:border-border .ftree-footer{border-color:var(--border)}.\[\&_\.ftree-footer\]\:bg-background .ftree-footer{background-color:var(--base)}.\[\&_\.ftree-footer\]\:px-2\.5 .ftree-footer{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_\.ftree-footer\]\:py-1\.5 .ftree-footer{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\.ftree-footer_code\]\:max-w-95 .ftree-footer code{max-width:calc(var(--spacing) * 95)}.\[\&_\.hc-actions\]\:mt-2\.5 .hc-actions{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-actions\]\:flex .hc-actions{display:flex}.\[\&_\.hc-actions\]\:items-center .hc-actions{align-items:center}.\[\&_\.hc-actions\]\:gap-1\.5 .hc-actions{gap:calc(var(--spacing) * 1.5)}.\[\&_\.hc-actions_button\]\:inline-flex .hc-actions button{display:inline-flex}.\[\&_\.hc-actions_button\]\:min-w-21 .hc-actions button{min-width:calc(var(--spacing) * 21)}.\[\&_\.hc-actions_button\]\:items-center .hc-actions button{align-items:center}.\[\&_\.hc-actions_button\]\:justify-center .hc-actions button{justify-content:center}.\[\&_\.hc-actions_button\]\:gap-\[5px\] .hc-actions button{gap:5px}.\[\&_\.hc-actions_button\]\:rounded-md .hc-actions button{border-radius:8px}.\[\&_\.hc-actions_button\]\:border .hc-actions button{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.hc-actions_button\]\:border-border .hc-actions button{border-color:var(--border)}.\[\&_\.hc-actions_button\]\:bg-background .hc-actions button{background-color:var(--base)}.\[\&_\.hc-actions_button\]\:px-2\.5 .hc-actions button{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_\.hc-actions_button\]\:py-1\.5 .hc-actions button{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\.hc-actions_button\]\:text-sm .hc-actions button{font-size:var(--fs-sm)}.\[\&_\.hc-actions_button\]\:font-medium .hc-actions button{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.hc-actions_button\]\:text-text .hc-actions button{color:var(--text)}.\[\&_\.hc-actions_button\:hover\]\:border-\[color-mix\(in_oklab\,_var\(--border\)_55\%\,_var\(--text\)\)\] .hc-actions button:hover{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.hc-actions_button\:hover\]\:border-\[color-mix\(in_oklab\,_var\(--border\)_55\%\,_var\(--text\)\)\] .hc-actions button:hover{border-color:color-mix(in oklab,var(--border) 55%,var(--text))}}.\[\&_\.hc-actions_button\:hover\]\:bg-canvas .hc-actions button:hover{background-color:var(--canvas)}.\[\&_\.hc-body\]\:mt-2\.5 .hc-body{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-body\]\:line-clamp-10 .hc-body{-webkit-line-clamp:10;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&_\.hc-body\]\:border-t .hc-body{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.hc-body\]\:border-t-border-variant .hc-body{border-top-color:var(--border-variant)}.\[\&_\.hc-body\]\:pt-2\.5 .hc-body{padding-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-body\]\:leading-\[1\.6\] .hc-body{--tw-leading:1.6;line-height:1.6}.\[\&_\.hc-body\]\:whitespace-pre-line .hc-body{white-space:pre-line}.\[\&_\.hc-body\.expanded\]\:line-clamp-none .hc-body.expanded{-webkit-line-clamp:unset;-webkit-box-orient:horizontal;display:block;overflow:visible}.\[\&_\.hc-body\.expanded\]\:block .hc-body.expanded{display:block}.\[\&_\.hc-body\.expanded\]\:max-h-\[45vh\] .hc-body.expanded{max-height:45vh}.\[\&_\.hc-body\.expanded\]\:overflow-x-hidden .hc-body.expanded{overflow-x:hidden}.\[\&_\.hc-body\.expanded\]\:overflow-y-auto .hc-body.expanded{overflow-y:auto}.\[\&_\.hc-body\.expanded\]\:pb-1 .hc-body.expanded{padding-bottom:var(--spacing)}.\[\&_\.hc-branch\]\:inline-flex .hc-branch{display:inline-flex}.\[\&_\.hc-branch\]\:min-w-0 .hc-branch{min-width:0}.\[\&_\.hc-branch\]\:items-center .hc-branch{align-items:center}.\[\&_\.hc-branch\]\:gap-1 .hc-branch{gap:var(--spacing)}.\[\&_\.hc-branch\]\:overflow-hidden .hc-branch{overflow:hidden}.\[\&_\.hc-branch\]\:font-mono .hc-branch{font-family:var(--mono)}.\[\&_\.hc-branch\]\:text-ellipsis .hc-branch{text-overflow:ellipsis}.\[\&_\.hc-branch\]\:whitespace-nowrap .hc-branch{white-space:nowrap}.\[\&_\.hc-failure\]\:mt-2 .hc-failure{margin-top:calc(var(--spacing) * 2)}.\[\&_\.hc-failure\]\:line-clamp-3 .hc-failure{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&_\.hc-failure\]\:text-accent-red .hc-failure{color:var(--accent-red)}.\[\&_\.hc-foot\]\:mt-2 .hc-foot{margin-top:calc(var(--spacing) * 2)}.\[\&_\.hc-foot\]\:flex .hc-foot{display:flex}.\[\&_\.hc-foot\]\:items-center .hc-foot{align-items:center}.\[\&_\.hc-foot\]\:justify-between .hc-foot{justify-content:space-between}.\[\&_\.hc-foot\]\:gap-2\.5 .hc-foot{gap:calc(var(--spacing) * 2.5)}.\[\&_\.hc-foot\]\:text-2xs .hc-foot{font-size:var(--fs-2xs)}.\[\&_\.hc-foot\]\:text-muted .hc-foot{color:var(--muted)}.\[\&_\.hc-foot_\.hc-mono\]\:min-w-0 .hc-foot .hc-mono{min-width:0}.\[\&_\.hc-foot_\.hc-mono\]\:overflow-hidden .hc-foot .hc-mono{overflow:hidden}.\[\&_\.hc-foot_\.hc-mono\]\:text-ellipsis .hc-foot .hc-mono{text-overflow:ellipsis}.\[\&_\.hc-foot_\.hc-mono\]\:whitespace-nowrap .hc-foot .hc-mono{white-space:nowrap}.\[\&_\.hc-git\]\:mt-2\.5 .hc-git{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-git\]\:flex .hc-git{display:flex}.\[\&_\.hc-git\]\:flex-col .hc-git{flex-direction:column}.\[\&_\.hc-git\]\:gap-1 .hc-git{gap:var(--spacing)}.\[\&_\.hc-git\]\:border-t .hc-git{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.hc-git\]\:border-t-border-variant .hc-git{border-top-color:var(--border-variant)}.\[\&_\.hc-git\]\:pt-2 .hc-git{padding-top:calc(var(--spacing) * 2)}.\[\&_\.hc-git\]\:text-xs .hc-git{font-size:var(--fs-xs)}.\[\&_\.hc-git\]\:text-text .hc-git{color:var(--text)}.\[\&_\.hc-git-row\]\:flex .hc-git-row{display:flex}.\[\&_\.hc-git-row\]\:min-w-0 .hc-git-row{min-width:0}.\[\&_\.hc-git-row\]\:flex-wrap .hc-git-row{flex-wrap:wrap}.\[\&_\.hc-git-row\]\:items-center .hc-git-row{align-items:center}.\[\&_\.hc-git-row\]\:gap-2\.5 .hc-git-row{gap:calc(var(--spacing) * 2.5)}.\[\&_\.hc-head\]\:flex .hc-head{display:flex}.\[\&_\.hc-head\]\:items-baseline .hc-head{align-items:baseline}.\[\&_\.hc-head\]\:justify-between .hc-head{justify-content:space-between}.\[\&_\.hc-head\]\:gap-2\.5 .hc-head{gap:calc(var(--spacing) * 2.5)}.\[\&_\.hc-mono\]\:font-mono .hc-mono{font-family:var(--mono)}.\[\&_\.hc-slug\]\:min-w-0 .hc-slug{min-width:0}.\[\&_\.hc-slug\]\:overflow-hidden .hc-slug{overflow:hidden}.\[\&_\.hc-slug\]\:font-mono .hc-slug{font-family:var(--mono)}.\[\&_\.hc-slug\]\:text-md .hc-slug{font-size:var(--fs-md)}.\[\&_\.hc-slug\]\:font-semibold .hc-slug{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.hc-slug\]\:text-ellipsis .hc-slug{text-overflow:ellipsis}.\[\&_\.hc-slug\]\:whitespace-nowrap .hc-slug{white-space:nowrap}.\[\&_\.hc-stats\]\:mt-2\.5 .hc-stats{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-stats\]\:flex .hc-stats{display:flex}.\[\&_\.hc-stats\]\:flex-wrap .hc-stats{flex-wrap:wrap}.\[\&_\.hc-stats\]\:items-center .hc-stats{align-items:center}.\[\&_\.hc-stats\]\:gap-3 .hc-stats{gap:calc(var(--spacing) * 3)}.\[\&_\.hc-stats\]\:border-t .hc-stats{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.hc-stats\]\:border-t-border-variant .hc-stats{border-top-color:var(--border-variant)}.\[\&_\.hc-stats\]\:pt-2\.5 .hc-stats{padding-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-stats\]\:text-xs .hc-stats{font-size:var(--fs-xs)}.\[\&_\.hc-stats\]\:text-text .hc-stats{color:var(--text)}.\[\&_\.hc-title\]\:mt-\[3px\] .hc-title{margin-top:3px}.\[\&_\.hc-title\]\:text-text .hc-title{color:var(--text)}.\[\&_\.hc-toggle\]\:mt-1 .hc-toggle{margin-top:var(--spacing)}.\[\&_\.hc-toggle\]\:text-xs .hc-toggle{font-size:var(--fs-xs)}.\[\&_\.hc-toggle\]\:font-medium .hc-toggle{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.hc-toggle\]\:text-muted .hc-toggle{color:var(--muted)}.\[\&_\.hc-toggle\:hover\]\:text-text .hc-toggle:hover{color:var(--text)}.\[\&_\.home-inner\]\:max-w-140 .home-inner{max-width:calc(var(--spacing) * 140)}.\[\&_\.home-inner\]\:max-w-300 .home-inner{max-width:calc(var(--spacing) * 300)}.\[\&_\.home-inner\]\:pt-0 .home-inner{padding-top:0}.\[\&_\.home-inner\]\:pt-24 .home-inner{padding-top:calc(var(--spacing) * 24)}.\[\&_\.home-inner\]\:pb-0 .home-inner{padding-bottom:0}.\[\&_\.icon-btn\]\:ml-2 .icon-btn{margin-left:calc(var(--spacing) * 2)}.\[\&_\.icon-btn\]\:h-5\.5 .icon-btn{height:calc(var(--spacing) * 5.5)}.\[\&_\.icon-btn\]\:w-5\.5 .icon-btn{width:calc(var(--spacing) * 5.5)}.\[\&_\.icon-btn\]\:align-middle .icon-btn{vertical-align:middle}.\[\&_\.icon-btn\:hover\]\:text-accent-red .icon-btn:hover{color:var(--accent-red)}.\[\&_\.id\]\:font-mono .id{font-family:var(--mono)}.\[\&_\.id\]\:text-xs .id{font-size:var(--fs-xs)}.\[\&_\.id\]\:text-muted .id{color:var(--muted)}.\[\&_\.k\]\:text-subtext .k{color:var(--subtext)}.\[\&_\.katex\]\:text-\[1\.05em\] .katex{font-size:1.05em}.\[\&_\.katex-display\]\:mx-0 .katex-display{margin-inline:0}.\[\&_\.katex-display\]\:my-3 .katex-display{margin-block:calc(var(--spacing) * 3)}.\[\&_\.katex-display\]\:overflow-x-auto .katex-display{overflow-x:auto}.\[\&_\.katex-display\]\:overflow-y-hidden .katex-display{overflow-y:hidden}.\[\&_\.katex-display\]\:px-0 .katex-display{padding-inline:0}.\[\&_\.katex-display\]\:py-0\.5 .katex-display{padding-block:calc(var(--spacing) * .5)}.\[\&_\.kv\]\:grid-cols-\[132px_minmax\(0\,_1fr\)\] .kv{grid-template-columns:132px minmax(0,1fr)}.\[\&_\.kv\]\:items-center .kv{align-items:center}.\[\&_\.kv\]\:gap-x-4\.5 .kv{column-gap:calc(var(--spacing) * 4.5)}.\[\&_\.kv\]\:gap-y-1\.5 .kv{row-gap:calc(var(--spacing) * 1.5)}.\[\&_\.kv\]\:gap-y-\[9px\] .kv{row-gap:9px}.\[\&_\.kv_\.k\]\:text-sm .kv .k{font-size:var(--fs-sm)}.\[\&_\.kv_\.k\.mono\]\:font-mono .kv .k.mono{font-family:var(--mono)}.\[\&_\.kv_\.k\.mono\]\:text-sm .kv .k.mono{font-size:var(--fs-sm)}.\[\&_\.kv_\.v\]\:flex .kv .v{display:flex}.\[\&_\.kv_\.v\]\:min-w-0 .kv .v{min-width:0}.\[\&_\.kv_\.v\]\:flex-wrap .kv .v{flex-wrap:wrap}.\[\&_\.kv_\.v\]\:items-center .kv .v{align-items:center}.\[\&_\.kv_\.v\]\:gap-\[7px\] .kv .v{gap:7px}.\[\&_\.kv_\.v\]\:font-sans .kv .v{font-family:var(--sans)}.\[\&_\.kv_\.v\]\:text-md .kv .v{font-size:var(--fs-md)}.\[\&_\.kv_\.v\]\:break-normal .kv .v{overflow-wrap:normal;word-break:normal}.\[\&_\.kv_\.v_\.mono\]\:font-mono .kv .v .mono{font-family:var(--mono)}.\[\&_\.kv_\.v_\.mono\]\:text-sm .kv .v .mono{font-size:var(--fs-sm)}.\[\&_\.kv_\.v\.mono\]\:font-mono .kv .v.mono{font-family:var(--mono)}.\[\&_\.kv_\.v\.mono\]\:text-sm .kv .v.mono{font-size:var(--fs-sm)}.\[\&_\.md\]\:max-w-readable .md{max-width:var(--readable-col)}.\[\&_\.md\]\:text-base .md{font-size:var(--fs-base)}.\[\&_\.md\]\:leading-\[1\.65\] .md{--tw-leading:1.65;line-height:1.65}.\[\&_\.md\]\:text-text .md{color:var(--text)}.\[\&_\.md_h1\]\:mx-0 .md h1{margin-inline:0}.\[\&_\.md_h1\]\:mt-4\.5 .md h1{margin-top:calc(var(--spacing) * 4.5)}.\[\&_\.md_h1\]\:mb-2 .md h1{margin-bottom:calc(var(--spacing) * 2)}.\[\&_\.md_h1\]\:text-\[1\.5em\] .md h1{font-size:1.5em}.\[\&_\.md_h2\]\:mx-0 .md h2{margin-inline:0}.\[\&_\.md_h2\]\:mt-4 .md h2{margin-top:calc(var(--spacing) * 4)}.\[\&_\.md_h2\]\:mb-2 .md h2{margin-bottom:calc(var(--spacing) * 2)}.\[\&_\.md_h2\]\:text-\[1\.25em\] .md h2{font-size:1.25em}.\[\&_\.md_h3\]\:text-\[1\.1em\] .md h3{font-size:1.1em}.\[\&_\.model-id\]\:block .model-id{display:block}.\[\&_\.model-id\]\:font-mono .model-id{font-family:var(--mono)}.\[\&_\.model-id\]\:text-2xs .model-id{font-size:var(--fs-2xs)}.\[\&_\.model-id\]\:text-muted .model-id{color:var(--muted)}.\[\&_\.model-item\]\:pl-6 .model-item{padding-left:calc(var(--spacing) * 6)}.\[\&_\.model-item\]\:whitespace-nowrap .model-item{white-space:nowrap}.\[\&_\.model-item\:disabled\]\:cursor-default .model-item:disabled{cursor:default}.\[\&_\.model-item\:disabled\]\:text-muted .model-item:disabled{color:var(--muted)}.\[\&_\.model-item\:disabled\:hover\]\:bg-transparent .model-item:disabled:hover{background-color:#0000}.\[\&_\.name\]\:text-base .name{font-size:var(--fs-base)}.\[\&_\.name\]\:font-semibold .name{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.new-project-actions\]\:mt-2\.5 .new-project-actions{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.new-project-actions\]\:justify-start .new-project-actions{justify-content:flex-start}.\[\&_\.new-project-actions_\.primary\]\:ml-auto .new-project-actions .primary{margin-left:auto}.\[\&_\.node-action\]\:inline-flex .node-action{display:inline-flex}.\[\&_\.node-action\]\:items-center .node-action{align-items:center}.\[\&_\.node-action\]\:gap-\[5px\] .node-action{gap:5px}.\[\&_\.node-action\]\:rounded-sm .node-action{border-radius:6px}.\[\&_\.node-action\]\:px-1\.5 .node-action{padding-inline:calc(var(--spacing) * 1.5)}.\[\&_\.node-action\]\:py-\[3px\] .node-action{padding-block:3px}.\[\&_\.node-action\]\:text-xs .node-action{font-size:var(--fs-xs)}.\[\&_\.node-action\]\:font-medium .node-action{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.node-action\]\:text-text .node-action{color:var(--text)}.\[\&_\.node-action\]\:no-underline .node-action{text-decoration-line:none}.\[\&_\.node-action-ext\]\:ml-auto .node-action-ext{margin-left:auto}.\[\&_\.node-action-ext\]\:px-\[5px\] .node-action-ext{padding-inline:5px}.\[\&_\.node-action-ext\]\:py-\[3px\] .node-action-ext{padding-block:3px}.\[\&_\.node-action\:hover\]\:bg-surface .node-action:hover{background-color:var(--surface)}.\[\&_\.node-action\:hover\]\:text-text .node-action:hover{color:var(--text)}.\[\&_\.node-actions\]\:mt-2 .node-actions{margin-top:calc(var(--spacing) * 2)}.\[\&_\.node-actions\]\:flex .node-actions{display:flex}.\[\&_\.node-actions\]\:items-center .node-actions{align-items:center}.\[\&_\.node-actions\]\:gap-\[3px\] .node-actions{gap:3px}.\[\&_\.node-actions\]\:border-t .node-actions{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.node-actions\]\:border-t-border-variant .node-actions{border-top-color:var(--border-variant)}.\[\&_\.node-actions\]\:pt-1\.5 .node-actions{padding-top:calc(var(--spacing) * 1.5)}.\[\&_\.node-eyebrow\]\:mb-1\.5 .node-eyebrow{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_\.node-eyebrow\]\:flex .node-eyebrow{display:flex}.\[\&_\.node-eyebrow\]\:items-center .node-eyebrow{align-items:center}.\[\&_\.node-eyebrow\]\:justify-between .node-eyebrow{justify-content:space-between}.\[\&_\.node-eyebrow\]\:gap-2 .node-eyebrow{gap:calc(var(--spacing) * 2)}.\[\&_\.node-eyebrow\]\:text-2xs .node-eyebrow{font-size:var(--fs-2xs)}.\[\&_\.node-eyebrow\]\:font-medium .node-eyebrow{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.node-eyebrow\]\:text-muted .node-eyebrow{color:var(--muted)}.\[\&_\.node-head\]\:flex .node-head{display:flex}.\[\&_\.node-head\]\:min-w-0 .node-head{min-width:0}.\[\&_\.node-head\]\:items-center .node-head{align-items:center}.\[\&_\.node-head\]\:gap-\[7px\] .node-head{gap:7px}.\[\&_\.node-meta\]\:mt-2 .node-meta{margin-top:calc(var(--spacing) * 2)}.\[\&_\.node-meta\]\:flex .node-meta{display:flex}.\[\&_\.node-meta\]\:items-center .node-meta{align-items:center}.\[\&_\.node-meta\]\:gap-2 .node-meta{gap:calc(var(--spacing) * 2)}.\[\&_\.node-meta\]\:text-2xs .node-meta{font-size:var(--fs-2xs)}.\[\&_\.node-meta\]\:text-muted .node-meta{color:var(--muted)}.\[\&_\.node-overview-link\]\:block .node-overview-link{display:block}.\[\&_\.node-overview-link\]\:w-full .node-overview-link{width:100%}.\[\&_\.node-overview-link\]\:cursor-pointer .node-overview-link{cursor:pointer}.\[\&_\.node-overview-link\]\:border-0 .node-overview-link{border-style:var(--tw-border-style);border-width:0}.\[\&_\.node-overview-link\]\:bg-transparent .node-overview-link{background-color:#0000}.\[\&_\.node-overview-link\]\:p-0 .node-overview-link{padding:0}.\[\&_\.node-overview-link\]\:text-left .node-overview-link{text-align:left}.\[\&_\.node-overview-link\]\:text-inherit .node-overview-link{color:inherit}.\[\&_\.node-overview-link\]\:\[font\:inherit\] .node-overview-link{font:inherit}.\[\&_\.node-overview-link\:focus-visible\]\:rounded-xs .node-overview-link:focus-visible{border-radius:4px}.\[\&_\.node-overview-link\:focus-visible\]\:outline-2 .node-overview-link:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.\[\&_\.node-overview-link\:focus-visible\]\:outline-offset-4 .node-overview-link:focus-visible{outline-offset:4px}.\[\&_\.node-overview-link\:focus-visible\]\:outline-accent .node-overview-link:focus-visible{outline-color:var(--accent)}.\[\&_\.node-overview-link\:focus-visible\]\:outline-solid .node-overview-link:focus-visible{--tw-outline-style:solid;outline-style:solid}.\[\&_\.node-overview-link\:hover_\.node-slug\]\:underline .node-overview-link:hover .node-slug{text-decoration-line:underline}.\[\&_\.node-overview-link\:hover_\.node-slug\]\:underline-offset-\[3px\] .node-overview-link:hover .node-slug{text-underline-offset:3px}.\[\&_\.node-slug\]\:min-w-0 .node-slug{min-width:0}.\[\&_\.node-slug\]\:flex-1 .node-slug{flex:1}.\[\&_\.node-slug\]\:overflow-hidden .node-slug{overflow:hidden}.\[\&_\.node-slug\]\:font-mono .node-slug{font-family:var(--mono)}.\[\&_\.node-slug\]\:text-sm .node-slug{font-size:var(--fs-sm)}.\[\&_\.node-slug\]\:font-semibold .node-slug{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.node-slug\]\:text-ellipsis .node-slug{text-overflow:ellipsis}.\[\&_\.node-slug\]\:whitespace-nowrap .node-slug{white-space:nowrap}.\[\&_\.node-slug\]\:text-text .node-slug{color:var(--text)}.\[\&_\.node-status\]\:h-2 .node-status{height:calc(var(--spacing) * 2)}.\[\&_\.node-status\]\:w-2 .node-status{width:calc(var(--spacing) * 2)}.\[\&_\.node-status\]\:shrink-0 .node-status{flex-shrink:0}.\[\&_\.node-status\]\:rounded-full .node-status{border-radius:999px}.\[\&_\.node-title\]\:mt-1 .node-title{margin-top:var(--spacing)}.\[\&_\.node-title\]\:line-clamp-2 .node-title{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&_\.node-title\]\:text-sm .node-title{font-size:var(--fs-sm)}.\[\&_\.node-title\]\:text-text .node-title{color:var(--text)}.\[\&_\.onb-token-form\]\:mt-2\.5 .onb-token-form{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.openresearch-diff-file\]\:w-full .openresearch-diff-file{width:100%}.\[\&_\.openresearch-diff-file\]\:text-sm .openresearch-diff-file{font-size:var(--fs-sm)}.\[\&_\.openresearch-diff-file\]\:leading-\[1\.55\] .openresearch-diff-file{--tw-leading:1.55;line-height:1.55}.\[\&_\.openresearch-diff-file\]\:\[--diff-background-color\:var\(--base\)\] .openresearch-diff-file{--diff-background-color:var(--base)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-background-color\:var\(--openresearch-diff-delete-code-background-color\)\] .openresearch-diff-file{--diff-code-delete-background-color:var(--openresearch-diff-delete-code-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-edit-background-color\:var\(--openresearch-diff-delete-edit-background-color\)\] .openresearch-diff-file{--diff-code-delete-edit-background-color:var(--openresearch-diff-delete-edit-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-edit-text-color\:var\(--diff-text-color\)\] .openresearch-diff-file{--diff-code-delete-edit-text-color:var(--diff-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-text-color\:var\(--diff-text-color\)\] .openresearch-diff-file{--diff-code-delete-text-color:var(--diff-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-background-color\:var\(--openresearch-diff-insert-code-background-color\)\] .openresearch-diff-file{--diff-code-insert-background-color:var(--openresearch-diff-insert-code-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-edit-background-color\:var\(--openresearch-diff-insert-edit-background-color\)\] .openresearch-diff-file{--diff-code-insert-edit-background-color:var(--openresearch-diff-insert-edit-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-edit-text-color\:var\(--diff-text-color\)\] .openresearch-diff-file{--diff-code-insert-edit-text-color:var(--diff-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-text-color\:var\(--diff-text-color\)\] .openresearch-diff-file{--diff-code-insert-text-color:var(--diff-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-selected-background-color\:var\(--diff-selection-background-color\)\] .openresearch-diff-file{--diff-code-selected-background-color:var(--diff-selection-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-selected-text-color\:var\(--diff-selection-text-color\)\] .openresearch-diff-file{--diff-code-selected-text-color:var(--diff-selection-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-font-family\:var\(--mono\)\] .openresearch-diff-file{--diff-font-family:var(--mono)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-delete-background-color\:var\(--openresearch-diff-delete-gutter-background-color\)\] .openresearch-diff-file{--diff-gutter-delete-background-color:var(--openresearch-diff-delete-gutter-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-delete-text-color\:var\(--accent-red\)\] .openresearch-diff-file{--diff-gutter-delete-text-color:var(--accent-red)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-insert-background-color\:var\(--openresearch-diff-insert-gutter-background-color\)\] .openresearch-diff-file{--diff-gutter-insert-background-color:var(--openresearch-diff-insert-gutter-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-insert-text-color\:var\(--accent-green\)\] .openresearch-diff-file{--diff-gutter-insert-text-color:var(--accent-green)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-selected-background-color\:var\(--openresearch-diff-gutter-selection-background-color\)\] .openresearch-diff-file{--diff-gutter-selected-background-color:var(--openresearch-diff-gutter-selection-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-selected-text-color\:var\(--diff-selection-text-color\)\] .openresearch-diff-file{--diff-gutter-selected-text-color:var(--diff-selection-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-omit-gutter-line-color\:var\(--openresearch-diff-omit-gutter-line-color\)\] .openresearch-diff-file{--diff-omit-gutter-line-color:var(--openresearch-diff-omit-gutter-line-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-selection-background-color\:var\(--openresearch-diff-selection-background-color\)\] .openresearch-diff-file{--diff-selection-background-color:var(--openresearch-diff-selection-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-selection-text-color\:var\(--primary\)\] .openresearch-diff-file{--diff-selection-text-color:var(--primary)}.\[\&_\.openresearch-diff-file\]\:\[--diff-text-color\:var\(--text\)\] .openresearch-diff-file{--diff-text-color:var(--text)}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-code-background-color\:color-mix\(_in_oklab\,_var\(--base\)_92\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-code-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-code-background-color\:color-mix\(_in_oklab\,_var\(--base\)_92\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-code-background-color:color-mix(in oklab, var(--base) 92%, var(--accent-red))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-edit-background-color\:color-mix\(_in_oklab\,_var\(--base\)_78\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-edit-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-edit-background-color\:color-mix\(_in_oklab\,_var\(--base\)_78\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-edit-background-color:color-mix(in oklab, var(--base) 78%, var(--accent-red))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-gutter-background-color\:color-mix\(_in_oklab\,_var\(--base\)_86\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-gutter-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-gutter-background-color\:color-mix\(_in_oklab\,_var\(--base\)_86\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-gutter-background-color:color-mix(in oklab, var(--base) 86%, var(--accent-red))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-divider-color\:var\(--border\)\] .openresearch-diff-file{--openresearch-diff-divider-color:var(--border)}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-gutter-selection-background-color\:color-mix\(_in_oklab\,_var\(--surface\)_68\%\,_var\(--primary\)_\)\] .openresearch-diff-file{--openresearch-diff-gutter-selection-background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-gutter-selection-background-color\:color-mix\(_in_oklab\,_var\(--surface\)_68\%\,_var\(--primary\)_\)\] .openresearch-diff-file{--openresearch-diff-gutter-selection-background-color:color-mix(in oklab, var(--surface) 68%, var(--primary))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-code-background-color\:color-mix\(_in_oklab\,_var\(--base\)_91\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-code-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-code-background-color\:color-mix\(_in_oklab\,_var\(--base\)_91\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-code-background-color:color-mix(in oklab, var(--base) 91%, var(--accent-green))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-edit-background-color\:color-mix\(_in_oklab\,_var\(--base\)_72\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-edit-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-edit-background-color\:color-mix\(_in_oklab\,_var\(--base\)_72\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-edit-background-color:color-mix(in oklab, var(--base) 72%, var(--accent-green))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-gutter-background-color\:color-mix\(_in_oklab\,_var\(--base\)_84\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-gutter-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-gutter-background-color\:color-mix\(_in_oklab\,_var\(--base\)_84\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-gutter-background-color:color-mix(in oklab, var(--base) 84%, var(--accent-green))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-omit-gutter-line-color\:color-mix\(in_oklab\,_var\(--base\)_86\%\,_var\(--text\)\)\] .openresearch-diff-file{--openresearch-diff-omit-gutter-line-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-omit-gutter-line-color\:color-mix\(in_oklab\,_var\(--base\)_86\%\,_var\(--text\)\)\] .openresearch-diff-file{--openresearch-diff-omit-gutter-line-color:color-mix(in oklab, var(--base) 86%, var(--text))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-selection-background-color\:color-mix\(_in_oklab\,_var\(--surface\)_76\%\,_var\(--primary\)_\)\] .openresearch-diff-file{--openresearch-diff-selection-background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-selection-background-color\:color-mix\(_in_oklab\,_var\(--surface\)_76\%\,_var\(--primary\)_\)\] .openresearch-diff-file{--openresearch-diff-selection-background-color:color-mix(in oklab, var(--surface) 76%, var(--primary))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-unified-gutter-text-color\:color-mix\(in_oklab\,_var\(--text\)_45\%\,_var\(--base\)\)\] .openresearch-diff-file{--openresearch-diff-unified-gutter-text-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-unified-gutter-text-color\:color-mix\(in_oklab\,_var\(--text\)_45\%\,_var\(--base\)\)\] .openresearch-diff-file{--openresearch-diff-unified-gutter-text-color:color-mix(in oklab, var(--text) 45%, var(--base))}}.\[\&_\.openresearch-diff-file_\.diff-code\]\:px-4 .openresearch-diff-file .diff-code{padding-inline:calc(var(--spacing) * 4)}.\[\&_\.openresearch-diff-file_\.diff-code\]\:py-0 .openresearch-diff-file .diff-code{padding-block:0}.\[\&_\.openresearch-diff-file_\.diff-code\]\:break-normal .openresearch-diff-file .diff-code{overflow-wrap:normal;word-break:normal}.\[\&_\.openresearch-diff-file_\.diff-code\]\:wrap-normal .openresearch-diff-file .diff-code{overflow-wrap:normal}.\[\&_\.openresearch-diff-file_\.diff-code\]\:whitespace-pre .openresearch-diff-file .diff-code{white-space:pre}.\[\&_\.openresearch-diff-file_\.diff-hunk_\+_\.diff-hunk_\.diff-line\:first-child_\>_td\]\:border-t .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.openresearch-diff-file_\.diff-hunk_\+_\.diff-hunk_\.diff-line\:first-child_\>_td\]\:border-t-\[var\(--openresearch-diff-divider-color\)\] .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top-color:var(--openresearch-diff-divider-color)}.\[\&_\.openresearch-diff-file_\.diff-line\]\:leading-\[1\.55\] .openresearch-diff-file .diff-line{--tw-leading:1.55;line-height:1.55}.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-delete\)\]\:bg-\[var\(--openresearch-diff-delete-code-background-color\)\] .openresearch-diff-file .diff-line:has(.diff-code-delete){background-color:var(--openresearch-diff-delete-code-background-color)}.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-insert\)\]\:bg-\[var\(--openresearch-diff-insert-code-background-color\)\] .openresearch-diff-file .diff-line:has(.diff-code-insert){background-color:var(--openresearch-diff-insert-code-background-color)}.\[\&_\.openresearch-diff-file\.diff-unified\]\:table-auto .openresearch-diff-file.diff-unified{table-layout:auto}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:first-child\]\:hidden .openresearch-diff-file.diff-unified .diff-line>td:first-child{display:none}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:sticky .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){position:sticky}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:left-0 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){left:0}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:z-1 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){z-index:1}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:w-\[1\%\] .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){width:1%}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:cursor-default .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){cursor:default}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:border-r .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){border-right-style:var(--tw-border-style);border-right-width:1px}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:border-r-\[var\(--openresearch-diff-divider-color\)\] .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){border-right-color:var(--openresearch-diff-divider-color)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pt-0 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-top:0}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pr-2\.5 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-right:calc(var(--spacing) * 2.5)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pb-0 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-bottom:0}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pl-3\.5 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-left:calc(var(--spacing) * 3.5)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:text-right .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){text-align:right}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:whitespace-nowrap .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){white-space:nowrap}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:text-\[var\(--openresearch-diff-unified-gutter-text-color\)\] .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){color:var(--openresearch-diff-unified-gutter-text-color)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:select-none .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){-webkit-user-select:none;user-select:none}.\[\&_\.openresearch-diff-file\.diff-unified_col\.diff-gutter-col\:first-child\]\:collapse .openresearch-diff-file.diff-unified col.diff-gutter-col:first-child{visibility:collapse}.\[\&_\.openresearch-diff-file\.diff-unified_col\.diff-gutter-col\:first-child\]\:w-0 .openresearch-diff-file.diff-unified col.diff-gutter-col:first-child{width:0}.\[\&_\.openresearch-diff-file\.diff-unified_col\.diff-gutter-col\:nth-child\(2\)\]\:w-\[1\%\] .openresearch-diff-file.diff-unified col.diff-gutter-col:nth-child(2){width:1%}.\[\&_\.paper\]\:text-xs .paper{font-size:var(--fs-xs)}.\[\&_\.paper\]\:text-muted .paper{color:var(--muted)}.\[\&_\.paper-destination\]\:flex .paper-destination{display:flex}.\[\&_\.paper-destination\]\:items-center .paper-destination{align-items:center}.\[\&_\.paper-destination\]\:gap-2\.5 .paper-destination{gap:calc(var(--spacing) * 2.5)}.\[\&_\.paper-destination\]\:rounded-md .paper-destination{border-radius:8px}.\[\&_\.paper-destination\]\:border .paper-destination{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.paper-destination\]\:border-border .paper-destination{border-color:var(--border)}.\[\&_\.paper-destination\]\:bg-background .paper-destination{background-color:var(--base)}.\[\&_\.paper-destination\]\:pt-2 .paper-destination{padding-top:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pr-2 .paper-destination{padding-right:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pb-2 .paper-destination{padding-bottom:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pl-3 .paper-destination{padding-left:calc(var(--spacing) * 3)}.\[\&_\.paper-destination_\.btn\]\:flex-none .paper-destination .btn{flex:none}.\[\&_\.paper-destination_code\]\:min-w-0 .paper-destination code{min-width:0}.\[\&_\.paper-destination_code\]\:flex-1 .paper-destination code{flex:1}.\[\&_\.paper-destination_code\]\:overflow-hidden .paper-destination code{overflow:hidden}.\[\&_\.paper-destination_code\]\:text-sm .paper-destination code{font-size:var(--fs-sm)}.\[\&_\.paper-destination_code\]\:font-normal .paper-destination code{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_\.paper-destination_code\]\:text-ellipsis .paper-destination code{text-overflow:ellipsis}.\[\&_\.paper-destination_code\]\:whitespace-nowrap .paper-destination code{white-space:nowrap}.\[\&_\.paper-destination_code\]\:text-text .paper-destination code{color:var(--text)}.\[\&_\.paper-pick\]\:flex .paper-pick{display:flex}.\[\&_\.paper-pick\]\:items-center .paper-pick{align-items:center}.\[\&_\.paper-pick\]\:justify-between .paper-pick{justify-content:space-between}.\[\&_\.paper-pick\]\:gap-2\.5 .paper-pick{gap:calc(var(--spacing) * 2.5)}.\[\&_\.paper-pick\]\:rounded-md .paper-pick{border-radius:8px}.\[\&_\.paper-pick\]\:border .paper-pick{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.paper-pick\]\:border-border .paper-pick{border-color:var(--border)}.\[\&_\.paper-pick\]\:bg-surface .paper-pick{background-color:var(--surface)}.\[\&_\.paper-pick\]\:px-3 .paper-pick{padding-inline:calc(var(--spacing) * 3)}.\[\&_\.paper-pick\]\:py-2\.5 .paper-pick{padding-block:calc(var(--spacing) * 2.5)}.\[\&_\.paper-pick_\.id\]\:font-mono .paper-pick .id{font-family:var(--mono)}.\[\&_\.paper-pick_\.id\]\:text-xs .paper-pick .id{font-size:var(--fs-xs)}.\[\&_\.paper-pick_\.id\]\:text-muted .paper-pick .id{color:var(--muted)}.\[\&_\.paper-pick_\.meta\]\:min-w-0 .paper-pick .meta{min-width:0}.\[\&_\.paper-pick_\.title\]\:text-md .paper-pick .title{font-size:var(--fs-md)}.\[\&_\.paper-pick_\.title\]\:font-semibold .paper-pick .title{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.paper-results\]\:flex .paper-results{display:flex}.\[\&_\.paper-results\]\:max-h-60 .paper-results{max-height:calc(var(--spacing) * 60)}.\[\&_\.paper-results\]\:flex-col .paper-results{flex-direction:column}.\[\&_\.paper-results\]\:overflow-y-auto .paper-results{overflow-y:auto}.\[\&_\.paper-results\]\:rounded-md .paper-results{border-radius:8px}.\[\&_\.paper-results\]\:border .paper-results{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.paper-results\]\:border-border .paper-results{border-color:var(--border)}.\[\&_\.paper-results_\.id\]\:font-mono .paper-results .id{font-family:var(--mono)}.\[\&_\.paper-results_\.id\]\:text-xs .paper-results .id{font-size:var(--fs-xs)}.\[\&_\.paper-results_\.id\]\:text-muted .paper-results .id{color:var(--muted)}.\[\&_\.paper-results_\.title\]\:text-md .paper-results .title{font-size:var(--fs-md)}.\[\&_\.paper-results_\.title\]\:font-medium .paper-results .title{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.paper-results_button\]\:flex .paper-results button{display:flex}.\[\&_\.paper-results_button\]\:cursor-pointer .paper-results button{cursor:pointer}.\[\&_\.paper-results_button\]\:flex-col .paper-results button{flex-direction:column}.\[\&_\.paper-results_button\]\:items-start .paper-results button{align-items:flex-start}.\[\&_\.paper-results_button\]\:gap-0\.5 .paper-results button{gap:calc(var(--spacing) * .5)}.\[\&_\.paper-results_button\]\:border-0 .paper-results button{border-style:var(--tw-border-style);border-width:0}.\[\&_\.paper-results_button\]\:border-b .paper-results button{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_\.paper-results_button\]\:border-b-border-variant .paper-results button{border-bottom-color:var(--border-variant)}.\[\&_\.paper-results_button\]\:bg-transparent .paper-results button{background-color:#0000}.\[\&_\.paper-results_button\]\:bg-none .paper-results button{background-image:none}.\[\&_\.paper-results_button\]\:px-2\.5 .paper-results button{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_\.paper-results_button\]\:py-2 .paper-results button{padding-block:calc(var(--spacing) * 2)}.\[\&_\.paper-results_button\]\:text-left .paper-results button{text-align:left}.\[\&_\.paper-results_button\]\:text-text .paper-results button{color:var(--text)}.\[\&_\.paper-results_button\]\:\[font\:inherit\] .paper-results button{font:inherit}.\[\&_\.paper-results_button\:hover\]\:bg-surface .paper-results button:hover{background-color:var(--surface)}.\[\&_\.paper-results_button\:last-child\]\:border-b-0 .paper-results button:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&_\.path\]\:flex .path{display:flex}.\[\&_\.path\]\:min-w-0 .path{min-width:0}.\[\&_\.path\]\:flex-1 .path{flex:1}.\[\&_\.path\]\:items-center .path{align-items:center}.\[\&_\.path\]\:gap-2 .path{gap:calc(var(--spacing) * 2)}.\[\&_\.path_code\]\:min-w-0 .path code{min-width:0}.\[\&_\.path_code\]\:flex-1 .path code{flex:1}.\[\&_\.path_code\]\:overflow-hidden .path code{overflow:hidden}.\[\&_\.path_code\]\:font-mono .path code{font-family:var(--mono)}.\[\&_\.path_code\]\:text-xs .path code{font-size:var(--fs-xs)}.\[\&_\.path_code\]\:font-semibold .path code{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.path_code\]\:text-ellipsis .path code{text-overflow:ellipsis}.\[\&_\.path_code\]\:whitespace-nowrap .path code{white-space:nowrap}.\[\&_\.path_code\]\:text-text .path code{color:var(--text)}.\[\&_\.plan-strip-caret\]\:flex .plan-strip-caret{display:flex}.\[\&_\.plan-strip-caret\]\:items-center .plan-strip-caret{align-items:center}.\[\&_\.plan-strip-caret\]\:rounded-tl-none .plan-strip-caret{border-top-left-radius:0}.\[\&_\.plan-strip-caret\]\:rounded-bl-none .plan-strip-caret{border-bottom-left-radius:0}.\[\&_\.plan-strip-caret\]\:border-l .plan-strip-caret{border-left-style:var(--tw-border-style);border-left-width:1px}.\[\&_\.plan-strip-caret\]\:border-l-\[color-mix\(in_oklab\,_var\(--base\)_35\%\,_var\(--text\)\)\] .plan-strip-caret{border-left-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.plan-strip-caret\]\:border-l-\[color-mix\(in_oklab\,_var\(--base\)_35\%\,_var\(--text\)\)\] .plan-strip-caret{border-left-color:color-mix(in oklab,var(--base) 35%,var(--text))}}.\[\&_\.plan-strip-caret\]\:px-1\.5 .plan-strip-caret{padding-inline:calc(var(--spacing) * 1.5)}.\[\&_\.plan-strip-caret\]\:py-0 .plan-strip-caret{padding-block:0}.\[\&_\.plan-strip-primary\]\:border-text .plan-strip-primary{border-color:var(--text)}.\[\&_\.plan-strip-primary\]\:bg-text .plan-strip-primary{background-color:var(--text)}.\[\&_\.plan-strip-primary\]\:text-background .plan-strip-primary{color:var(--base)}.\[\&_\.plan-strip-primary\:hover\:not\(\:disabled\)\]\:border-text .plan-strip-primary:hover:not(:disabled){border-color:var(--text)}.\[\&_\.plan-strip-primary\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_85\%\,_var\(--base\)\)\] .plan-strip-primary:hover:not(:disabled){background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.plan-strip-primary\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_85\%\,_var\(--base\)\)\] .plan-strip-primary:hover:not(:disabled){background-color:color-mix(in oklab,var(--text) 85%,var(--base))}}.\[\&_\.plan-strip-primary\:hover\:not\(\:disabled\)\]\:text-background .plan-strip-primary:hover:not(:disabled){color:var(--base)}.\[\&_\.progress\]\:mx-0 .progress{margin-inline:0}.\[\&_\.progress\]\:mt-2 .progress{margin-top:calc(var(--spacing) * 2)}.\[\&_\.progress\]\:mb-0 .progress{margin-bottom:0}.\[\&_\.progress-track\]\:h-\[5px\] .progress-track{height:5px}.\[\&_\.progress-track\]\:border-0 .progress-track{border-style:var(--tw-border-style);border-width:0}.\[\&_\.progress-track\]\:bg-border .progress-track{background-color:var(--border)}.\[\&_\.project-back\]\:shrink-0 .project-back{flex-shrink:0}.\[\&_\.project-chevron\]\:text-muted .project-chevron{color:var(--muted)}.\[\&_\.project-chevron\]\:opacity-0 .project-chevron{opacity:0}.\[\&_\.project-chevron\]\:transition-transform .project-chevron{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_\.project-chevron\]\:duration-120 .project-chevron{--tw-duration:.12s;transition-duration:.12s}.\[\&_\.project-chevron\]\:ease-standard .project-chevron{--tw-ease:ease;transition-timing-function:ease}.\[\&_\.project-delete\]\:absolute .project-delete{position:absolute}.\[\&_\.project-delete\]\:top-2\.5 .project-delete{top:calc(var(--spacing) * 2.5)}.\[\&_\.project-delete\]\:right-2\.5 .project-delete{right:calc(var(--spacing) * 2.5)}.\[\&_\.project-delete\]\:z-2 .project-delete{z-index:2}.\[\&_\.project-delete\]\:hidden .project-delete{display:none}.\[\&_\.project-delete\]\:rounded-sm .project-delete{border-radius:6px}.\[\&_\.project-delete\]\:p-\[5px\] .project-delete{padding:5px}.\[\&_\.project-delete\]\:leading-\[0\] .project-delete{--tw-leading:0;line-height:0}.\[\&_\.project-delete\]\:text-muted .project-delete{color:var(--muted)}.\[\&_\.project-field-label\]\:text-base .project-field-label{font-size:var(--fs-base)}.\[\&_\.project-field-label\]\:font-semibold .project-field-label{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.project-field-label\]\:text-text .project-field-label{color:var(--text)}.\[\&_\.project-location-field\]\:flex .project-location-field{display:flex}.\[\&_\.project-location-field\]\:flex-col .project-location-field{flex-direction:column}.\[\&_\.project-location-field\]\:gap-2 .project-location-field{gap:calc(var(--spacing) * 2)}.\[\&_\.project-location-label\]\:text-base .project-location-label{font-size:var(--fs-base)}.\[\&_\.project-location-label\]\:font-semibold .project-location-label{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.project-location-label\]\:text-text .project-location-label{color:var(--text)}.\[\&_\.project-menu\]\:left-0 .project-menu{left:0}.\[\&_\.project-menu\]\:z-70 .project-menu{z-index:70}.\[\&_\.project-menu\]\:w-52\.5 .project-menu{width:calc(var(--spacing) * 52.5)}.\[\&_\.project-path-notice\]\:rounded-sm .project-path-notice{border-radius:6px}.\[\&_\.project-path-notice\]\:border .project-path-notice{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.project-path-notice\]\:border-border-variant .project-path-notice{border-color:var(--border-variant)}.\[\&_\.project-path-notice\]\:bg-surface .project-path-notice{background-color:var(--surface)}.\[\&_\.project-path-notice\]\:px-\[11px\] .project-path-notice{padding-inline:11px}.\[\&_\.project-path-notice\]\:py-\[9px\] .project-path-notice{padding-block:9px}.\[\&_\.project-path-notice\]\:text-sm .project-path-notice{font-size:var(--fs-sm)}.\[\&_\.project-path-notice\]\:leading-\[1\.4\] .project-path-notice{--tw-leading:1.4;line-height:1.4}.\[\&_\.project-path-notice\]\:text-subtext .project-path-notice{color:var(--subtext)}.\[\&_\.project-path-notice\.error\]\:border-\[color-mix\(in_srgb\,_var\(--accent-red\)_35\%\,_var\(--border-variant\)\)\] .project-path-notice.error{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.project-path-notice\.error\]\:border-\[color-mix\(in_srgb\,_var\(--accent-red\)_35\%\,_var\(--border-variant\)\)\] .project-path-notice.error{border-color:color-mix(in srgb,var(--accent-red) 35%,var(--border-variant))}}.\[\&_\.project-switcher\]\:relative .project-switcher{position:relative}.\[\&_\.project-switcher\]\:min-w-0 .project-switcher{min-width:0}.\[\&_\.project-switcher\]\:flex-1 .project-switcher{flex:1}.\[\&_\.project-switcher\]\:self-stretch .project-switcher{align-self:stretch}.\[\&_\.rail-body\]\:min-h-0 .rail-body{min-height:0}.\[\&_\.rail-body\]\:flex-1 .rail-body{flex:1}.\[\&_\.rail-body\]\:overflow-y-auto .rail-body{overflow-y:auto}.\[\&_\.rail-body\]\:px-2 .rail-body{padding-inline:calc(var(--spacing) * 2)}.\[\&_\.rail-body\]\:py-1 .rail-body{padding-block:var(--spacing)}.\[\&_\.react-flow\\_\\_attribution\]\:hidden\! .react-flow__attribution{display:none!important}.\[\&_\.react-flow\\_\\_handle\]\:pointer-events-none .react-flow__handle{pointer-events:none}.\[\&_\.react-flow\\_\\_handle\]\:opacity-0 .react-flow__handle{opacity:0}.\[\&_\.react-flow\\_\\_node\.react-flow\\_\\_node-elided\.selectable\]\:cursor-pointer .react-flow__node.react-flow__node-elided.selectable{cursor:pointer}.\[\&_\.react-flow\\_\\_node\.react-flow\\_\\_node-exp\.selectable\]\:cursor-default .react-flow__node.react-flow__node-exp.selectable{cursor:default}.\[\&_\.repo-hint\]\:font-mono .repo-hint{font-family:var(--mono)}.\[\&_\.repo-hint\]\:text-xs .repo-hint{font-size:var(--fs-xs)}.\[\&_\.repo-hint\]\:font-normal .repo-hint{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_\.repo-hint\]\:text-muted .repo-hint{color:var(--muted)}.\[\&_\.repo-hint\.ok\]\:text-accent-teal .repo-hint.ok{color:var(--accent-teal)}.\[\&_\.row2\]\:grid .row2{display:grid}.\[\&_\.row2\]\:grid-cols-2 .row2{grid-template-columns:repeat(2,minmax(0,1fr))}.\[\&_\.row2\]\:gap-2\.5 .row2{gap:calc(var(--spacing) * 2.5)}.\[\&_\.run-chip_svg\]\:text-primary .run-chip svg{color:var(--primary)}.\[\&_\.run-chip_svg\]\:opacity-100 .run-chip svg{opacity:1}.\[\&_\.run-label\]\:text-sm .run-label{font-size:var(--fs-sm)}.\[\&_\.run-label\]\:font-semibold .run-label,.\[\&_\.sel\]\:font-semibold .sel{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.sel\]\:text-text .sel{color:var(--text)}.\[\&_\.session-dot\]\:inline-flex .session-dot{display:inline-flex}.\[\&_\.session-dot\]\:w-3\.5 .session-dot{width:calc(var(--spacing) * 3.5)}.\[\&_\.session-dot\]\:shrink-0 .session-dot{flex-shrink:0}.\[\&_\.session-dot\]\:items-center .session-dot{align-items:center}.\[\&_\.session-dot\]\:justify-center .session-dot{justify-content:center}.\[\&_\.session-menu-btn\]\:mx-0 .session-menu-btn{margin-inline:0}.\[\&_\.session-menu-btn\]\:-my-0\.5 .session-menu-btn{margin-block:calc(var(--spacing) * -.5)}.\[\&_\.session-menu-btn\]\:hidden .session-menu-btn{display:none}.\[\&_\.session-menu-btn\]\:h-4 .session-menu-btn{height:calc(var(--spacing) * 4)}.\[\&_\.session-menu-btn\]\:w-4 .session-menu-btn{width:calc(var(--spacing) * 4)}.\[\&_\.session-menu-btn\]\:shrink-0 .session-menu-btn{flex-shrink:0}.\[\&_\.session-menu-btn\]\:items-center .session-menu-btn{align-items:center}.\[\&_\.session-menu-btn\]\:justify-center .session-menu-btn{justify-content:center}.\[\&_\.session-menu-btn\]\:rounded-sm .session-menu-btn{border-radius:6px}.\[\&_\.session-menu-btn\]\:text-muted .session-menu-btn{color:var(--muted)}.\[\&_\.session-menu-btn\:hover\]\:bg-panel .session-menu-btn:hover{background-color:var(--panel)}.\[\&_\.session-menu-btn\:hover\]\:text-text .session-menu-btn:hover{color:var(--text)}.\[\&_\.session-time\]\:shrink-0 .session-time{flex-shrink:0}.\[\&_\.session-time\]\:text-2xs .session-time{font-size:var(--fs-2xs)}.\[\&_\.session-time\]\:text-muted .session-time{color:var(--muted)}.\[\&_\.session-title\]\:min-w-0 .session-title{min-width:0}.\[\&_\.session-title\]\:flex-1 .session-title{flex:1}.\[\&_\.session-title\]\:overflow-hidden .session-title{overflow:hidden}.\[\&_\.session-title\]\:text-ellipsis .session-title{text-overflow:ellipsis}.\[\&_\.session-title\]\:whitespace-nowrap .session-title{white-space:nowrap}.\[\&_\.session-title-input\]\:mx-0 .session-title-input{margin-inline:0}.\[\&_\.session-title-input\]\:-my-0\.5 .session-title-input{margin-block:calc(var(--spacing) * -.5)}.\[\&_\.session-title-input\]\:min-w-0 .session-title-input{min-width:0}.\[\&_\.session-title-input\]\:flex-1 .session-title-input{flex:1}.\[\&_\.session-title-input\]\:rounded-sm .session-title-input{border-radius:6px}.\[\&_\.session-title-input\]\:border .session-title-input{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.session-title-input\]\:border-primary .session-title-input{border-color:var(--primary)}.\[\&_\.session-title-input\]\:bg-background .session-title-input{background-color:var(--base)}.\[\&_\.session-title-input\]\:px-\[5px\] .session-title-input{padding-inline:5px}.\[\&_\.session-title-input\]\:py-px .session-title-input{padding-block:1px}.\[\&_\.session-title-input\]\:text-text .session-title-input{color:var(--text)}.\[\&_\.session-title-input\]\:outline-none .session-title-input{--tw-outline-style:none;outline-style:none}.\[\&_\.session-title-input\]\:\[font\:inherit\] .session-title-input{font:inherit}.\[\&_\.settings-card\]\:mt-3\.5 .settings-card{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\.settings-card\]\:mb-0 .settings-card,.\[\&_\.settings-card-head\]\:mb-0 .settings-card-head{margin-bottom:0}.\[\&_\.settings-card-head\]\:justify-between .settings-card-head{justify-content:space-between}.\[\&_\.settings-card-head\]\:pb-3 .settings-card-head{padding-bottom:calc(var(--spacing) * 3)}.\[\&_\.settings-card-head_h3\]\:m-0 .settings-card-head h3{margin:0}.\[\&_\.settings-sub\]\:mb-3 .settings-sub{margin-bottom:calc(var(--spacing) * 3)}.\[\&_\.skill-chip\]\:mr-0\.5 .skill-chip{margin-right:calc(var(--spacing) * .5)}.\[\&_\.skill-chip\]\:align-baseline .skill-chip{vertical-align:baseline}.\[\&_\.skill-desc\]\:text-sm .skill-desc{font-size:var(--fs-sm)}.\[\&_\.skill-desc\]\:text-subtext .skill-desc{color:var(--subtext)}.\[\&_\.skill-hint\]\:text-muted .skill-hint{color:var(--muted)}.\[\&_\.skill-name\]\:text-md .skill-name{font-size:var(--fs-md)}.\[\&_\.spinner\]\:h-5\.5 .spinner{height:calc(var(--spacing) * 5.5)}.\[\&_\.spinner\]\:w-5\.5 .spinner{width:calc(var(--spacing) * 5.5)}.\[\&_\.spinner\]\:border-\[3px\] .spinner{border-style:var(--tw-border-style);border-width:3px}.\[\&_\.stats\]\:flex .stats{display:flex}.\[\&_\.stats\]\:shrink-0 .stats{flex-shrink:0}.\[\&_\.stats\]\:items-center .stats{align-items:center}.\[\&_\.stats\]\:gap-2 .stats{gap:calc(var(--spacing) * 2)}.\[\&_\.stats\]\:font-mono .stats{font-family:var(--mono)}.\[\&_\.stats\]\:text-2xs .stats{font-size:var(--fs-2xs)}.\[\&_\.stats\]\:font-medium .stats{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.stats\]\:tabular-nums .stats{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.\[\&_\.status-badge\]\:text-text .status-badge{color:var(--text)}.\[\&_\.tab-close\]\:inline-flex .tab-close{display:inline-flex}.\[\&_\.tab-close\]\:h-3\.5 .tab-close{height:calc(var(--spacing) * 3.5)}.\[\&_\.tab-close\]\:w-3\.5 .tab-close{width:calc(var(--spacing) * 3.5)}.\[\&_\.tab-close\]\:shrink-0 .tab-close{flex-shrink:0}.\[\&_\.tab-close\]\:items-center .tab-close{align-items:center}.\[\&_\.tab-close\]\:justify-center .tab-close{justify-content:center}.\[\&_\.tab-close\]\:rounded-xs .tab-close{border-radius:4px}.\[\&_\.tab-close\]\:text-muted .tab-close{color:var(--muted)}.\[\&_\.tab-close\:hover\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_15\%\,_transparent\)\] .tab-close:hover{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.tab-close\:hover\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_15\%\,_transparent\)\] .tab-close:hover{background-color:color-mix(in oklab,var(--text) 15%,transparent)}}.\[\&_\.tab-close\:hover\]\:text-text .tab-close:hover{color:var(--text)}.\[\&_\.tab-label\]\:grid .tab-label{display:grid}.\[\&_\.tab-label\]\:min-w-0 .tab-label{min-width:0}.\[\&_\.tab-label\]\:grid-cols-\[minmax\(0\,_1fr\)\] .tab-label{grid-template-columns:minmax(0,1fr)}.\[\&_\.tab-label\]\:overflow-hidden .tab-label,.\[\&_\.tab-label_\>_span\]\:overflow-hidden .tab-label>span{overflow:hidden}.\[\&_\.tab-label_\>_span\]\:pr-1 .tab-label>span{padding-right:var(--spacing)}.\[\&_\.tab-label_\>_span\]\:text-ellipsis .tab-label>span{text-overflow:ellipsis}.\[\&_\.tab-label_\>_span\]\:whitespace-nowrap .tab-label>span{white-space:nowrap}.\[\&_\.tab-label_\>_span\]\:\[grid-area\:1_\/_1\] .tab-label>span{grid-area:1/1}.\[\&_\.tab-label\:\:after\]\:invisible .tab-label:after{visibility:hidden}.\[\&_\.tab-label\:\:after\]\:overflow-hidden .tab-label:after{overflow:hidden}.\[\&_\.tab-label\:\:after\]\:pr-1 .tab-label:after{padding-right:var(--spacing)}.\[\&_\.tab-label\:\:after\]\:font-medium .tab-label:after{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.tab-label\:\:after\]\:text-ellipsis .tab-label:after{text-overflow:ellipsis}.\[\&_\.tab-label\:\:after\]\:whitespace-nowrap .tab-label:after{white-space:nowrap}.\[\&_\.tab-label\:\:after\]\:content-\[attr\(data-label\)\] .tab-label:after{--tw-content:attr(data-label);content:var(--tw-content)}.\[\&_\.tab-label\:\:after\]\:\[grid-area\:1_\/_1\] .tab-label:after{grid-area:1/1}.\[\&_\.time\]\:text-xs .time{font-size:var(--fs-xs)}.\[\&_\.time\]\:text-muted .time{color:var(--muted)}.\[\&_\.title\]\:max-w-60 .title{max-width:calc(var(--spacing) * 60)}.\[\&_\.title\]\:overflow-hidden .title{overflow:hidden}.\[\&_\.title\]\:text-md .title{font-size:var(--fs-md)}.\[\&_\.title\]\:font-medium .title{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.title\]\:text-ellipsis .title{text-overflow:ellipsis}.\[\&_\.title\]\:whitespace-nowrap .title{white-space:nowrap}.\[\&_\.tool-line\]\:text-lg .tool-line{font-size:var(--fs-lg)}.\[\&_\.unread-dot\]\:h-\[7px\] .unread-dot{height:7px}.\[\&_\.unread-dot\]\:w-\[7px\] .unread-dot{width:7px}.\[\&_\.unread-dot\]\:shrink-0 .unread-dot{flex-shrink:0}.\[\&_\.unread-dot\]\:rounded-full .unread-dot{border-radius:999px}.\[\&_\.unread-dot\]\:bg-primary .unread-dot{background-color:var(--primary)}.\[\&_\.v\]\:font-mono .v{font-family:var(--mono)}.\[\&_\.v\]\:text-sm .v{font-size:var(--fs-sm)}.\[\&_\.v\]\:break-all .v{word-break:break-all}.\[\&_\.when\]\:ml-auto .when{margin-left:auto}.\[\&_\.when\]\:text-xs .when{font-size:var(--fs-xs)}.\[\&_\.when\]\:text-muted .when{color:var(--muted)}.\[\&_\:where\(\[data-tip-align\=\'end\'\]\)\:\:after\]\:right-0 :where([data-tip-align=end]):after{right:0}.\[\&_\:where\(\[data-tip-align\=\'end\'\]\)\:\:after\]\:left-auto :where([data-tip-align=end]):after{left:auto}.\[\&_\:where\(\[data-tip-align\=\'end\'\]\)\:\:after\]\:translate-none :where([data-tip-align=end]):after{translate:none}.\[\&_\:where\(\[data-tip-align\=\'start\'\]\)\:\:after\]\:left-0 :where([data-tip-align=start]):after{left:0}.\[\&_\:where\(\[data-tip-align\=\'start\'\]\)\:\:after\]\:translate-none :where([data-tip-align=start]):after{translate:none}.\[\&_\:where\(\[data-tip\]\)\]\:relative :where([data-tip]){position:relative}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:pointer-events-none :where([data-tip]):after{pointer-events:none}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:invisible :where([data-tip]):after{visibility:hidden}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:absolute :where([data-tip]):after{position:absolute}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:top-\[calc\(100\%_\+_6px\)\] :where([data-tip]):after{top:calc(100% + 6px)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:left-1\/2 :where([data-tip]):after{left:50%}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:z-\[9999\] :where([data-tip]):after{z-index:9999}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:w-max :where([data-tip]):after{width:max-content}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:max-w-none :where([data-tip]):after{max-width:none}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:-translate-x-1\/2 :where([data-tip]):after{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:rounded-sm :where([data-tip]):after{border-radius:6px}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:bg-text :where([data-tip]):after{background-color:var(--text)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:px-2 :where([data-tip]):after{padding-inline:calc(var(--spacing) * 2)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:py-\[5px\] :where([data-tip]):after{padding-block:5px}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:text-xs :where([data-tip]):after{font-size:var(--fs-xs)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:leading-none :where([data-tip]):after{--tw-leading:1;line-height:1}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:font-medium :where([data-tip]):after{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:whitespace-nowrap :where([data-tip]):after{white-space:nowrap}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:text-background :where([data-tip]):after{color:var(--base)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:opacity-0 :where([data-tip]):after{opacity:0}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:content-\[attr\(data-tip\)\] :where([data-tip]):after{--tw-content:attr(data-tip);content:var(--tw-content)}.\[\&_\:where\(\[data-tip\]\)\:is\(\:hover\,\:focus-visible\)\:\:after\]\:visible :where([data-tip]):is(:hover,:focus-visible):after{visibility:visible}.\[\&_\:where\(\[data-tip\]\)\:is\(\:hover\,\:focus-visible\)\:\:after\]\:opacity-100 :where([data-tip]):is(:hover,:focus-visible):after{opacity:1}.\[\&_\>_\*\:first-child\]\:mt-0>:first-child{margin-top:0}.\[\&_\>_\*\:last-child\]\:mb-0>:last-child{margin-bottom:0}.\[\&_\>_\.changes-note\]\:mx-4>.changes-note{margin-inline:calc(var(--spacing) * 4)}.\[\&_\>_\.changes-note\]\:my-3\.5>.changes-note{margin-block:calc(var(--spacing) * 3.5)}.\[\&_\>_\.diff-explorer\]\:mx-4>.diff-explorer{margin-inline:calc(var(--spacing) * 4)}.\[\&_\>_\.diff-explorer\]\:mt-3\.5>.diff-explorer{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\.diff-explorer\]\:mb-0>.diff-explorer{margin-bottom:0}.\[\&_\>_\.error\]\:mx-0>.error{margin-inline:0}.\[\&_\>_\.error\]\:mt-0>.error{margin-top:0}.\[\&_\>_\.error\]\:mt-3\.5>.error{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\.error\]\:mb-3>.error{margin-bottom:calc(var(--spacing) * 3)}.\[\&_\>_\.error\]\:text-md>.error{font-size:var(--fs-md)}.\[\&_\>_\.error\]\:whitespace-pre-wrap>.error{white-space:pre-wrap}.\[\&_\>_\.error\]\:text-accent-red>.error{color:var(--accent-red)}.\[\&_\>_\.openresearch-diff\]\:mx-4>.openresearch-diff{margin-inline:calc(var(--spacing) * 4)}.\[\&_\>_\.openresearch-diff\]\:mt-3\.5>.openresearch-diff{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\.openresearch-diff\]\:mb-0>.openresearch-diff{margin-bottom:0}.\[\&_\>_\.project-default-row\:first-child\]\:border-t-0>.project-default-row:first-child{border-top-style:var(--tw-border-style);border-top-width:0}.\[\&_\>_\.project-default-row\:first-child\]\:pt-0>.project-default-row:first-child{padding-top:0}.\[\&_\>_\.seg\]\:rounded-sm>.seg{border-radius:6px}.\[\&_\>_\.seg\]\:p-0\.5>.seg{padding:calc(var(--spacing) * .5)}.\[\&_\>_\.seg_button\]\:px-2>.seg button{padding-inline:calc(var(--spacing) * 2)}.\[\&_\>_\.seg_button\]\:py-0\.5>.seg button{padding-block:calc(var(--spacing) * .5)}.\[\&_\>_\.seg_button\]\:text-sm>.seg button{font-size:var(--fs-sm)}.\[\&_\>_\.seg_button\]\:font-medium>.seg button{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\>_\.truncated-notice\]\:mx-4>.truncated-notice{margin-inline:calc(var(--spacing) * 4)}.\[\&_\>_\.truncated-notice\]\:mt-3\.5>.truncated-notice{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\.truncated-notice\]\:mb-0>.truncated-notice{margin-bottom:0}.\[\&_\>_\:first-child\]\:mt-3\.5>:first-child{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\:last-child\]\:mb-0>:last-child{margin-bottom:0}.\[\&_\>_\:not\(\.project-card-open\,_\.project-delete\)\]\:pointer-events-none>:not(.project-card-open,.project-delete){pointer-events:none}.\[\&_\>_\:not\(\.project-card-open\,_\.project-delete\)\]\:relative>:not(.project-card-open,.project-delete){position:relative}.\[\&_\>_\:not\(\.project-card-open\,_\.project-delete\)\]\:z-1>:not(.project-card-open,.project-delete){z-index:1}.\[\&_\>_h2\]\:mx-0>h2{margin-inline:0}.\[\&_\>_h2\]\:mt-0>h2{margin-top:0}.\[\&_\>_h2\]\:mb-1\.5>h2{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_\>_h2\]\:text-xl>h2{font-size:var(--fs-xl)}.\[\&_\>_label\]\:gap-2>label{gap:calc(var(--spacing) * 2)}.\[\&_\>_p\]\:m-0>p{margin:0}.\[\&_\>_p\]\:text-md>p{font-size:var(--fs-md)}.\[\&_\>_p\]\:leading-normal>p{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.\[\&_\>_p\]\:text-muted>p{color:var(--muted)}.\[\&_\>_span\]\:inline-flex>span{display:inline-flex}.\[\&_\>_span\]\:items-center>span{align-items:center}.\[\&_\>_span\]\:gap-\[5px\]>span{gap:5px}.\[\&_\>_svg\]\:shrink-0>svg{flex-shrink:0}.\[\&_\>_svg\]\:text-muted>svg{color:var(--muted)}.\[\&_\>_svg\]\:text-subtext>svg{color:var(--subtext)}.\[\&_\>_svg\.file-tree-chevron\]\:text-muted>svg.file-tree-chevron{color:var(--muted)}.\[\&_a\]\:pointer-events-auto a{pointer-events:auto}.\[\&_a\]\:inline-flex a{display:inline-flex}.\[\&_a\]\:text-sm a{font-size:var(--fs-sm)}.\[\&_a\]\:whitespace-nowrap a{white-space:nowrap}.\[\&_a\]\:text-primary a{color:var(--primary)}.\[\&_a\]\:text-subtext a{color:var(--subtext)}.\[\&_a\:hover\]\:text-text a:hover{color:var(--text)}.\[\&_blockquote\]\:mx-0 blockquote{margin-inline:0}.\[\&_blockquote\]\:my-1\.5 blockquote{margin-block:calc(var(--spacing) * 1.5)}.\[\&_blockquote\]\:border-l-\[3px\] blockquote{border-left-style:var(--tw-border-style);border-left-width:3px}.\[\&_blockquote\]\:border-l-border blockquote{border-left-color:var(--border)}.\[\&_blockquote\]\:pt-0\.5 blockquote{padding-top:calc(var(--spacing) * .5)}.\[\&_blockquote\]\:pr-0 blockquote{padding-right:0}.\[\&_blockquote\]\:pb-0\.5 blockquote{padding-bottom:calc(var(--spacing) * .5)}.\[\&_blockquote\]\:pl-2\.5 blockquote{padding-left:calc(var(--spacing) * 2.5)}.\[\&_blockquote\]\:text-subtext blockquote{color:var(--subtext)}.\[\&_button\]\:absolute button{position:absolute}.\[\&_button\]\:-top-\[5px\] button{top:-5px}.\[\&_button\]\:-right-\[5px\] button{right:-5px}.\[\&_button\]\:-mb-px button{margin-bottom:-1px}.\[\&_button\]\:flex button{display:flex}.\[\&_button\]\:grid button{display:grid}.\[\&_button\]\:inline-flex button{display:inline-flex}.\[\&_button\]\:h-4 button{height:calc(var(--spacing) * 4)}.\[\&_button\]\:w-4 button{width:calc(var(--spacing) * 4)}.\[\&_button\]\:w-full button{width:100%}.\[\&_button\]\:cursor-pointer button{cursor:pointer}.\[\&_button\]\:grid-cols-\[18px_minmax\(0\,_1fr\)_auto_auto\] button{grid-template-columns:18px minmax(0,1fr) auto auto}.\[\&_button\]\:grid-cols-\[minmax\(72px\,_0\.7fr\)_minmax\(100px\,_1fr\)_minmax\(70px\,_0\.7fr\)_60px_16px\] button{grid-template-columns:minmax(72px,.7fr) minmax(100px,1fr) minmax(70px,.7fr) 60px 16px}.\[\&_button\]\:flex-col button{flex-direction:column}.\[\&_button\]\:items-center button{align-items:center}.\[\&_button\]\:items-start button{align-items:flex-start}.\[\&_button\]\:justify-center button{justify-content:center}.\[\&_button\]\:gap-0\.5 button{gap:calc(var(--spacing) * .5)}.\[\&_button\]\:gap-3\.5 button{gap:calc(var(--spacing) * 3.5)}.\[\&_button\]\:gap-\[7px\] button{gap:7px}.\[\&_button\]\:rounded-full button{border-radius:999px}.\[\&_button\]\:rounded-sm button{border-radius:6px}.\[\&_button\]\:rounded-xs button{border-radius:4px}.\[\&_button\]\:border button{border-style:var(--tw-border-style);border-width:1px}.\[\&_button\]\:border-0 button{border-style:var(--tw-border-style);border-width:0}.\[\&_button\]\:border-b button{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_button\]\:border-b-2 button{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.\[\&_button\]\:border-border button{border-color:var(--border)}.\[\&_button\]\:border-b-border-variant button{border-bottom-color:var(--border-variant)}.\[\&_button\]\:border-b-transparent button{border-bottom-color:#0000}.\[\&_button\]\:bg-surface button{background-color:var(--surface)}.\[\&_button\]\:bg-transparent button{background-color:#0000}.\[\&_button\]\:bg-none button{background-image:none}.\[\&_button\]\:p-0 button{padding:0}.\[\&_button\]\:p-0\.5 button{padding:calc(var(--spacing) * .5)}.\[\&_button\]\:px-0 button{padding-inline:0}.\[\&_button\]\:px-0\.5 button{padding-inline:calc(var(--spacing) * .5)}.\[\&_button\]\:px-2 button{padding-inline:calc(var(--spacing) * 2)}.\[\&_button\]\:px-2\.5 button{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_button\]\:px-3 button{padding-inline:calc(var(--spacing) * 3)}.\[\&_button\]\:px-\[9px\] button{padding-inline:9px}.\[\&_button\]\:py-0\.5 button{padding-block:calc(var(--spacing) * .5)}.\[\&_button\]\:py-2 button{padding-block:calc(var(--spacing) * 2)}.\[\&_button\]\:py-\[3px\] button{padding-block:3px}.\[\&_button\]\:py-\[7px\] button{padding-block:7px}.\[\&_button\]\:py-\[11px\] button{padding-block:11px}.\[\&_button\]\:text-left button{text-align:left}.\[\&_button\]\:text-md button{font-size:var(--fs-md)}.\[\&_button\]\:text-sm button{font-size:var(--fs-sm)}.\[\&_button\]\:text-xs button{font-size:var(--fs-xs)}.\[\&_button\]\:font-medium button{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_button\]\:font-semibold button{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_button\]\:text-muted button{color:var(--muted)}.\[\&_button\]\:text-text button{color:var(--text)}.\[\&_button\]\:\[font\:inherit\] button{font:inherit}.\[\&_button\.active\]\:border-b-primary button.active{border-bottom-color:var(--primary)}.\[\&_button\.active\]\:bg-background button.active{background-color:var(--base)}.\[\&_button\.active\]\:bg-surface button.active{background-color:var(--surface)}.\[\&_button\.active\]\:shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_25\%\,_transparent\)\] button.active{--tw-shadow:0 1px 3px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.\[\&_button\.active\]\:shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_25\%\,_transparent\)\] button.active{--tw-shadow:0 1px 3px var(--tw-shadow-color,color-mix(in oklab, var(--text) 25%, transparent))}}.\[\&_button\.active\]\:shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_25\%\,_transparent\)\] button.active{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&_button\.active\]\:shadow-\[inset_2px_0_0_var\(--text\)\] button.active{--tw-shadow:inset 2px 0 0 var(--tw-shadow-color,var(--text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&_button\:disabled\]\:cursor-default button:disabled{cursor:default}.\[\&_button\:disabled\]\:text-muted button:disabled{color:var(--muted)}.\[\&_button\:disabled\]\:opacity-50 button:disabled{opacity:.5}.\[\&_button\:hover\]\:bg-\[var\(--surface-2\,_rgb\(0_0_0_\/_5\%\)\)\] button:hover{background-color:var(--surface-2,#0000000d)}.\[\&_button\:hover\]\:bg-panel button:hover{background-color:var(--panel)}.\[\&_button\:hover\]\:bg-surface button:hover{background-color:var(--surface)}.\[\&_button\:hover\]\:bg-text button:hover{background-color:var(--text)}.\[\&_button\:hover\]\:text-background button:hover{color:var(--base)}.\[\&_button\:hover\]\:text-text button:hover{color:var(--text)}.\[\&_button\:hover\]\:underline button:hover{text-decoration-line:underline}.\[\&_button\:hover\]\:underline-offset-2 button:hover{text-underline-offset:2px}.\[\&_button\:last-child\]\:border-b-0 button:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&_button\:not\(\:disabled\)\:hover\]\:text-text button:not(:disabled):hover{color:var(--text)}.\[\&_code\]\:min-w-0 code{min-width:0}.\[\&_code\]\:flex-1 code{flex:1}.\[\&_code\]\:overflow-hidden code{overflow:hidden}.\[\&_code\]\:rounded-xs code{border-radius:4px}.\[\&_code\]\:border code{border-style:var(--tw-border-style);border-width:1px}.\[\&_code\]\:border-border-variant code{border-color:var(--border-variant)}.\[\&_code\]\:bg-panel code{background-color:var(--panel)}.\[\&_code\]\:px-\[5px\] code{padding-inline:5px}.\[\&_code\]\:py-px code{padding-block:1px}.\[\&_code\]\:text-left code{text-align:left}.\[\&_code\]\:font-mono code{font-family:var(--mono)}.\[\&_code\]\:text-\[0\.9em\] code{font-size:.9em}.\[\&_code\]\:text-\[0\.92em\] code{font-size:.92em}.\[\&_code\]\:text-sm code{font-size:var(--fs-sm)}.\[\&_code\]\:text-xs code{font-size:var(--fs-xs)}.\[\&_code\]\:font-medium code{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_code\]\:text-ellipsis code{text-overflow:ellipsis}.\[\&_code\]\:whitespace-nowrap code{white-space:nowrap}.\[\&_code\]\:text-inherit code{color:inherit}.\[\&_code\]\:text-muted code{color:var(--muted)}.\[\&_code\]\:text-primary code{color:var(--primary)}.\[\&_code\]\:text-text code{color:var(--text)}.\[\&_code\]\:\[direction\:rtl\] code{direction:rtl}.\[\&_h1\]\:m-0 h1{margin:0}.\[\&_h1\]\:mx-0 h1{margin-inline:0}.\[\&_h1\]\:mt-0 h1{margin-top:0}.\[\&_h1\]\:mt-3 h1{margin-top:calc(var(--spacing) * 3)}.\[\&_h1\]\:mt-7 h1{margin-top:calc(var(--spacing) * 7)}.\[\&_h1\]\:mb-1\.5 h1{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_h1\]\:mb-3\.5 h1{margin-bottom:calc(var(--spacing) * 3.5)}.\[\&_h1\]\:text-3xl h1{font-size:var(--fs-3xl)}.\[\&_h1\]\:text-\[1\.05em\] h1{font-size:1.05em}.\[\&_h1\]\:text-\[2em\] h1{font-size:2em}.\[\&_h1\]\:text-\[22px\] h1{font-size:22px}.\[\&_h1\]\:leading-\[1\.18\] h1{--tw-leading:1.18;line-height:1.18}.\[\&_h1\]\:leading-tight h1{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.\[\&_h1\]\:font-semibold h1{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_h1\]\:text-text h1{color:var(--text)}.\[\&_h2\]\:m-0 h2{margin:0}.\[\&_h2\]\:mx-0 h2{margin-inline:0}.\[\&_h2\]\:mt-0 h2{margin-top:0}.\[\&_h2\]\:mt-3 h2{margin-top:calc(var(--spacing) * 3)}.\[\&_h2\]\:mt-7 h2{margin-top:calc(var(--spacing) * 7)}.\[\&_h2\]\:mb-1\.5 h2{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_h2\]\:mb-2\.5 h2{margin-bottom:calc(var(--spacing) * 2.5)}.\[\&_h2\]\:mb-3\.5 h2{margin-bottom:calc(var(--spacing) * 3.5)}.\[\&_h2\]\:flex h2{display:flex}.\[\&_h2\]\:items-center h2{align-items:center}.\[\&_h2\]\:gap-2 h2{gap:calc(var(--spacing) * 2)}.\[\&_h2\]\:text-2xl h2{font-size:var(--fs-2xl)}.\[\&_h2\]\:text-5xl h2{font-size:var(--fs-5xl)}.\[\&_h2\]\:text-\[1\.05em\] h2{font-size:1.05em}.\[\&_h2\]\:text-\[1\.5em\] h2{font-size:1.5em}.\[\&_h2\]\:text-lg h2{font-size:var(--fs-lg)}.\[\&_h2\]\:text-md h2{font-size:var(--fs-md)}.\[\&_h2\]\:text-xl h2{font-size:var(--fs-xl)}.\[\&_h2\]\:leading-tight h2{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.\[\&_h2\]\:font-medium h2{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_h2\]\:font-semibold h2{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_h2\]\:tracking-\[-0\.01em\] h2{--tw-tracking:-.01em;letter-spacing:-.01em}.\[\&_h2\]\:tracking-\[-0\.015em\] h2{--tw-tracking:-.015em;letter-spacing:-.015em}.\[\&_h2\]\:text-text h2{color:var(--text)}.\[\&_h3\]\:mx-0 h3{margin-inline:0}.\[\&_h3\]\:mt-0 h3{margin-top:0}.\[\&_h3\]\:mt-1\.5 h3{margin-top:calc(var(--spacing) * 1.5)}.\[\&_h3\]\:mt-3 h3{margin-top:calc(var(--spacing) * 3)}.\[\&_h3\]\:mt-5\.5 h3{margin-top:calc(var(--spacing) * 5.5)}.\[\&_h3\]\:mb-0 h3{margin-bottom:0}.\[\&_h3\]\:mb-1\.5 h3{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_h3\]\:mb-2 h3{margin-bottom:calc(var(--spacing) * 2)}.\[\&_h3\]\:mb-2\.5 h3{margin-bottom:calc(var(--spacing) * 2.5)}.\[\&_h3\]\:mb-3 h3{margin-bottom:calc(var(--spacing) * 3)}.\[\&_h3\]\:text-\[1\.2em\] h3{font-size:1.2em}.\[\&_h3\]\:text-\[1\.05em\] h3{font-size:1.05em}.\[\&_h3\]\:text-base h3{font-size:var(--fs-base)}.\[\&_h3\]\:text-sm h3{font-size:var(--fs-sm)}.\[\&_h3\]\:leading-\[1\.35\] h3{--tw-leading:1.35;line-height:1.35}.\[\&_h3\]\:font-semibold h3{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_h3\]\:text-text h3{color:var(--text)}.\[\&_h4\]\:mx-0 h4{margin-inline:0}.\[\&_h4\]\:mt-0 h4{margin-top:0}.\[\&_h4\]\:mt-3 h4{margin-top:calc(var(--spacing) * 3)}.\[\&_h4\]\:mt-4\.5 h4{margin-top:calc(var(--spacing) * 4.5)}.\[\&_h4\]\:mb-1 h4{margin-bottom:var(--spacing)}.\[\&_h4\]\:mb-1\.5 h4{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_h4\]\:text-\[1\.05em\] h4{font-size:1.05em}.\[\&_h4\]\:text-\[1em\] h4{font-size:1em}.\[\&_h4\]\:text-md h4{font-size:var(--fs-md)}.\[\&_h4\]\:leading-\[1\.4\] h4{--tw-leading:1.4;line-height:1.4}.\[\&_h4\]\:font-semibold h4{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_h4\]\:text-accent-amber h4{color:var(--accent-amber)}.\[\&_h4\]\:text-text h4{color:var(--text)}.\[\&_img\]\:block img{display:block}.\[\&_img\]\:h-13 img{height:calc(var(--spacing) * 13)}.\[\&_img\]\:h-auto img{height:auto}.\[\&_img\]\:max-h-40 img{max-height:calc(var(--spacing) * 40)}.\[\&_img\]\:w-13 img{width:calc(var(--spacing) * 13)}.\[\&_img\]\:max-w-55 img{max-width:calc(var(--spacing) * 55)}.\[\&_img\]\:max-w-full img{max-width:100%}.\[\&_img\]\:rounded-sm img{border-radius:6px}.\[\&_img\]\:rounded-xs img{border-radius:4px}.\[\&_img\]\:border img{border-style:var(--tw-border-style);border-width:1px}.\[\&_img\]\:border-border img{border-color:var(--border)}.\[\&_img\]\:border-border-variant img{border-color:var(--border-variant)}.\[\&_img\]\:object-cover img{object-fit:cover}.\[\&_input\]\:m-0 input{margin:0}.\[\&_input\]\:w-full input{width:100%}.\[\&_input\]\:min-w-55 input{min-width:calc(var(--spacing) * 55)}.\[\&_input\]\:flex-1 input{flex:1}.\[\&_input\]\:rounded-none input{border-radius:0}.\[\&_input\]\:border-0 input{border-style:var(--tw-border-style);border-width:0}.\[\&_input\]\:border-b input{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_input\]\:border-b-border-variant input{border-bottom-color:var(--border-variant)}.\[\&_input\]\:bg-transparent input{background-color:#0000}.\[\&_input\]\:bg-none input{background-image:none}.\[\&_input\]\:p-0 input{padding:0}.\[\&_input\]\:px-2\.5 input{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_input\]\:py-2 input{padding-block:calc(var(--spacing) * 2)}.\[\&_input\]\:font-mono input{font-family:var(--mono)}.\[\&_input\]\:text-sm input{font-size:var(--fs-sm)}.\[\&_input\]\:outline-none input{--tw-outline-style:none;outline-style:none}.\[\&_input\:focus\]\:shadow-\[0_1px_0_0_var\(--text\)\] input:focus{--tw-shadow:0 1px 0 0 var(--tw-shadow-color,var(--text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&_label\]\:flex label{display:flex}.\[\&_label\]\:max-w-80 label{max-width:calc(var(--spacing) * 80)}.\[\&_label\]\:flex-col label{flex-direction:column}.\[\&_label\]\:gap-1 label{gap:var(--spacing)}.\[\&_label\]\:text-xs label{font-size:var(--fs-xs)}.\[\&_label\]\:font-medium label{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_label\]\:text-text label{color:var(--text)}.\[\&_legend\]\:mb-1\.5 legend{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_legend\]\:text-base legend{font-size:var(--fs-base)}.\[\&_legend\]\:font-semibold legend{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_li\:\:marker\]\:text-primary li::marker{color:var(--primary)}.\[\&_ol\]\:mx-0 ol{margin-inline:0}.\[\&_ol\]\:my-1\.5 ol{margin-block:calc(var(--spacing) * 1.5)}.\[\&_ol\]\:pl-5\.5 ol{padding-left:calc(var(--spacing) * 5.5)}.\[\&_p\]\:m-0 p{margin:0}.\[\&_p\]\:mx-0 p{margin-inline:0}.\[\&_p\]\:my-2\.5 p{margin-block:calc(var(--spacing) * 2.5)}.\[\&_p\]\:mt-\[3px\] p{margin-top:3px}.\[\&_p\]\:mb-0 p{margin-bottom:0}.\[\&_p\]\:max-w-80 p{max-width:calc(var(--spacing) * 80)}.\[\&_p\]\:max-w-105 p{max-width:calc(var(--spacing) * 105)}.\[\&_p\]\:max-w-\[46ch\] p{max-width:46ch}.\[\&_p\]\:text-2xl p{font-size:var(--fs-2xl)}.\[\&_p\]\:text-md p{font-size:var(--fs-md)}.\[\&_p\]\:text-sm p{font-size:var(--fs-sm)}.\[\&_p\]\:leading-\[1\.55\] p{--tw-leading:1.55;line-height:1.55}.\[\&_p\]\:leading-normal p{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.\[\&_p\]\:text-balance p{text-wrap:balance}.\[\&_p\]\:text-muted p{color:var(--muted)}.\[\&_p\]\:text-subtext p{color:var(--subtext)}.\[\&_p_\+_p\]\:mt-3 p+p{margin-top:calc(var(--spacing) * 3)}.\[\&_p\.empty-state-hint\]\:text-lg p.empty-state-hint{font-size:var(--fs-lg)}.\[\&_p\.empty-state-hint\]\:text-subtext p.empty-state-hint{color:var(--subtext)}.\[\&_p\.empty-state-title\]\:text-2xl p.empty-state-title{font-size:var(--fs-2xl)}.\[\&_p\.empty-state-title\]\:font-normal p.empty-state-title{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_p\.empty-state-title\]\:text-text p.empty-state-title{color:var(--text)}.\[\&_pre\]\:m-0 pre{margin:0}.\[\&_pre\]\:overflow-x-auto pre{overflow-x:auto}.\[\&_pre\]\:rounded-md pre{border-radius:8px}.\[\&_pre\]\:border pre{border-style:var(--tw-border-style);border-width:1px}.\[\&_pre\]\:border-\[color-mix\(in_oklab\,_var\(--border\)_50\%\,_transparent\)\] pre{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.\[\&_pre\]\:border-\[color-mix\(in_oklab\,_var\(--border\)_50\%\,_transparent\)\] pre{border-color:color-mix(in oklab,var(--border) 50%,transparent)}}.\[\&_pre\]\:bg-surface pre{background-color:var(--surface)}.\[\&_pre\]\:px-3 pre{padding-inline:calc(var(--spacing) * 3)}.\[\&_pre\]\:py-2 pre{padding-block:calc(var(--spacing) * 2)}.\[\&_pre\]\:text-sm pre{font-size:var(--fs-sm)}.\[\&_pre\]\:text-text pre{color:var(--text)}.\[\&_pre_code\]\:border-0 pre code{border-style:var(--tw-border-style);border-width:0}.\[\&_pre_code\]\:bg-transparent pre code{background-color:#0000}.\[\&_pre_code\]\:bg-none pre code{background-image:none}.\[\&_pre_code\]\:p-0 pre code{padding:0}.\[\&_pre_code\]\:font-normal pre code{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_pre_code\]\:text-inherit pre code{color:inherit}.\[\&_span\]\:absolute span{position:absolute}.\[\&_span\]\:top-\[3px\] span{top:3px}.\[\&_span\]\:left-\[3px\] span{left:3px}.\[\&_span\]\:h-3\.5 span{height:calc(var(--spacing) * 3.5)}.\[\&_span\]\:w-3\.5 span{width:calc(var(--spacing) * 3.5)}.\[\&_span\]\:overflow-hidden span{overflow:hidden}.\[\&_span\]\:rounded-full span{border-radius:999px}.\[\&_span\]\:bg-muted span{background-color:var(--muted)}.\[\&_span\]\:text-ellipsis span{text-overflow:ellipsis}.\[\&_span\]\:whitespace-nowrap span{white-space:nowrap}.\[\&_span\]\:transition-\[translate\,background\] span{transition-property:translate,background;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_span\]\:duration-120 span{--tw-duration:.12s;transition-duration:.12s}.\[\&_span\]\:ease-standard span{--tw-ease:ease;transition-timing-function:ease}.\[\&_strong\]\:font-medium strong{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_strong\]\:font-semibold strong{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_strong\]\:text-accent-amber strong{color:var(--accent-amber)}.\[\&_strong\]\:text-text strong{color:var(--text)}.\[\&_summary\]\:flex summary{display:flex}.\[\&_summary\]\:w-fit summary{width:fit-content}.\[\&_summary\]\:max-w-full summary{max-width:100%}.\[\&_summary\]\:cursor-pointer summary{cursor:pointer}.\[\&_summary\]\:list-none summary{list-style-type:none}.\[\&_summary\]\:items-center summary{align-items:center}.\[\&_summary\]\:gap-2 summary{gap:calc(var(--spacing) * 2)}.\[\&_summary\]\:rounded-sm summary{border-radius:6px}.\[\&_summary\]\:px-1 summary{padding-inline:var(--spacing)}.\[\&_summary\]\:py-\[3px\] summary{padding-block:3px}.\[\&_summary\]\:select-none summary{-webkit-user-select:none;user-select:none}.\[\&_summary_\.plan-chevron\]\:transition-transform summary .plan-chevron{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_summary_\.plan-chevron\]\:duration-120 summary .plan-chevron{--tw-duration:.12s;transition-duration:.12s}.\[\&_summary_\.plan-chevron\]\:ease-standard summary .plan-chevron{--tw-ease:ease;transition-timing-function:ease}.\[\&_summary\:\:-webkit-details-marker\]\:hidden summary::-webkit-details-marker{display:none}.\[\&_summary\:\:after\]\:text-muted summary:after{color:var(--muted)}.\[\&_summary\:\:after\]\:transition-transform summary:after{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_summary\:\:after\]\:duration-80 summary:after{--tw-duration:80ms;transition-duration:80ms}.\[\&_summary\:\:after\]\:ease-standard summary:after{--tw-ease:ease;transition-timing-function:ease}.\[\&_summary\:\:after\]\:content-\[\'›\'\] summary:after{--tw-content:"›";content:var(--tw-content)}.\[\&_summary\:hover\]\:bg-surface summary:hover{background-color:var(--surface)}.\[\&_svg\]\:mt-px svg{margin-top:1px}.\[\&_svg\]\:block svg{display:block}.\[\&_svg\]\:h-\[1em\] svg{height:1em}.\[\&_svg\]\:h-full svg{height:100%}.\[\&_svg\]\:w-\[1em\] svg{width:1em}.\[\&_svg\]\:w-full svg{width:100%}.\[\&_svg\]\:flex-none svg{flex:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\]\:text-muted svg{color:var(--muted)}.\[\&_table\]\:mx-0 table{margin-inline:0}.\[\&_table\]\:my-2\.5 table{margin-block:calc(var(--spacing) * 2.5)}.\[\&_table\]\:block table{display:block}.\[\&_table\]\:w-max table{width:max-content}.\[\&_table\]\:max-w-full table{max-width:100%}.\[\&_table\]\:border-collapse table{border-collapse:collapse}.\[\&_table\]\:overflow-x-auto table{overflow-x:auto}.\[\&_table\]\:rounded-md table{border-radius:8px}.\[\&_table\]\:border table{border-style:var(--tw-border-style);border-width:1px}.\[\&_table\]\:border-border table{border-color:var(--border)}.\[\&_table\]\:text-md table{font-size:var(--fs-md)}.\[\&_tbody_tr\:hover_td\]\:bg-surface-bright tbody tr:hover td{background-color:var(--surface-bright)}.\[\&_td\]\:h-9 td{height:calc(var(--spacing) * 9)}.\[\&_td\]\:border-b td{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_td\]\:border-b-\[color-mix\(in_oklab\,_var\(--text\)_6\%\,_transparent\)\] td{border-bottom-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_td\]\:border-b-\[color-mix\(in_oklab\,_var\(--text\)_6\%\,_transparent\)\] td{border-bottom-color:color-mix(in oklab,var(--text) 6%,transparent)}}.\[\&_td\]\:border-b-border-variant td{border-bottom-color:var(--border-variant)}.\[\&_td\]\:px-3 td{padding-inline:calc(var(--spacing) * 3)}.\[\&_td\]\:px-3\.5 td{padding-inline:calc(var(--spacing) * 3.5)}.\[\&_td\]\:py-2 td{padding-block:calc(var(--spacing) * 2)}.\[\&_td\]\:pt-0 td{padding-top:0}.\[\&_td\]\:pt-\[5px\] td{padding-top:5px}.\[\&_td\]\:pr-2\.5 td{padding-right:calc(var(--spacing) * 2.5)}.\[\&_td\]\:pb-0 td{padding-bottom:0}.\[\&_td\]\:pb-\[5px\] td{padding-bottom:5px}.\[\&_td\]\:pl-0 td{padding-left:0}.\[\&_td\]\:text-left td{text-align:left}.\[\&_td\]\:align-middle td{vertical-align:middle}.\[\&_td\]\:break-normal td{overflow-wrap:normal;word-break:normal}.\[\&_td\]\:break-words td{overflow-wrap:break-word}.\[\&_td\]\:wrap-anywhere td{overflow-wrap:anywhere}.\[\&_td\]\:whitespace-nowrap td{white-space:nowrap}.\[\&_td\]\:text-text td{color:var(--text)}.\[\&_td\:first-child\]\:w-\[32\%\] td:first-child{width:32%}.\[\&_td\:first-child\]\:wrap-anywhere td:first-child{overflow-wrap:anywhere}.\[\&_td\:last-child\]\:w-29 td:last-child{width:calc(var(--spacing) * 29)}.\[\&_td\:last-child\]\:pr-0 td:last-child{padding-right:0}.\[\&_td\:last-child\]\:text-right td:last-child{text-align:right}.\[\&_td\:last-child\]\:whitespace-nowrap td:last-child{white-space:nowrap}.\[\&_td\[colspan\]\]\:text-left td[colspan]{text-align:left}.\[\&_td\[colspan\]\]\:whitespace-normal td[colspan]{white-space:normal}.\[\&_textarea\]\:field-sizing-content textarea{field-sizing:content}.\[\&_textarea\]\:max-h-45 textarea{max-height:calc(var(--spacing) * 45)}.\[\&_textarea\]\:min-h-18 textarea{min-height:calc(var(--spacing) * 18)}.\[\&_textarea\]\:flex-1 textarea{flex:1}.\[\&_textarea\]\:resize-none textarea{resize:none}.\[\&_textarea\]\:border-0 textarea{border-style:var(--tw-border-style);border-width:0}.\[\&_textarea\]\:bg-transparent textarea{background-color:#0000}.\[\&_textarea\]\:bg-none textarea{background-image:none}.\[\&_textarea\]\:px-3 textarea{padding-inline:calc(var(--spacing) * 3)}.\[\&_textarea\]\:pt-2\.5 textarea{padding-top:calc(var(--spacing) * 2.5)}.\[\&_textarea\]\:pb-1 textarea{padding-bottom:var(--spacing)}.\[\&_textarea\]\:text-base textarea{font-size:var(--fs-base)}.\[\&_th\]\:sticky th{position:sticky}.\[\&_th\]\:top-0 th{top:0}.\[\&_th\]\:z-1 th{z-index:1}.\[\&_th\]\:border-b th{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_th\]\:border-b-border th{border-bottom-color:var(--border)}.\[\&_th\]\:border-b-border-variant th{border-bottom-color:var(--border-variant)}.\[\&_th\]\:bg-background th{background-color:var(--base)}.\[\&_th\]\:px-3 th{padding-inline:calc(var(--spacing) * 3)}.\[\&_th\]\:px-3\.5 th{padding-inline:calc(var(--spacing) * 3.5)}.\[\&_th\]\:py-2 th{padding-block:calc(var(--spacing) * 2)}.\[\&_th\]\:pt-\[5px\] th{padding-top:5px}.\[\&_th\]\:pr-2\.5 th{padding-right:calc(var(--spacing) * 2.5)}.\[\&_th\]\:pb-\[5px\] th{padding-bottom:5px}.\[\&_th\]\:pl-0 th{padding-left:0}.\[\&_th\]\:text-left th{text-align:left}.\[\&_th\]\:text-xs th{font-size:var(--fs-xs)}.\[\&_th\]\:font-medium th{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_th\]\:font-semibold th{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_th\]\:break-normal th{overflow-wrap:normal;word-break:normal}.\[\&_th\]\:break-words th{overflow-wrap:break-word}.\[\&_th\]\:text-text th{color:var(--text)}.\[\&_th\:nth-child\(1\)\]\:w-\[20\%\] th:first-child{width:20%}.\[\&_th\:nth-child\(2\)\]\:w-\[26\%\] th:nth-child(2){width:26%}.\[\&_th\:nth-child\(4\)\]\:w-27 th:nth-child(4){width:calc(var(--spacing) * 27)}.\[\&_th\:nth-child\(5\)\]\:w-13 th:nth-child(5){width:calc(var(--spacing) * 13)}.\[\&_thead_th\]\:border-b thead th{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_thead_th\]\:border-b-border thead th{border-bottom-color:var(--border)}.\[\&_thead_th\]\:bg-surface thead th{background-color:var(--surface)}.\[\&_thead_th\]\:font-medium thead th{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_thead_th\]\:text-text thead th{color:var(--text)}.\[\&_tr\.clickable\]\:cursor-pointer tr.clickable{cursor:pointer}.\[\&_tr\.clickable\:hover_td\]\:bg-canvas tr.clickable:hover td{background-color:var(--canvas)}.\[\&_tr\:last-child_td\]\:border-b-0 tr:last-child td{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&_ul\]\:mx-0 ul{margin-inline:0}.\[\&_ul\]\:my-1\.5 ul{margin-block:calc(var(--spacing) * 1.5)}.\[\&_ul\]\:pl-5\.5 ul{padding-left:calc(var(--spacing) * 5.5)}.\[\&\+\&\]\:border-t+.\[\&\+\&\]\:border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&\+\&\]\:border-border-variant+.\[\&\+\&\]\:border-border-variant{border-color:var(--border-variant)}.\[\&\.active\]\:border-border.active{border-color:var(--border)}.\[\&\.active\]\:bg-background.active{background-color:var(--base)}.\[\&\.active\]\:bg-panel.active{background-color:var(--panel)}.\[\&\.active\]\:bg-surface.active{background-color:var(--surface)}.\[\&\.active\]\:font-medium.active{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&\.active\]\:font-semibold.active{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&\.active\]\:text-primary.active{color:var(--primary)}.\[\&\.active\]\:text-text.active{color:var(--text)}.\[\&\.active\:\:after\]\:absolute.active:after{position:absolute}.\[\&\.active\:\:after\]\:right-0.active:after{right:0}.\[\&\.active\:\:after\]\:-bottom-px.active:after{bottom:-1px}.\[\&\.active\:\:after\]\:left-0.active:after{left:0}.\[\&\.active\:\:after\]\:h-px.active:after{height:1px}.\[\&\.active\:\:after\]\:bg-background.active:after{background-color:var(--base)}.\[\&\.active\:\:after\]\:content-\[\'\'\].active:after{--tw-content:"";content:var(--tw-content)}.\[\&\.align-right\]\:right-0.align-right{right:0}.\[\&\.align-right\]\:left-auto.align-right{left:auto}.\[\&\.approved\]\:text-accent-green.approved{color:var(--accent-green)}.\[\&\.approved\:\:before\]\:content-\[\'✓_\'\].approved:before{--tw-content:"✓ ";content:var(--tw-content)}.\[\&\.archive\]\:text-accent-amber.archive{color:var(--accent-amber)}.\[\&\.awaiting\]\:italic.awaiting{font-style:italic}.\[\&\.blue_svg\]\:text-accent-blue.blue svg{color:var(--accent-blue)}.\[\&\.chosen\]\:text-accent-green.chosen{color:var(--accent-green)}.\[\&\.chosen\:\:before\]\:content-\[\'✓_\'\].chosen:before{--tw-content:"✓ ";content:var(--tw-content)}.\[\&\.clamped\]\:relative.clamped{position:relative}.\[\&\.clamped\]\:max-h-\[9\.5em\].clamped{max-height:9.5em}.\[\&\.clamped\]\:overflow-hidden.clamped{overflow:hidden}.\[\&\.clamped\:\:after\]\:pointer-events-none.clamped:after{pointer-events:none}.\[\&\.clamped\:\:after\]\:absolute.clamped:after{position:absolute}.\[\&\.clamped\:\:after\]\:inset-x-0.clamped:after{inset-inline:0}.\[\&\.clamped\:\:after\]\:top-auto.clamped:after{top:auto}.\[\&\.clamped\:\:after\]\:bottom-0.clamped:after{bottom:0}.\[\&\.clamped\:\:after\]\:h-8\.5.clamped:after{height:calc(var(--spacing) * 8.5)}.\[\&\.clamped\:\:after\]\:bg-\[linear-gradient\(to_bottom\,_transparent\,_var\(--surface\)\)\].clamped:after{background-image:linear-gradient(to bottom,transparent,var(--surface))}.\[\&\.clamped\:\:after\]\:content-\[\'\'\].clamped:after{--tw-content:"";content:var(--tw-content)}.\[\&\.closable\]\:max-w-60.closable{max-width:calc(var(--spacing) * 60)}.\[\&\.closable\]\:pr-0\.5.closable{padding-right:calc(var(--spacing) * .5)}.\[\&\.code\]\:text-accent-orange.code{color:var(--accent-orange)}.\[\&\.context-ring\]\:mr-2.context-ring{margin-right:calc(var(--spacing) * 2)}.\[\&\.context-ring\]\:inline-flex.context-ring{display:inline-flex}.\[\&\.context-ring\]\:items-center.context-ring{align-items:center}.\[\&\.danger\]\:border-\[color-mix\(in_oklab\,_var\(--accent-red\)_42\%\,_var\(--border\)\)\].danger{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.danger\]\:border-\[color-mix\(in_oklab\,_var\(--accent-red\)_42\%\,_var\(--border\)\)\].danger{border-color:color-mix(in oklab,var(--accent-red) 42%,var(--border))}}.\[\&\.danger\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_6\%\,_var\(--base\)\)\].danger{background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.danger\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_6\%\,_var\(--base\)\)\].danger{background-color:color-mix(in oklab,var(--accent-red) 6%,var(--base))}}.\[\&\.danger\]\:text-accent-red.danger{color:var(--accent-red)}.\[\&\.danger\:active\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_14\%\,_transparent\)\].danger:active:not(:disabled){background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.danger\:active\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_14\%\,_transparent\)\].danger:active:not(:disabled){background-color:color-mix(in oklab,var(--accent-red) 14%,transparent)}}.\[\&\.danger\:hover\]\:text-accent-red.danger:hover{color:var(--accent-red)}.\[\&\.danger\:hover\:not\(\:disabled\)\]\:border-accent-red.danger:hover:not(:disabled){border-color:var(--accent-red)}.\[\&\.danger\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_8\%\,_transparent\)\].danger:hover:not(:disabled){background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.danger\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_8\%\,_transparent\)\].danger:hover:not(:disabled){background-color:color-mix(in oklab,var(--accent-red) 8%,transparent)}}.\[\&\.danger\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_10\%\,_var\(--base\)\)\].danger:hover:not(:disabled){background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.danger\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_10\%\,_var\(--base\)\)\].danger:hover:not(:disabled){background-color:color-mix(in oklab,var(--accent-red) 10%,var(--base))}}.\[\&\.disabled\]\:opacity-52.disabled{opacity:.52}.\[\&\.disabled_\.compute-row-head\]\:cursor-default.disabled .compute-row-head{cursor:default}.\[\&\.doc\]\:px-7.doc{padding-inline:calc(var(--spacing) * 7)}.\[\&\.doc\]\:pt-4\.5.doc{padding-top:calc(var(--spacing) * 4.5)}.\[\&\.doc\]\:pb-12.doc{padding-bottom:calc(var(--spacing) * 12)}.\[\&\.doc_\.artifact-md\]\:mx-auto.doc .artifact-md{margin-inline:auto}.\[\&\.doc_\.artifact-md\]\:my-0.doc .artifact-md{margin-block:0}.\[\&\.doc_\.artifact-md\]\:max-w-readable.doc .artifact-md{max-width:var(--readable-col)}.\[\&\.document\]\:text-subtext.document{color:var(--subtext)}.\[\&\.drop-down\]\:top-\[calc\(100\%_\+_4px\)\].drop-down{top:calc(100% + 4px)}.\[\&\.drop-down\]\:bottom-auto.drop-down{bottom:auto}.\[\&\.editing\]\:cursor-default.editing{cursor:default}.\[\&\.editing\]\:bg-surface.editing{background-color:var(--surface)}.\[\&\.editing_\.session-menu-btn\]\:hidden.editing .session-menu-btn,.\[\&\.editing_\.session-time\]\:hidden.editing .session-time{display:none}.\[\&\.err\]\:border-accent-red.err{border-color:var(--accent-red)}.\[\&\.err\]\:bg-accent-red.err{background-color:var(--accent-red)}.\[\&\.err\]\:bg-accent-red-subtle.err{background-color:var(--accent-red-subtle)}.\[\&\.err\]\:text-accent-red.err{color:var(--accent-red)}.\[\&\.expanded_\.diff-file-header\]\:border-b.expanded .diff-file-header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&\.expanded_\.diff-file-header\]\:border-b-border.expanded .diff-file-header{border-bottom-color:var(--border)}.\[\&\.fail\]\:border-\[1\.5px\].fail{border-style:var(--tw-border-style);border-width:1.5px}.\[\&\.fail\]\:border-\[color-mix\(in_oklab\,_var\(--accent-red\)_55\%\,_transparent\)\].fail{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.fail\]\:border-\[color-mix\(in_oklab\,_var\(--accent-red\)_55\%\,_transparent\)\].fail{border-color:color-mix(in oklab,var(--accent-red) 55%,transparent)}}.\[\&\.failed\]\:text-accent-red.failed{color:var(--accent-red)}.\[\&\.ghost\]\:border-transparent.ghost{border-color:#0000}.\[\&\.ghost\]\:text-text.ghost{color:var(--text)}.\[\&\.ghost\:hover\:not\(\:disabled\)\]\:bg-surface.ghost:hover:not(:disabled){background-color:var(--surface)}.\[\&\.ghost\:hover\:not\(\:disabled\)\]\:text-text.ghost:hover:not(:disabled){color:var(--text)}.\[\&\.green_svg\]\:text-accent-green.green svg{color:var(--accent-green)}.\[\&\.image\]\:text-accent-purple.image{color:var(--accent-purple)}.\[\&\.live\]\:animate-\[or-pulse_1\.2s_ease-in-out_infinite\].live{animation:1.2s ease-in-out infinite or-pulse}.\[\&\.live\]\:border-accent-teal.live{border-color:var(--accent-teal)}.\[\&\.live\]\:bg-accent-teal.live{background-color:var(--accent-teal)}.\[\&\.live\]\:shadow-\[0_2px_12px_rgba\(32\,_154\,_132\,_0\.2\)\].live{--tw-shadow:0 2px 12px var(--tw-shadow-color,#209a8433);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&\.live_\.dot\]\:animate-\[or-pulse_1\.2s_ease-in-out_infinite\].live .dot{animation:1.2s ease-in-out infinite or-pulse}.\[\&\.markdown\]\:text-accent-blue.markdown{color:var(--accent-blue)}.\[\&\.max\]\:fixed.max{position:fixed}.\[\&\.max\]\:inset-2\.5.max{inset:calc(var(--spacing) * 2.5)}.\[\&\.max\]\:z-60.max{z-index:60}.\[\&\.max\]\:m-0.max{margin:0}.\[\&\.max\]\:shadow-\[0_12px_40px_color-mix\(in_oklab\,_var\(--text\)_22\%\,_transparent\)\].max{--tw-shadow:0 12px 40px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.\[\&\.max\]\:shadow-\[0_12px_40px_color-mix\(in_oklab\,_var\(--text\)_22\%\,_transparent\)\].max{--tw-shadow:0 12px 40px var(--tw-shadow-color,color-mix(in oklab, var(--text) 22%, transparent))}}.\[\&\.max\]\:shadow-\[0_12px_40px_color-mix\(in_oklab\,_var\(--text\)_22\%\,_transparent\)\].max{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&\.menu-open_\.session-menu-btn\]\:inline-flex.menu-open .session-menu-btn{display:inline-flex}.\[\&\.menu-open_\.session-time\]\:hidden.menu-open .session-time{display:none}.\[\&\.muted\]\:text-muted.muted{color:var(--muted)}.\[\&\.ok\]\:border-accent-green.ok{border-color:var(--accent-green)}.\[\&\.ok\]\:bg-accent-green.ok{background-color:var(--accent-green)}.\[\&\.ok\]\:bg-accent-green-subtle.ok{background-color:var(--accent-green-subtle)}.\[\&\.ok\]\:text-accent-green.ok{color:var(--accent-green)}.\[\&\.on\]\:border-primary.on{border-color:var(--primary)}.\[\&\.on\]\:bg-primary.on{background-color:var(--primary)}.\[\&\.on\]\:text-background.on{color:var(--base)}.\[\&\.on_span\]\:translate-x-4.on span{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\.on_span\]\:bg-background.on span{background-color:var(--base)}.\[\&\.open\]\:rotate-90.open{rotate:90deg}.\[\&\.open_\.compute-row-head\:hover\]\:rounded-\[var\(--radius-lg\)_var\(--radius-lg\)_0_0\].open .compute-row-head:hover{border-radius:var(--radius-lg) var(--radius-lg) 0 0}.\[\&\.orange_svg\]\:text-accent-orange.orange svg{color:var(--accent-orange)}.\[\&\.other\]\:border-\[1\.5px\].other{border-style:var(--tw-border-style);border-width:1.5px}.\[\&\.other\]\:border-border.other{border-color:var(--border)}.\[\&\.pass\]\:bg-accent-green.pass{background-color:var(--accent-green)}.\[\&\.pdf\]\:text-accent-red.pdf{color:var(--accent-red)}.\[\&\.permission\]\:border-l-accent-amber.permission{border-left-color:var(--accent-amber)}.\[\&\.plan\]\:border-l-accent-blue.plan{border-left-color:var(--accent-blue)}.\[\&\.primary\]\:border-primary.primary{border-color:var(--primary)}.\[\&\.primary\]\:bg-primary.primary{background-color:var(--primary)}.\[\&\.primary\]\:text-background.primary{color:var(--base)}.\[\&\.primary\:active\:not\(\:disabled\)\]\:border-\[color-mix\(in_oklab\,_var\(--primary\)_80\%\,_var\(--text\)\)\].primary:active:not(:disabled){border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\.primary\:active\:not\(\:disabled\)\]\:border-\[color-mix\(in_oklab\,_var\(--primary\)_80\%\,_var\(--text\)\)\].primary:active:not(:disabled){border-color:color-mix(in oklab,var(--primary) 80%,var(--text))}}.\[\&\.primary\:active\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_80\%\,_var\(--text\)\)\].primary:active:not(:disabled){background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\.primary\:active\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_80\%\,_var\(--text\)\)\].primary:active:not(:disabled){background-color:color-mix(in oklab,var(--primary) 80%,var(--text))}}.\[\&\.primary\:hover\:not\(\:disabled\)\]\:border-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\].primary:hover:not(:disabled){border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\.primary\:hover\:not\(\:disabled\)\]\:border-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\].primary:hover:not(:disabled){border-color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.\[\&\.primary\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\].primary:hover:not(:disabled){background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\.primary\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\].primary:hover:not(:disabled){background-color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.\[\&\.purple_svg\]\:text-accent-purple.purple svg{color:var(--accent-purple)}.\[\&\.question\]\:border-l-accent-purple.question{border-left-color:var(--accent-purple)}.\[\&\.rail-hidden\]\:max-w-none.rail-hidden{max-width:none}.\[\&\.rail-hidden\]\:px-0\.5.rail-hidden{padding-inline:calc(var(--spacing) * .5)}.\[\&\.rail-hidden\]\:py-0.rail-hidden{padding-block:0}.\[\&\.readonly\]\:opacity-60.readonly{opacity:.6}.\[\&\.rejected\]\:text-accent-amber.rejected,.\[\&\.revised\]\:text-accent-amber.revised{color:var(--accent-amber)}.\[\&\.sel\]\:border-primary.sel{border-color:var(--primary)}.\[\&\.sel\]\:bg-primary-subtle.sel{background-color:var(--primary-subtle)}.\[\&\.selected\]\:border-accent.selected{border-color:var(--accent)}.\[\&\.selected\]\:bg-panel.selected{background-color:var(--panel)}.\[\&\.selected\]\:shadow-\[0_0_0_1px_var\(--accent\)\].selected{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--accent));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&\.selected\:hover\]\:bg-panel.selected:hover{background-color:var(--panel)}.\[\&\.session-menu\]\:top-\[calc\(100\%_-_2px\)\].session-menu{top:calc(100% - 2px)}.\[\&\.session-menu\]\:right-1\.5.session-menu{right:calc(var(--spacing) * 1.5)}.\[\&\.session-menu\]\:left-auto.session-menu{left:auto}.\[\&\.session-menu\]\:min-w-35.session-menu{min-width:calc(var(--spacing) * 35)}.\[\&\.sm\]\:rounded-sm.sm{border-radius:6px}.\[\&\.sm\]\:px-\[9px\].sm{padding-inline:9px}.\[\&\.sm\]\:py-\[3px\].sm{padding-block:3px}.\[\&\.sm\]\:text-xs.sm{font-size:var(--fs-xs)}.\[\&\.spreadsheet\]\:text-accent-green.spreadsheet{color:var(--accent-green)}.\[\&\.st-cancelled_\.dot\]\:text-accent-orange.st-cancelled .dot,.\[\&\.st-cancelling_\.dot\]\:text-accent-orange.st-cancelling .dot{color:var(--accent-orange)}.\[\&\.st-done_\.dot\]\:text-accent-green.st-done .dot,.\[\&\.st-done_\>_svg\]\:text-accent-green.st-done>svg{color:var(--accent-green)}.\[\&\.st-editing_\.dot\]\:text-accent-purple.st-editing .dot{color:var(--accent-purple)}.\[\&\.st-failed_\.dot\]\:text-accent-red.st-failed .dot{color:var(--accent-red)}.\[\&\.st-idle_\.dot\]\:text-muted.st-idle .dot{color:var(--muted)}.\[\&\.st-running_\.dot\]\:text-accent-teal.st-running .dot{color:var(--accent-teal)}.\[\&\.st-starting_\.dot\]\:text-accent-amber.st-starting .dot{color:var(--accent-amber)}.\[\&\.status-add\]\:text-accent-green.status-add{color:var(--accent-green)}.\[\&\.status-copy\]\:text-accent-blue.status-copy{color:var(--accent-blue)}.\[\&\.status-delete\]\:text-accent-red.status-delete{color:var(--accent-red)}.\[\&\.status-rename\]\:text-accent-blue.status-rename{color:var(--accent-blue)}.\[\&\.stop\]\:bg-surface.stop{background-color:var(--surface)}.\[\&\.stop\]\:text-text.stop{color:var(--text)}.\[\&\.stop\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--surface\)_88\%\,_var\(--text\)\)\].stop:hover:not(:disabled){background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.\[\&\.stop\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--surface\)_88\%\,_var\(--text\)\)\].stop:hover:not(:disabled){background-color:color-mix(in oklab,var(--surface) 88%,var(--text))}}.\[\&\.unread_\.session-title\]\:font-semibold.unread .session-title{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&\.warn\]\:border-accent-amber.warn{border-color:var(--accent-amber)}.\[\&\.warn\]\:bg-accent-amber.warn{background-color:var(--accent-amber)}.\[\&\.warn\]\:bg-accent-amber-subtle.warn{background-color:var(--accent-amber-subtle)}.\[\&\.warn\]\:text-accent-amber.warn{color:var(--accent-amber)}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}.\[\&\:\:after\]\:absolute:after{position:absolute}.\[\&\:\:after\]\:top-full:after{top:100%}.\[\&\:\:after\]\:right-0:after{right:0}.\[\&\:\:after\]\:left-0:after{left:0}.\[\&\:\:after\]\:h-6:after{height:calc(var(--spacing) * 6)}.\[\&\:\:after\]\:bg-\[linear-gradient\(to_bottom\,_var\(--base\)\,_transparent\)\]:after{background-image:linear-gradient(to bottom,var(--base),transparent)}.\[\&\:\:after\]\:content-\[\'\'\]:after{--tw-content:"";content:var(--tw-content)}.\[\&\:\:before\]\:pointer-events-none:before{pointer-events:none}.\[\&\:\:before\]\:absolute:before{position:absolute}.\[\&\:\:before\]\:right-0:before{right:0}.\[\&\:\:before\]\:bottom-full:before{bottom:100%}.\[\&\:\:before\]\:left-0:before{left:0}.\[\&\:\:before\]\:h-6:before{height:calc(var(--spacing) * 6)}.\[\&\:\:before\]\:bg-\[linear-gradient\(to_top\,_var\(--base\)\,_transparent\)\]:before{background-image:linear-gradient(to top,var(--base),transparent)}.\[\&\:\:before\]\:content-\[\'\'\]:before{--tw-content:"";content:var(--tw-content)}.\[\&\:active\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_12\%\,_transparent\)\]:active{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\:active\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_12\%\,_transparent\)\]:active{background-color:color-mix(in oklab,var(--text) 12%,transparent)}}.\[\&\:active\:not\(\:disabled\)\]\:bg-highlight:active:not(:disabled){background-color:var(--highlight)}.\[\&\:disabled\]\:cursor-default:disabled{cursor:default}.\[\&\:disabled\]\:text-muted:disabled{color:var(--muted)}.\[\&\:disabled\]\:opacity-40:disabled{opacity:.4}.\[\&\:disabled\]\:opacity-45:disabled{opacity:.45}.\[\&\:disabled\]\:opacity-50:disabled{opacity:.5}.\[\&\:disabled\:hover\]\:bg-transparent:disabled:hover{background-color:#0000}.\[\&\:disabled\:hover\]\:text-subtext:disabled:hover{color:var(--subtext)}.\[\&\:focus\]\:border-accent-blue:focus{border-color:var(--accent-blue)}.\[\&\:focus-visible\]\:opacity-100:focus-visible{opacity:1}.\[\&\:focus-visible\]\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.\[\&\:focus-visible\]\:outline-offset-2:focus-visible{outline-offset:2px}.\[\&\:focus-visible\]\:outline-text:focus-visible{outline-color:var(--text)}.\[\&\:focus-visible\]\:outline-solid:focus-visible{--tw-outline-style:solid;outline-style:solid}.\[\&\:focus-within_\.session-menu-btn\]\:inline-flex:focus-within .session-menu-btn{display:inline-flex}.\[\&\:focus-within_\.session-time\]\:hidden:focus-within .session-time{display:none}.\[\&\:has\(input\:checked\)\]\:border-accent:has(input:checked){border-color:var(--accent)}.\[\&\:has\(input\:checked\)\]\:bg-primary-subtle:has(input:checked){background-color:var(--primary-subtle)}.\[\&\:hover\]\:-translate-y-px:hover{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\:hover\]\:rounded-lg:hover{border-radius:10px}.\[\&\:hover\]\:border-\[color-mix\(in_oklab\,_var\(--text\)_34\%\,_var\(--border\)\)\]:hover{border-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\]\:border-\[color-mix\(in_oklab\,_var\(--text\)_34\%\,_var\(--border\)\)\]:hover{border-color:color-mix(in oklab,var(--text) 34%,var(--border))}}.\[\&\:hover\]\:border-muted:hover{border-color:var(--muted)}.\[\&\:hover\]\:border-primary:hover{border-color:var(--primary)}.\[\&\:hover\]\:border-text:hover{border-color:var(--text)}.\[\&\:hover\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_12\%\,_transparent\)\]:hover{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_12\%\,_transparent\)\]:hover{background-color:color-mix(in oklab,var(--text) 12%,transparent)}}.\[\&\:hover\]\:bg-\[var\(--overlay\,_rgba\(0\,_0\,_0\,_0\.05\)\)\]:hover{background-color:var(--overlay,#0000000d)}.\[\&\:hover\]\:bg-canvas:hover{background-color:var(--canvas)}.\[\&\:hover\]\:bg-panel:hover{background-color:var(--panel)}.\[\&\:hover\]\:bg-surface:hover{background-color:var(--surface)}.\[\&\:hover\]\:bg-text:hover{background-color:var(--text)}.\[\&\:hover\]\:text-\[var\(--danger\,_\#d33\)\]:hover{color:var(--danger,#d33)}.\[\&\:hover\]\:text-background:hover{color:var(--base)}.\[\&\:hover\]\:text-text:hover{color:var(--text)}.\[\&\:hover\]\:underline:hover{text-decoration-line:underline}.\[\&\:hover\]\:shadow-\[0_2px_8px_rgba\(0\,_0\,_0\,_0\.08\)\]:hover{--tw-shadow:0 2px 8px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&\:hover\]\:shadow-\[0_3px_12px_color-mix\(in_srgb\,_var\(--text\)_8\%\,_transparent\)\]:hover{--tw-shadow:0 3px 12px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\]\:shadow-\[0_3px_12px_color-mix\(in_srgb\,_var\(--text\)_8\%\,_transparent\)\]:hover{--tw-shadow:0 3px 12px var(--tw-shadow-color,color-mix(in srgb, var(--text) 8%, transparent))}}.\[\&\:hover\]\:shadow-\[0_3px_12px_color-mix\(in_srgb\,_var\(--text\)_8\%\,_transparent\)\]:hover{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&\:hover_\.ft-row-delete\]\:opacity-100:hover .ft-row-delete,.\[\&\:hover_\.md-code-copy\]\:opacity-100:hover .md-code-copy{opacity:1}.\[\&\:hover_\.session-menu-btn\]\:inline-flex:hover .session-menu-btn{display:inline-flex}.\[\&\:hover_\.session-time\]\:hidden:hover .session-time{display:none}.\[\&\:hover\:not\(\.on\)\]\:bg-highlight:hover:not(.on){background-color:var(--highlight)}.\[\&\:hover\:not\(\.on\)\]\:text-text:hover:not(.on){color:var(--text)}.\[\&\:hover\:not\(\:disabled\)\]\:border-border-strong:hover:not(:disabled){border-color:var(--border-strong)}.\[\&\:hover\:not\(\:disabled\)\]\:border-border-variant:hover:not(:disabled){border-color:var(--border-variant)}.\[\&\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\]:hover:not(:disabled){background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\]:hover:not(:disabled){background-color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.\[\&\:hover\:not\(\:disabled\)\]\:bg-surface:hover:not(:disabled){background-color:var(--surface)}.\[\&\:is\(\:hover\,_\:focus-within\)_\.project-delete\]\:block:is(:hover,:focus-within) .project-delete{display:block}.\[\&\:last-child\]\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:absolute:not(.active)+.tab:not(.active):before{position:absolute}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:top-2\.5:not(.active)+.tab:not(.active):before{top:calc(var(--spacing) * 2.5)}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:bottom-2\.5:not(.active)+.tab:not(.active):before{bottom:calc(var(--spacing) * 2.5)}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:-left-px:not(.active)+.tab:not(.active):before{left:-1px}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:w-px:not(.active)+.tab:not(.active):before{width:1px}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:bg-border:not(.active)+.tab:not(.active):before{background-color:var(--border)}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:content-\[\'\'\]:not(.active)+.tab:not(.active):before{--tw-content:"";content:var(--tw-content)}.\[\&\[data-tip\]\:\:after\]\:top-auto[data-tip]:after{top:auto}.\[\&\[data-tip\]\:\:after\]\:bottom-\[calc\(100\%_\+_6px\)\][data-tip]:after{bottom:calc(100% + 6px)}.\[\&\[open\]_summary_\.plan-chevron\]\:rotate-90[open] summary .plan-chevron,.\[\&\[open\]_summary\:\:after\]\:rotate-90[open] summary:after{rotate:90deg}.chat-header .\[\.chat-header_\&\]\:min-w-0{min-width:0}.chat-header .\[\.chat-header_\&\]\:flex-1{flex:1}.chat-header .\[\.chat-header_\&\]\:overflow-hidden{overflow:hidden}.chat-header .\[\.chat-header_\&\]\:text-base{font-size:var(--fs-base)}.chat-header .\[\.chat-header_\&\]\:font-semibold{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.chat-header .\[\.chat-header_\&\]\:text-ellipsis{text-overflow:ellipsis}.chat-header .\[\.chat-header_\&\]\:whitespace-nowrap{white-space:nowrap}.chat-header .\[\.chat-header_\&\]\:text-text{color:var(--text)}.chat-header.rail-hidden>.\[\.chat-header\.rail-hidden_\>_\&\:first-child\]\:mr-3:first-child{margin-right:calc(var(--spacing) * 3)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.atrule\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.atrule{color:var(--syntax-orange)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.attr-name\]\:text-syntax-green,.openresearch-diff,.file-view) .token.attr-name{color:var(--syntax-green)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.attr-value\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.attr-value,:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.boolean\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.boolean{color:var(--syntax-orange)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.builtin\]\:text-syntax-yellow,.openresearch-diff,.file-view) .token.builtin{color:var(--syntax-yellow)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.cdata\]\:text-syntax-comment,.openresearch-diff,.file-view) .token.cdata{color:var(--syntax-comment)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.cdata\]\:italic,.openresearch-diff,.file-view) .token.cdata{font-style:italic}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.char\]\:text-syntax-green,.openresearch-diff,.file-view) .token.char{color:var(--syntax-green)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.class-name\]\:text-syntax-yellow,.openresearch-diff,.file-view) .token.class-name{color:var(--syntax-yellow)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.comment\]\:text-syntax-comment,.openresearch-diff,.file-view) .token.comment{color:var(--syntax-comment)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.comment\]\:italic,.openresearch-diff,.file-view) .token.comment{font-style:italic}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.constant\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.constant{color:var(--syntax-orange)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.decorator\]\:text-syntax-blue,.openresearch-diff,.file-view) .token.decorator,:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.def\]\:text-syntax-blue,.openresearch-diff,.file-view) .token.def{color:var(--syntax-blue)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.deleted\]\:text-syntax-red,.openresearch-diff,.file-view) .token.deleted{color:var(--syntax-red)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.entity\]\:text-syntax-cyan,.openresearch-diff,.file-view) .token.entity{color:var(--syntax-cyan)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.function\]\:text-syntax-blue,.openresearch-diff,.file-view) .token.function{color:var(--syntax-blue)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.important\]\:text-syntax-red,.openresearch-diff,.file-view) .token.important{color:var(--syntax-red)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.inserted\]\:text-syntax-green,.openresearch-diff,.file-view) .token.inserted{color:var(--syntax-green)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.keyword\]\:text-syntax-purple,.openresearch-diff,.file-view) .token.keyword{color:var(--syntax-purple)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.namespace\]\:text-syntax-yellow,.openresearch-diff,.file-view) .token.namespace{color:var(--syntax-yellow)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.number\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.number{color:var(--syntax-orange)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.operator\]\:text-syntax-cyan,.openresearch-diff,.file-view) .token.operator{color:var(--syntax-cyan)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.parameter\]\:text-syntax-text,.openresearch-diff,.file-view) .token.parameter{color:var(--syntax-text)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.prolog\]\:text-syntax-comment,.openresearch-diff,.file-view) .token.prolog{color:var(--syntax-comment)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.prolog\]\:italic,.openresearch-diff,.file-view) .token.prolog{font-style:italic}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.property\]\:text-syntax-red,.openresearch-diff,.file-view) .token.property{color:var(--syntax-red)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.punctuation\]\:text-syntax-text,.openresearch-diff,.file-view) .token.punctuation{color:var(--syntax-text)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.regex\]\:text-syntax-green,.openresearch-diff,.file-view) .token.regex,:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.selector\]\:text-syntax-green,.openresearch-diff,.file-view) .token.selector,:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.string\]\:text-syntax-green,.openresearch-diff,.file-view) .token.string{color:var(--syntax-green)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.symbol\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.symbol{color:var(--syntax-orange)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.tag\]\:text-syntax-red,.openresearch-diff,.file-view) .token.tag{color:var(--syntax-red)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.url\]\:text-syntax-cyan,.openresearch-diff,.file-view) .token.url{color:var(--syntax-cyan)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.variable\]\:text-syntax-red,.openresearch-diff,.file-view) .token.variable{color:var(--syntax-red)}@container (max-width:400px){.\[\@container\(\(max-width\:_400px\)\)\]\:grid-cols-\[minmax\(0\,_1fr\)\]{grid-template-columns:minmax(0,1fr)}.\[\@container\(\(max-width\:_400px\)\)\]\:\!flex-row{flex-direction:row!important}.\[\@container\(\(max-width\:_400px\)\)\]\:flex-wrap{flex-wrap:wrap}.\[\@container\(\(max-width\:_400px\)\)\]\:\!items-center{align-items:center!important}.\[\@container\(\(max-width\:_400px\)\)\]\:justify-start{justify-content:flex-start}.\[\@container\(\(max-width\:_400px\)\)\]\:gap-3{gap:calc(var(--spacing) * 3)}.\[\@container\(\(max-width\:_400px\)\)\]\:\[grid-template-areas\:\'name\'_\'meta\'_\'actions\'\]{grid-template-areas:"name""meta""actions"}}@container (max-width:560px){.\[\@container\(\(max-width\:_560px\)\)\]\:grid-cols-\[minmax\(0\,_1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.\[\@container\(\(max-width\:_560px\)\)\]\:flex-col{flex-direction:column}.\[\@container\(\(max-width\:_560px\)\)\]\:items-end{align-items:flex-end}.\[\@container\(\(max-width\:_560px\)\)\]\:gap-1\.5{gap:calc(var(--spacing) * 1.5)}.\[\@container\(\(max-width\:_560px\)\)\]\:gap-x-3\.5{column-gap:calc(var(--spacing) * 3.5)}.\[\@container\(\(max-width\:_560px\)\)\]\:gap-y-\[9px\]{row-gap:9px}.\[\@container\(\(max-width\:_560px\)\)\]\:\[\&\.danger\]\:ml-auto.danger{margin-left:auto}}@container (max-width:960px){.\[\@container\(\(max-width\:_960px\)\)\]\:static{position:static}.\[\@container\(\(max-width\:_960px\)\)\]\:max-h-55{max-height:calc(var(--spacing) * 55)}.\[\@container\(\(max-width\:_960px\)\)\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@container (min-width:500px){.\[\@container\(\(min-width\:_500px\)\)\]\:w-\[min\(100\%\,_720px\)\]{width:min(100%,720px)}.\[\@container\(\(min-width\:_500px\)\)\]\:grid-cols-\[repeat\(4\,_minmax\(0\,_1fr\)\)\]{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(max-width:640px){.\[\@media\(\(max-width\:_640px\)\)\]\:flex-col{flex-direction:column}.\[\@media\(\(max-width\:_640px\)\)\]\:items-stretch{align-items:stretch}.\[\@media\(\(max-width\:_640px\)\)\]\:justify-start{justify-content:flex-start}.\[\@media\(\(max-width\:_640px\)\)\]\:\[\&_\.kv\]\:grid-cols-1 .kv{grid-template-columns:repeat(1,minmax(0,1fr))}.\[\@media\(\(max-width\:_640px\)\)\]\:\[\&_\.kv\]\:gap-\[3px\] .kv{gap:3px}.\[\@media\(\(max-width\:_640px\)\)\]\:\[\&_\.kv_\.v_\+_\.k\]\:mt-\[7px\] .kv .v+.k{margin-top:7px}}@media(max-width:720px){.\[\@media\(\(max-width\:_720px\)\)\]\:flex-wrap{flex-wrap:wrap}.\[\@media\(\(max-width\:_720px\)\)\]\:px-4\.5{padding-inline:calc(var(--spacing) * 4.5)}.\[\@media\(\(max-width\:_720px\)\)\]\:pt-5{padding-top:calc(var(--spacing) * 5)}.\[\@media\(\(max-width\:_720px\)\)\]\:pb-8{padding-bottom:calc(var(--spacing) * 8)}.\[\@media\(\(max-width\:_720px\)\)\]\:\[\&_button\]\:grid-cols-\[65px_1fr_60px_16px\] button{grid-template-columns:65px 1fr 60px 16px}.\[\@media\(\(max-width\:_720px\)\)\]\:\[\&_button_\>_\:nth-child\(3\)\]\:hidden button>:nth-child(3){display:none}}@media(prefers-reduced-motion:reduce){.\[\@media\(\(prefers-reduced-motion\:_reduce\)\)\]\:animate-none{animation:none}}a.\[a\&\:hover\]\:border-muted:hover{border-color:var(--muted)}button.\[button\&\]\:inline-flex{display:inline-flex}button.\[button\&\]\:h-\[13px\]{height:13px}button.\[button\&\]\:w-\[13px\]{width:13px}button.\[button\&\]\:cursor-pointer{cursor:pointer}button.\[button\&\]\:items-center{align-items:center}button.\[button\&\]\:justify-center{justify-content:center}button.\[button\&\]\:border-0{border-style:var(--tw-border-style);border-width:0}button.\[button\&\]\:bg-transparent{background-color:#0000}button.\[button\&\]\:p-0{padding:0}button.\[button\&_\>_svg\]\:transition-transform>svg{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}button.\[button\&_\>_svg\]\:duration-120>svg{--tw-duration:.12s;transition-duration:.12s}button.\[button\&_\>_svg\]\:ease-standard>svg{--tw-ease:ease;transition-timing-function:ease}button.\[button\&_\>_svg\.open\]\:rotate-90>svg.open{rotate:90deg}button.\[button\&\:hover\]\:border-muted:hover{border-color:var(--muted)}}:root{--base:#fff;--canvas:#faf8f4;--panel:#f3f0ea;--surface:#faf7f2;--surface-bright:#fdfbfb;--highlight:#fdf3f1;--chat-annotation-highlight:#b8d4ff;--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;--fs-2xs:10px;--fs-xs:11px;--fs-sm:13px;--fs-md:14px;--fs-base:15px;--fs-lg:16px;--fs-xl:16px;--fs-2xl:18px;--fs-3xl:22px;--fs-4xl:28px;--fs-5xl:34px;--fw-regular:400;--fw-medium:500;--fw-semibold:600;--fw-display:700;--modal-top:min(30vh, 260px);--term-bg:#1a1a1a;--readable-col:840px;--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);--syntax-comment:#a0a1a7;--syntax-text:#383a42;--syntax-red:#e45649;--syntax-orange:#986801;--syntax-green:#50a14f;--syntax-yellow:#c18401;--syntax-cyan:#56b6c2;--syntax-purple:#a626a4;--syntax-blue:#4078f2;color-scheme:light}:root[data-theme=dark]{--base:#0e0c0c;--canvas:#141110;--panel:#221f1e;--surface:#1d1b1a;--surface-bright:#130f0f;--highlight:#393433;--chat-annotation-highlight:#244e7a;--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:#555;--syntax-comment:#7f848e;--syntax-text:#abb2bf;--syntax-red:#e06c75;--syntax-orange:#d19a66;--syntax-green:#98c379;--syntax-yellow:#e5c07b;--syntax-purple:#c678dd;--syntax-blue:#61afef;color-scheme:dark}@keyframes or-pulse{50%{opacity:.35}}@keyframes tool-target-reveal{0%{opacity:0;filter:blur(1.5px)}to{opacity:1;filter:blur()}}@keyframes tool-running-shimmer{0%{background-position:200% 0}to{background-position:-100% 0}}@keyframes tool-running-shimmer-icon{0%,to{color:var(--muted);opacity:.35}50%{color:color-mix(in srgb,var(--text) 58%,var(--subtext));opacity:1}}.tool-running-shimmer{color:#0000;background:linear-gradient(100deg,var(--muted) 12%,var(--subtext) 34%,var(--text) 50%,var(--subtext) 66%,var(--muted) 88%)}@supports (color:color-mix(in lab,red,red)){.tool-running-shimmer{background:linear-gradient(100deg,var(--muted) 12%,var(--subtext) 34%,color-mix(in srgb,var(--text) 58%,var(--subtext)) 50%,var(--subtext) 66%,var(--muted) 88%)}}.tool-running-shimmer{-webkit-text-fill-color:transparent;background-size:300% 100%;-webkit-background-clip:text;background-clip:text;animation:1.75s linear infinite tool-running-shimmer}.tool-running-shimmer::selection{color:var(--text);-webkit-text-fill-color:var(--text)}.tool-running-shimmer-icon{color:var(--muted);animation:1.75s ease-in-out infinite tool-running-shimmer-icon}.tool-active-label{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.tool-group-summary .tool-group-label{transition:color .12s;transform:translateY(-1px)}.tool-group-summary:hover .tool-group-label,.tool-group-summary:hover .tool-chevron{color:var(--text)}.tool-group-disclosure{grid-template-rows:0fr;transition:grid-template-rows .22s cubic-bezier(.2,.75,.25,1);display:grid}.tool-group-disclosure.open{grid-template-rows:1fr}.tool-group-disclosure-inner{min-height:0;position:relative;overflow:hidden}.tool-target-reveal{animation:.18s cubic-bezier(.2,.75,.25,1) tool-target-reveal}.tool-target,.tool-target-more{color:inherit;font-weight:inherit;text-underline-offset:3px;-webkit-text-decoration-skip-ink:auto;text-decoration-skip-ink:auto;text-decoration-line:underline;text-decoration-thickness:.6px;transition:color .14s,text-decoration-color .14s}.tool-line,.tool-group-summary{font-weight:375}.tool-group-rows .tool-line{font-size:var(--fs-md)}.msg-assistant .md table{margin-block:14px;margin-inline:auto}.msg-assistant .md th,.msg-assistant .md td{padding-block:10px}.msg-assistant .md figure{width:fit-content;max-width:100%;margin-inline:auto}.msg-assistant .md img{max-width:100%;height:auto;margin-inline:auto;display:block}.md[data-streaming=true] .katex-error{visibility:hidden}.tool-target{-webkit-text-decoration-color:var(--border-strong);text-decoration-color:var(--border-strong)}.tool-target-more{text-decoration-color:#0000}.tool-target:hover,.tool-target-more:hover{color:var(--primary);-webkit-text-decoration-color:var(--border-strong);text-decoration-color:var(--border-strong)}.tool-target:focus-visible,.tool-target-more:focus-visible{color:var(--primary);-webkit-text-decoration-color:var(--border-strong);text-decoration-color:var(--border-strong);outline:1px solid var(--border-strong);outline-offset:2px}@media(prefers-reduced-motion:reduce){.tool-group-disclosure{transition:none}.tool-target-reveal{animation:none}.tool-running-shimmer{color:var(--subtext);-webkit-text-fill-color:currentColor;background:0 0;animation:none}.tool-running-shimmer-icon{animation:none}}@media(forced-colors:active){.tool-running-shimmer{color:canvastext;-webkit-text-fill-color:currentColor;background:0 0;animation:none}.tool-running-shimmer::selection{color:highlighttext;-webkit-text-fill-color:HighlightText}.tool-running-shimmer-icon{color:canvastext;animation:none}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes title-char-in{0%{opacity:0;filter:blur(4px);transform:translateY(.15em)}}@keyframes settings-spin{to{transform:rotate(360deg)}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0} diff --git a/ui/dist/assets/index-E_PWOcfp.js b/ui/dist/assets/index-E_PWOcfp.js deleted file mode 100644 index 811356c6..00000000 --- a/ui/dist/assets/index-E_PWOcfp.js +++ /dev/null @@ -1,1030 +0,0 @@ -var F5=e=>{throw TypeError(e)};var P5=(e,t,n)=>t.has(e)||F5("Cannot "+n);var kn=(e,t,n)=>(P5(e,t,"read from private field"),n?n.call(e):t.get(e)),Ti=(e,t,n)=>t.has(e)?F5("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),wr=(e,t,n,r)=>(P5(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var U5=(e,t,n,r)=>({set _(i){wr(e,t,i,n)},get _(){return kn(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function np(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Q1={exports:{}},Wu={};/** - * @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 q5;function aj(){if(q5)return Wu;q5=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var l in i)l!=="key"&&(a[l]=i[l])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:a}}return Wu.Fragment=t,Wu.jsx=n,Wu.jsxs=n,Wu}var G5;function oj(){return G5||(G5=1,Q1.exports=aj()),Q1.exports}var h=oj(),J1={exports:{}},wt={};/** - * @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 V5;function lj(){if(V5)return wt;V5=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),g=Symbol.iterator;function b(H){return H===null||typeof H!="object"?null:(H=g&&H[g]||H["@@iterator"],typeof H=="function"?H:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,x={};function _(H,V,W){this.props=H,this.context=V,this.refs=x,this.updater=W||k}_.prototype.isReactComponent={},_.prototype.setState=function(H,V){if(typeof H!="object"&&typeof H!="function"&&H!=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,H,V,"setState")},_.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function w(){}w.prototype=_.prototype;function y(H,V,W){this.props=H,this.context=V,this.refs=x,this.updater=W||k}var C=y.prototype=new w;C.constructor=y,S(C,_.prototype),C.isPureReactComponent=!0;var N=Array.isArray;function E(){}var j={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function D(H,V,W){var re=W.ref;return{$$typeof:e,type:H,key:V,ref:re!==void 0?re:null,props:W}}function I(H,V){return D(H.type,V,H.props)}function $(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function F(H){var V={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(W){return V[W]})}var U=/\/+/g;function G(H,V){return typeof H=="object"&&H!==null&&H.key!=null?F(""+H.key):V.toString(36)}function X(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(E,E):(H.status="pending",H.then(function(V){H.status==="pending"&&(H.status="fulfilled",H.value=V)},function(V){H.status==="pending"&&(H.status="rejected",H.reason=V)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function Y(H,V,W,re,le){var pe=typeof H;(pe==="undefined"||pe==="boolean")&&(H=null);var te=!1;if(H===null)te=!0;else switch(pe){case"bigint":case"string":case"number":te=!0;break;case"object":switch(H.$$typeof){case e:case t:te=!0;break;case m:return te=H._init,Y(te(H._payload),V,W,re,le)}}if(te)return le=le(H),te=re===""?"."+G(H,0):re,N(le)?(W="",te!=null&&(W=te.replace(U,"$&/")+"/"),Y(le,V,W,"",function(oe){return oe})):le!=null&&($(le)&&(le=I(le,W+(le.key==null||H&&H.key===le.key?"":(""+le.key).replace(U,"$&/")+"/")+te)),V.push(le)),1;te=0;var B=re===""?".":re+":";if(N(H))for(var ie=0;ie>>1,O=Y[z];if(0>>1;zi(W,Q))rei(le,W)?(Y[z]=le,Y[re]=Q,z=re):(Y[z]=W,Y[V]=Q,z=V);else if(rei(le,Q))Y[z]=le,Y[re]=Q,z=re;else break e}}return Z}function i(Y,Z){var Q=Y.sortIndex-Z.sortIndex;return Q!==0?Q:Y.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var u=[],d=[],m=1,f=null,g=3,b=!1,k=!1,S=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function C(Y){for(var Z=n(d);Z!==null;){if(Z.callback===null)r(d);else if(Z.startTime<=Y)r(d),Z.sortIndex=Z.expirationTime,t(u,Z);else break;Z=n(d)}}function N(Y){if(S=!1,C(Y),!k)if(n(u)!==null)k=!0,E||(E=!0,F());else{var Z=n(d);Z!==null&&X(N,Z.startTime-Y)}}var E=!1,j=-1,T=5,D=-1;function I(){return x?!0:!(e.unstable_now()-DY&&I());){var z=f.callback;if(typeof z=="function"){f.callback=null,g=f.priorityLevel;var O=z(f.expirationTime<=Y);if(Y=e.unstable_now(),typeof O=="function"){f.callback=O,C(Y),Z=!0;break t}f===n(u)&&r(u),C(Y)}else r(u);f=n(u)}if(f!==null)Z=!0;else{var H=n(d);H!==null&&X(N,H.startTime-Y),Z=!1}}break e}finally{f=null,g=Q,b=!1}Z=void 0}}finally{Z?F():E=!1}}}var F;if(typeof y=="function")F=function(){y($)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,G=U.port2;U.port1.onmessage=$,F=function(){G.postMessage(null)}}else F=function(){_($,0)};function X(Y,Z){j=_(function(){Y(e.unstable_now())},Z)}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(Y){Y.callback=null},e.unstable_forceFrameRate=function(Y){0>Y||125z?(Y.sortIndex=Q,t(d,Y),n(u)===null&&Y===n(d)&&(S?(w(j),j=-1):S=!0,X(N,Q-z))):(Y.sortIndex=O,t(u,Y),k||b||(k=!0,E||(E=!0,F()))),Y},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(Y){var Z=g;return function(){var Q=g;g=Z;try{return Y.apply(this,arguments)}finally{g=Q}}}})(ng)),ng}var X5;function dj(){return X5||(X5=1,tg.exports=uj()),tg.exports}var rg={exports:{}},jr={};/** - * @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 K5;function hj(){if(K5)return jr;K5=1;var e=eh();function t(u){var d="https://react.dev/errors/"+u;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),rg.exports=hj(),rg.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 Q5;function fj(){if(Q5)return Yu;Q5=1;var e=dj(),t=eh(),n=U8();function r(s){var c="https://react.dev/errors/"+s;if(1O||(s.current=z[O],z[O]=null,O--)}function W(s,c){O++,z[O]=s.current,s.current=c}var re=H(null),le=H(null),pe=H(null),te=H(null);function B(s,c){switch(W(pe,c),W(le,s),W(re,null),c.nodeType){case 9:case 11:s=(s=c.documentElement)&&(s=s.namespaceURI)?u5(s):0;break;default:if(s=c.tagName,c=c.namespaceURI)c=u5(c),s=d5(c,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}V(re),W(re,s)}function ie(){V(re),V(le),V(pe)}function oe(s){s.memoizedState!==null&&W(te,s);var c=re.current,p=d5(c,s.type);c!==p&&(W(le,s),W(re,p))}function be(s){le.current===s&&(V(re),V(le)),te.current===s&&(V(te),Uu._currentValue=Q)}var ge,Ce;function Le(s){if(ge===void 0)try{throw Error()}catch(p){var c=p.stack.trim().match(/\n( *(at )?)/);ge=c&&c[1]||"",Ce=-1)":-1A||ue[v]!==_e[A]){var Ae=` -`+ue[v].replace(" at new "," at ");return s.displayName&&Ae.includes("")&&(Ae=Ae.replace("",s.displayName)),Ae}while(1<=v&&0<=A);break}}}finally{Ue=!1,Error.prepareStackTrace=p}return(p=s?s.displayName||s.name:"")?Le(p):""}function Fe(s,c){switch(s.tag){case 26:case 27:case 5:return Le(s.type);case 16:return Le("Lazy");case 13:return s.child!==c&&c!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return We(s.type,!1);case 11:return We(s.type.render,!1);case 1:return We(s.type,!0);case 31:return Le("Activity");default:return""}}function mt(s){try{var c="",p=null;do c+=Fe(s,p),p=s,s=s.return;while(s);return c}catch(v){return` -Error generating stack: `+v.message+` -`+v.stack}}var De=Object.prototype.hasOwnProperty,ot=e.unstable_scheduleCallback,Bt=e.unstable_cancelCallback,on=e.unstable_shouldYield,Ze=e.unstable_requestPaint,ct=e.unstable_now,st=e.unstable_getCurrentPriorityLevel,xe=e.unstable_ImmediatePriority,Me=e.unstable_UserBlockingPriority,Ge=e.unstable_NormalPriority,Qe=e.unstable_LowPriority,Oe=e.unstable_IdlePriority,tt=e.log,it=e.unstable_setDisableYieldValue,jt=null,_t=null;function Tt(s){if(typeof tt=="function"&&it(s),_t&&typeof _t.setStrictMode=="function")try{_t.setStrictMode(jt,s)}catch{}}var ut=Math.clz32?Math.clz32:Or,xn=Math.log,dr=Math.LN2;function Or(s){return s>>>=0,s===0?32:31-(xn(s)/dr|0)|0}var os=256,ls=262144,gi=4194304;function pr(s){var c=s&42;if(c!==0)return c;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Ts(s,c,p){var v=s.pendingLanes;if(v===0)return 0;var A=0,M=s.suspendedLanes,q=s.pingedLanes;s=s.warmLanes;var J=v&134217727;return J!==0?(v=J&~M,v!==0?A=pr(v):(q&=J,q!==0?A=pr(q):p||(p=J&~s,p!==0&&(A=pr(p))))):(J=v&~M,J!==0?A=pr(J):q!==0?A=pr(q):p||(p=v&~s,p!==0&&(A=pr(p)))),A===0?0:c!==0&&c!==A&&(c&M)===0&&(M=A&-A,p=c&-c,M>=p||M===32&&(p&4194048)!==0)?c:A}function Jn(s,c){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&c)===0}function Xr(s,c){switch(s){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 Kr(){var s=gi;return gi<<=1,(gi&62914560)===0&&(gi=4194304),s}function yn(s){for(var c=[],p=0;31>p;p++)c.push(s);return c}function mn(s,c){s.pendingLanes|=c,c!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function bi(s,c,p,v,A,M){var q=s.pendingLanes;s.pendingLanes=p,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=p,s.entangledLanes&=p,s.errorRecoveryDisabledLanes&=p,s.shellSuspendCounter=0;var J=s.entanglements,ue=s.expirationTimes,_e=s.hiddenUpdates;for(p=q&~p;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var Ga=/[\n"\\]/g;function ir(s){return s.replace(Ga,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function aa(s,c,p,v,A,M,q,J){s.name="",q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?s.type=q:s.removeAttribute("type"),c!=null?q==="number"?(c===0&&s.value===""||s.value!=c)&&(s.value=""+rr(c)):s.value!==""+rr(c)&&(s.value=""+rr(c)):q!=="submit"&&q!=="reset"||s.removeAttribute("value"),c!=null?Ms(s,q,rr(c)):p!=null?Ms(s,q,rr(p)):v!=null&&s.removeAttribute("value"),A==null&&M!=null&&(s.defaultChecked=!!M),A!=null&&(s.checked=A&&typeof A!="function"&&typeof A!="symbol"),J!=null&&typeof J!="function"&&typeof J!="symbol"&&typeof J!="boolean"?s.name=""+rr(J):s.removeAttribute("name")}function cn(s,c,p,v,A,M,q,J){if(M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(s.type=M),c!=null||p!=null){if(!(M!=="submit"&&M!=="reset"||c!=null)){sa(s);return}p=p!=null?""+rr(p):"",c=c!=null?""+rr(c):p,J||c===s.value||(s.value=c),s.defaultValue=c}v=v??A,v=typeof v!="function"&&typeof v!="symbol"&&!!v,s.checked=J?s.checked:!!v,s.defaultChecked=!!v,q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"&&(s.name=q),sa(s)}function Ms(s,c,p){c==="number"&&ti(s.ownerDocument)===s||s.defaultValue===""+p||(s.defaultValue=""+p)}function gn(s,c,p,v){if(s=s.options,c){c={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_i=!1;if(St)try{var Wi={};Object.defineProperty(Wi,"passive",{get:function(){_i=!0}}),window.addEventListener("test",Wi,Wi),window.removeEventListener("test",Wi,Wi)}catch{_i=!1}var Yi=null,Wa=null,ds=null;function se(){if(ds)return ds;var s,c=Wa,p=c.length,v,A="value"in Yi?Yi.value:Yi.textContent,M=A.length;for(s=0;s=uu),bx=" ",vx=!1;function _x(s,c){switch(s){case"keyup":return TT.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xx(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var ql=!1;function jT(s,c){switch(s){case"compositionend":return xx(c);case"keypress":return c.which!==32?null:(vx=!0,bx);case"textInput":return s=c.data,s===bx&&vx?null:s;default:return null}}function MT(s,c){if(ql)return s==="compositionend"||!im&&_x(s,c)?(s=se(),ds=Wa=Yi=null,ql=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:p,offset:c-s};s=v}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=Tx(p)}}function jx(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?jx(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function Mx(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var c=ti(s.document);c instanceof s.HTMLIFrameElement;){try{var p=typeof c.contentWindow.location.href=="string"}catch{p=!1}if(p)s=c.contentWindow;else break;c=ti(s.document)}return c}function om(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}var HT=St&&"documentMode"in document&&11>=document.documentMode,Gl=null,lm=null,pu=null,cm=!1;function Rx(s,c,p){var v=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;cm||Gl==null||Gl!==ti(v)||(v=Gl,"selectionStart"in v&&om(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),pu&&fu(pu,v)||(pu=v,v=p0(lm,"onSelect"),0>=q,A-=q,Os=1<<32-ut(c)+A|p<Ct?(It=rt,rt=null):It=rt.sibling;var Vt=ye(me,rt,ve[Ct],Ne);if(Vt===null){rt===null&&(rt=It);break}s&&rt&&Vt.alternate===null&&c(me,rt),de=M(Vt,de,Ct),Gt===null?ht=Vt:Gt.sibling=Vt,Gt=Vt,rt=It}if(Ct===ve.length)return p(me,rt),Ht&&ca(me,Ct),ht;if(rt===null){for(;CtCt?(It=rt,rt=null):It=rt.sibling;var bo=ye(me,rt,Vt.value,Ne);if(bo===null){rt===null&&(rt=It);break}s&&rt&&bo.alternate===null&&c(me,rt),de=M(bo,de,Ct),Gt===null?ht=bo:Gt.sibling=bo,Gt=bo,rt=It}if(Vt.done)return p(me,rt),Ht&&ca(me,Ct),ht;if(rt===null){for(;!Vt.done;Ct++,Vt=ve.next())Vt=je(me,Vt.value,Ne),Vt!==null&&(de=M(Vt,de,Ct),Gt===null?ht=Vt:Gt.sibling=Vt,Gt=Vt);return Ht&&ca(me,Ct),ht}for(rt=v(rt);!Vt.done;Ct++,Vt=ve.next())Vt=ke(rt,me,Ct,Vt.value,Ne),Vt!==null&&(s&&Vt.alternate!==null&&rt.delete(Vt.key===null?Ct:Vt.key),de=M(Vt,de,Ct),Gt===null?ht=Vt:Gt.sibling=Vt,Gt=Vt);return s&&rt.forEach(function(sj){return c(me,sj)}),Ht&&ca(me,Ct),ht}function an(me,de,ve,Ne){if(typeof ve=="object"&&ve!==null&&ve.type===S&&ve.key===null&&(ve=ve.props.children),typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case b:e:{for(var ht=ve.key;de!==null;){if(de.key===ht){if(ht=ve.type,ht===S){if(de.tag===7){p(me,de.sibling),Ne=A(de,ve.props.children),Ne.return=me,me=Ne;break e}}else if(de.elementType===ht||typeof ht=="object"&&ht!==null&&ht.$$typeof===T&&Qo(ht)===de.type){p(me,de.sibling),Ne=A(de,ve.props),xu(Ne,ve),Ne.return=me,me=Ne;break e}p(me,de);break}else c(me,de);de=de.sibling}ve.type===S?(Ne=Wo(ve.props.children,me.mode,Ne,ve.key),Ne.return=me,me=Ne):(Ne=Mh(ve.type,ve.key,ve.props,null,me.mode,Ne),xu(Ne,ve),Ne.return=me,me=Ne)}return q(me);case k:e:{for(ht=ve.key;de!==null;){if(de.key===ht)if(de.tag===4&&de.stateNode.containerInfo===ve.containerInfo&&de.stateNode.implementation===ve.implementation){p(me,de.sibling),Ne=A(de,ve.children||[]),Ne.return=me,me=Ne;break e}else{p(me,de);break}else c(me,de);de=de.sibling}Ne=gm(ve,me.mode,Ne),Ne.return=me,me=Ne}return q(me);case T:return ve=Qo(ve),an(me,de,ve,Ne)}if(X(ve))return et(me,de,ve,Ne);if(F(ve)){if(ht=F(ve),typeof ht!="function")throw Error(r(150));return ve=ht.call(ve),gt(me,de,ve,Ne)}if(typeof ve.then=="function")return an(me,de,Bh(ve),Ne);if(ve.$$typeof===y)return an(me,de,Lh(me,ve),Ne);Hh(me,ve)}return typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint"?(ve=""+ve,de!==null&&de.tag===6?(p(me,de.sibling),Ne=A(de,ve),Ne.return=me,me=Ne):(p(me,de),Ne=mm(ve,me.mode,Ne),Ne.return=me,me=Ne),q(me)):p(me,de)}return function(me,de,ve,Ne){try{_u=0;var ht=an(me,de,ve,Ne);return nc=null,ht}catch(rt){if(rt===tc||rt===Ih)throw rt;var Gt=wi(29,rt,null,me.mode);return Gt.lanes=Ne,Gt.return=me,Gt}finally{}}}var el=t4(!0),n4=t4(!1),Ja=!1;function Tm(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nm(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function eo(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function to(s,c,p){var v=s.updateQueue;if(v===null)return null;if(v=v.shared,(Wt&2)!==0){var A=v.pending;return A===null?c.next=c:(c.next=A.next,A.next=c),v.pending=c,c=jh(s),Hx(s,null,p),c}return Nh(s,v,c,p),jh(s)}function yu(s,c,p){if(c=c.updateQueue,c!==null&&(c=c.shared,(p&4194048)!==0)){var v=c.lanes;v&=s.pendingLanes,p|=v,c.lanes=p,Ui(s,p)}}function jm(s,c){var p=s.updateQueue,v=s.alternate;if(v!==null&&(v=v.updateQueue,p===v)){var A=null,M=null;if(p=p.firstBaseUpdate,p!==null){do{var q={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};M===null?A=M=q:M=M.next=q,p=p.next}while(p!==null);M===null?A=M=c:M=M.next=c}else A=M=c;p={baseState:v.baseState,firstBaseUpdate:A,lastBaseUpdate:M,shared:v.shared,callbacks:v.callbacks},s.updateQueue=p;return}s=p.lastBaseUpdate,s===null?p.firstBaseUpdate=c:s.next=c,p.lastBaseUpdate=c}var Mm=!1;function wu(){if(Mm){var s=ec;if(s!==null)throw s}}function Su(s,c,p,v){Mm=!1;var A=s.updateQueue;Ja=!1;var M=A.firstBaseUpdate,q=A.lastBaseUpdate,J=A.shared.pending;if(J!==null){A.shared.pending=null;var ue=J,_e=ue.next;ue.next=null,q===null?M=_e:q.next=_e,q=ue;var Ae=s.alternate;Ae!==null&&(Ae=Ae.updateQueue,J=Ae.lastBaseUpdate,J!==q&&(J===null?Ae.firstBaseUpdate=_e:J.next=_e,Ae.lastBaseUpdate=ue))}if(M!==null){var je=A.baseState;q=0,Ae=_e=ue=null,J=M;do{var ye=J.lane&-536870913,ke=ye!==J.lane;if(ke?(Ot&ye)===ye:(v&ye)===ye){ye!==0&&ye===Jl&&(Mm=!0),Ae!==null&&(Ae=Ae.next={lane:0,tag:J.tag,payload:J.payload,callback:null,next:null});e:{var et=s,gt=J;ye=c;var an=p;switch(gt.tag){case 1:if(et=gt.payload,typeof et=="function"){je=et.call(an,je,ye);break e}je=et;break e;case 3:et.flags=et.flags&-65537|128;case 0:if(et=gt.payload,ye=typeof et=="function"?et.call(an,je,ye):et,ye==null)break e;je=f({},je,ye);break e;case 2:Ja=!0}}ye=J.callback,ye!==null&&(s.flags|=64,ke&&(s.flags|=8192),ke=A.callbacks,ke===null?A.callbacks=[ye]:ke.push(ye))}else ke={lane:ye,tag:J.tag,payload:J.payload,callback:J.callback,next:null},Ae===null?(_e=Ae=ke,ue=je):Ae=Ae.next=ke,q|=ye;if(J=J.next,J===null){if(J=A.shared.pending,J===null)break;ke=J,J=ke.next,ke.next=null,A.lastBaseUpdate=ke,A.shared.pending=null}}while(!0);Ae===null&&(ue=je),A.baseState=ue,A.firstBaseUpdate=_e,A.lastBaseUpdate=Ae,M===null&&(A.shared.lanes=0),ao|=q,s.lanes=q,s.memoizedState=je}}function r4(s,c){if(typeof s!="function")throw Error(r(191,s));s.call(c)}function i4(s,c){var p=s.callbacks;if(p!==null)for(s.callbacks=null,s=0;sM?M:8;var q=Y.T,J={};Y.T=J,Km(s,!1,c,p);try{var ue=A(),_e=Y.S;if(_e!==null&&_e(J,ue),ue!==null&&typeof ue=="object"&&typeof ue.then=="function"){var Ae=YT(ue,v);Eu(s,c,Ae,Ai(s))}else Eu(s,c,v,Ai(s))}catch(je){Eu(s,c,{then:function(){},status:"rejected",reason:je},Ai())}finally{Z.p=M,q!==null&&J.types!==null&&(q.types=J.types),Y.T=q}}function eN(){}function Ym(s,c,p,v){if(s.tag!==5)throw Error(r(476));var A=I4(s).queue;O4(s,A,c,Q,p===null?eN:function(){return z4(s),p(v)})}function I4(s){var c=s.memoizedState;if(c!==null)return c;c={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:Q},next:null};var p={};return c.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:p},next:null},s.memoizedState=c,s=s.alternate,s!==null&&(s.memoizedState=c),c}function z4(s){var c=I4(s);c.next===null&&(c=s.alternate.memoizedState),Eu(s,c.next.queue,{},Ai())}function Xm(){return _r(Uu)}function B4(){return Bn().memoizedState}function H4(){return Bn().memoizedState}function tN(s){for(var c=s.return;c!==null;){switch(c.tag){case 24:case 3:var p=Ai();s=eo(p);var v=to(c,s,p);v!==null&&(li(v,c,p),yu(v,c,p)),c={cache:km()},s.payload=c;return}c=c.return}}function nN(s,c,p){var v=Ai();p={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Xh(s)?F4(c,p):(p=fm(s,c,p,v),p!==null&&(li(p,s,v),P4(p,c,v)))}function $4(s,c,p){var v=Ai();Eu(s,c,p,v)}function Eu(s,c,p,v){var A={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(Xh(s))F4(c,A);else{var M=s.alternate;if(s.lanes===0&&(M===null||M.lanes===0)&&(M=c.lastRenderedReducer,M!==null))try{var q=c.lastRenderedState,J=M(q,p);if(A.hasEagerState=!0,A.eagerState=J,yi(J,q))return Nh(s,c,A,0),un===null&&Th(),!1}catch{}finally{}if(p=fm(s,c,A,v),p!==null)return li(p,s,v),P4(p,c,v),!0}return!1}function Km(s,c,p,v){if(v={lane:2,revertLane:T1(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},Xh(s)){if(c)throw Error(r(479))}else c=fm(s,p,v,2),c!==null&&li(c,s,2)}function Xh(s){var c=s.alternate;return s===kt||c!==null&&c===kt}function F4(s,c){ic=Ph=!0;var p=s.pending;p===null?c.next=c:(c.next=p.next,p.next=c),s.pending=c}function P4(s,c,p){if((p&4194048)!==0){var v=c.lanes;v&=s.pendingLanes,p|=v,c.lanes=p,Ui(s,p)}}var Au={readContext:_r,use:Gh,useCallback:Dn,useContext:Dn,useEffect:Dn,useImperativeHandle:Dn,useLayoutEffect:Dn,useInsertionEffect:Dn,useMemo:Dn,useReducer:Dn,useRef:Dn,useState:Dn,useDebugValue:Dn,useDeferredValue:Dn,useTransition:Dn,useSyncExternalStore:Dn,useId:Dn,useHostTransitionStatus:Dn,useFormState:Dn,useActionState:Dn,useOptimistic:Dn,useMemoCache:Dn,useCacheRefresh:Dn};Au.useEffectEvent=Dn;var U4={readContext:_r,use:Gh,useCallback:function(s,c){return Fr().memoizedState=[s,c===void 0?null:c],s},useContext:_r,useEffect:E4,useImperativeHandle:function(s,c,p){p=p!=null?p.concat([s]):null,Wh(4194308,4,j4.bind(null,c,s),p)},useLayoutEffect:function(s,c){return Wh(4194308,4,s,c)},useInsertionEffect:function(s,c){Wh(4,2,s,c)},useMemo:function(s,c){var p=Fr();c=c===void 0?null:c;var v=s();if(tl){Tt(!0);try{s()}finally{Tt(!1)}}return p.memoizedState=[v,c],v},useReducer:function(s,c,p){var v=Fr();if(p!==void 0){var A=p(c);if(tl){Tt(!0);try{p(c)}finally{Tt(!1)}}}else A=c;return v.memoizedState=v.baseState=A,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:A},v.queue=s,s=s.dispatch=nN.bind(null,kt,s),[v.memoizedState,s]},useRef:function(s){var c=Fr();return s={current:s},c.memoizedState=s},useState:function(s){s=Um(s);var c=s.queue,p=$4.bind(null,kt,c);return c.dispatch=p,[s.memoizedState,p]},useDebugValue:Vm,useDeferredValue:function(s,c){var p=Fr();return Wm(p,s,c)},useTransition:function(){var s=Um(!1);return s=O4.bind(null,kt,s.queue,!0,!1),Fr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,c,p){var v=kt,A=Fr();if(Ht){if(p===void 0)throw Error(r(407));p=p()}else{if(p=c(),un===null)throw Error(r(349));(Ot&127)!==0||u4(v,c,p)}A.memoizedState=p;var M={value:p,getSnapshot:c};return A.queue=M,E4(h4.bind(null,v,M,s),[s]),v.flags|=2048,ac(9,{destroy:void 0},d4.bind(null,v,M,p,c),null),p},useId:function(){var s=Fr(),c=un.identifierPrefix;if(Ht){var p=Is,v=Os;p=(v&~(1<<32-ut(v)-1)).toString(32)+p,c="_"+c+"R_"+p,p=Uh++,0<\/script>",M=M.removeChild(M.firstChild);break;case"select":M=typeof v.is=="string"?q.createElement("select",{is:v.is}):q.createElement("select"),v.multiple?M.multiple=!0:v.size&&(M.size=v.size);break;default:M=typeof v.is=="string"?q.createElement(A,{is:v.is}):q.createElement(A)}}M[ft]=c,M[In]=v;e:for(q=c.child;q!==null;){if(q.tag===5||q.tag===6)M.appendChild(q.stateNode);else if(q.tag!==4&&q.tag!==27&&q.child!==null){q.child.return=q,q=q.child;continue}if(q===c)break e;for(;q.sibling===null;){if(q.return===null||q.return===c)break e;q=q.return}q.sibling.return=q.return,q=q.sibling}c.stateNode=M;e:switch(yr(M,A,v),A){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&ma(c)}}return vn(c),u1(c,c.type,s===null?null:s.memoizedProps,c.pendingProps,p),null;case 6:if(s&&c.stateNode!=null)s.memoizedProps!==v&&ma(c);else{if(typeof v!="string"&&c.stateNode===null)throw Error(r(166));if(s=pe.current,Zl(c)){if(s=c.stateNode,p=c.memoizedProps,v=null,A=vr,A!==null)switch(A.tag){case 27:case 5:v=A.memoizedProps}s[ft]=c,s=!!(s.nodeValue===p||v!==null&&v.suppressHydrationWarning===!0||l5(s.nodeValue,p)),s||Za(c,!0)}else s=m0(s).createTextNode(v),s[ft]=c,c.stateNode=s}return vn(c),null;case 31:if(p=c.memoizedState,s===null||s.memoizedState!==null){if(v=Zl(c),p!==null){if(s===null){if(!v)throw Error(r(318));if(s=c.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[ft]=c}else Yo(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;vn(c),s=!1}else p=xm(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),s=!0;if(!s)return c.flags&256?(ki(c),c):(ki(c),null);if((c.flags&128)!==0)throw Error(r(558))}return vn(c),null;case 13:if(v=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(A=Zl(c),v!==null&&v.dehydrated!==null){if(s===null){if(!A)throw Error(r(318));if(A=c.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[ft]=c}else Yo(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;vn(c),A=!1}else A=xm(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=A),A=!0;if(!A)return c.flags&256?(ki(c),c):(ki(c),null)}return ki(c),(c.flags&128)!==0?(c.lanes=p,c):(p=v!==null,s=s!==null&&s.memoizedState!==null,p&&(v=c.child,A=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(A=v.alternate.memoizedState.cachePool.pool),M=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(M=v.memoizedState.cachePool.pool),M!==A&&(v.flags|=2048)),p!==s&&p&&(c.child.flags|=8192),e0(c,c.updateQueue),vn(c),null);case 4:return ie(),s===null&&R1(c.stateNode.containerInfo),vn(c),null;case 10:return da(c.type),vn(c),null;case 19:if(V(zn),v=c.memoizedState,v===null)return vn(c),null;if(A=(c.flags&128)!==0,M=v.rendering,M===null)if(A)Nu(v,!1);else{if(Ln!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(M=Fh(s),M!==null){for(c.flags|=128,Nu(v,!1),s=M.updateQueue,c.updateQueue=s,e0(c,s),c.subtreeFlags=0,s=p,p=c.child;p!==null;)$x(p,s),p=p.sibling;return W(zn,zn.current&1|2),Ht&&ca(c,v.treeForkCount),c.child}s=s.sibling}v.tail!==null&&ct()>s0&&(c.flags|=128,A=!0,Nu(v,!1),c.lanes=4194304)}else{if(!A)if(s=Fh(M),s!==null){if(c.flags|=128,A=!0,s=s.updateQueue,c.updateQueue=s,e0(c,s),Nu(v,!0),v.tail===null&&v.tailMode==="hidden"&&!M.alternate&&!Ht)return vn(c),null}else 2*ct()-v.renderingStartTime>s0&&p!==536870912&&(c.flags|=128,A=!0,Nu(v,!1),c.lanes=4194304);v.isBackwards?(M.sibling=c.child,c.child=M):(s=v.last,s!==null?s.sibling=M:c.child=M,v.last=M)}return v.tail!==null?(s=v.tail,v.rendering=s,v.tail=s.sibling,v.renderingStartTime=ct(),s.sibling=null,p=zn.current,W(zn,A?p&1|2:p&1),Ht&&ca(c,v.treeForkCount),s):(vn(c),null);case 22:case 23:return ki(c),Dm(),v=c.memoizedState!==null,s!==null?s.memoizedState!==null!==v&&(c.flags|=8192):v&&(c.flags|=8192),v?(p&536870912)!==0&&(c.flags&128)===0&&(vn(c),c.subtreeFlags&6&&(c.flags|=8192)):vn(c),p=c.updateQueue,p!==null&&e0(c,p.retryQueue),p=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==p&&(c.flags|=2048),s!==null&&V(Zo),null;case 24:return p=null,s!==null&&(p=s.memoizedState.cache),c.memoizedState.cache!==p&&(c.flags|=2048),da(Pn),vn(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function oN(s,c){switch(vm(c),c.tag){case 1:return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return da(Pn),ie(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 26:case 27:case 5:return be(c),null;case 31:if(c.memoizedState!==null){if(ki(c),c.alternate===null)throw Error(r(340));Yo()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 13:if(ki(c),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Yo()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return V(zn),null;case 4:return ie(),null;case 10:return da(c.type),null;case 22:case 23:return ki(c),Dm(),s!==null&&V(Zo),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 24:return da(Pn),null;case 25:return null;default:return null}}function fy(s,c){switch(vm(c),c.tag){case 3:da(Pn),ie();break;case 26:case 27:case 5:be(c);break;case 4:ie();break;case 31:c.memoizedState!==null&&ki(c);break;case 13:ki(c);break;case 19:V(zn);break;case 10:da(c.type);break;case 22:case 23:ki(c),Dm(),s!==null&&V(Zo);break;case 24:da(Pn)}}function ju(s,c){try{var p=c.updateQueue,v=p!==null?p.lastEffect:null;if(v!==null){var A=v.next;p=A;do{if((p.tag&s)===s){v=void 0;var M=p.create,q=p.inst;v=M(),q.destroy=v}p=p.next}while(p!==A)}}catch(J){en(c,c.return,J)}}function io(s,c,p){try{var v=c.updateQueue,A=v!==null?v.lastEffect:null;if(A!==null){var M=A.next;v=M;do{if((v.tag&s)===s){var q=v.inst,J=q.destroy;if(J!==void 0){q.destroy=void 0,A=c;var ue=p,_e=J;try{_e()}catch(Ae){en(A,ue,Ae)}}}v=v.next}while(v!==M)}}catch(Ae){en(c,c.return,Ae)}}function py(s){var c=s.updateQueue;if(c!==null){var p=s.stateNode;try{i4(c,p)}catch(v){en(s,s.return,v)}}}function my(s,c,p){p.props=nl(s.type,s.memoizedProps),p.state=s.memoizedState;try{p.componentWillUnmount()}catch(v){en(s,c,v)}}function Mu(s,c){try{var p=s.ref;if(p!==null){switch(s.tag){case 26:case 27:case 5:var v=s.stateNode;break;case 30:v=s.stateNode;break;default:v=s.stateNode}typeof p=="function"?s.refCleanup=p(v):p.current=v}}catch(A){en(s,c,A)}}function zs(s,c){var p=s.ref,v=s.refCleanup;if(p!==null)if(typeof v=="function")try{v()}catch(A){en(s,c,A)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(A){en(s,c,A)}else p.current=null}function gy(s){var c=s.type,p=s.memoizedProps,v=s.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":p.autoFocus&&v.focus();break e;case"img":p.src?v.src=p.src:p.srcSet&&(v.srcset=p.srcSet)}}catch(A){en(s,s.return,A)}}function d1(s,c,p){try{var v=s.stateNode;NN(v,s.type,p,c),v[In]=c}catch(A){en(s,s.return,A)}}function by(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ho(s.type)||s.tag===4}function h1(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||by(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&ho(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function f1(s,c,p){var v=s.tag;if(v===5||v===6)s=s.stateNode,c?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(s,c):(c=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,c.appendChild(s),p=p._reactRootContainer,p!=null||c.onclick!==null||(c.onclick=nn));else if(v!==4&&(v===27&&ho(s.type)&&(p=s.stateNode,c=null),s=s.child,s!==null))for(f1(s,c,p),s=s.sibling;s!==null;)f1(s,c,p),s=s.sibling}function t0(s,c,p){var v=s.tag;if(v===5||v===6)s=s.stateNode,c?p.insertBefore(s,c):p.appendChild(s);else if(v!==4&&(v===27&&ho(s.type)&&(p=s.stateNode),s=s.child,s!==null))for(t0(s,c,p),s=s.sibling;s!==null;)t0(s,c,p),s=s.sibling}function vy(s){var c=s.stateNode,p=s.memoizedProps;try{for(var v=s.type,A=c.attributes;A.length;)c.removeAttributeNode(A[0]);yr(c,v,p),c[ft]=s,c[In]=p}catch(M){en(s,s.return,M)}}var ga=!1,Gn=!1,p1=!1,_y=typeof WeakSet=="function"?WeakSet:Set,hr=null;function lN(s,c){if(s=s.containerInfo,O1=w0,s=Mx(s),om(s)){if("selectionStart"in s)var p={start:s.selectionStart,end:s.selectionEnd};else e:{p=(p=s.ownerDocument)&&p.defaultView||window;var v=p.getSelection&&p.getSelection();if(v&&v.rangeCount!==0){p=v.anchorNode;var A=v.anchorOffset,M=v.focusNode;v=v.focusOffset;try{p.nodeType,M.nodeType}catch{p=null;break e}var q=0,J=-1,ue=-1,_e=0,Ae=0,je=s,ye=null;t:for(;;){for(var ke;je!==p||A!==0&&je.nodeType!==3||(J=q+A),je!==M||v!==0&&je.nodeType!==3||(ue=q+v),je.nodeType===3&&(q+=je.nodeValue.length),(ke=je.firstChild)!==null;)ye=je,je=ke;for(;;){if(je===s)break t;if(ye===p&&++_e===A&&(J=q),ye===M&&++Ae===v&&(ue=q),(ke=je.nextSibling)!==null)break;je=ye,ye=je.parentNode}je=ke}p=J===-1||ue===-1?null:{start:J,end:ue}}else p=null}p=p||{start:0,end:0}}else p=null;for(I1={focusedElem:s,selectionRange:p},w0=!1,hr=c;hr!==null;)if(c=hr,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,hr=s;else for(;hr!==null;){switch(c=hr,M=c.alternate,s=c.flags,c.tag){case 0:if((s&4)!==0&&(s=c.updateQueue,s=s!==null?s.events:null,s!==null))for(p=0;p title"))),yr(M,v,p),M[ft]=s,Qt(M),v=M;break e;case"link":var q=C5("link","href",A).get(v+(p.href||""));if(q){for(var J=0;Jan&&(q=an,an=gt,gt=q);var me=Nx(J,gt),de=Nx(J,an);if(me&&de&&(ke.rangeCount!==1||ke.anchorNode!==me.node||ke.anchorOffset!==me.offset||ke.focusNode!==de.node||ke.focusOffset!==de.offset)){var ve=je.createRange();ve.setStart(me.node,me.offset),ke.removeAllRanges(),gt>an?(ke.addRange(ve),ke.extend(de.node,de.offset)):(ve.setEnd(de.node,de.offset),ke.addRange(ve))}}}}for(je=[],ke=J;ke=ke.parentNode;)ke.nodeType===1&&je.push({element:ke,left:ke.scrollLeft,top:ke.scrollTop});for(typeof J.focus=="function"&&J.focus(),J=0;Jp?32:p,Y.T=null,p=y1,y1=null;var M=lo,q=ya;if(ar=0,dc=lo=null,ya=0,(Wt&6)!==0)throw Error(r(331));var J=Wt;if(Wt|=4,jy(M.current),Ay(M,M.current,q,p),Wt=J,zu(0,!1),_t&&typeof _t.onPostCommitFiberRoot=="function")try{_t.onPostCommitFiberRoot(jt,M)}catch{}return!0}finally{Z.p=A,Y.T=v,Yy(s,c)}}function Ky(s,c,p){c=Ki(p,c),c=e1(s.stateNode,c,2),s=to(s,c,2),s!==null&&(mn(s,2),Bs(s))}function en(s,c,p){if(s.tag===3)Ky(s,s,p);else for(;c!==null;){if(c.tag===3){Ky(c,s,p);break}else if(c.tag===1){var v=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(oo===null||!oo.has(v))){s=Ki(p,s),p=Z4(2),v=to(c,p,2),v!==null&&(Q4(p,v,c,s),mn(v,2),Bs(v));break}}c=c.return}}function C1(s,c,p){var v=s.pingCache;if(v===null){v=s.pingCache=new dN;var A=new Set;v.set(c,A)}else A=v.get(c),A===void 0&&(A=new Set,v.set(c,A));A.has(p)||(b1=!0,A.add(p),s=gN.bind(null,s,c,p),c.then(s,s))}function gN(s,c,p){var v=s.pingCache;v!==null&&v.delete(c),s.pingedLanes|=s.suspendedLanes&p,s.warmLanes&=~p,un===s&&(Ot&p)===p&&(Ln===4||Ln===3&&(Ot&62914560)===Ot&&300>ct()-i0?(Wt&2)===0&&hc(s,0):v1|=p,uc===Ot&&(uc=0)),Bs(s)}function Zy(s,c){c===0&&(c=Kr()),s=Vo(s,c),s!==null&&(mn(s,c),Bs(s))}function bN(s){var c=s.memoizedState,p=0;c!==null&&(p=c.retryLane),Zy(s,p)}function vN(s,c){var p=0;switch(s.tag){case 31:case 13:var v=s.stateNode,A=s.memoizedState;A!==null&&(p=A.retryLane);break;case 19:v=s.stateNode;break;case 22:v=s.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(c),Zy(s,p)}function _N(s,c){return ot(s,c)}var d0=null,pc=null,E1=!1,h0=!1,A1=!1,uo=0;function Bs(s){s!==pc&&s.next===null&&(pc===null?d0=pc=s:pc=pc.next=s),h0=!0,E1||(E1=!0,yN())}function zu(s,c){if(!A1&&h0){A1=!0;do for(var p=!1,v=d0;v!==null;){if(s!==0){var A=v.pendingLanes;if(A===0)var M=0;else{var q=v.suspendedLanes,J=v.pingedLanes;M=(1<<31-ut(42|s)+1)-1,M&=A&~(q&~J),M=M&201326741?M&201326741|1:M?M|2:0}M!==0&&(p=!0,t5(v,M))}else M=Ot,M=Ts(v,v===un?M:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(M&3)===0||Jn(v,M)||(p=!0,t5(v,M));v=v.next}while(p);A1=!1}}function xN(){Qy()}function Qy(){h0=E1=!1;var s=0;uo!==0&&MN()&&(s=uo);for(var c=ct(),p=null,v=d0;v!==null;){var A=v.next,M=Jy(v,c);M===0?(v.next=null,p===null?d0=A:p.next=A,A===null&&(pc=p)):(p=v,(s!==0||(M&3)!==0)&&(h0=!0)),v=A}ar!==0&&ar!==5||zu(s),uo!==0&&(uo=0)}function Jy(s,c){for(var p=s.suspendedLanes,v=s.pingedLanes,A=s.expirationTimes,M=s.pendingLanes&-62914561;0J)break;var Ae=ue.transferSize,je=ue.initiatorType;Ae&&c5(je)&&(ue=ue.responseEnd,q+=Ae*(ue"u"?null:document;function y5(s,c,p){var v=mc;if(v&&typeof c=="string"&&c){var A=ir(c);A='link[rel="'+s+'"][href="'+A+'"]',typeof p=="string"&&(A+='[crossorigin="'+p+'"]'),x5.has(A)||(x5.add(A),s={rel:s,crossOrigin:p,href:c},v.querySelector(A)===null&&(c=v.createElement("link"),yr(c,"link",s),Qt(c),v.head.appendChild(c)))}}function $N(s){wa.D(s),y5("dns-prefetch",s,null)}function FN(s,c){wa.C(s,c),y5("preconnect",s,c)}function PN(s,c,p){wa.L(s,c,p);var v=mc;if(v&&s&&c){var A='link[rel="preload"][as="'+ir(c)+'"]';c==="image"&&p&&p.imageSrcSet?(A+='[imagesrcset="'+ir(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(A+='[imagesizes="'+ir(p.imageSizes)+'"]')):A+='[href="'+ir(s)+'"]';var M=A;switch(c){case"style":M=gc(s);break;case"script":M=bc(s)}ns.has(M)||(s=f({rel:"preload",href:c==="image"&&p&&p.imageSrcSet?void 0:s,as:c},p),ns.set(M,s),v.querySelector(A)!==null||c==="style"&&v.querySelector(Fu(M))||c==="script"&&v.querySelector(Pu(M))||(c=v.createElement("link"),yr(c,"link",s),Qt(c),v.head.appendChild(c)))}}function UN(s,c){wa.m(s,c);var p=mc;if(p&&s){var v=c&&typeof c.as=="string"?c.as:"script",A='link[rel="modulepreload"][as="'+ir(v)+'"][href="'+ir(s)+'"]',M=A;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":M=bc(s)}if(!ns.has(M)&&(s=f({rel:"modulepreload",href:s},c),ns.set(M,s),p.querySelector(A)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(Pu(M)))return}v=p.createElement("link"),yr(v,"link",s),Qt(v),p.head.appendChild(v)}}}function qN(s,c,p){wa.S(s,c,p);var v=mc;if(v&&s){var A=Ir(v).hoistableStyles,M=gc(s);c=c||"default";var q=A.get(M);if(!q){var J={loading:0,preload:null};if(q=v.querySelector(Fu(M)))J.loading=5;else{s=f({rel:"stylesheet",href:s,"data-precedence":c},p),(p=ns.get(M))&&U1(s,p);var ue=q=v.createElement("link");Qt(ue),yr(ue,"link",s),ue._p=new Promise(function(_e,Ae){ue.onload=_e,ue.onerror=Ae}),ue.addEventListener("load",function(){J.loading|=1}),ue.addEventListener("error",function(){J.loading|=2}),J.loading|=4,b0(q,c,v)}q={type:"stylesheet",instance:q,count:1,state:J},A.set(M,q)}}}function GN(s,c){wa.X(s,c);var p=mc;if(p&&s){var v=Ir(p).hoistableScripts,A=bc(s),M=v.get(A);M||(M=p.querySelector(Pu(A)),M||(s=f({src:s,async:!0},c),(c=ns.get(A))&&q1(s,c),M=p.createElement("script"),Qt(M),yr(M,"link",s),p.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},v.set(A,M))}}function VN(s,c){wa.M(s,c);var p=mc;if(p&&s){var v=Ir(p).hoistableScripts,A=bc(s),M=v.get(A);M||(M=p.querySelector(Pu(A)),M||(s=f({src:s,async:!0,type:"module"},c),(c=ns.get(A))&&q1(s,c),M=p.createElement("script"),Qt(M),yr(M,"link",s),p.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},v.set(A,M))}}function w5(s,c,p,v){var A=(A=pe.current)?g0(A):null;if(!A)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(c=gc(p.href),p=Ir(A).hoistableStyles,v=p.get(c),v||(v={type:"style",instance:null,count:0,state:null},p.set(c,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){s=gc(p.href);var M=Ir(A).hoistableStyles,q=M.get(s);if(q||(A=A.ownerDocument||A,q={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},M.set(s,q),(M=A.querySelector(Fu(s)))&&!M._p&&(q.instance=M,q.state.loading=5),ns.has(s)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},ns.set(s,p),M||WN(A,s,p,q.state))),c&&v===null)throw Error(r(528,""));return q}if(c&&v!==null)throw Error(r(529,""));return null;case"script":return c=p.async,p=p.src,typeof p=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=bc(p),p=Ir(A).hoistableScripts,v=p.get(c),v||(v={type:"script",instance:null,count:0,state:null},p.set(c,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function gc(s){return'href="'+ir(s)+'"'}function Fu(s){return'link[rel="stylesheet"]['+s+"]"}function S5(s){return f({},s,{"data-precedence":s.precedence,precedence:null})}function WN(s,c,p,v){s.querySelector('link[rel="preload"][as="style"]['+c+"]")?v.loading=1:(c=s.createElement("link"),v.preload=c,c.addEventListener("load",function(){return v.loading|=1}),c.addEventListener("error",function(){return v.loading|=2}),yr(c,"link",p),Qt(c),s.head.appendChild(c))}function bc(s){return'[src="'+ir(s)+'"]'}function Pu(s){return"script[async]"+s}function k5(s,c,p){if(c.count++,c.instance===null)switch(c.type){case"style":var v=s.querySelector('style[data-href~="'+ir(p.href)+'"]');if(v)return c.instance=v,Qt(v),v;var A=f({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return v=(s.ownerDocument||s).createElement("style"),Qt(v),yr(v,"style",A),b0(v,p.precedence,s),c.instance=v;case"stylesheet":A=gc(p.href);var M=s.querySelector(Fu(A));if(M)return c.state.loading|=4,c.instance=M,Qt(M),M;v=S5(p),(A=ns.get(A))&&U1(v,A),M=(s.ownerDocument||s).createElement("link"),Qt(M);var q=M;return q._p=new Promise(function(J,ue){q.onload=J,q.onerror=ue}),yr(M,"link",v),c.state.loading|=4,b0(M,p.precedence,s),c.instance=M;case"script":return M=bc(p.src),(A=s.querySelector(Pu(M)))?(c.instance=A,Qt(A),A):(v=p,(A=ns.get(M))&&(v=f({},p),q1(v,A)),s=s.ownerDocument||s,A=s.createElement("script"),Qt(A),yr(A,"link",v),s.head.appendChild(A),c.instance=A);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(v=c.instance,c.state.loading|=4,b0(v,p.precedence,s));return c.instance}function b0(s,c,p){for(var v=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=v.length?v[v.length-1]:null,M=A,q=0;q title"):null)}function YN(s,c,p){if(p===1||c.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return s=c.disabled,typeof c.precedence=="string"&&s==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function A5(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function XN(s,c,p,v){if(p.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var A=gc(v.href),M=c.querySelector(Fu(A));if(M){c=M._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(s.count++,s=_0.bind(s),c.then(s,s)),p.state.loading|=4,p.instance=M,Qt(M);return}M=c.ownerDocument||c,v=S5(v),(A=ns.get(A))&&U1(v,A),M=M.createElement("link"),Qt(M);var q=M;q._p=new Promise(function(J,ue){q.onload=J,q.onerror=ue}),yr(M,"link",v),p.instance=M}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(p,c),(c=p.state.preload)&&(p.state.loading&3)===0&&(s.count++,p=_0.bind(s),c.addEventListener("load",p),c.addEventListener("error",p))}}var G1=0;function KN(s,c){return s.stylesheets&&s.count===0&&y0(s,s.stylesheets),0G1?50:800)+c);return s.unsuspend=p,function(){s.unsuspend=null,clearTimeout(v),clearTimeout(A)}}:null}function _0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)y0(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var x0=null;function y0(s,c){s.stylesheets=null,s.unsuspend!==null&&(s.count++,x0=new Map,c.forEach(ZN,s),x0=null,_0.call(s))}function ZN(s,c){if(!(c.state.loading&4)){var p=x0.get(s);if(p)var v=p.get(null);else{p=new Map,x0.set(s,p);for(var A=s.querySelectorAll("link[data-precedence],style[data-precedence]"),M=0;M"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),eg.exports=fj(),eg.exports}var mj=pj();/** - * @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 q8=(...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 gj=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 bj=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 e3=e=>{const t=bj(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 ig={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 vj=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},_j=R.createContext({}),xj=()=>R.useContext(_j),yj=R.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...l},u)=>{const{size:d=24,strokeWidth:m=2,absoluteStrokeWidth:f=!1,color:g="currentColor",className:b=""}=xj()??{},k=r??f?Number(n??m)*24/Number(t??d):n??m;return R.createElement("svg",{ref:u,...ig,width:t??d??ig.width,height:t??d??ig.height,stroke:e??g,strokeWidth:k,className:q8("lucide",b,i),...!a&&!vj(l)&&{"aria-hidden":"true"},...l},[...o.map(([S,x])=>R.createElement(S,x)),...Array.isArray(a)?a:[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 Xe=(e,t)=>{const n=R.forwardRef(({className:r,...i},a)=>R.createElement(yj,{ref:a,iconNode:t,className:q8(`lucide-${gj(e3(e))}`,`lucide-${e}`,r),...i}));return n.displayName=e3(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 wj=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Cf=Xe("arrow-left",wj);/** - * @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 Sj=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],sg=Xe("arrow-right",Sj);/** - * @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 kj=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Cj=Xe("arrow-up-right",kj);/** - * @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 Ej=[["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"}]],Aj=Xe("blocks",Ej);/** - * @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 Tj=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],G8=Xe("book-open",Tj);/** - * @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 Nj=[["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"}]],jj=Xe("boxes",Nj);/** - * @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 Mj=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],Rj=Xe("calendar-days",Mj);/** - * @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 Dj=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16c.5-2 1.5-7 4-7 2 0 2 3 4 3 2.5 0 4.5-5 5-7",key:"lw07rv"}]],V8=Xe("chart-spline",Dj);/** - * @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 Lj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Di=Xe("check",Lj);/** - * @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 Oj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Rl=Xe("chevron-down",Oj);/** - * @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 Ij=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],W8=Xe("chevron-left",Ij);/** - * @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 zj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xs=Xe("chevron-right",zj);/** - * @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 Bj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Hj=Xe("circle-alert",Bj);/** - * @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 $j=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Fj=Xe("circle-question-mark",$j);/** - * @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 Pj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],Y8=Xe("circle-stop",Pj);/** - * @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 Uj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],X8=Xe("circle-x",Uj);/** - * @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 qj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],Gj=Xe("clock-3",qj);/** - * @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 Vj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Wj=Xe("clock",Vj);/** - * @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 Yj=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],K8=Xe("code",Yj);/** - * @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 Xj=[["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"}]],t_=Xe("copy",Xj);/** - * @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 Kj=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],Z8=Xe("corner-down-left",Kj);/** - * @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 Zj=[["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"}]],Qj=Xe("cpu",Zj);/** - * @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 Jj=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],eM=Xe("download",Jj);/** - * @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 tM=[["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"}]],Q8=Xe("ellipsis",tM);/** - * @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 nM=[["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"}]],xd=Xe("external-link",nM);/** - * @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 rM=[["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"}]],J8=Xe("file-code",rM);/** - * @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 iM=[["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"}]],th=Xe("file-text",iM);/** - * @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 sM=[["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:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]],aM=Xe("file-up",sM);/** - * @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 oM=[["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"}]],Cb=Xe("flask-conical",oM);/** - * @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 lM=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 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.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],eS=Xe("folder-git-2",lM);/** - * @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 cM=[["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"}]],yd=Xe("folder-open",cM);/** - * @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 uM=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["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"}]],dM=Xe("folder-plus",uM);/** - * @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 hM=[["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"}]],rp=Xe("folder-tree",hM);/** - * @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 fM=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],pM=Xe("funnel",fM);/** - * @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 mM=[["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"}]],nh=Xe("git-branch",mM);/** - * @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 gM=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],bM=Xe("git-commit-horizontal",gM);/** - * @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 vM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],_M=Xe("globe",vM);/** - * @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 xM=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],yM=Xe("history",xM);/** - * @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 wM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],SM=Xe("info",wM);/** - * @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 kM=[["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"}]],CM=Xe("laptop",kM);/** - * @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 EM=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],AM=Xe("lightbulb",EM);/** - * @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 TM=[["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"}]],t3=Xe("lock",TM);/** - * @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 NM=[["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"}]],jM=Xe("maximize-2",NM);/** - * @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 MM=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],tS=Xe("message-square-quote",MM);/** - * @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 RM=[["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"}]],DM=Xe("minimize-2",RM);/** - * @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 LM=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],OM=Xe("monitor",LM);/** - * @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 IM=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],zM=Xe("moon",IM);/** - * @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 BM=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],HM=Xe("mouse-pointer-click",BM);/** - * @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 $M=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],n_=Xe("package",$M);/** - * @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 FM=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],nS=Xe("panel-left",FM);/** - * @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 PM=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],UM=Xe("paperclip",PM);/** - * @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 qM=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],ip=Xe("pencil",qM);/** - * @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 GM=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],r_=Xe("plus",GM);/** - * @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 VM=[["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"}]],rh=Xe("refresh-cw",VM);/** - * @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 WM=[["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"}]],rS=Xe("rotate-cw",WM);/** - * @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 YM=[["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"}]],i_=Xe("scroll-text",YM);/** - * @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 XM=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],KM=Xe("search",XM);/** - * @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 ZM=[["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"}]],n3=Xe("server",ZM);/** - * @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 QM=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],JM=Xe("settings-2",QM);/** - * @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 eR=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],tR=Xe("settings",eR);/** - * @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 nR=[["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"}]],rR=Xe("sliders-horizontal",nR);/** - * @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 iR=[["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"}]],iS=Xe("square-terminal",iR);/** - * @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 sR=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],aR=Xe("sun",sR);/** - * @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 oR=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Uc=Xe("terminal",oR);/** - * @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 lR=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],cR=Xe("toggle-right",lR);/** - * @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 uR=[["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"}]],ih=Xe("trash-2",uR);/** - * @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 dR=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],hR=Xe("triangle-alert",dR);/** - * @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 fR=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],pR=Xe("upload",fR);/** - * @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 mR=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],sS=Xe("users",mR);/** - * @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 gR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],qr=Xe("x",gR),ag="demo_nanochat_v1",Ef="PROJECT.md",og=e=>e.startsWith("demo_"),cd="chat_demo_nanochat_v1",aS="chat_demo_nanochat_figures_v1",oS="chat_demo_nanochat_literature_v1";function ss(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}async function Ba(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 At=e=>fetch(e).then(t=>Ba(t)),zt=(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=>Ba(n)),sp=(e,t)=>fetch(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(n=>Ba(n)),lS=(e,t)=>fetch(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(n=>Ba(n)),bR=()=>At("/api/projects").then(e=>e.projects),vR=()=>At("/api/settings/ui-state"),r3=e=>zt("/api/settings/ui-state",e),_R=(e,t)=>zt("/api/onboarding/complete",{...e,...t}),cS=(e="")=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return At(`/api/project-path/status${t}`)},xR=()=>zt("/api/project-path/pick").then(e=>e.path),yR=e=>zt("/api/projects",e),uS=e=>At(`/api/papers/search?q=${encodeURIComponent(e)}`).then(t=>t.papers),wR=()=>At("/api/github/account"),SR=e=>At(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`),kR=(e,t)=>At(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(t)}`),Eb=e=>At(`/api/papers/resolve?id=${encodeURIComponent(e)}`).then(t=>t.paper),CR=e=>zt(`/api/projects/${e}/open`).then(t=>t.project),ER=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})`)}}),AR=e=>At(`/api/projects/${e}/experiments`).then(t=>t.experiments),TR=e=>At(`/api/projects/${e}/runs`).then(t=>t.runs),dS=()=>At("/api/instances").then(e=>e.instances),hS=e=>zt(`/api/runs/${e}/cancel`).then(()=>{}),NR=(e,t)=>At(`/api/runs/${e}/log?offset=${t}`),jR=e=>At(`/api/runs/${e}/diff`),MR=e=>At(`/api/experiments/${e}/diff`),s_=(e,t=new URLSearchParams)=>(e.sessionId&&t.set("sessionId",e.sessionId),e.ref&&t.set("ref",e.ref),t),i3=(e,t,n={})=>At(`/api/projects/${e}/file?${s_(n,new URLSearchParams({path:t}))}`),RR=(e,t,n={})=>`/api/projects/${e}/file/raw?${s_(n,new URLSearchParams({path:t}))}`,DR=e=>At(`/api/files/abs?path=${encodeURIComponent(e)}`),LR=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,OR=(e,t,n,r={})=>lS(`/api/projects/${e}/file`,{path:t,content:n,sessionId:r.sessionId}),IR=(e,t,n={})=>zt(`/api/projects/${e}/file/open`,{path:t,sessionId:n.sessionId}),Ab=(e,t={})=>{const n=s_(t).toString();return At(`/api/projects/${e}/code-tree${n?`?${n}`:""}`)},fS=e=>At(`/api/chat/sessions/${e}/worktree`),ap=(e,t,n)=>`https://github.com/${e}/${t}/tree/${n.split("/").map(encodeURIComponent).join("/")}`,zR=()=>At("/api/settings/hf"),BR=e=>zt("/api/settings/hf",{token:e}),HR=()=>At("/api/update"),$R=()=>zt("/api/update/apply"),FR=e=>zt("/api/update/auto",{enabled:e}),PR=(e=!1)=>zt("/api/update/install-cli",{force:e}),UR=()=>At("/api/settings/k8s"),qR=e=>zt("/api/settings/k8s",e),GR=()=>At("/api/settings/modal"),VR=()=>zt("/api/settings/modal/provision"),WR=()=>At("/api/settings/env").then(e=>e.vars),pS=(e,t)=>zt("/api/settings/env",{key:e,value:t}).then(n=>n.vars),YR=e=>fetch(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(t=>Ba(t)).then(t=>t.vars),XR=()=>At("/api/settings/data-dir"),KR=e=>zt("/api/settings/data-dir/validate",{path:e}),ZR=e=>zt("/api/settings/data-dir/move",{path:e}),QR=()=>At("/api/settings/ssh").then(e=>e.hosts),JR=e=>zt("/api/settings/ssh/preflight",{host:e}),eD=()=>At("/api/settings/slurm"),tD=e=>zt("/api/settings/slurm",e),nD=e=>zt("/api/settings/slurm/preflight",{host:e}),rD=()=>At("/api/settings/ray"),iD=e=>zt("/api/settings/ray",e),sD=e=>zt("/api/settings/ray/preflight",{address:e??null}),aD=e=>At(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`),mS=e=>zt("/api/settings/compute/default",e),oD=()=>At("/api/settings/local"),lD=()=>At("/api/settings/openresearch"),s3=e=>At(`/api/projects/${e}/files`),cD=(e,t)=>fetch(`/api/projects/${e}/files?path=${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>Ba(n)),sh=(e,t)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(t)}`,gS=512e3,uD=(e,t)=>{const n=new Uint8Array(e);if(n.includes(0))return{content:"",binary:!0,truncated:t};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(n,{stream:t}),binary:!1,truncated:t}}catch{return{content:"",binary:!0,truncated:t}}},bS=(e,t)=>fetch(sh(e,t),{headers:{Range:`bytes=0-${gS-1}`}}).then(n=>{var i;if(n.status===404)return null;if(n.status===416&&n.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!n.ok)throw new Error(`HTTP ${n.status}`);const r=Number((i=n.headers.get("content-range"))==null?void 0:i.split("/").pop());return n.arrayBuffer().then(a=>uD(a,Number.isFinite(r)&&r>a.byteLength))}),dD=(e,t)=>lS(`/api/projects/${e}/brief`,{content:t}),hD=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",fD=(e,t)=>fetch(sh(e,t),{method:"HEAD"}).then(n=>{if(n.status===404)return null;if(!n.ok)throw new Error(`HTTP ${n.status}`);const r=n.headers.get("x-openresearch-presentation");return{size:Number(n.headers.get("content-length"))||0,presentation:hD(r)?r:"download"}}),pD=e=>zt("/api/settings/git/token",{token:e}),mD=()=>At("/api/settings/profile"),gD=()=>At("/api/settings/lit-sources"),bD=e=>zt("/api/settings/lit-sources",e),a_=()=>At("/api/settings/projects"),vS=(e,t)=>zt("/api/settings/projects",{githubForNewProjects:e,githubDefaultPromptSeen:t}),vD=e=>At(`/api/projects/${e}/git`),_D=e=>zt(`/api/projects/${e}/git/init`),xD=e=>zt(`/api/projects/${e}/github`),yD=e=>zt(`/api/projects/${e}/github/disable`),Af=e=>e.displayName??xS(e.id),Tb="default";function op(e,t){var o,l,u;const n=e==null?void 0:e.models.find(d=>d.id===t),r=(n==null?void 0:n.reasoningLevels)??((o=e==null?void 0:e.options)==null?void 0:o.reasoningLevels)??[],i=n==null?void 0:n.defaultReasoningLevel,a=i&&r.some(d=>d.id===i)?i:r.some(d=>d.id===Tb)?Tb:((l=e==null?void 0:e.options)==null?void 0:l.defaultReasoningLevel)??((u=r[0])==null?void 0:u.id)??null;return{choices:r,defaultId:a}}function _S(e,t,n){if(!e)return n;const{choices:r,defaultId:i}=op(e,t);return r.length===0?Tb:n&&r.some(a=>a.id===n)?n:i}const Tf=(e=!1,t=!1)=>{const n=new URLSearchParams;e&&n.set("refresh","1"),t&&n.set("retry","1");const r=n.size>0?`?${n.toString()}`:"";return At(`/api/harnesses${r}`).then(i=>i.harnesses)},wD=e=>At(`/api/skills${e?`?project=${encodeURIComponent(e)}`:""}`).then(t=>t.skills),SD=e=>At(`/api/user-skills${e?`?project=${encodeURIComponent(e)}`:""}`).then(t=>t.skills),kD=e=>zt("/api/user-skills",e).then(t=>t.skill),CD=e=>{const t=new URLSearchParams({scope:e.scope,name:e.name});return e.projectId&&t.set("project",e.projectId),fetch(`/api/user-skills?${t.toString()}`,{method:"DELETE"}).then(n=>Ba(n))},ED=()=>At("/api/harness-skills").then(e=>e.skills),AD=e=>zt("/api/user-skills/import",e).then(t=>t.skill);function xS(e){const t=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),n=[],r=[];for(const i of t.split("-"))/^\d+(\.\d+)?$/.test(i)?r.push(i):(r.length&&n.push(r.splice(0).join(".")),n.push(i==="gpt"?"GPT":i.charAt(0).toUpperCase()+i.slice(1)));return r.length&&n.push(r.join(".")),n.join(" ")}const lf=e=>At(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`).then(t=>t.sessions),TD=(e,t,n={})=>zt("/api/chat/sessions",{projectId:e,harness:t,...n}).then(r=>r.session),ND=e=>fetch(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(t=>Ba(t)),jD=(e,t)=>sp(`/api/chat/sessions/${e}`,{archived:t}).then(n=>n.session),MD=(e,t)=>sp(`/api/chat/sessions/${e}`,{title:t}).then(n=>n.session),RD=(e,t)=>sp(`/api/chat/sessions/${e}`,{planMode:t}).then(n=>n.session),DD=(e,t)=>sp(`/api/chat/sessions/${e}`,{permissionMode:t}).then(n=>n.session),ud=e=>At(`/api/chat/sessions/${e}/messages`).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),LD=(e,t)=>fetch(`/api/chat/sessions/${e}/queue/${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>Ba(n)),OD=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,a3=(e,t,n={},r,i,a)=>zt(`/api/chat/sessions/${e}/message`,{text:t,model:n.model,permissionMode:n.permissionMode,planMode:n.planMode,reasoningLevel:n.reasoningLevel,images:r,annotations:i,mode:a}),ID=(e,t,n)=>zt(`/api/chat/sessions/${e}/fork`,{messageId:t,text:n}),zD=(e,t)=>zt(`/api/chat/sessions/${e}/branch`,{leafId:t}),BD=e=>zt(`/api/chat/sessions/${e}/interrupt`),HD=(e,t)=>zt(`/api/chat/sessions/${e}/respond`,t);function Gs(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 Nf(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 Ao(e){const t=["B","KB","MB","GB","TB"];let n=e,r=0;for(;n>=1024&&r10?`${e.slice(0,10)}…`:e}function o_(e){return e?typeof e.kind=="string"?e.kind:typeof e.type=="string"?e.type:"":""}function FD(e){return e?typeof e.flavor=="string"&&e.flavor?e.flavor:typeof e.manifest=="string"&&e.manifest?e.manifest:o_(e)==="ray_job"?"":typeof e.namespace=="string"&&e.namespace?e.namespace:"":""}function l_(){return h.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[h.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),h.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function cf(){return h.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[h.jsx(l_,{}),"OpenResearch"]})}function PD(e,t){if(!t)return e;const n=new Map(e.map(a=>[a.id,a]));let r=n.get(t);if(!r)return e;const i=[];for(;r;)i.push(r),r=r.parentId?n.get(r.parentId):void 0;return i.reverse()}function UD(e,t,n){var o;let r=e;for(;r&&r.role!=="user";)r=r.parentId?t.get(r.parentId):void 0;const i=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,a=(o=n.get(i))==null?void 0:o.filter(l=>l.role===e.role);return a!=null&&a.length?a:[e]}function qD(e,t,n,r){const i=e.filter(d=>!r(d.id)),a=new Map(i.map(d=>[d.id,d])),o=new Map;for(const d of i){const m=d.parentId??null,f=o.get(m);f?f.push(d):o.set(m,[d])}const l=new Set(t.map(d=>d.id)),u=new Map;for(const d of n){const m=UD(d,a,o),f=m.findIndex(g=>l.has(g.id));u.set(d.id,{count:m.length,index:f,prevId:f>0?m[f-1].id:void 0,nextId:f{n.delete(t),n.size===0&&uf.delete(e)}}function VD(e){var t;(t=uf.get(e.runId))==null||t.forEach(n=>n(e))}const Nb=new Set;function wd(e){return Nb.add(e),()=>{Nb.delete(e)}}function vo(e){Nb.forEach(t=>t(e))}const jb=new Set;function c_(e){return jb.add(e),()=>{jb.delete(e)}}function l3(e){jb.forEach(t=>t(e))}const Mb=new Set;function WD(e){return Mb.add(e),()=>{Mb.delete(e)}}function lg(e){Mb.forEach(t=>t(e))}const Rb=new Set;function YD(e){return Rb.add(e),()=>{Rb.delete(e)}}function XD(e){Rb.forEach(t=>t(e))}function KD(e){const t=R.useRef(e);t.current=e,R.useEffect(()=>{const n=new EventSource("/api/events");let r=!1;n.onerror=()=>{r=!0},n.onopen=()=>{var a,o;r&&(vo({type:"reconnected"}),l3({harness:"*",authState:"unknown"}),(o=(a=t.current).onReconnect)==null||o.call(a)),r=!0};const i=a=>{try{return JSON.parse(a.data)}catch{return null}};return n.addEventListener("run.updated",a=>{const o=i(a);o!=null&&o.run&&t.current.onRun(o.run)}),n.addEventListener("experiment.updated",a=>{const o=i(a);o!=null&&o.experiment&&t.current.onExperiment(o.experiment)}),n.addEventListener("project.updated",a=>{const o=i(a);o!=null&&o.project&&t.current.onProject(o.project)}),n.addEventListener("files.updated",a=>{var l,u;const o=i(a);o!=null&&o.projectId&&((u=(l=t.current).onArtifacts)==null||u.call(l,o.projectId))}),n.addEventListener("run.log",a=>{const o=i(a);o!=null&&o.runId&&VD(o)}),n.addEventListener("chat.session",a=>{const o=i(a);o!=null&&o.session&&vo({type:"session",session:o.session})}),n.addEventListener("chat.session.deleted",a=>{const o=i(a);o!=null&&o.sessionId&&vo({type:"sessionDeleted",sessionId:o.sessionId})}),n.addEventListener("chat.message",a=>{const o=i(a);o!=null&&o.message&&vo({type:"message",sessionId:o.sessionId,message:o.message})}),n.addEventListener("chat.busy",a=>{const o=i(a);o!=null&&o.sessionId&&vo({type:"busy",sessionId:o.sessionId,busy:o.busy})}),n.addEventListener("chat.usage",a=>{const o=i(a);o!=null&&o.sessionId&&o.usage&&vo({type:"usage",sessionId:o.sessionId,usage:o.usage})}),n.addEventListener("chat.queued",a=>{const o=i(a);o!=null&&o.sessionId&&vo({type:"queued",sessionId:o.sessionId,items:o.items??[]})}),n.addEventListener("chat.branch",a=>{const o=i(a);o!=null&&o.sessionId&&vo({type:"branch",sessionId:o.sessionId,activeLeafId:o.activeLeafId??null})}),n.addEventListener("harness.auth",a=>{const o=i(a);o!=null&&o.harness&&o.authState&&l3(o)}),n.addEventListener("datadir.move.progress",a=>{const o=i(a);o&&lg({type:"progress",...o})}),n.addEventListener("datadir.move.done",a=>{const o=i(a);o&&lg({type:"done",path:o.path,oldPathLeft:o.oldPathLeft})}),n.addEventListener("datadir.move.error",a=>{const o=i(a);o&&lg({type:"error",error:o.error})}),n.addEventListener("update.status",a=>{const o=i(a);o&&XD(o)}),()=>n.close()},[])}const ZD=` - - - - -`,QD='',JD=` - - -`,u_={alphaxiv:"alphaXiv",openalex:"OpenAlex",biorxiv:"bioRxiv"},eL={alphaxiv:ZD,openalex:JD,biorxiv:QD};function d_({source:e,size:t=16,decorative:n=!1,className:r=""}){return h.jsx("span",{className:`lit-logo flex-none inline-flex items-center justify-center p-[1.5px] box-border bg-white rounded-[3px] shadow-[0_0_0_1px_rgba(0,_0,_0,_0.08)] [&_svg]:w-full [&_svg]:h-full [&_svg]:block ${r}`,style:{width:t,height:t},...n?{"aria-hidden":!0}:{role:"img","aria-label":u_[e]},dangerouslySetInnerHTML:{__html:eL[e]}})}function c3(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function tL(e){const t=e.trim(),n=t.toLowerCase();if(n.includes("biorxiv.org"))return"biorxiv";if(n.includes("openalex.org"))return"openalex";const r=t.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const i=t.split("/").pop()??"";return/^W\d+$/i.test(i)?"openalex":"alphaxiv"}function nL(e){const n=e.trim().replace(/^https?:\/\/doi\.org\//i,"").replace(/^doi:/i,"").match(/10\.\d+\/[^\s?#]+/);return n?n[0].replace(/[.,)]+$/,"").replace(/v\d+(\.[a-z][a-z-]*)*$/i,""):null}function rL(e,t){const n=t.trim();if(e==="alphaxiv"){const a=(n.split(/[?#]/)[0].split("/").pop()||n).replace(/\.(pdf|md)$/i,"");return`https://www.alphaxiv.org/abs/${encodeURIComponent(a)}`}const r=nL(n);if(r)return`https://doi.org/${r}`;if(e==="openalex"){const i=n.split("/").pop()||n;return`https://openalex.org/${encodeURIComponent(i)}`}return`https://doi.org/${n}`}function iL(e){const t=[];let n="",r=!1,i=null;for(const a of e){if(i){a===i?i=null:n+=a,r=!0;continue}if(a==='"'||a==="'"){i=a,r=!0;continue}if(a===" "||a===" "||a===` -`){r&&(t.push(n),n="",r=!1);continue}if(a==="|"||a===";"||a===">"||a==="&")break;n+=a,r=!0}return r&&t.push(n),t}function sL(e){const t=e.match(/(?:^|[\s;&|(])orx\s+(lit|paper)\b/);if(!t)return null;const n=t[1],r=e.slice((t.index??0)+t[0].length),i=iL(r);let a,o;for(let l=0;l_&:first-child]:mr-3 [&.active]:text-primary","[&.active]:bg-surface"].join(" "),Xn=[ah,"w-7 h-7"].join(" "),hi=["model-item [&.danger]:text-accent-red [&.danger:hover]:text-accent-red flex","items-center justify-between gap-2 w-full text-left py-1.5 px-2","text-md rounded-sm [&:hover]:bg-surface","[&_.model-id]:block [&_.model-id]:font-mono [&_.model-id]:text-2xs","[&_.model-id]:text-muted"].join(" "),ur=["settings-loading flex items-center gap-2 text-subtext text-md","py-1 px-0"].join(" "),qt=["spinner w-[13px] h-[13px] border-2 border-border border-t-primary","rounded-full animate-[spin_0.8s_linear_infinite] shrink-0"].join(" "),tn="mono font-mono text-sm",Aa="tab-body flex-1 min-h-0 relative flex flex-col",Dc="code-tab-body flex-1 min-h-0 overflow-auto bg-background",vs=["code-tab-note py-2 px-4 text-sm text-muted","border-b border-b-border-variant shrink-0"].join(" "),Sd=["title [.chat-header_&]:text-base [.chat-header_&]:font-semibold","[.chat-header_&]:text-text [.chat-header_&]:flex-1 [.chat-header_&]:min-w-0","[.chat-header_&]:overflow-hidden [.chat-header_&]:text-ellipsis","[.chat-header_&]:whitespace-nowrap"].join(" "),fi=["btn inline-flex items-center justify-center gap-1.5 py-1.5 px-3.5","text-sm font-semibold border border-border","rounded-md bg-background text-text whitespace-nowrap","transition-[background,border-color,color] duration-120 ease-standard","[&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight","[&:disabled]:opacity-45 [&:disabled]:cursor-default [&.primary]:bg-primary","[&.primary]:border-primary [&.primary]:text-background","[&.primary:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))]","[&.primary:hover:not(:disabled)]:border-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))]","[&.primary:active:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_80%,_var(--text))]","[&.primary:active:not(:disabled)]:border-[color-mix(in_oklab,_var(--primary)_80%,_var(--text))]","[&.danger]:text-accent-red","[&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_8%,_transparent)]","[&.danger:active:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_14%,_transparent)]","[&.ghost]:border-transparent [&.ghost]:text-text","[&.ghost:hover:not(:disabled)]:text-text [&.ghost:hover:not(:disabled)]:bg-surface","[&.sm]:py-[3px] [&.sm]:px-[9px] [&.sm]:text-xs [&.sm]:rounded-sm"].join(" "),Kn=`${fi} sm`,Wr=`${fi} primary`,cg=`${fi} ghost`,aL=`${Kn} primary`,lr=["badge inline-flex items-center font-sans text-xs","font-medium py-px px-[7px] border border-border","rounded-sm text-text [&.ok]:text-accent-green","[&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle","[&.err]:text-accent-red [&.err]:border-accent-red","[&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber","[&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle"].join(" "),Li=`${lr} err`,Cs=`${lr} ok`,h_=`${lr} warn`,f_=["status-badge inline-flex items-center gap-1.5 text-sm","font-medium text-text whitespace-nowrap [&_.dot]:w-[7px]","[&_.dot]:h-[7px] [&_.dot]:rounded-full [&_.dot]:bg-current","[&_.dot]:shrink-0 [&.live_.dot]:animate-[or-pulse_1.2s_ease-in-out_infinite]","[&.st-done_.dot]:text-accent-green [&.st-done_>_svg]:text-accent-green","[&.st-failed_.dot]:text-accent-red [&.st-running_.dot]:text-accent-teal","[&.st-starting_.dot]:text-accent-amber [&.st-cancelling_.dot]:text-accent-orange","[&.st-cancelled_.dot]:text-accent-orange [&.st-editing_.dot]:text-accent-purple","[&.st-idle_.dot]:text-muted"].join(" "),p_=["settings-switch relative flex-none w-9.5 h-5.5 border border-border rounded-full","bg-surface transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:top-[3px] [&_span]:left-[3px] [&_span]:w-3.5 [&_span]:h-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background]","[&_span]:duration-120 [&_span]:ease-standard [&.on]:border-primary [&.on]:bg-primary","[&.on_span]:bg-background [&.on_span]:translate-x-4 [&:disabled]:opacity-45","[&:disabled]:cursor-default [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid","[&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2"].join(" "),oL=["alphaxiv","openalex","biorxiv"];let u3=null;function lL(){const[e,t]=R.useState(u3),[n,r]=R.useState(!1),i=o=>{u3=o,t(o)};R.useEffect(()=>{gD().then(i).catch(()=>{})},[]);const a=o=>{!e||n||(r(!0),bD({...e,[o]:!e[o]}).then(i).catch(()=>{}).finally(()=>r(!1)))};return e?h.jsx("div",{className:"flex flex-col",children:oL.map(o=>{const l=e[o];return h.jsxs("button",{type:"button",role:"switch","aria-checked":l,className:hi,disabled:n,onClick:()=>a(o),children:[h.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[h.jsx(d_,{source:o,size:16,decorative:!0}),u_[o]]}),h.jsx("span",{className:`${p_} ${l?"on":""}`,"aria-hidden":"true",children:h.jsx("span",{})})]},o)})}):h.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:"Loading…"})}function ug(e,t){if(!e)throw new Error("Assertion Error")}function sl(e,t){if(e==null)throw new Error(`Unexpected ${e}`);return e}function cL(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 uL(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` -`}]}function dL(e,t){const n=t.value?t.value+` -`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function hL(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fL(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Gr=Io(/[A-Za-z]/),Rr=Io(/[\dA-Za-z]/),pL=Io(/[#-'*+\--9=?A-Z^-~]/);function jf(e){return e!==null&&(e<32||e===127)}const Db=Io(/\d/),mL=Io(/[\dA-Fa-f]/),gL=Io(/[!-/:-@[-`{-~]/);function at(e){return e!==null&&e<-2}function hn(e){return e!==null&&(e<0||e===32)}function Lt(e){return e===-2||e===-1||e===32}const lp=Io(new RegExp("\\p{P}|\\p{S}","u")),Cl=Io(/\s/);function Io(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function nu(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function bL(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=nu(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,d),e.applyData(t,d)}function vL(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 _L(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function yS(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 i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function xL(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yS(e,t);const i={src:nu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function yL(e,t){const n={src:nu(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 wL(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 SL(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yS(e,t);const i={href:nu(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function kL(e,t){const n={href:nu(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 CL(e,t,n){const r=e.all(t),i=n?EL(n):wS(t),a={},o=[];if(typeof t.checked=="boolean"){const m=r[0];let f;m&&m.type==="element"&&m.tagName==="p"?f=m:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l1}function AL(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0&&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 ML(e){const t=m_(e),n=SS(e);if(t&&n)return{start:t,end:n}}function RL(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=m_(t.children[1]),u=SS(t.children[t.children.length-1]);l&&u&&(o.position={start:l,end:u}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function DL(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let u=-1;const d=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(f3(t.slice(i),i>0,!1)),a.join("")}function f3(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===d3||a===h3;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===d3||a===h3;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function IL(e,t){const n={type:"text",value:OL(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function zL(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const BL={blockquote:cL,break:uL,code:dL,delete:hL,emphasis:fL,footnoteReference:bL,heading:vL,html:_L,imageReference:xL,image:yL,inlineCode:wL,linkReference:SL,link:kL,listItem:CL,list:AL,paragraph:TL,root:NL,strong:jL,table:RL,tableCell:LL,tableRow:DL,text:IL,thematicBreak:zL,toml:j0,yaml:j0,definition:j0,footnoteDefinition:j0};function j0(){}const CS=-1,cp=0,dd=1,Mf=2,g_=3,b_=4,v_=5,__=6,ES=7,AS=8,HL=typeof self=="object"?self:globalThis,p3=(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 HL[e](t)},$L=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case cp:case CS:return n(o,i);case dd:{const l=n([],i);for(const u of o)l.push(r(u));return l}case Mf:{const l=n({},i);for(const[u,d]of o)l[r(u)]=r(d);return l}case g_:return n(new Date(o),i);case b_:{const{source:l,flags:u}=o;return n(new RegExp(l,u),i)}case v_:{const l=n(new Map,i);for(const[u,d]of o)l.set(r(u),r(d));return l}case __:{const l=n(new Set,i);for(const u of o)l.add(r(u));return l}case ES:{const{name:l,message:u}=o;return n(p3(l,u),i)}case AS:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(p3(a,o),i)};return r},m3=e=>$L(new Map,e)(0),ul="",{toString:FL}={},{keys:PL}=Object,Xu=e=>{const t=typeof e;if(t!=="object"||!e)return[cp,t];const n=FL.call(e).slice(8,-1);switch(n){case"Array":return[dd,ul];case"Object":return[Mf,ul];case"Date":return[g_,ul];case"RegExp":return[b_,ul];case"Map":return[v_,ul];case"Set":return[__,ul];case"DataView":return[dd,n]}return n.includes("Array")?[dd,n]:n.includes("Error")?[ES,n]:[Mf,n]},M0=([e,t])=>e===cp&&(t==="function"||t==="symbol"),UL=(e,t,n,r)=>{const i=(o,l)=>{const u=r.push(o)-1;return n.set(l,u),u},a=o=>{if(n.has(o))return n.get(o);let[l,u]=Xu(o);switch(l){case cp:{let m=o;switch(u){case"bigint":l=AS,m=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);m=null;break;case"undefined":return i([CS],o)}return i([l,m],o)}case dd:{if(u){let g=o;return u==="DataView"?g=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(g=new Uint8Array(o)),i([u,[...g]],o)}const m=[],f=i([l,m],o);for(const g of o)m.push(a(g));return f}case Mf:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const m=[],f=i([l,m],o);for(const g of PL(o))(e||!M0(Xu(o[g])))&&m.push([a(g),a(o[g])]);return f}case g_:return i([l,isNaN(o.getTime())?ul:o.toISOString()],o);case b_:{const{source:m,flags:f}=o;return i([l,{source:m,flags:f}],o)}case v_:{const m=[],f=i([l,m],o);for(const[g,b]of o)(e||!(M0(Xu(g))||M0(Xu(b))))&&m.push([a(g),a(b)]);return f}case __:{const m=[],f=i([l,m],o);for(const g of o)(e||!M0(Xu(g)))&&m.push(a(g));return f}}const{message:d}=o;return i([l,{name:u,message:d}],o)};return a},g3=(e,{json:t,lossy:n}={})=>{const r=[];return UL(!(t||n),!!t,new Map,r)(e),r},Rf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?m3(g3(e,t)):structuredClone(e):(e,t)=>m3(g3(e,t));function qL(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 GL(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function VL(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||qL,r=e.options.footnoteBackLabel||GL,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u0&&k.push({type:"text",value:" "});let w=typeof n=="string"?n:n(u,b);typeof w=="string"&&(w={type:"text",value:w}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,b),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const x=m[m.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const w=x.children[x.children.length-1];w&&w.type==="text"?w.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...k)}else m.push(...k);const _={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(m,!0)};e.patch(d,_),l.push(_)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Rf(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const oh=(function(e){if(e==null)return KL;if(typeof e=="function")return up(e);if(typeof e=="object")return Array.isArray(e)?WL(e):YL(e);if(typeof e=="string")return XL(e);throw new Error("Expected function, string, or object as test")});function WL(e){const t=[];let n=-1;for(;++n":""))+")"})}return g;function g(){let b=TS,k,S,x;if((!t||a(u,d,m[m.length-1]||void 0))&&(b=JL(n(u,m)),b[0]===Lb))return b;if("children"in u&&u.children){const _=u;if(_.children&&b[0]!==NS)for(S=(r?_.children.length:-1)+o,x=m.concat(_);S>-1&&S<_.children.length;){const w=_.children[S];if(k=l(w,S,x)(),k[0]===Lb)return k;S=typeof k[1]=="number"?k[1]:S+o}}return b}}}function JL(e){return Array.isArray(e)?e:typeof e=="number"?[QL,e]:e==null?TS:[e]}function y_(e,t,n,r){let i,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,i=n):(a=t,o=n,i=r),x_(e,a,l,i);function l(u,d){const m=d[d.length-1],f=m?m.children.indexOf(u):void 0;return o(u,f,m)}}const Ob={}.hasOwnProperty,eO={};function tO(e,t){const n=t||eO,r=new Map,i=new Map,a=new Map,o={...BL,...n.handlers},l={all:d,applyData:rO,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:u,options:n,patch:nO,wrap:sO};return y_(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const f=m.type==="definition"?r:i,g=String(m.identifier).toUpperCase();f.has(g)||f.set(g,m)}}),l;function u(m,f){const g=m.type,b=l.handlers[g];if(Ob.call(l.handlers,g)&&b)return b(l,m,f);if(l.options.passThrough&&l.options.passThrough.includes(g)){if("children"in m){const{children:S,...x}=m,_=Rf(x);return _.children=l.all(m),_}return Rf(m)}return(l.options.unknownHandler||iO)(l,m,f)}function d(m){const f=[];if("children"in m){const g=m.children;let b=-1;for(;++b0&&n.push({type:"text",value:` -`}),n}function b3(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function v3(e,t){const n=tO(e,t),r=n.one(e,void 0),i=VL(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:` -`},i),a}function Df(e,t){return e&&"run"in e?async function(n,r){const i=v3(n,{file:r,...t});await e.run(i,r)}:function(n,r){return v3(n,{file:r,...e||t})}}function _3(e){if(e)throw e}var dg,x3;function aO(){if(x3)return dg;x3=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},a=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),f=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!f)return!1;var g;for(g in d);return typeof g>"u"||e.call(d,g)},o=function(d,m){n&&m.name==="__proto__"?n(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},l=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(r)return r(d,m).value}else return;return d[m]};return dg=function u(){var d,m,f,g,b,k,S=arguments[0],x=1,_=arguments.length,w=!1;for(typeof S=="boolean"&&(w=S,S=arguments[1]||{},x=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});x<_;++x)if(d=arguments[x],d!=null)for(m in d)f=l(S,m),g=l(d,m),S!==g&&(w&&g&&(a(g)||(b=i(g)))?(b?(b=!1,k=f&&i(f)?f:[]):k=f&&a(f)?f:{},o(S,{name:m,newValue:u(w,k,g)})):typeof g<"u"&&o(S,{name:m,newValue:g}));return S},dg}var oO=aO();const hg=np(oO);function Ib(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 lO(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...i);function l(u,...d){const m=e[++a];let f=-1;if(u){o(u);return}for(;++fo.length;let u;l&&o.push(i);try{u=e.apply(this,o)}catch(d){const m=d;if(l&&n)throw m;return i(m)}l||(u&&u.then&&typeof u.then=="function"?u.then(a,i):u instanceof Error?i(u):a(u))}function i(o,...l){n||(n=!0,t(o,...l))}function a(o){i(null,o)}}function hd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?y3(e.position):"start"in e||"end"in e?y3(e):"line"in e||"column"in e?zb(e):""}function zb(e){return w3(e&&e.line)+":"+w3(e&&e.column)}function y3(e){return zb(e&&e.start)+"-"+zb(e&&e.end)}function w3(e){return e&&typeof e=="number"?e:1}class Lr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?a.ruleId=r:(a.source=r.slice(0,u),a.ruleId=r.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=hd(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Lr.prototype.file="";Lr.prototype.name="";Lr.prototype.reason="";Lr.prototype.message="";Lr.prototype.stack="";Lr.prototype.column=void 0;Lr.prototype.line=void 0;Lr.prototype.ancestors=void 0;Lr.prototype.cause=void 0;Lr.prototype.fatal=void 0;Lr.prototype.place=void 0;Lr.prototype.ruleId=void 0;Lr.prototype.source=void 0;const $s={basename:uO,dirname:dO,extname:hO,join:fO,sep:"/"};function uO(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');lh(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function dO(e){if(lh(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 hO(e){lh(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function fO(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function mO(e,t){let n="",r=0,i=-1,a=0,o=-1,l,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function lh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const gO={cwd:bO};function bO(){return"/"}function Bb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function vO(e){if(typeof e=="string")e=new URL(e);else if(!Bb(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 _O(e)}function _O(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(;++n0){let[b,...k]=m;const S=r[g][1];Ib(S)&&Ib(b)&&(b=hg(!0,S,b)),r[g]=[d,b,...k]}}}}const S_=new w_().freeze();function gg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function bg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function vg(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 k3(e){if(!Ib(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function C3(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function R0(e){return SO(e)?e:new jS(e)}function SO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function kO(e){return typeof e=="string"||CO(e)}function CO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var E3=Object.prototype.hasOwnProperty;function A3(e,t,n){for(n of e.keys())if(fd(n,t))return n}function fd(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&fd(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i=="object"&&(i=A3(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i=="object"&&(i=A3(t,i),!i)||!fd(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(E3.call(e,n)&&++r&&!E3.call(t,n)||!(n in t)||!fd(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function T3(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const o=n.slice(i,r).trim();(o||!a)&&t.push(o),i=r+1,r=n.indexOf(",",i)}return t}function EO(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const AO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,TO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,NO={};function N3(e,t){return(NO.jsx?TO:AO).test(e)}const jO=/[ \t\n\f\r]/g;function MO(e){return typeof e=="object"?e.type==="text"?j3(e.value):!1:j3(e)}function j3(e){return e.replace(jO,"")===""}class ch{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ch.prototype.normal={};ch.prototype.property={};ch.prototype.space=void 0;function MS(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ch(n,r,t)}function kd(e){return e.toLowerCase()}class mi{constructor(t,n){this.attribute=n,this.property=t}}mi.prototype.attribute="";mi.prototype.booleanish=!1;mi.prototype.boolean=!1;mi.prototype.commaOrSpaceSeparated=!1;mi.prototype.commaSeparated=!1;mi.prototype.defined=!1;mi.prototype.mustUseProperty=!1;mi.prototype.number=!1;mi.prototype.overloadedBoolean=!1;mi.prototype.property="";mi.prototype.spaceSeparated=!1;mi.prototype.space=void 0;let RO=0;const xt=Dl(),Vn=Dl(),Hb=Dl(),Be=Dl(),dn=Dl(),yl=Dl(),Ni=Dl();function Dl(){return 2**++RO}const $b=Object.freeze(Object.defineProperty({__proto__:null,boolean:xt,booleanish:Vn,commaOrSpaceSeparated:Ni,commaSeparated:yl,number:Be,overloadedBoolean:Hb,spaceSeparated:dn},Symbol.toStringTag,{value:"Module"})),_g=Object.keys($b);class k_ extends mi{constructor(t,n,r,i){let a=-1;if(super(t,n),M3(this,"space",i),typeof r=="number")for(;++a<_g.length;){const o=_g[a];M3(this,_g[a],(r&$b[o])===$b[o])}}}k_.prototype.defined=!0;function M3(e,t,n){n&&(e[t]=n)}function ru(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new k_(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[kd(r)]=r,n[kd(a.attribute)]=r}return new ch(t,n,e.space)}const RS=ru({properties:{ariaActiveDescendant:null,ariaAtomic:Vn,ariaAutoComplete:null,ariaBusy:Vn,ariaChecked:Vn,ariaColCount:Be,ariaColIndex:Be,ariaColSpan:Be,ariaControls:dn,ariaCurrent:null,ariaDescribedBy:dn,ariaDetails:null,ariaDisabled:Vn,ariaDropEffect:dn,ariaErrorMessage:null,ariaExpanded:Vn,ariaFlowTo:dn,ariaGrabbed:Vn,ariaHasPopup:null,ariaHidden:Vn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dn,ariaLevel:Be,ariaLive:null,ariaModal:Vn,ariaMultiLine:Vn,ariaMultiSelectable:Vn,ariaOrientation:null,ariaOwns:dn,ariaPlaceholder:null,ariaPosInSet:Be,ariaPressed:Vn,ariaReadOnly:Vn,ariaRelevant:null,ariaRequired:Vn,ariaRoleDescription:dn,ariaRowCount:Be,ariaRowIndex:Be,ariaRowSpan:Be,ariaSelected:Vn,ariaSetSize:Be,ariaSort:null,ariaValueMax:Be,ariaValueMin:Be,ariaValueNow:Be,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function DS(e,t){return t in e?e[t]:t}function LS(e,t){return DS(e,t.toLowerCase())}const DO=ru({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:yl,acceptCharset:dn,accessKey:dn,action:null,allow:null,allowFullScreen:xt,allowPaymentRequest:xt,allowUserMedia:xt,alpha:xt,alt:null,as:null,async:xt,autoCapitalize:null,autoComplete:dn,autoFocus:xt,autoPlay:xt,blocking:dn,capture:null,charSet:null,checked:xt,cite:null,className:dn,closedBy:null,colorSpace:null,cols:Be,colSpan:Be,command:null,commandFor:null,content:null,contentEditable:Vn,controls:xt,controlsList:dn,coords:Be|yl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:xt,defer:xt,dir:null,dirName:null,disabled:xt,download:Hb,draggable:Vn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:xt,formTarget:null,headers:dn,height:Be,hidden:Hb,high:Be,href:null,hrefLang:null,htmlFor:dn,httpEquiv:dn,id:null,imageSizes:null,imageSrcSet:null,inert:xt,inputMode:null,integrity:null,is:null,isMap:xt,itemId:null,itemProp:dn,itemRef:dn,itemScope:xt,itemType:dn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:xt,low:Be,manifest:null,max:null,maxLength:Be,media:null,method:null,min:null,minLength:Be,multiple:xt,muted:xt,name:null,nonce:null,noModule:xt,noValidate:xt,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:xt,optimum:Be,pattern:null,ping:dn,placeholder:null,playsInline:xt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:xt,referrerPolicy:null,rel:dn,required:xt,reversed:xt,rows:Be,rowSpan:Be,sandbox:dn,scope:null,scoped:xt,seamless:xt,selected:xt,shadowRootClonable:xt,shadowRootCustomElementRegistry:xt,shadowRootDelegatesFocus:xt,shadowRootMode:null,shadowRootSerializable:xt,shape:null,size:Be,sizes:null,slot:null,span:Be,spellCheck:Vn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Be,step:null,style:null,tabIndex:Be,target:null,title:null,translate:null,type:null,typeMustMatch:xt,useMap:null,value:Vn,width:Be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dn,axis:null,background:null,bgColor:null,border:Be,borderColor:null,bottomMargin:Be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:xt,declare:xt,event:null,face:null,frame:null,frameBorder:null,hSpace:Be,leftMargin:Be,link:null,longDesc:null,lowSrc:null,marginHeight:Be,marginWidth:Be,noResize:xt,noHref:xt,noShade:xt,noWrap:xt,object:null,profile:null,prompt:null,rev:null,rightMargin:Be,rules:null,scheme:null,scrolling:Vn,standby:null,summary:null,text:null,topMargin:Be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Be,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:xt,disablePictureInPicture:xt,disableRemotePlayback:xt,exportParts:yl,part:dn,prefix:null,property:null,results:Be,security:null,unselectable:null},space:"html",transform:LS}),LO=ru({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:Ni,accentHeight:Be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Be,amplitude:Be,arabicForm:null,ascent:Be,attributeName:null,attributeType:null,azimuth:Be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Be,by:null,calcMode:null,capHeight:Be,className:dn,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:Be,diffuseConstant:Be,direction:null,display:null,dur:null,divisor:Be,dominantBaseline:null,download:xt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Be,enableBackground:null,end:null,event:null,exponent:Be,externalResourcesRequired:null,fill:null,fillOpacity:Be,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:yl,g2:yl,glyphName:yl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Be,horizOriginX:Be,horizOriginY:Be,id:null,ideographic:Be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Be,k:Be,k1:Be,k2:Be,k3:Be,k4:Be,kernelMatrix:Ni,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Be,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:Be,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:Be,overlineThickness:Be,paintOrder:null,panose1:null,path:null,pathLength:Be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:dn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Be,pointsAtY:Be,pointsAtZ:Be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ni,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ni,rev:Ni,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ni,requiredFeatures:Ni,requiredFonts:Ni,requiredFormats:Ni,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:Be,specularExponent:Be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Be,strikethroughThickness:Be,string:null,stroke:null,strokeDashArray:Ni,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Be,strokeOpacity:Be,strokeWidth:null,style:null,surfaceScale:Be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ni,tabIndex:Be,tableValues:null,target:null,targetX:Be,targetY:Be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ni,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Be,underlineThickness:Be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Be,values:null,vAlphabetic:Be,vMathematical:Be,vectorEffect:null,vHanging:Be,vIdeographic:Be,version:null,vertAdvY:Be,vertOriginX:Be,vertOriginY:Be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:DS}),OS=ru({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()}}),IS=ru({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:LS}),zS=ru({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),OO={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"},IO=/[A-Z]/g,R3=/-[a-z]/g,zO=/^data[-\w.:]+$/i;function BS(e,t){const n=kd(t);let r=t,i=mi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&zO.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(R3,HO);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!R3.test(a)){let o=a.replace(IO,BO);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=k_}return new i(r,t)}function BO(e){return"-"+e.toLowerCase()}function HO(e){return e.charAt(1).toUpperCase()}const HS=MS([RS,DO,OS,IS,zS],"html"),dp=MS([RS,LO,OS,IS,zS],"svg");function D3(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function $O(e){return e.join(" ").trim()}var _c={},xg,L3;function FO(){if(L3)return xg;L3=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,u=` -`,d="/",m="*",f="",g="comment",b="declaration";function k(x,_){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];_=_||{};var w=1,y=1;function C(G){var X=G.match(t);X&&(w+=X.length);var Y=G.lastIndexOf(u);y=~Y?G.length-Y:y+G.length}function N(){var G={line:w,column:y};return function(X){return X.position=new E(G),D(),X}}function E(G){this.start=G,this.end={line:w,column:y},this.source=_.source}E.prototype.content=x;function j(G){var X=new Error(_.source+":"+w+":"+y+": "+G);if(X.reason=G,X.filename=_.source,X.line=w,X.column=y,X.source=x,!_.silent)throw X}function T(G){var X=G.exec(x);if(X){var Y=X[0];return C(Y),x=x.slice(Y.length),X}}function D(){T(n)}function I(G){var X;for(G=G||[];X=$();)X!==!1&&G.push(X);return G}function $(){var G=N();if(!(d!=x.charAt(0)||m!=x.charAt(1))){for(var X=2;f!=x.charAt(X)&&(m!=x.charAt(X)||d!=x.charAt(X+1));)++X;if(X+=2,f===x.charAt(X-1))return j("End of comment missing");var Y=x.slice(2,X-2);return y+=2,C(Y),x=x.slice(X),y+=2,G({type:g,comment:Y})}}function F(){var G=N(),X=T(r);if(X){if($(),!T(i))return j("property missing ':'");var Y=T(a),Z=G({type:b,property:S(X[0].replace(e,f)),value:Y?S(Y[0].replace(e,f)):f});return T(o),Z}}function U(){var G=[];I(G);for(var X;X=F();)X!==!1&&(G.push(X),I(G));return G}return D(),U()}function S(x){return x?x.replace(l,f):f}return xg=k,xg}var O3;function PO(){if(O3)return _c;O3=1;var e=_c&&_c.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_c,"__esModule",{value:!0}),_c.default=n;const t=e(FO());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),l=typeof i=="function";return o.forEach(u=>{if(u.type!=="declaration")return;const{property:d,value:m}=u;l?i(d,m,u):m&&(a=a||{},a[d]=m)}),a}return _c}var Ku={},I3;function UO(){if(I3)return Ku;I3=1,Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(d){return!d||n.test(d)||e.test(d)},o=function(d,m){return m.toUpperCase()},l=function(d,m){return"".concat(m,"-")},u=function(d,m){return m===void 0&&(m={}),a(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(i,l):d=d.replace(r,l),d.replace(t,o))};return Ku.camelCase=u,Ku}var Zu,z3;function qO(){if(z3)return Zu;z3=1;var e=Zu&&Zu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(PO()),n=UO();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(l,u){l&&u&&(o[(0,n.camelCase)(l,a)]=u)}),o}return r.default=r,Zu=r,Zu}var GO=qO();const VO=np(GO),C_={}.hasOwnProperty,WO=new Map,YO=/[A-Z]/g,XO=new Set(["table","tbody","thead","tfoot","tr"]),KO=new Set(["td","th"]),$S="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function FS(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=iI(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=rI(n,t.jsx,t.jsxs)}const i={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"?dp:HS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=PS(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function PS(e,t,n){if(t.type==="element")return ZO(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return QO(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return eI(e,t,n);if(t.type==="mdxjsEsm")return JO(e,t);if(t.type==="root")return tI(e,t,n);if(t.type==="text")return nI(e,t)}function ZO(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=dp,e.schema=i),e.ancestors.push(t);const a=qS(e,t.tagName,!1),o=sI(e,t);let l=A_(e,t);return XO.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!MO(u):!0})),US(e,o,a,t),E_(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function QO(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)}Cd(e,t.position)}function JO(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Cd(e,t.position)}function eI(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=dp,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:qS(e,t.name,!0),o=aI(e,t),l=A_(e,t);return US(e,o,a,t),E_(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function tI(e,t,n){const r={};return E_(r,A_(e,t)),e.create(t,e.Fragment,r,n)}function nI(e,t){return t.value}function US(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function E_(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function rI(e,t,n){return r;function r(i,a,o,l){const d=Array.isArray(o.children)?n:t;return l?d(a,o,l):d(a,o)}}function iI(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),u=m_(r);return t(i,a,o,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function sI(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&C_.call(t.properties,i)){const a=oI(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&KO.has(t.tagName)?r=l:n[o]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function aI(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Cd(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else Cd(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function A_(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:WO;for(;++ry.key).filter(y=>y!==void 0));let d=0;for(;d=e.children.length-m&&(E=i.length-(e.children.length-y)),E>=0&&(N=((_=i[E])==null?void 0:_.key)??N);N&&u.has(N)&&((w=i[E])==null?void 0:w.key)!==N;)N=`${N}+`;N&&u.add(N);const j=GS(C,i[E]??null,n,N);a.push(j),j.react!==void 0&&o.push(j.react)}const f=t!==null&&mI(e,t.node);if(t&&t.key===r&&f&&i.length===a.length&&a.every((y,C)=>y===i[C]))return t;const g=e.type==="element"&&hI.has(e.tagName)?o.filter(y=>typeof y!="string"||!fI.test(y)):o,b=g.length>0?g.length===1?g[0]:g:null;let k=f?t==null?void 0:t.shell:null;if(!k){const y=FS({...e,children:[]},n);k={props:y.props,type:y.type}}return{children:a,key:r,node:e,react:h.jsx(k.type,{...k.props,children:b},r),shell:k}}function mI(e,t){if(e===t)return!0;const{children:n,position:r,...i}=e,{children:a,position:o,...l}=t;return fd(i,l)}function Lc(e,t){if(e===t)return!0;if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let o=0;oi?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(Oi(e,e.length,0,t),e):t}const $3={}.hasOwnProperty;function WS(e){const t={};let n=-1;for(;++n13&&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 ws(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function Mt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(u){return Lt(u)?(e.enter(n),l(u)):t(u)}function l(u){return Lt(u)&&a++o))return;const j=t.events.length;let T=j,D,I;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(D){I=t.events[T][1].end;break}D=!0}for(_(r),E=j;Ey;){const N=n[C];t.containerState=N[1],N[0].exit.call(t,e)}n.length=y}function w(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function kI(e,t,n){return Mt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qc(e){if(e===null||hn(e)||Cl(e))return 1;if(lp(e))return 2}function hp(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},g={...e[n][1].start};P3(f,-u),P3(g,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},a={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=rs(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=rs(d,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),d=rs(d,hp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=rs(d,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,d=rs(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,Oi(e,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n0&&Lt(E)?Mt(e,w,"linePrefix",a+1)(E):w(E)}function w(E){return E===null||at(E)?e.check(U3,S,C)(E):(e.enter("codeFlowValue"),y(E))}function y(E){return E===null||at(E)?(e.exit("codeFlowValue"),w(E)):(e.consume(E),y)}function C(E){return e.exit("codeFenced"),t(E)}function N(E,j,T){let D=0;return I;function I(X){return E.enter("lineEnding"),E.consume(X),E.exit("lineEnding"),$}function $(X){return E.enter("codeFencedFence"),Lt(X)?Mt(E,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):F(X)}function F(X){return X===l?(E.enter("codeFencedFenceSequence"),U(X)):T(X)}function U(X){return X===l?(D++,E.consume(X),U):D>=o?(E.exit("codeFencedFenceSequence"),Lt(X)?Mt(E,G,"whitespace")(X):G(X)):T(X)}function G(X){return X===null||at(X)?(E.exit("codeFencedFence"),j(X)):T(X)}}}function II(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const yg={name:"codeIndented",tokenize:BI},zI={partial:!0,tokenize:HI};function BI(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),Mt(e,a,"linePrefix",5)(d)}function a(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?o(d):n(d)}function o(d){return d===null?u(d):at(d)?e.attempt(zI,o,u)(d):(e.enter("codeFlowValue"),l(d))}function l(d){return d===null||at(d)?(e.exit("codeFlowValue"),o(d)):(e.consume(d),l)}function u(d){return e.exit("codeIndented"),t(d)}}function HI(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):at(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Mt(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):at(o)?i(o):n(o)}}const $I={name:"codeText",previous:PI,resolve:FI,tokenize:UI};function FI(e){let t=e.length-4,n=3,r,i;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=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 tthis.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 i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Qu(this.left,r),a.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),Qu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Qu(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=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function JS(e,t,n,r,i,a,o,l,u){const d=u||Number.POSITIVE_INFINITY;let m=0;return f;function f(_){return _===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(_),e.exit(a),g):_===null||_===32||_===41||jf(_)?n(_):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),S(_))}function g(_){return _===62?(e.enter(a),e.consume(_),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===62?(e.exit("chunkString"),e.exit(l),g(_)):_===null||_===60||at(_)?n(_):(e.consume(_),_===92?k:b)}function k(_){return _===60||_===62||_===92?(e.consume(_),b):b(_)}function S(_){return!m&&(_===null||_===41||hn(_))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(_)):m999||b===null||b===91||b===93&&!u||b===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(b):b===93?(e.exit(a),e.enter(i),e.consume(b),e.exit(i),e.exit(r),t):at(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===null||b===91||b===93||at(b)||l++>999?(e.exit("chunkString"),m(b)):(e.consume(b),u||(u=!Lt(b)),b===92?g:f)}function g(b){return b===91||b===92||b===93?(e.consume(b),l++,f):f(b)}}function t9(e,t,n,r,i,a){let o;return l;function l(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),o=g===40?41:g,u):n(g)}function u(g){return g===o?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(a),d(g))}function d(g){return g===o?(e.exit(a),u(o)):g===null?n(g):at(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Mt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===o||g===null||at(g)?(e.exit("chunkString"),d(g)):(e.consume(g),g===92?f:m)}function f(g){return g===o||g===92?(e.consume(g),m):m(g)}}function pd(e,t){let n;return r;function r(i){return at(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Lt(i)?Mt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const ZI={name:"definition",tokenize:JI},QI={partial:!0,tokenize:ez};function JI(e,t,n){const r=this;let i;return a;function a(b){return e.enter("definition"),o(b)}function o(b){return e9.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function l(b){return i=ws(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),u):n(b)}function u(b){return hn(b)?pd(e,d)(b):d(b)}function d(b){return JS(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function m(b){return e.attempt(QI,f,f)(b)}function f(b){return Lt(b)?Mt(e,g,"whitespace")(b):g(b)}function g(b){return b===null||at(b)?(e.exit("definition"),r.parser.defined.push(i),t(b)):n(b)}}function ez(e,t,n){return r;function r(l){return hn(l)?pd(e,i)(l):n(l)}function i(l){return t9(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Lt(l)?Mt(e,o,"whitespace")(l):o(l)}function o(l){return l===null||at(l)?t(l):n(l)}}const tz={name:"hardBreakEscape",tokenize:nz};function nz(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return at(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const rz={name:"headingAtx",resolve:iz,tokenize:sz};function iz(e,t){let n=e.length-2,r=3,i,a;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&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Oi(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function sz(e,t,n){let r=0;return i;function i(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),o(m)}function o(m){return m===35&&r++<6?(e.consume(m),o):m===null||hn(m)?(e.exit("atxHeadingSequence"),l(m)):n(m)}function l(m){return m===35?(e.enter("atxHeadingSequence"),u(m)):m===null||at(m)?(e.exit("atxHeading"),t(m)):Lt(m)?Mt(e,l,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function u(m){return m===35?(e.consume(m),u):(e.exit("atxHeadingSequence"),l(m))}function d(m){return m===null||m===35||hn(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),d)}}const az=["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"],G3=["pre","script","style","textarea"],oz={concrete:!0,name:"htmlFlow",resolveTo:uz,tokenize:dz},lz={partial:!0,tokenize:fz},cz={partial:!0,tokenize:hz};function uz(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 dz(e,t,n){const r=this;let i,a,o,l,u;return d;function d(W){return m(W)}function m(W){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(W),f}function f(W){return W===33?(e.consume(W),g):W===47?(e.consume(W),a=!0,S):W===63?(e.consume(W),i=3,r.interrupt?t:O):Gr(W)?(e.consume(W),o=String.fromCharCode(W),x):n(W)}function g(W){return W===45?(e.consume(W),i=2,b):W===91?(e.consume(W),i=5,l=0,k):Gr(W)?(e.consume(W),i=4,r.interrupt?t:O):n(W)}function b(W){return W===45?(e.consume(W),r.interrupt?t:O):n(W)}function k(W){const re="CDATA[";return W===re.charCodeAt(l++)?(e.consume(W),l===re.length?r.interrupt?t:F:k):n(W)}function S(W){return Gr(W)?(e.consume(W),o=String.fromCharCode(W),x):n(W)}function x(W){if(W===null||W===47||W===62||hn(W)){const re=W===47,le=o.toLowerCase();return!re&&!a&&G3.includes(le)?(i=1,r.interrupt?t(W):F(W)):az.includes(o.toLowerCase())?(i=6,re?(e.consume(W),_):r.interrupt?t(W):F(W)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(W):a?w(W):y(W))}return W===45||Rr(W)?(e.consume(W),o+=String.fromCharCode(W),x):n(W)}function _(W){return W===62?(e.consume(W),r.interrupt?t:F):n(W)}function w(W){return Lt(W)?(e.consume(W),w):I(W)}function y(W){return W===47?(e.consume(W),I):W===58||W===95||Gr(W)?(e.consume(W),C):Lt(W)?(e.consume(W),y):I(W)}function C(W){return W===45||W===46||W===58||W===95||Rr(W)?(e.consume(W),C):N(W)}function N(W){return W===61?(e.consume(W),E):Lt(W)?(e.consume(W),N):y(W)}function E(W){return W===null||W===60||W===61||W===62||W===96?n(W):W===34||W===39?(e.consume(W),u=W,j):Lt(W)?(e.consume(W),E):T(W)}function j(W){return W===u?(e.consume(W),u=null,D):W===null||at(W)?n(W):(e.consume(W),j)}function T(W){return W===null||W===34||W===39||W===47||W===60||W===61||W===62||W===96||hn(W)?N(W):(e.consume(W),T)}function D(W){return W===47||W===62||Lt(W)?y(W):n(W)}function I(W){return W===62?(e.consume(W),$):n(W)}function $(W){return W===null||at(W)?F(W):Lt(W)?(e.consume(W),$):n(W)}function F(W){return W===45&&i===2?(e.consume(W),Y):W===60&&i===1?(e.consume(W),Z):W===62&&i===4?(e.consume(W),H):W===63&&i===3?(e.consume(W),O):W===93&&i===5?(e.consume(W),z):at(W)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(lz,V,U)(W)):W===null||at(W)?(e.exit("htmlFlowData"),U(W)):(e.consume(W),F)}function U(W){return e.check(cz,G,V)(W)}function G(W){return e.enter("lineEnding"),e.consume(W),e.exit("lineEnding"),X}function X(W){return W===null||at(W)?U(W):(e.enter("htmlFlowData"),F(W))}function Y(W){return W===45?(e.consume(W),O):F(W)}function Z(W){return W===47?(e.consume(W),o="",Q):F(W)}function Q(W){if(W===62){const re=o.toLowerCase();return G3.includes(re)?(e.consume(W),H):F(W)}return Gr(W)&&o.length<8?(e.consume(W),o+=String.fromCharCode(W),Q):F(W)}function z(W){return W===93?(e.consume(W),O):F(W)}function O(W){return W===62?(e.consume(W),H):W===45&&i===2?(e.consume(W),O):F(W)}function H(W){return W===null||at(W)?(e.exit("htmlFlowData"),V(W)):(e.consume(W),H)}function V(W){return e.exit("htmlFlow"),t(W)}}function hz(e,t,n){const r=this;return i;function i(o){return at(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function fz(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(uh,t,n)}}const pz={name:"htmlText",tokenize:mz};function mz(e,t,n){const r=this;let i,a,o;return l;function l(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),u}function u(O){return O===33?(e.consume(O),d):O===47?(e.consume(O),N):O===63?(e.consume(O),y):Gr(O)?(e.consume(O),T):n(O)}function d(O){return O===45?(e.consume(O),m):O===91?(e.consume(O),a=0,k):Gr(O)?(e.consume(O),w):n(O)}function m(O){return O===45?(e.consume(O),b):n(O)}function f(O){return O===null?n(O):O===45?(e.consume(O),g):at(O)?(o=f,Z(O)):(e.consume(O),f)}function g(O){return O===45?(e.consume(O),b):f(O)}function b(O){return O===62?Y(O):O===45?g(O):f(O)}function k(O){const H="CDATA[";return O===H.charCodeAt(a++)?(e.consume(O),a===H.length?S:k):n(O)}function S(O){return O===null?n(O):O===93?(e.consume(O),x):at(O)?(o=S,Z(O)):(e.consume(O),S)}function x(O){return O===93?(e.consume(O),_):S(O)}function _(O){return O===62?Y(O):O===93?(e.consume(O),_):S(O)}function w(O){return O===null||O===62?Y(O):at(O)?(o=w,Z(O)):(e.consume(O),w)}function y(O){return O===null?n(O):O===63?(e.consume(O),C):at(O)?(o=y,Z(O)):(e.consume(O),y)}function C(O){return O===62?Y(O):y(O)}function N(O){return Gr(O)?(e.consume(O),E):n(O)}function E(O){return O===45||Rr(O)?(e.consume(O),E):j(O)}function j(O){return at(O)?(o=j,Z(O)):Lt(O)?(e.consume(O),j):Y(O)}function T(O){return O===45||Rr(O)?(e.consume(O),T):O===47||O===62||hn(O)?D(O):n(O)}function D(O){return O===47?(e.consume(O),Y):O===58||O===95||Gr(O)?(e.consume(O),I):at(O)?(o=D,Z(O)):Lt(O)?(e.consume(O),D):Y(O)}function I(O){return O===45||O===46||O===58||O===95||Rr(O)?(e.consume(O),I):$(O)}function $(O){return O===61?(e.consume(O),F):at(O)?(o=$,Z(O)):Lt(O)?(e.consume(O),$):D(O)}function F(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),i=O,U):at(O)?(o=F,Z(O)):Lt(O)?(e.consume(O),F):(e.consume(O),G)}function U(O){return O===i?(e.consume(O),i=void 0,X):O===null?n(O):at(O)?(o=U,Z(O)):(e.consume(O),U)}function G(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||hn(O)?D(O):(e.consume(O),G)}function X(O){return O===47||O===62||hn(O)?D(O):n(O)}function Y(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function Z(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Q}function Q(O){return Lt(O)?Mt(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):z(O)}function z(O){return e.enter("htmlTextData"),o(O)}}const N_={name:"labelEnd",resolveAll:_z,resolveTo:xz,tokenize:yz},gz={tokenize:wz},bz={tokenize:Sz},vz={tokenize:kz};function _z(e){let t=-1;const n=[];for(;++t=3&&(d===null||at(d))?(e.exit("thematicBreak"),t(d)):n(d)}function u(d){return d===i?(e.consume(d),r++,u):(e.exit("thematicBreakSequence"),Lt(d)?Mt(e,l,"whitespace")(d):l(d))}}const ci={continuation:{tokenize:Lz},exit:Iz,name:"list",tokenize:Dz},Mz={partial:!0,tokenize:zz},Rz={partial:!0,tokenize:Oz};function Dz(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(b){const k=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:Db(b)){if(r.containerState.type||(r.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(df,n,d)(b):d(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(b)}return n(b)}function u(b){return Db(b)&&++o<10?(e.consume(b),u):(!r.interrupt||o<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):n(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(uh,r.interrupt?n:m,e.attempt(Mz,g,f))}function m(b){return r.containerState.initialBlankLine=!0,a++,g(b)}function f(b){return Lt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),g):n(b)}function g(b){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function Lz(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(uh,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Mt(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!Lt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Rz,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Mt(e,e.attempt(ci,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Oz(e,t,n){const r=this;return Mt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function Iz(e){e.exit(this.containerState.type)}function zz(e,t,n){const r=this;return Mt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!Lt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const V3={name:"setextUnderline",resolveTo:Bz,tokenize:Hz};function Bz(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Hz(e,t,n){const r=this;let i;return a;function a(d){let m=r.events.length,f;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){f=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=d,o(d)):n(d)}function o(d){return e.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===i?(e.consume(d),l):(e.exit("setextHeadingLineSequence"),Lt(d)?Mt(e,u,"lineSuffix")(d):u(d))}function u(d){return d===null||at(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const $z={tokenize:Fz};function Fz(e){const t=this,n=e.attempt(uh,r,e.attempt(this.parser.constructs.flowInitial,i,Mt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(VI,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Pz={resolveAll:r9()},Uz=n9("string"),qz=n9("text");function n9(e){return{resolveAll:r9(e==="text"?Gz:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,l);return o;function o(m){return d(m)?a(m):l(m)}function l(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),u}function u(m){return d(m)?(n.exit("data"),a(m)):(n.consume(m),u)}function d(m){if(m===null)return!0;const f=i[m];let g=-1;if(f)for(;++g-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function iB(e,t){let n=-1;const r=[];let i;for(;++n0){const tt=Ge.tokenStack[Ge.tokenStack.length-1];(tt[1]||Y3).call(Ge,void 0,tt[0])}for(Me.position={start:_o(xe.length>0?xe[0][1].start:{line:1,column:1,offset:0}),end:_o(xe.length>0?xe[xe.length-2][1].end:{line:1,column:1,offset:0})},Oe=-1;++Oe0&&(wr(this,Eo,kn(this,Eo)+n.slice(0,r.commitIndex)),n=n.slice(r.commitIndex),r=X3(n)),kn(this,Eo)+EB(n,r)}}Eo=new WeakMap;const mB=new Set(["*","**","_","__"]);function X3(e){const t={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let n=0;nn){n=i-1;continue}if(t.exclusive)continue;if(CB(t)){K3(t,n,r);continue}const a=xB(t,e,n);if(a>n){n=a-1;continue}const o=yB(t,e,n);if(o>n){n=o-1;continue}Ss(e,n)||K3(t,n,r)}return t}function gB(e,t,n){const r=t[n];return r==="`"?bB(e,t,n):r==="$"?vB(e,t,n):r==="~"?_B(e,t,n):n}function bB(e,t,n){const r=M_(t,n),i="`".repeat(r),a=e.exclusive;return(a==null?void 0:a.kind)==="fence"?(a.token[0]==="`"&&Lf(t,n)&&!Ss(t,n)&&r>=a.token.length&&(e.exclusive=null),n+r):(a==null?void 0:a.kind)==="code"?(!Ss(t,n)&&r>=a.token.length&&(e.exclusive=null),n+r):a||Ss(t,n)?n+r:r>=3&&Lf(t,n)?(e.exclusive={kind:"fence",start:n,token:i},n+r):(e.exclusive={kind:"code",start:n,token:i},n+r)}function vB(e,t,n){const r=M_(t,n),i=e.exclusive;return(i==null?void 0:i.kind)==="math"?(!Ss(t,n)&&r>=i.token.length&&(e.exclusive=null),n+r):(i||Ss(t,n)||(e.exclusive={kind:"math",start:n,token:r>=2?"$$":"$"}),n+r)}function _B(e,t,n){const r=M_(t,n),i=e.exclusive;return(i==null?void 0:i.kind)==="fence"&&i.token[0]==="~"?(Lf(t,n)&&!Ss(t,n)&&r>=i.token.length&&(e.exclusive=null),n+r):i||r<3||!Lf(t,n)||Ss(t,n)?n:(e.exclusive={kind:"fence",start:n,token:"~".repeat(r)},n+r)}function xB(e,t,n){if(t[n]!=="<"||Ss(t,n))return n;const r=t[n+1];if(r!==void 0&&!l9(r))return n;e.pendingHtml=n;for(let i=n+1;i"||t[i]===` -`)return e.pendingHtml=null,i+1;return t.length}function yB(e,t,n){const r=wB(t,n);if(!r)return n;if(Ss(t,n))return n+r.length;const i=e.delims.findLastIndex(a=>a.token===r);return i!==-1?(e.delims.splice(i,1),n+r.length):n+r.length===t.length?(e.pendingDelim={start:n,token:r},n+r.length):(SB(t,n,r)&&e.delims.push({start:n,token:r}),n+r.length)}function wB(e,t){const n=e[t];if(n==="*")return e.startsWith("***",t)?"***":e.startsWith("**",t)?"**":"*";if(n==="_")return e.startsWith("__",t)?"__":"_";if(n==="~"&&e.startsWith("~~",t))return"~~"}function SB(e,t,n){const r=e[t+n.length];if(!r||/\s/.test(r))return!1;const i=e[t-1];return!J3(i)||!J3(r)}function K3(e,t,n){const r=e.links.at(-1);if(n==="["){e.links.push({phase:"text",start:t});return}if(n==="]"&&(r==null?void 0:r.phase)==="text"){e.links[e.links.length-1]={phase:"url_wait",start:r.start,textEnd:t};return}if(n==="("&&(r==null?void 0:r.phase)==="url_wait"){e.links[e.links.length-1]={phase:"url",start:r.start,textEnd:r.textEnd,parenDepth:0};return}if(n==="("&&(r==null?void 0:r.phase)==="url"){r.parenDepth+=1;return}if(n===")"&&(r==null?void 0:r.phase)==="url"){if(r.parenDepth>0){r.parenDepth-=1;return}e.links.pop()}}function kB(e){var t,n;e.delims.length=0,e.links.length=0,((t=e.exclusive)==null?void 0:t.kind)!=="fence"&&(((n=e.exclusive)==null?void 0:n.kind)==="math"&&e.exclusive.token==="$$"||(e.exclusive=null))}function CB(e){var n;const t=(n=e.links.at(-1))==null?void 0:n.phase;return t==="url_wait"||t==="url"}function EB(e,t){t.pendingHtml!==null&&(e=e.slice(0,NB(e,t.pendingHtml)));const n=t.links.at(-1);if(n)return Hs(AB(e,n));const r=TB(t);if(r)return Hs(Nc(e,r));const i=RB(t);return i?i.kind==="delim"?Hs(Pb(e,i.start,i.token.length)?a9(e,i.token):e.slice(0,i.start)):Pb(e,i.start,i.token.length)?i.kind==="fence"?Hs(e):i.kind==="code"?Hs(Nc(e,i.token)):i.token==="$$"?Hs(Nc(e,(e.endsWith(` -`)?"":` -`)+"$$")):/\s/.test(e[e.length-1]??"")?Hs(e):Hs(Nc(e,"$")):Hs(i.kind==="fence"?e:e.slice(0,i.start)):Hs(t.pendingDelim?e.slice(0,t.pendingDelim.start):e)}function AB(e,t){const n=e.slice(0,t.start);if(t.phase==="text")return Pb(e,t.start,1)?n+e.slice(t.start+1):n;const r=e.slice(t.start+1,t.textEnd);return t.phase==="url_wait"?n+r+e.slice(t.textEnd+1):n+r}function TB(e){const t=[];if(e.exclusive){if(e.exclusive.kind!=="code")return;t.push(e.exclusive.token)}for(let n=e.delims.length-1;n>=0;n--){const r=e.delims[n].token;if(!mB.has(r))return;t.push(r)}if(!(t.length<2))return t.join("")}function NB(e,t){let n=t,r=t;for(;r>0;){const i=e.lastIndexOf("<",r-1);if(i===-1||!jB(e,i,r))break;n=i,r=i}return n}function jB(e,t,n){if(e[n-1]!==">"||Ss(e,t))return!1;const r=e[t+1];if(r!==void 0&&!l9(r))return!1;for(let i=t+1;i"||a===` -`)return!1}return!0}function Hs(e){var x;const t=e.lastIndexOf(` - -`),n=t===-1?0:t+2,r=e.slice(0,n),i=e.slice(n),a=i.indexOf(` -`),o=a===-1?i:i.slice(0,a),l=(x=o.match(/^( *)\|/))==null?void 0:x[1];if(l===void 0)return e;if(Z3(o)<2&&!DB(o,l))return r;const u=o.trimEnd().endsWith("|")?o:a9(o," |"),d=Z3(u),m=d<2?0:u.trimEnd().endsWith("|")?d-1:d;if(m===0)return e;const f=a===-1?"":i.slice(a+1),g=Q3(l,Array.from({length:m},()=>"-"));if(f.length===0)return r+u+` -`+g;const b=f.indexOf(` -`),k=b===-1?f:f.slice(0,b),S=b===-1?"":f.slice(b);if(LB(k,l,m))return e;if(k.startsWith(l+"|")&&/^[ |:\-\t]*$/.test(k.slice(l.length))){const _=o9(k,l).map(w=>{const y=w.trim();if(y.length===0)return"-";let C=0;for(let N=0;N1&&y.endsWith(":")?":":"")});for(;_.length0;n-=1)if(e.endsWith(t.slice(0,n)))return n;return 0}function RB(e){const t=e.delims.at(-1);return e.exclusive&&(!t||e.exclusive.start>t.start)?e.exclusive:t?{kind:"delim",start:t.start,token:t.token}:e.exclusive}function Z3(e){let t=0;for(let n=0;n0}function Q3(e,t){return e+"|"+t.map(n=>` ${n} |`).join("")}function o9(e,t){const n=e.slice(t.length+1).split("|");return e.trimEnd().endsWith("|")&&n.pop(),n}function LB(e,t,n){if(!e.startsWith(t))return!1;const r=e.slice(t.length).trim();if(!r.startsWith("|")||!r.endsWith("|"))return!1;const i=o9(r,"").map(a=>a.trim());return i.length===n&&i.every(a=>/^:?-+:?$/.test(a))}function M_(e,t){let n=t+1;for(;nt+n}function Lf(e,t){return t===0||e[t-1]===` -`}function Ss(e,t){let n=0;for(let r=t-1;r>=0&&e[r]==="\\";r--)n+=1;return n%2===1}function J3(e){return!!e&&/[A-Za-z0-9]/.test(e)}function l9(e){return!!e&&/[A-Za-z]/.test(e)}const c9=S_().use(j_);var Xd,$c,Fc,vl,Pc,Kd,Zd,Qd,_l,Jd,xl;class OB{constructor(){Ti(this,Xd,c9);Ti(this,$c,null);Ti(this,Fc,{});Ti(this,vl,null);Ti(this,Pc,"");Ti(this,Kd,[]);Ti(this,Zd,[]);Ti(this,Qd,[]);Ti(this,_l,0);Ti(this,Jd,[]);Ti(this,xl,[])}reconfigure(t,n,r){kn(this,$c)!==null&&kn(this,Xd)===t&&u9(kn(this,Fc),r)&&!!kn(this,vl)===n||(wr(this,Xd,t),t.attachers.some(i=>i[0]===Df)||(t=t(),t.use(Df),t.freeze()),wr(this,$c,t),wr(this,Fc,r),wr(this,Pc,""),wr(this,Kd,[]),wr(this,Zd,[]),wr(this,Qd,[]),wr(this,_l,0),wr(this,Jd,[]),wr(this,vl,n?new pB:null))}update(t){kn(this,vl)&&(t=kn(this,vl).update(t));let n=kn(this,Pc);if(t===n)return kn(this,xl);const r=kn(this,Kd),i=IB(t,n);let a=r.length-1;for(;a>=0&&!(i>=r[a]);a-=1);let o=r[a]??0;a===-1&&(a=0);const l=sl(kn(this,$c)),u=kn(this,Zd),d=u.slice(a).some(E=>E.some(Ub));let m=l.parse(t.slice(o)),f=m.children.map(E=>sl(sl(E.position).start.offset)+o);wr(this,Pc,t),ug(r.length===u.length),r.splice(a,r.length-a,...f);{const E=Sg(m,f,o);ug(E.length===f.length),u.splice(a,u.length-a,...E)}if(d||Ub(m)){a=0,o=0,m=l.parse(t),f=m.children.map(j=>sl(sl(j.position).start.offset)+o),r.splice(0,r.length,...f);const E=Sg(m,f,o);ug(E.length===f.length),u.splice(0,u.length,...E)}const g=Sg(l.runSync(m),f,o),b=kn(this,Qd),k=kn(this,Jd),S=kn(this,xl),x=k.length;let _=null,w=0;for(;wx&&(b.length=k.length=r.length);for(let E=r.length=C?D=x-(r.length-j):j=x){b[j]=String(kn(this,_l)),wr(this,_l,kn(this,_l)+1),k[j]=null,_&&(_[j]=void 0);continue}b[j]=b[D]??String(U5(this,_l)._++),k[j]=k[D]??null,_&&(_[j]=S[D])}r.length[]);let i=0;for(const o of e.children){const l=(a=o.position)==null?void 0:a.start.offset;if(l!==void 0){for(;i+1i||n!==-1&&t>n||r!==-1&&t>r||UB.test(e.slice(0,t))?e:""}const r6=/[#.]/g;function XB(e,t){const n=e||"",r={};let i=0,a,o;for(;id&&(d=m):m&&(d!==void 0&&d>-1&&u.push(` -`.repeat(d)||" "),d=-1,u.push(m))}return u.join("")}function b9(e,t,n){return e.type==="element"?bH(e,t,n):e.type==="text"?n.whitespace==="normal"?v9(e,n):vH(e):[]}function bH(e,t,n){const r=_9(e,n),i=e.children||[];let a=-1,o=[];if(mH(e))return o;let l,u;for(Gb(e)||u6(e)&&a6(t,e,u6)?u=` -`:pH(e)?(l=2,u=2):g9(e)&&(l=1,u=1);++a15?d="…"+l.slice(i-15,i):d=l.slice(0,i);var m;a+15e.replace(SH,"-$1").toLowerCase(),CH={"&":"&",">":">","<":"<",'"':""","'":"'"},EH=/[&><"']/g,Dr=e=>String(e).replace(EH,t=>CH[t]),hf=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?hf(e.body[0]):e:e.type==="font"?hf(e.body):e,AH=new Set(["mathord","textord","atom"]),Ha=e=>AH.has(hf(e).type),TH=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},Vb={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function NH(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function jH(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return NH(t)}function MH(e,t,n,r){var i=n[t];e[t]=i!==void 0?r.processor?r.processor(i):i:jH(r)}class D_{constructor(t){t===void 0&&(t={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n of Object.keys(Vb)){var r=Vb[n];r&&MH(this,n,t,r)}}reportNonstrict(t,n,r){var i=this.strict;if(typeof i=="function"&&(i=i(t,n,r)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new He("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),r);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,r){var i=this.strict;if(typeof i=="function")try{i=i(t,n,r)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=TH(t.url);if(n==null)return!1;t.protocol=n}var r=typeof this.trust=="function"?this.trust(t):this.trust;return!!r}}class xo{constructor(t,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=r}sup(){return Fs[RH[this.id]]}sub(){return Fs[DH[this.id]]}fracNum(){return Fs[LH[this.id]]}fracDen(){return Fs[OH[this.id]]}cramp(){return Fs[IH[this.id]]}text(){return Fs[zH[this.id]]}isTight(){return this.size>=2}}var L_=0,Of=1,Oc=2,ja=3,Ad=4,is=5,Gc=6,Vr=7,Fs=[new xo(L_,0,!1),new xo(Of,0,!0),new xo(Oc,1,!1),new xo(ja,1,!0),new xo(Ad,2,!1),new xo(is,2,!0),new xo(Gc,3,!1),new xo(Vr,3,!0)],RH=[Ad,is,Ad,is,Gc,Vr,Gc,Vr],DH=[is,is,is,is,Vr,Vr,Vr,Vr],LH=[Oc,ja,Ad,is,Gc,Vr,Gc,Vr],OH=[ja,ja,is,is,Vr,Vr,Vr,Vr],IH=[Of,Of,ja,ja,is,is,Vr,Vr],zH=[L_,Of,Oc,ja,Oc,ja,Oc,ja],yt={DISPLAY:Fs[L_],TEXT:Fs[Oc],SCRIPT:Fs[Ad],SCRIPTSCRIPT:Fs[Gc]},Wb=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function BH(e){for(var t=0;t=i[0]&&e<=i[1])return n.name}return null}var ff=[];Wb.forEach(e=>e.blocks.forEach(t=>ff.push(...t)));function x9(e){for(var t=0;t=ff[t]&&e<=ff[t+1])return!0;return!1}var or=e=>e+" "+e,xc=80,HH=function(t,n){return"M95,"+(622+t+n)+` -c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 -c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 -c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 -s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 -c69,-144,104.5,-217.7,106.5,-221 -l`+t/2.075+" -"+t+` -c5.3,-9.3,12,-14,20,-14 -H400000v`+(40+t)+`H845.2724 -s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 -c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},$H=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119 -c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 -c340,-704.7,510.7,-1060.3,512,-1067 -l`+t/2.084+" -"+t+` -c4.7,-7.3,11,-11,19,-11 -H40000v`+(40+t)+`H1012.3 -s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 -c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 -s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 -c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},FH=function(t,n){return"M983 "+(10+t+n)+` -l`+t/3.13+" -"+t+` -c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+` -H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 -s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 -c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 -c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 -c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 -c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},PH=function(t,n){return"M424,"+(2398+t+n)+` -c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 -c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 -s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 -s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 -l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000 -v`+(40+t)+`H1014.6 -s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 -c-2,6,-10,9,-24,9 -c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+` -h400000v`+(40+t)+"h-400000z"},UH=function(t,n){return"M473,"+(2713+t+n)+` -c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+` -c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7 -s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 -c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 -c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 -s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, -606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},qH=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},GH=function(t,n,r){var i=r-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+` -H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 -h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 -c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 -219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},VH=function(t,n,r){n=1e3*n;var i="";switch(t){case"sqrtMain":i=HH(n,xc);break;case"sqrtSize1":i=$H(n,xc);break;case"sqrtSize2":i=FH(n,xc);break;case"sqrtSize3":i=PH(n,xc);break;case"sqrtSize4":i=UH(n,xc);break;case"sqrtTall":i=GH(n,xc,r)}return i},WH=function(t,n){switch(t){case"⎜":return or("M291 0 H417 V"+n+" H291z");case"∣":return or("M145 0 H188 V"+n+" H145z");case"∥":return or("M145 0 H188 V"+n+" H145z")+or("M367 0 H410 V"+n+" H367z");case"⎟":return or("M457 0 H583 V"+n+" H457z");case"⎢":return or("M319 0 H403 V"+n+" H319z");case"⎥":return or("M263 0 H347 V"+n+" H263z");case"⎪":return or("M384 0 H504 V"+n+" H384z");case"⏐":return or("M312 0 H355 V"+n+" H312z");case"‖":return or("M257 0 H300 V"+n+" H257z")+or("M478 0 H521 V"+n+" H478z");default:return""}},d6={doubleleftarrow:`M262 157 -l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 - 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 - 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 -c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 - 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 --86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 --2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z -m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l --10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 - 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 --33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 --17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 --13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 -c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 --107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 - 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 --5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 -c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 - 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 - 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 - l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 --45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 - 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 - 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 - 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 --331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 -H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 - 435 0h399565z`,leftgroupunder:`M400000 262 -H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 - 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 --3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 --18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 --196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 - 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 --4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 --10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z -m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 - 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 - 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 --152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 - 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 --2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 -v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 --83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 --68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 - 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:or("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:or("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:or("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:or("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 --.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 -c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 - 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:or("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 -c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 --53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 - 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 - 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 -c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 - 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 - 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 --5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 --320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z -m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 -60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 --451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z -m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 -c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 --480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z -m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 -85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 --707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z -m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 -c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 --16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 - 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 - 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 --40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 --12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 - 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l --6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 -s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 -c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 - 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 --174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 - 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 - 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 --3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 --10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 - 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 --18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 - 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z -m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 - 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 --7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 --27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 - 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 - 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 --64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z -m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 - 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 --13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 - 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:or("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:or("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:or("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 - 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 --52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 --167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 - 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 --70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 --40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 --37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 - 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 -c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 - 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 - 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 --19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 - 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 --2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 - 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 - 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 --68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 --8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 - 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 -c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 - 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 --11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 - 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 - 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 - -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 --11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 - 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 - 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 - -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 -3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 -10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 --1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 --7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 -H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 -c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 -c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, --5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 -c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 -c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 -s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 -121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 -s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 -c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z -M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 --27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 -13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 --84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 --119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 --12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 -151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 -c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 -c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 -c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 -c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z -M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 -c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, --231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 -c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 -c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, -1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, --152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z -M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 -c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, --231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 -c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},YH=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84 -H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z -M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z -M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z -MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z -MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z -M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z -M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 -c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, --36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, -949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 -c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, --544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 -l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, --210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, -63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 -c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+` -c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 -c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 -c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 -c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 -l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function XH(e){return"toText"in e}class iu{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n{if(XH(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var Yb={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},KH={ex:!0,em:!0,mu:!0},y9=function(t){return typeof t!="string"&&(t=t.unit),t in Yb||t in KH||t==="ex"},Mn=function(t,n){var r;if(t.unit in Yb)r=Yb[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var i;if(n.style.isTight()?i=n.havingStyle(n.style.text()):i=n,t.unit==="ex")r=i.fontMetrics().xHeight;else if(t.unit==="em")r=i.fontMetrics().quad;else throw new He("Invalid unit: '"+t.unit+"'");i!==n&&(r*=i.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*r,n.maxSize)},Pe=function(t){return+t.toFixed(4)+"em"},jo=function(t){return t.filter(n=>n).join(" ")},O_=function(t){var n="";for(var r of Object.keys(t)){var i=t[r];i!==void 0&&(n+=kH(r)+":"+i+";")}return n},w9=function(t,n,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var i=n.getColor();i&&(this.style.color=i)}},S9=function(t){var n=document.createElement(t);n.className=jo(this.classes),Object.assign(n.style,this.style);for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i/=\x00-\x1f]/,k9=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+Dr(jo(this.classes))+'"');var r=O_(this.style);r&&(n+=' style="'+Dr(r)+'"');for(var i of Object.keys(this.attributes)){if(ZH.test(i))throw new He("Invalid attribute name '"+i+"'");n+=" "+i+'="'+Dr(this.attributes[i])+'"'}n+=">";for(var a=0;a",n};class su{constructor(t,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,w9.call(this,t,r,i),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return S9.call(this,"span")}toMarkup(){return k9.call(this,"span")}}class fp{constructor(t,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,w9.call(this,n,i),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return S9.call(this,"a")}toMarkup(){return k9.call(this,"a")}}class QH{constructor(t,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t=''+Dr(this.alt)+'0&&(n=document.createElement("span"),n.style.marginRight=Pe(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=jo(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="0&&(r+="margin-right:"+Pe(this.italic)+";"),r+=O_(this.style),r&&(t=!0,n+=' style="'+Dr(r)+'"');var i=Dr(this.text);return t?(n+=">",n+=i,n+="",n):i}}class Da{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i':''}}class Xb{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var t=" but got "+String(e)+".")}var n$=e=>e instanceof su||e instanceof fp||e instanceof iu,Us={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},D0={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},h6={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function r$(e,t){Us[e]=t}function I_(e,t,n){if(!Us[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=Us[t][r];if(!i&&e[0]in h6&&(r=h6[e[0]].charCodeAt(0),i=Us[t][r]),!i&&n==="text"&&x9(r)&&(i=Us[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Eg={};function i$(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!Eg[t]){var n=Eg[t]={cssEmPerMu:D0.quad[t]/18};for(var r in D0)D0.hasOwnProperty(r)&&(n[r]=D0[r][t])}return Eg[t]}var En={math:{},text:{}};function L(e,t,n,r,i,a){En[e][i]={font:t,group:n,replace:r},a&&r&&(En[e][r]=En[e][i])}var P="math",Re="text",K="main",ae="ams",Tn="accent-token",Ke="bin",Yr="close",au="inner",pt="mathord",Zn="op-token",Fi="open",dh="punct",ce="rel",$a="spacing",he="textord";L(P,K,ce,"≡","\\equiv",!0);L(P,K,ce,"≺","\\prec",!0);L(P,K,ce,"≻","\\succ",!0);L(P,K,ce,"∼","\\sim",!0);L(P,K,ce,"⊥","\\perp");L(P,K,ce,"⪯","\\preceq",!0);L(P,K,ce,"⪰","\\succeq",!0);L(P,K,ce,"≃","\\simeq",!0);L(P,K,ce,"∣","\\mid",!0);L(P,K,ce,"≪","\\ll",!0);L(P,K,ce,"≫","\\gg",!0);L(P,K,ce,"≍","\\asymp",!0);L(P,K,ce,"∥","\\parallel");L(P,K,ce,"⋈","\\bowtie",!0);L(P,K,ce,"⌣","\\smile",!0);L(P,K,ce,"⊑","\\sqsubseteq",!0);L(P,K,ce,"⊒","\\sqsupseteq",!0);L(P,K,ce,"≐","\\doteq",!0);L(P,K,ce,"⌢","\\frown",!0);L(P,K,ce,"∋","\\ni",!0);L(P,K,ce,"∝","\\propto",!0);L(P,K,ce,"⊢","\\vdash",!0);L(P,K,ce,"⊣","\\dashv",!0);L(P,K,ce,"∋","\\owns");L(P,K,dh,".","\\ldotp");L(P,K,dh,"⋅","\\cdotp");L(P,K,dh,"⋅","·");L(Re,K,he,"⋅","·");L(P,K,he,"#","\\#");L(Re,K,he,"#","\\#");L(P,K,he,"&","\\&");L(Re,K,he,"&","\\&");L(P,K,he,"ℵ","\\aleph",!0);L(P,K,he,"∀","\\forall",!0);L(P,K,he,"ℏ","\\hbar",!0);L(P,K,he,"∃","\\exists",!0);L(P,K,he,"∇","\\nabla",!0);L(P,K,he,"♭","\\flat",!0);L(P,K,he,"ℓ","\\ell",!0);L(P,K,he,"♮","\\natural",!0);L(P,K,he,"♣","\\clubsuit",!0);L(P,K,he,"℘","\\wp",!0);L(P,K,he,"♯","\\sharp",!0);L(P,K,he,"♢","\\diamondsuit",!0);L(P,K,he,"ℜ","\\Re",!0);L(P,K,he,"♡","\\heartsuit",!0);L(P,K,he,"ℑ","\\Im",!0);L(P,K,he,"♠","\\spadesuit",!0);L(P,K,he,"§","\\S",!0);L(Re,K,he,"§","\\S");L(P,K,he,"¶","\\P",!0);L(Re,K,he,"¶","\\P");L(P,K,he,"†","\\dag");L(Re,K,he,"†","\\dag");L(Re,K,he,"†","\\textdagger");L(P,K,he,"‡","\\ddag");L(Re,K,he,"‡","\\ddag");L(Re,K,he,"‡","\\textdaggerdbl");L(P,K,Yr,"⎱","\\rmoustache",!0);L(P,K,Fi,"⎰","\\lmoustache",!0);L(P,K,Yr,"⟯","\\rgroup",!0);L(P,K,Fi,"⟮","\\lgroup",!0);L(P,K,Ke,"∓","\\mp",!0);L(P,K,Ke,"⊖","\\ominus",!0);L(P,K,Ke,"⊎","\\uplus",!0);L(P,K,Ke,"⊓","\\sqcap",!0);L(P,K,Ke,"∗","\\ast");L(P,K,Ke,"⊔","\\sqcup",!0);L(P,K,Ke,"◯","\\bigcirc",!0);L(P,K,Ke,"∙","\\bullet",!0);L(P,K,Ke,"‡","\\ddagger");L(P,K,Ke,"≀","\\wr",!0);L(P,K,Ke,"⨿","\\amalg");L(P,K,Ke,"&","\\And");L(P,K,ce,"⟵","\\longleftarrow",!0);L(P,K,ce,"⇐","\\Leftarrow",!0);L(P,K,ce,"⟸","\\Longleftarrow",!0);L(P,K,ce,"⟶","\\longrightarrow",!0);L(P,K,ce,"⇒","\\Rightarrow",!0);L(P,K,ce,"⟹","\\Longrightarrow",!0);L(P,K,ce,"↔","\\leftrightarrow",!0);L(P,K,ce,"⟷","\\longleftrightarrow",!0);L(P,K,ce,"⇔","\\Leftrightarrow",!0);L(P,K,ce,"⟺","\\Longleftrightarrow",!0);L(P,K,ce,"↦","\\mapsto",!0);L(P,K,ce,"⟼","\\longmapsto",!0);L(P,K,ce,"↗","\\nearrow",!0);L(P,K,ce,"↩","\\hookleftarrow",!0);L(P,K,ce,"↪","\\hookrightarrow",!0);L(P,K,ce,"↘","\\searrow",!0);L(P,K,ce,"↼","\\leftharpoonup",!0);L(P,K,ce,"⇀","\\rightharpoonup",!0);L(P,K,ce,"↙","\\swarrow",!0);L(P,K,ce,"↽","\\leftharpoondown",!0);L(P,K,ce,"⇁","\\rightharpoondown",!0);L(P,K,ce,"↖","\\nwarrow",!0);L(P,K,ce,"⇌","\\rightleftharpoons",!0);L(P,ae,ce,"≮","\\nless",!0);L(P,ae,ce,"","\\@nleqslant");L(P,ae,ce,"","\\@nleqq");L(P,ae,ce,"⪇","\\lneq",!0);L(P,ae,ce,"≨","\\lneqq",!0);L(P,ae,ce,"","\\@lvertneqq");L(P,ae,ce,"⋦","\\lnsim",!0);L(P,ae,ce,"⪉","\\lnapprox",!0);L(P,ae,ce,"⊀","\\nprec",!0);L(P,ae,ce,"⋠","\\npreceq",!0);L(P,ae,ce,"⋨","\\precnsim",!0);L(P,ae,ce,"⪹","\\precnapprox",!0);L(P,ae,ce,"≁","\\nsim",!0);L(P,ae,ce,"","\\@nshortmid");L(P,ae,ce,"∤","\\nmid",!0);L(P,ae,ce,"⊬","\\nvdash",!0);L(P,ae,ce,"⊭","\\nvDash",!0);L(P,ae,ce,"⋪","\\ntriangleleft");L(P,ae,ce,"⋬","\\ntrianglelefteq",!0);L(P,ae,ce,"⊊","\\subsetneq",!0);L(P,ae,ce,"","\\@varsubsetneq");L(P,ae,ce,"⫋","\\subsetneqq",!0);L(P,ae,ce,"","\\@varsubsetneqq");L(P,ae,ce,"≯","\\ngtr",!0);L(P,ae,ce,"","\\@ngeqslant");L(P,ae,ce,"","\\@ngeqq");L(P,ae,ce,"⪈","\\gneq",!0);L(P,ae,ce,"≩","\\gneqq",!0);L(P,ae,ce,"","\\@gvertneqq");L(P,ae,ce,"⋧","\\gnsim",!0);L(P,ae,ce,"⪊","\\gnapprox",!0);L(P,ae,ce,"⊁","\\nsucc",!0);L(P,ae,ce,"⋡","\\nsucceq",!0);L(P,ae,ce,"⋩","\\succnsim",!0);L(P,ae,ce,"⪺","\\succnapprox",!0);L(P,ae,ce,"≆","\\ncong",!0);L(P,ae,ce,"","\\@nshortparallel");L(P,ae,ce,"∦","\\nparallel",!0);L(P,ae,ce,"⊯","\\nVDash",!0);L(P,ae,ce,"⋫","\\ntriangleright");L(P,ae,ce,"⋭","\\ntrianglerighteq",!0);L(P,ae,ce,"","\\@nsupseteqq");L(P,ae,ce,"⊋","\\supsetneq",!0);L(P,ae,ce,"","\\@varsupsetneq");L(P,ae,ce,"⫌","\\supsetneqq",!0);L(P,ae,ce,"","\\@varsupsetneqq");L(P,ae,ce,"⊮","\\nVdash",!0);L(P,ae,ce,"⪵","\\precneqq",!0);L(P,ae,ce,"⪶","\\succneqq",!0);L(P,ae,ce,"","\\@nsubseteqq");L(P,ae,Ke,"⊴","\\unlhd");L(P,ae,Ke,"⊵","\\unrhd");L(P,ae,ce,"↚","\\nleftarrow",!0);L(P,ae,ce,"↛","\\nrightarrow",!0);L(P,ae,ce,"⇍","\\nLeftarrow",!0);L(P,ae,ce,"⇏","\\nRightarrow",!0);L(P,ae,ce,"↮","\\nleftrightarrow",!0);L(P,ae,ce,"⇎","\\nLeftrightarrow",!0);L(P,ae,ce,"△","\\vartriangle");L(P,ae,he,"ℏ","\\hslash");L(P,ae,he,"▽","\\triangledown");L(P,ae,he,"◊","\\lozenge");L(P,ae,he,"Ⓢ","\\circledS");L(P,ae,he,"®","\\circledR");L(Re,ae,he,"®","\\circledR");L(P,ae,he,"∡","\\measuredangle",!0);L(P,ae,he,"∄","\\nexists");L(P,ae,he,"℧","\\mho");L(P,ae,he,"Ⅎ","\\Finv",!0);L(P,ae,he,"⅁","\\Game",!0);L(P,ae,he,"‵","\\backprime");L(P,ae,he,"▲","\\blacktriangle");L(P,ae,he,"▼","\\blacktriangledown");L(P,ae,he,"■","\\blacksquare");L(P,ae,he,"⧫","\\blacklozenge");L(P,ae,he,"★","\\bigstar");L(P,ae,he,"∢","\\sphericalangle",!0);L(P,ae,he,"∁","\\complement",!0);L(P,ae,he,"ð","\\eth",!0);L(Re,K,he,"ð","ð");L(P,ae,he,"╱","\\diagup");L(P,ae,he,"╲","\\diagdown");L(P,ae,he,"□","\\square");L(P,ae,he,"□","\\Box");L(P,ae,he,"◊","\\Diamond");L(P,ae,he,"¥","\\yen",!0);L(Re,ae,he,"¥","\\yen",!0);L(P,ae,he,"✓","\\checkmark",!0);L(Re,ae,he,"✓","\\checkmark");L(P,ae,he,"ℶ","\\beth",!0);L(P,ae,he,"ℸ","\\daleth",!0);L(P,ae,he,"ℷ","\\gimel",!0);L(P,ae,he,"ϝ","\\digamma",!0);L(P,ae,he,"ϰ","\\varkappa");L(P,ae,Fi,"┌","\\@ulcorner",!0);L(P,ae,Yr,"┐","\\@urcorner",!0);L(P,ae,Fi,"└","\\@llcorner",!0);L(P,ae,Yr,"┘","\\@lrcorner",!0);L(P,ae,ce,"≦","\\leqq",!0);L(P,ae,ce,"⩽","\\leqslant",!0);L(P,ae,ce,"⪕","\\eqslantless",!0);L(P,ae,ce,"≲","\\lesssim",!0);L(P,ae,ce,"⪅","\\lessapprox",!0);L(P,ae,ce,"≊","\\approxeq",!0);L(P,ae,Ke,"⋖","\\lessdot");L(P,ae,ce,"⋘","\\lll",!0);L(P,ae,ce,"≶","\\lessgtr",!0);L(P,ae,ce,"⋚","\\lesseqgtr",!0);L(P,ae,ce,"⪋","\\lesseqqgtr",!0);L(P,ae,ce,"≑","\\doteqdot");L(P,ae,ce,"≓","\\risingdotseq",!0);L(P,ae,ce,"≒","\\fallingdotseq",!0);L(P,ae,ce,"∽","\\backsim",!0);L(P,ae,ce,"⋍","\\backsimeq",!0);L(P,ae,ce,"⫅","\\subseteqq",!0);L(P,ae,ce,"⋐","\\Subset",!0);L(P,ae,ce,"⊏","\\sqsubset",!0);L(P,ae,ce,"≼","\\preccurlyeq",!0);L(P,ae,ce,"⋞","\\curlyeqprec",!0);L(P,ae,ce,"≾","\\precsim",!0);L(P,ae,ce,"⪷","\\precapprox",!0);L(P,ae,ce,"⊲","\\vartriangleleft");L(P,ae,ce,"⊴","\\trianglelefteq");L(P,ae,ce,"⊨","\\vDash",!0);L(P,ae,ce,"⊪","\\Vvdash",!0);L(P,ae,ce,"⌣","\\smallsmile");L(P,ae,ce,"⌢","\\smallfrown");L(P,ae,ce,"≏","\\bumpeq",!0);L(P,ae,ce,"≎","\\Bumpeq",!0);L(P,ae,ce,"≧","\\geqq",!0);L(P,ae,ce,"⩾","\\geqslant",!0);L(P,ae,ce,"⪖","\\eqslantgtr",!0);L(P,ae,ce,"≳","\\gtrsim",!0);L(P,ae,ce,"⪆","\\gtrapprox",!0);L(P,ae,Ke,"⋗","\\gtrdot");L(P,ae,ce,"⋙","\\ggg",!0);L(P,ae,ce,"≷","\\gtrless",!0);L(P,ae,ce,"⋛","\\gtreqless",!0);L(P,ae,ce,"⪌","\\gtreqqless",!0);L(P,ae,ce,"≖","\\eqcirc",!0);L(P,ae,ce,"≗","\\circeq",!0);L(P,ae,ce,"≜","\\triangleq",!0);L(P,ae,ce,"∼","\\thicksim");L(P,ae,ce,"≈","\\thickapprox");L(P,ae,ce,"⫆","\\supseteqq",!0);L(P,ae,ce,"⋑","\\Supset",!0);L(P,ae,ce,"⊐","\\sqsupset",!0);L(P,ae,ce,"≽","\\succcurlyeq",!0);L(P,ae,ce,"⋟","\\curlyeqsucc",!0);L(P,ae,ce,"≿","\\succsim",!0);L(P,ae,ce,"⪸","\\succapprox",!0);L(P,ae,ce,"⊳","\\vartriangleright");L(P,ae,ce,"⊵","\\trianglerighteq");L(P,ae,ce,"⊩","\\Vdash",!0);L(P,ae,ce,"∣","\\shortmid");L(P,ae,ce,"∥","\\shortparallel");L(P,ae,ce,"≬","\\between",!0);L(P,ae,ce,"⋔","\\pitchfork",!0);L(P,ae,ce,"∝","\\varpropto");L(P,ae,ce,"◀","\\blacktriangleleft");L(P,ae,ce,"∴","\\therefore",!0);L(P,ae,ce,"∍","\\backepsilon");L(P,ae,ce,"▶","\\blacktriangleright");L(P,ae,ce,"∵","\\because",!0);L(P,ae,ce,"⋘","\\llless");L(P,ae,ce,"⋙","\\gggtr");L(P,ae,Ke,"⊲","\\lhd");L(P,ae,Ke,"⊳","\\rhd");L(P,ae,ce,"≂","\\eqsim",!0);L(P,K,ce,"⋈","\\Join");L(P,ae,ce,"≑","\\Doteq",!0);L(P,ae,Ke,"∔","\\dotplus",!0);L(P,ae,Ke,"∖","\\smallsetminus");L(P,ae,Ke,"⋒","\\Cap",!0);L(P,ae,Ke,"⋓","\\Cup",!0);L(P,ae,Ke,"⩞","\\doublebarwedge",!0);L(P,ae,Ke,"⊟","\\boxminus",!0);L(P,ae,Ke,"⊞","\\boxplus",!0);L(P,ae,Ke,"⋇","\\divideontimes",!0);L(P,ae,Ke,"⋉","\\ltimes",!0);L(P,ae,Ke,"⋊","\\rtimes",!0);L(P,ae,Ke,"⋋","\\leftthreetimes",!0);L(P,ae,Ke,"⋌","\\rightthreetimes",!0);L(P,ae,Ke,"⋏","\\curlywedge",!0);L(P,ae,Ke,"⋎","\\curlyvee",!0);L(P,ae,Ke,"⊝","\\circleddash",!0);L(P,ae,Ke,"⊛","\\circledast",!0);L(P,ae,Ke,"⋅","\\centerdot");L(P,ae,Ke,"⊺","\\intercal",!0);L(P,ae,Ke,"⋒","\\doublecap");L(P,ae,Ke,"⋓","\\doublecup");L(P,ae,Ke,"⊠","\\boxtimes",!0);L(P,ae,ce,"⇢","\\dashrightarrow",!0);L(P,ae,ce,"⇠","\\dashleftarrow",!0);L(P,ae,ce,"⇇","\\leftleftarrows",!0);L(P,ae,ce,"⇆","\\leftrightarrows",!0);L(P,ae,ce,"⇚","\\Lleftarrow",!0);L(P,ae,ce,"↞","\\twoheadleftarrow",!0);L(P,ae,ce,"↢","\\leftarrowtail",!0);L(P,ae,ce,"↫","\\looparrowleft",!0);L(P,ae,ce,"⇋","\\leftrightharpoons",!0);L(P,ae,ce,"↶","\\curvearrowleft",!0);L(P,ae,ce,"↺","\\circlearrowleft",!0);L(P,ae,ce,"↰","\\Lsh",!0);L(P,ae,ce,"⇈","\\upuparrows",!0);L(P,ae,ce,"↿","\\upharpoonleft",!0);L(P,ae,ce,"⇃","\\downharpoonleft",!0);L(P,K,ce,"⊶","\\origof",!0);L(P,K,ce,"⊷","\\imageof",!0);L(P,ae,ce,"⊸","\\multimap",!0);L(P,ae,ce,"↭","\\leftrightsquigarrow",!0);L(P,ae,ce,"⇉","\\rightrightarrows",!0);L(P,ae,ce,"⇄","\\rightleftarrows",!0);L(P,ae,ce,"↠","\\twoheadrightarrow",!0);L(P,ae,ce,"↣","\\rightarrowtail",!0);L(P,ae,ce,"↬","\\looparrowright",!0);L(P,ae,ce,"↷","\\curvearrowright",!0);L(P,ae,ce,"↻","\\circlearrowright",!0);L(P,ae,ce,"↱","\\Rsh",!0);L(P,ae,ce,"⇊","\\downdownarrows",!0);L(P,ae,ce,"↾","\\upharpoonright",!0);L(P,ae,ce,"⇂","\\downharpoonright",!0);L(P,ae,ce,"⇝","\\rightsquigarrow",!0);L(P,ae,ce,"⇝","\\leadsto");L(P,ae,ce,"⇛","\\Rrightarrow",!0);L(P,ae,ce,"↾","\\restriction");L(P,K,he,"‘","`");L(P,K,he,"$","\\$");L(Re,K,he,"$","\\$");L(Re,K,he,"$","\\textdollar");L(P,K,he,"%","\\%");L(Re,K,he,"%","\\%");L(P,K,he,"_","\\_");L(Re,K,he,"_","\\_");L(Re,K,he,"_","\\textunderscore");L(P,K,he,"∠","\\angle",!0);L(P,K,he,"∞","\\infty",!0);L(P,K,he,"′","\\prime");L(P,K,he,"△","\\triangle");L(P,K,he,"Γ","\\Gamma",!0);L(P,K,he,"Δ","\\Delta",!0);L(P,K,he,"Θ","\\Theta",!0);L(P,K,he,"Λ","\\Lambda",!0);L(P,K,he,"Ξ","\\Xi",!0);L(P,K,he,"Π","\\Pi",!0);L(P,K,he,"Σ","\\Sigma",!0);L(P,K,he,"Υ","\\Upsilon",!0);L(P,K,he,"Φ","\\Phi",!0);L(P,K,he,"Ψ","\\Psi",!0);L(P,K,he,"Ω","\\Omega",!0);L(P,K,he,"A","Α");L(P,K,he,"B","Β");L(P,K,he,"E","Ε");L(P,K,he,"Z","Ζ");L(P,K,he,"H","Η");L(P,K,he,"I","Ι");L(P,K,he,"K","Κ");L(P,K,he,"M","Μ");L(P,K,he,"N","Ν");L(P,K,he,"O","Ο");L(P,K,he,"P","Ρ");L(P,K,he,"T","Τ");L(P,K,he,"X","Χ");L(P,K,he,"¬","\\neg",!0);L(P,K,he,"¬","\\lnot");L(P,K,he,"⊤","\\top");L(P,K,he,"⊥","\\bot");L(P,K,he,"∅","\\emptyset");L(P,ae,he,"∅","\\varnothing");L(P,K,pt,"α","\\alpha",!0);L(P,K,pt,"β","\\beta",!0);L(P,K,pt,"γ","\\gamma",!0);L(P,K,pt,"δ","\\delta",!0);L(P,K,pt,"ϵ","\\epsilon",!0);L(P,K,pt,"ζ","\\zeta",!0);L(P,K,pt,"η","\\eta",!0);L(P,K,pt,"θ","\\theta",!0);L(P,K,pt,"ι","\\iota",!0);L(P,K,pt,"κ","\\kappa",!0);L(P,K,pt,"λ","\\lambda",!0);L(P,K,pt,"μ","\\mu",!0);L(P,K,pt,"ν","\\nu",!0);L(P,K,pt,"ξ","\\xi",!0);L(P,K,pt,"ο","\\omicron",!0);L(P,K,pt,"π","\\pi",!0);L(P,K,pt,"ρ","\\rho",!0);L(P,K,pt,"σ","\\sigma",!0);L(P,K,pt,"τ","\\tau",!0);L(P,K,pt,"υ","\\upsilon",!0);L(P,K,pt,"ϕ","\\phi",!0);L(P,K,pt,"χ","\\chi",!0);L(P,K,pt,"ψ","\\psi",!0);L(P,K,pt,"ω","\\omega",!0);L(P,K,pt,"ε","\\varepsilon",!0);L(P,K,pt,"ϑ","\\vartheta",!0);L(P,K,pt,"ϖ","\\varpi",!0);L(P,K,pt,"ϱ","\\varrho",!0);L(P,K,pt,"ς","\\varsigma",!0);L(P,K,pt,"φ","\\varphi",!0);L(P,K,Ke,"∗","*",!0);L(P,K,Ke,"+","+");L(P,K,Ke,"−","-",!0);L(P,K,Ke,"⋅","\\cdot",!0);L(P,K,Ke,"∘","\\circ",!0);L(P,K,Ke,"÷","\\div",!0);L(P,K,Ke,"±","\\pm",!0);L(P,K,Ke,"×","\\times",!0);L(P,K,Ke,"∩","\\cap",!0);L(P,K,Ke,"∪","\\cup",!0);L(P,K,Ke,"∖","\\setminus",!0);L(P,K,Ke,"∧","\\land");L(P,K,Ke,"∨","\\lor");L(P,K,Ke,"∧","\\wedge",!0);L(P,K,Ke,"∨","\\vee",!0);L(P,K,he,"√","\\surd");L(P,K,Fi,"⟨","\\langle",!0);L(P,K,Fi,"∣","\\lvert");L(P,K,Fi,"∥","\\lVert");L(P,K,Yr,"?","?");L(P,K,Yr,"!","!");L(P,K,Yr,"⟩","\\rangle",!0);L(P,K,Yr,"∣","\\rvert");L(P,K,Yr,"∥","\\rVert");L(P,K,ce,"=","=");L(P,K,ce,":",":");L(P,K,ce,"≈","\\approx",!0);L(P,K,ce,"≅","\\cong",!0);L(P,K,ce,"≥","\\ge");L(P,K,ce,"≥","\\geq",!0);L(P,K,ce,"←","\\gets");L(P,K,ce,">","\\gt",!0);L(P,K,ce,"∈","\\in",!0);L(P,K,ce,"","\\@not");L(P,K,ce,"⊂","\\subset",!0);L(P,K,ce,"⊃","\\supset",!0);L(P,K,ce,"⊆","\\subseteq",!0);L(P,K,ce,"⊇","\\supseteq",!0);L(P,ae,ce,"⊈","\\nsubseteq",!0);L(P,ae,ce,"⊉","\\nsupseteq",!0);L(P,K,ce,"⊨","\\models");L(P,K,ce,"←","\\leftarrow",!0);L(P,K,ce,"≤","\\le");L(P,K,ce,"≤","\\leq",!0);L(P,K,ce,"<","\\lt",!0);L(P,K,ce,"→","\\rightarrow",!0);L(P,K,ce,"→","\\to");L(P,ae,ce,"≱","\\ngeq",!0);L(P,ae,ce,"≰","\\nleq",!0);L(P,K,$a," ","\\ ");L(P,K,$a," ","\\space");L(P,K,$a," ","\\nobreakspace");L(Re,K,$a," ","\\ ");L(Re,K,$a," "," ");L(Re,K,$a," ","\\space");L(Re,K,$a," ","\\nobreakspace");L(P,K,$a,"","\\nobreak");L(P,K,$a,"","\\allowbreak");L(P,K,dh,",",",");L(P,K,dh,";",";");L(P,ae,Ke,"⊼","\\barwedge",!0);L(P,ae,Ke,"⊻","\\veebar",!0);L(P,K,Ke,"⊙","\\odot",!0);L(P,K,Ke,"⊕","\\oplus",!0);L(P,K,Ke,"⊗","\\otimes",!0);L(P,K,he,"∂","\\partial",!0);L(P,K,Ke,"⊘","\\oslash",!0);L(P,ae,Ke,"⊚","\\circledcirc",!0);L(P,ae,Ke,"⊡","\\boxdot",!0);L(P,K,Ke,"△","\\bigtriangleup");L(P,K,Ke,"▽","\\bigtriangledown");L(P,K,Ke,"†","\\dagger");L(P,K,Ke,"⋄","\\diamond");L(P,K,Ke,"⋆","\\star");L(P,K,Ke,"◃","\\triangleleft");L(P,K,Ke,"▹","\\triangleright");L(P,K,Fi,"{","\\{");L(Re,K,he,"{","\\{");L(Re,K,he,"{","\\textbraceleft");L(P,K,Yr,"}","\\}");L(Re,K,he,"}","\\}");L(Re,K,he,"}","\\textbraceright");L(P,K,Fi,"{","\\lbrace");L(P,K,Yr,"}","\\rbrace");L(P,K,Fi,"[","\\lbrack",!0);L(Re,K,he,"[","\\lbrack",!0);L(P,K,Yr,"]","\\rbrack",!0);L(Re,K,he,"]","\\rbrack",!0);L(P,K,Fi,"(","\\lparen",!0);L(P,K,Yr,")","\\rparen",!0);L(Re,K,he,"<","\\textless",!0);L(Re,K,he,">","\\textgreater",!0);L(P,K,Fi,"⌊","\\lfloor",!0);L(P,K,Yr,"⌋","\\rfloor",!0);L(P,K,Fi,"⌈","\\lceil",!0);L(P,K,Yr,"⌉","\\rceil",!0);L(P,K,he,"\\","\\backslash");L(P,K,he,"∣","|");L(P,K,he,"∣","\\vert");L(Re,K,he,"|","\\textbar",!0);L(P,K,he,"∥","\\|");L(P,K,he,"∥","\\Vert");L(Re,K,he,"∥","\\textbardbl");L(Re,K,he,"~","\\textasciitilde");L(Re,K,he,"\\","\\textbackslash");L(Re,K,he,"^","\\textasciicircum");L(P,K,ce,"↑","\\uparrow",!0);L(P,K,ce,"⇑","\\Uparrow",!0);L(P,K,ce,"↓","\\downarrow",!0);L(P,K,ce,"⇓","\\Downarrow",!0);L(P,K,ce,"↕","\\updownarrow",!0);L(P,K,ce,"⇕","\\Updownarrow",!0);L(P,K,Zn,"∐","\\coprod");L(P,K,Zn,"⋁","\\bigvee");L(P,K,Zn,"⋀","\\bigwedge");L(P,K,Zn,"⨄","\\biguplus");L(P,K,Zn,"⋂","\\bigcap");L(P,K,Zn,"⋃","\\bigcup");L(P,K,Zn,"∫","\\int");L(P,K,Zn,"∫","\\intop");L(P,K,Zn,"∬","\\iint");L(P,K,Zn,"∭","\\iiint");L(P,K,Zn,"∏","\\prod");L(P,K,Zn,"∑","\\sum");L(P,K,Zn,"⨂","\\bigotimes");L(P,K,Zn,"⨁","\\bigoplus");L(P,K,Zn,"⨀","\\bigodot");L(P,K,Zn,"∮","\\oint");L(P,K,Zn,"∯","\\oiint");L(P,K,Zn,"∰","\\oiiint");L(P,K,Zn,"⨆","\\bigsqcup");L(P,K,Zn,"∫","\\smallint");L(Re,K,au,"…","\\textellipsis");L(P,K,au,"…","\\mathellipsis");L(Re,K,au,"…","\\ldots",!0);L(P,K,au,"…","\\ldots",!0);L(P,K,au,"⋯","\\@cdots",!0);L(P,K,au,"⋱","\\ddots",!0);L(P,K,he,"⋮","\\varvdots");L(Re,K,he,"⋮","\\varvdots");L(P,K,Tn,"ˊ","\\acute");L(P,K,Tn,"ˋ","\\grave");L(P,K,Tn,"¨","\\ddot");L(P,K,Tn,"~","\\tilde");L(P,K,Tn,"ˉ","\\bar");L(P,K,Tn,"˘","\\breve");L(P,K,Tn,"ˇ","\\check");L(P,K,Tn,"^","\\hat");L(P,K,Tn,"⃗","\\vec");L(P,K,Tn,"˙","\\dot");L(P,K,Tn,"˚","\\mathring");L(P,K,pt,"","\\@imath");L(P,K,pt,"","\\@jmath");L(P,K,he,"ı","ı");L(P,K,he,"ȷ","ȷ");L(Re,K,he,"ı","\\i",!0);L(Re,K,he,"ȷ","\\j",!0);L(Re,K,he,"ß","\\ss",!0);L(Re,K,he,"æ","\\ae",!0);L(Re,K,he,"œ","\\oe",!0);L(Re,K,he,"ø","\\o",!0);L(Re,K,he,"Æ","\\AE",!0);L(Re,K,he,"Œ","\\OE",!0);L(Re,K,he,"Ø","\\O",!0);L(Re,K,Tn,"ˊ","\\'");L(Re,K,Tn,"ˋ","\\`");L(Re,K,Tn,"ˆ","\\^");L(Re,K,Tn,"˜","\\~");L(Re,K,Tn,"ˉ","\\=");L(Re,K,Tn,"˘","\\u");L(Re,K,Tn,"˙","\\.");L(Re,K,Tn,"¸","\\c");L(Re,K,Tn,"˚","\\r");L(Re,K,Tn,"ˇ","\\v");L(Re,K,Tn,"¨",'\\"');L(Re,K,Tn,"˝","\\H");L(Re,K,Tn,"◯","\\textcircled");var C9={"--":!0,"---":!0,"``":!0,"''":!0};L(Re,K,he,"–","--",!0);L(Re,K,he,"–","\\textendash");L(Re,K,he,"—","---",!0);L(Re,K,he,"—","\\textemdash");L(Re,K,he,"‘","`",!0);L(Re,K,he,"‘","\\textquoteleft");L(Re,K,he,"’","'",!0);L(Re,K,he,"’","\\textquoteright");L(Re,K,he,"“","``",!0);L(Re,K,he,"“","\\textquotedblleft");L(Re,K,he,"”","''",!0);L(Re,K,he,"”","\\textquotedblright");L(P,K,he,"°","\\degree",!0);L(Re,K,he,"°","\\degree");L(Re,K,he,"°","\\textdegree",!0);L(P,K,he,"£","\\pounds");L(P,K,he,"£","\\mathsterling",!0);L(Re,K,he,"£","\\pounds");L(Re,K,he,"£","\\textsterling",!0);L(P,ae,he,"✠","\\maltese");L(Re,ae,he,"✠","\\maltese");var f6='0123456789/@."';for(var Ag=0;Ag{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484){var i=Math.floor((r-119808)/26);return S6[i]}else if(120782<=r&&r<=120831){var a=Math.floor((r-120782)/10);return a$[a]}else{if(r===120485||r===120486)return S6[0];if(120486{if(jo(e.classes)!==jo(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},E9=e=>{for(var t=0;tn&&(n=o.height),o.depth>r&&(r=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}t.height=n,t.depth=r,t.maxFontSize=i},Ie=function(t,n,r,i){var a=new su(t,n,r,i);return B_(a),a},Ro=(e,t,n,r)=>new su(e,t,n,r),Vc=function(t,n,r){var i=Ie([t],[],n);return i.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),i.style.borderBottomWidth=Pe(i.height),i.maxFontSize=1,i},u$=function(t,n,r,i){var a=new fp(t,n,r,i);return B_(a),a},Fa=function(t){var n=new iu(t);return B_(n),n},Wc=function(t,n){return t instanceof iu?Ie([],[t],n):t},d$=function(t){if(t.positionType==="individualShift"){for(var n=t.children,r=[n[0]],i=-n[0].shift-n[0].elem.depth,a=i,o=1;o{var n=Ie(["mspace"],[],t),r=Mn(e,t);return n.style.marginRight=Pe(r),n},I0=(e,t,n)=>{var r,i;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return t==="textbf"&&n==="textit"?i="BoldItalic":t==="textbf"?i="Bold":n==="textit"?i="Italic":i="Regular",r+"-"+i},tv={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},T9={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},N9=function(t,n){var[r,i,a]=T9[t],o=new Mo(r),l=new Da([o],{width:Pe(i),height:Pe(a),style:"width:"+Pe(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),u=Ro(["overlay"],[l],n);return u.height=a,u.style.height=Pe(a),u.style.width=Pe(i),u},jn={number:3,unit:"mu"},ol={number:4,unit:"mu"},Sa={number:5,unit:"mu"},h$={mord:{mop:jn,mbin:ol,mrel:Sa,minner:jn},mop:{mord:jn,mop:jn,mrel:Sa,minner:jn},mbin:{mord:ol,mop:ol,mopen:ol,minner:ol},mrel:{mord:Sa,mop:Sa,mopen:Sa,minner:Sa},mopen:{},mclose:{mop:jn,mbin:ol,mrel:Sa,minner:jn},mpunct:{mord:jn,mop:jn,mrel:Sa,mopen:jn,mclose:jn,mpunct:jn,minner:jn},minner:{mord:jn,mop:jn,mbin:ol,mrel:Sa,mopen:jn,mpunct:jn,minner:jn}},f$={mord:{mop:jn},mop:{mord:jn,mop:jn},mbin:{},mrel:{},mopen:{},mclose:{mop:jn},mpunct:{},minner:{mop:jn}},j9={},zf={},Bf={};function Ye(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,l={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},u=0;u{var x=S.classes[0],_=k.classes[0];x==="mbin"&&m$.has(_)?S.classes[0]="mord":_==="mbin"&&p$.has(x)&&(k.classes[0]="mord")},{node:f},g,b),nv(a,(k,S)=>{var x,_,w=iv(S),y=iv(k),C=w&&y?k.hasClass("mtight")?(x=f$[w])==null?void 0:x[y]:(_=h$[w])==null?void 0:_[y]:null;if(C)return A9(C,d)},{node:f},g,b),a},nv=function(t,n,r,i,a){i&&t.push(i);for(var o=0;og=>{t.splice(f+1,0,g),o++})(o)}i&&t.pop()},M9=function(t){return t instanceof iu||t instanceof fp||t instanceof su&&t.hasClass("enclosing")?t:null},rv=function(t,n){var r=M9(t);if(r){var i=r.children;if(i.length){if(n==="right")return rv(i[i.length-1],"right");if(n==="left")return rv(i[0],"left")}}return t},iv=function(t,n){if(!t)return null;n&&(t=rv(t,n));var r=t.classes[0];return b$[r]||null},Td=function(t,n){var r=["nulldelimiter"].concat(t.baseSizingClasses());return Ie(n.concat(r))},Kt=function(t,n,r){if(!t)return Ie();if(zf[t.type]){var i=zf[t.type](t,n);if(r&&n.size!==r.size){i=Ie(n.sizingClasses(r),[i],n);var a=n.sizeMultiplier/r.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new He("Got group of unknown type: '"+t.type+"'")};function z0(e,t){var n=Ie(["base"],e,t),r=Ie(["strut"]);return r.style.height=Pe(n.height+n.depth),n.depth&&(r.style.verticalAlign=Pe(-n.depth)),n.children.unshift(r),n}function sv(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var r=cr(e,t,"root"),i;r.length===2&&r[1].hasClass("tag")&&(i=r.pop());for(var a=[],o=[],l=0;l0&&(a.push(z0(o,t)),o=[]),a.push(r[l]));o.length>0&&a.push(z0(o,t));var d;n?(d=z0(cr(n,t,!0),t),d.classes=["tag"],a.push(d)):i&&a.push(i);var m=Ie(["katex-html"],a);if(m.setAttribute("aria-hidden","true"),d){var f=d.children[0];f.style.height=Pe(m.height+m.depth),m.depth&&(f.style.verticalAlign=Pe(-m.depth))}return m}function R9(e){return new iu(e)}class $e{constructor(t,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=jo(this.classes));for(var r=0;r0&&(t+=' class ="'+Dr(jo(this.classes))+'"'),t+=">";for(var r=0;r",t}toText(){return this.children.map(t=>t.toText()).join("")}}class Yn{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return Dr(this.toText())}toText(){return this.text}}class D9{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character="  ":t>=-.05556&&t<=-.05555?this.character=" ⁣":t>=-.1667&&t<=-.1666?this.character=" ⁣":t>=-.2223&&t<=-.2222?this.character=" ⁣":t>=-.2778&&t<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",Pe(this.width)),t}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var v$=new Set(["\\imath","\\jmath"]),_$=new Set(["mrow","mtable"]),as=function(t,n,r){return En[n][t]&&En[n][t].replace&&t.charCodeAt(0)!==55349&&!(C9.hasOwnProperty(t)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(t=En[n][t].replace),new Yn(t)},H_=function(t){return t.length===1?t[0]:new $e("mrow",t)},x$={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},$_=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var r=e.mode,i=x$[n];if(i)return typeof i=="function"?i(e):i;var a=e.text;if(v$.has(a))return null;if(En[r][a]){var o=En[r][a].replace;o&&(a=o)}var l=tv[n].fontName;return I_(a,l,r)?tv[n].variant:null};function Mg(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof Yn&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof Yn&&n.text===","}else return!1}var Pi=function(t,n,r){if(t.length===1){var i=fn(t[0],n);return r&&i instanceof $e&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],o,l=0;l=1&&(o.type==="mn"||Mg(o))){var d=u.children[0];d instanceof $e&&d.type==="mn"&&(d.children=[...o.children,...d.children],a.pop())}else if(o.type==="mi"&&o.children.length===1){var m=o.children[0];if(m instanceof Yn&&m.text==="̸"&&(u.type==="mo"||u.type==="mi"||u.type==="mn")){var f=u.children[0];f instanceof Yn&&f.text.length>0&&(f.text=f.text.slice(0,1)+"̸"+f.text.slice(1),a.pop())}}}a.push(u),o=u}return a},Do=function(t,n,r){return H_(Pi(t,n,r))},fn=function(t,n){if(!t)return new $e("mrow");if(Bf[t.type])return Bf[t.type](t,n);throw new He("Got group of unknown type: '"+t.type+"'")};function k6(e,t,n,r,i){var a=Pi(e,n),o;a.length===1&&a[0]instanceof $e&&_$.has(a[0].type)?o=a[0]:o=new $e("mrow",a);var l=new $e("annotation",[new Yn(t)]);l.setAttribute("encoding","application/x-tex");var u=new $e("semantics",[o,l]),d=new $e("math",[u]);d.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&d.setAttribute("display","block");var m=i?"katex":"katex-mathml";return Ie([m],[d])}var y$=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],C6=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],E6=function(t,n){return n.size<2?t:y$[t-1][n.size-1]};class Ta{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||Ta.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=C6[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new Ta(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:E6(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:C6[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=E6(Ta.BASESIZE,t);return this.size===n&&this.textSize===Ta.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Ta.BASESIZE?["sizing","reset-size"+this.size,"size"+Ta.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=i$(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Ta.BASESIZE=6;var L9=function(t){return new Ta({style:t.displayMode?yt.DISPLAY:yt.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},O9=function(t,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),t=Ie(r,[t])}return t},w$=function(t,n,r){var i=L9(r),a;if(r.output==="mathml")return k6(t,n,i,r.displayMode,!0);if(r.output==="html"){var o=sv(t,i);a=Ie(["katex"],[o])}else{var l=k6(t,n,i,r.displayMode,!1),u=sv(t,i);a=Ie(["katex"],[l,u])}return O9(a,r)},S$=function(t,n,r){var i=L9(r),a=sv(t,i),o=Ie(["katex"],[a]);return O9(o,r)},k$={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},gp=function(t){var n=new $e("mo",[new Yn(k$[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},C$={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},E$=new Set(["widehat","widecheck","widetilde","utilde"]),bp=function(t,n){function r(){var l=4e5,u=t.label.slice(1);if(E$.has(u)&&"base"in t){var d=t.base.type==="ordgroup"?t.base.body.length:1,m,f,g;if(d>5)u==="widehat"||u==="widecheck"?(m=420,l=2364,g=.42,f=u+"4"):(m=312,l=2340,g=.34,f="tilde4");else{var b=[1,1,2,2,3,3][d];u==="widehat"||u==="widecheck"?(l=[0,1062,2364,2364,2364][b],m=[0,239,300,360,420][b],g=[0,.24,.3,.3,.36,.42][b],f=u+b):(l=[0,600,1033,2339,2340][b],m=[0,260,286,306,312][b],g=[0,.26,.286,.3,.306,.34][b],f="tilde"+b)}var k=new Mo(f),S=new Da([k],{width:"100%",height:Pe(g),viewBox:"0 0 "+l+" "+m,preserveAspectRatio:"none"});return{span:Ro([],[S],n),minWidth:0,height:g}}else{var x=[],_=C$[u];if(!_)throw new Error('No SVG data for "'+u+'".');var[w,y,C]=_,N=C/1e3,E=w.length,j,T;if(E===1){if(_.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+u+'".');j=["hide-tail"],T=[_[3]]}else if(E===2)j=["halfarrow-left","halfarrow-right"],T=["xMinYMin","xMaxYMin"];else if(E===3)j=["brace-left","brace-center","brace-right"],T=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+E+" children.");for(var D=0;D0&&(i.style.minWidth=Pe(a)),i},A$=function(t,n,r,i,a){var o,l=t.height+t.depth+r+i;if(/fbox|color|angl/.test(n)){if(o=Ie(["stretchy",n],[],a),n==="fbox"){var u=a.color&&a.getColor();u&&(o.style.borderColor=u)}}else{var d=[];/^[bx]cancel$/.test(n)&&d.push(new Xb({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&d.push(new Xb({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var m=new Da(d,{width:"100%",height:Pe(l)});o=Ro([],[m],a)}return o.height=l,o.style.height=Pe(l),o},T$={bin:1,close:1,inner:1,open:1,punct:1,rel:1},N$={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function j$(e){return e in T$}function Et(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function vp(e){var t=_p(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function _p(e){return e&&(e.type==="atom"||N$.hasOwnProperty(e.type))?e:null}var I9=e=>{if(e instanceof Bi)return e;if(n$(e)&&e.children.length===1)return I9(e.children[0])},F_=(e,t)=>{var n,r,i;e&&e.type==="supsub"?(r=Et(e.base,"accent"),n=r.base,e.base=n,i=t$(Kt(e,t)),e.base=r):(r=Et(e,"accent"),n=r.base);var a=Kt(n,t.havingCrampedStyle()),o=r.isShifty&&Ha(n),l=0;if(o){var u,d;l=(u=(d=I9(a))==null?void 0:d.skew)!=null?u:0}var m=r.label==="\\c",f=m?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),g;if(r.isStretchy)g=bp(r,t),g=Yt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:g,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+Pe(2*l)+")",marginLeft:Pe(2*l)}:void 0}]});else{var b,k;r.label==="\\vec"?(b=N9("vec",t),k=T9.vec[1]):(b=mp({mode:r.mode,text:r.label},t,"textord"),b=e$(b),b.italic=0,k=b.width,m&&(f+=b.depth)),g=Ie(["accent-body"],[b]);var S=r.label==="\\textcircled";S&&(g.classes.push("accent-full"),f=a.height);var x=l;S||(x-=k/2),g.style.left=Pe(x),r.label==="\\textcircled"&&(g.style.top=".2em"),g=Yt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-f},{type:"elem",elem:g}]})}var _=Ie(["mord","accent"],[g],t);return i?(i.children[0]=_,i.height=Math.max(_.height,i.height),i.classes[0]="mord",i):_},z9=(e,t)=>{var n=e.isStretchy?gp(e.label):new $e("mo",[as(e.label,e.mode)]),r=new $e("mover",[fn(e.base,t),n]);return r.setAttribute("accent","true"),r},M$=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Ye({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=Hf(t[0]),r=!M$.test(e.funcName),i=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:F_,mathmlBuilder:z9});Ye({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:F_,mathmlBuilder:z9});Ye({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=Kt(e.base,t),r=bp(e,t),i=e.label==="\\utilde"?.12:0,a=Yt({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]});return Ie(["mord","accentunder"],[a],t)},mathmlBuilder:(e,t)=>{var n=gp(e.label),r=new $e("munder",[fn(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var B0=e=>{var t=new $e("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Ye({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=Wc(Kt(e.body,r,t),t),a=e.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var o;e.below&&(r=t.havingStyle(n.sub()),o=Wc(Kt(e.below,r,t),t),o.classes.push(a+"-arrow-pad"));var l=bp(e,t),u=-t.fontMetrics().axisHeight+.5*l.height,d=-t.fontMetrics().axisHeight-.5*l.height-.111;(i.depth>.25||e.label==="\\xleftequilibrium")&&(d-=i.depth);var m;if(o){var f=-t.fontMetrics().axisHeight+o.height+.5*l.height+.111;m=Yt({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:u,wrapperClasses:["svg-align"]},{type:"elem",elem:o,shift:f}]})}else m=Yt({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:u,wrapperClasses:["svg-align"]}]});return Ie(["mrel","x-arrow"],[m],t)},mathmlBuilder(e,t){var n=gp(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var i=B0(fn(e.body,t));if(e.below){var a=B0(fn(e.below,t));r=new $e("munderover",[n,a,i])}else r=new $e("mover",[n,i])}else if(e.below){var o=B0(fn(e.below,t));r=new $e("munder",[n,o])}else r=B0(),r=new $e("mover",[n,r]);return r}});function B9(e,t){var n=cr(e.body,t,!0);return Ie([e.mclass],n,t)}function H9(e,t){var n,r=Pi(e.body,t);return e.mclass==="minner"?n=new $e("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(n=r[0],n.type="mi"):n=new $e("mi",r):(e.isCharacterBox?(n=r[0],n.type="mo"):n=new $e("mo",r),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Ye({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:Wn(i),isCharacterBox:Ha(i)}},htmlBuilder:B9,mathmlBuilder:H9});var xp=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};Ye({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:xp(t[0]),body:Wn(t[1]),isCharacterBox:Ha(t[1])}}});Ye({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],o;r!=="\\stackrel"?o=xp(i):o="mrel";var l={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:Wn(i)},u={type:"supsub",mode:a.mode,base:l,sup:r==="\\underset"?null:a,sub:r==="\\underset"?a:null};return{type:"mclass",mode:n.mode,mclass:o,body:[u],isCharacterBox:Ha(u)}},htmlBuilder:B9,mathmlBuilder:H9});Ye({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:xp(t[0]),body:Wn(t[0])}},htmlBuilder(e,t){var n=cr(e.body,t,!0),r=Ie([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=Pi(e.body,t),r=new $e("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var R$={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},A6=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),T6=e=>e.type==="textord"&&e.text==="@",D$=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function L$(e,t,n){var r=R$[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var i=n.callFunction("\\\\cdleft",[t[0]],[]),a={type:"atom",text:r,mode:"math",family:"rel"},o=n.callFunction("\\Big",[a],[]),l=n.callFunction("\\\\cdright",[t[1]],[]),u={type:"ordgroup",mode:"math",body:[i,o,l]};return n.callFunction("\\\\cdparent",[u],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var d={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[d],[])}default:return{type:"textord",text:" ",mode:"math"}}}function O$(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new He("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],i=[r],a=0;aAV".includes(d))for(var f=0;f<2;f++){for(var g=!0,b=u+1;bAV=|." after @',o[u]);var k=L$(d,m,e),S={type:"styling",body:[k],mode:"math",style:"display",resetFont:!0};r.push(S),l=A6()}a%2===0?r.push(l):r.shift(),r=[],i.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var x=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:x,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Ye({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=Wc(Kt(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=Pe(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new $e("mrow",[fn(e.label,t)]);return n=new $e("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new $e("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Ye({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=Wc(Kt(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new $e("mrow",[fn(e.fragment,t)])}});Ye({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=Et(t[0],"ordgroup"),i=r.body,a="",o=0;o=1114111)throw new He("\\@char with invalid code point "+a);return u<=65535?d=String.fromCharCode(u):(u-=65536,d=String.fromCharCode((u>>10)+55296,(u&1023)+56320)),{type:"textord",mode:n.mode,text:d}}});var $9=(e,t)=>{var n=cr(e.body,t.withColor(e.color),!1);return Fa(n)},F9=(e,t)=>{var n=Pi(e.body,t.withColor(e.color)),r=new $e("mstyle",n);return r.setAttribute("mathcolor",e.color),r};Ye({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=Et(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:Wn(i)}},htmlBuilder:$9,mathmlBuilder:F9});Ye({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=Et(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var a=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:a}},htmlBuilder:$9,mathmlBuilder:F9});Ye({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:a,size:i&&Et(i,"size").value}},htmlBuilder(e,t){var n=Ie(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Pe(Mn(e.size,t)))),n},mathmlBuilder(e,t){var n=new $e("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Pe(Mn(e.size,t)))),n}});var av={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},P9=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new He("Expected a control sequence",e);return t},I$=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},U9=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i==null&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};Ye({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(av[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=av[r.text]),Et(t.parseFunction(),"internal");throw new He("Invalid token after macro prefix",r)}});Ye({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new He("Expected a control sequence",r);for(var a=0,o,l=[[]];t.gullet.future().text!=="{";)if(r=t.gullet.popToken(),r.text==="#"){if(t.gullet.future().text==="{"){o=t.gullet.future(),l[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new He('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new He('Argument number "'+r.text+'" out of order');a++,l.push([])}else{if(r.text==="EOF")throw new He("Expected a macro definition");l[a].push(r.text)}var{tokens:u}=t.gullet.consumeArg();return o&&u.unshift(o),(n==="\\edef"||n==="\\xdef")&&(u=t.gullet.expandTokens(u),u.reverse()),t.gullet.macros.set(i,{tokens:u,numArgs:a,delimiters:l},n===av[n]),{type:"internal",mode:t.mode}}});Ye({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=P9(t.gullet.popToken());t.gullet.consumeSpaces();var i=I$(t);return U9(t,r,i,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});Ye({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=P9(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return U9(t,r,a,n==="\\\\globalfuture"),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var sd=function(t,n,r){var i=En.math[t]&&En.math[t].replace,a=I_(i||t,n,r);if(!a)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return a},P_=function(t,n,r,i){var a=r.havingBaseStyle(n),o=Ie(i.concat(a.sizingClasses(r)),[t],r),l=a.sizeMultiplier/r.sizeMultiplier;return o.height*=l,o.depth*=l,o.maxFontSize=a.sizeMultiplier,o},q9=function(t,n,r){var i=n.havingBaseStyle(r),a=(1-n.sizeMultiplier/i.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=Pe(a),t.height-=a,t.depth+=a},z$=function(t,n,r,i,a,o){var l=Ur(t,"Main-Regular",a,i),u=P_(l,n,i,o);return q9(u,i,n),u},B$=function(t,n,r,i){return Ur(t,"Size"+n+"-Regular",r,i)},G9=function(t,n,r,i,a,o){var l=B$(t,n,a,i),u=P_(Ie(["delimsizing","size"+n],[l],i),yt.TEXT,i,o);return r&&q9(u,i,yt.TEXT),u},Rg=function(t,n,r){var i;n==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Ie(["delimsizinginner",i],[Ie([],[Ur(t,n,r)])]);return{type:"elem",elem:a}},Dg=function(t,n,r){var i=Us["Size4-Regular"][t.charCodeAt(0)]?Us["Size4-Regular"][t.charCodeAt(0)][4]:Us["Size1-Regular"][t.charCodeAt(0)][4],a=new Mo("inner",WH(t,Math.round(1e3*n))),o=new Da([a],{width:Pe(i),height:Pe(n),style:"width:"+Pe(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),l=Ro([],[o],r);return l.height=n,l.style.height=Pe(n),l.style.width=Pe(i),{type:"elem",elem:l}},ov=.008,H0={type:"kern",size:-1*ov},H$=new Set(["|","\\lvert","\\rvert","\\vert"]),$$=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),V9=function(t,n,r,i,a,o){var l,u,d,m,f="",g=0;l=d=m=t,u=null;var b="Size1-Regular";t==="\\uparrow"?d=m="⏐":t==="\\Uparrow"?d=m="‖":t==="\\downarrow"?l=d="⏐":t==="\\Downarrow"?l=d="‖":t==="\\updownarrow"?(l="\\uparrow",d="⏐",m="\\downarrow"):t==="\\Updownarrow"?(l="\\Uparrow",d="‖",m="\\Downarrow"):H$.has(t)?(d="∣",f="vert",g=333):$$.has(t)?(d="∥",f="doublevert",g=556):t==="["||t==="\\lbrack"?(l="⎡",d="⎢",m="⎣",b="Size4-Regular",f="lbrack",g=667):t==="]"||t==="\\rbrack"?(l="⎤",d="⎥",m="⎦",b="Size4-Regular",f="rbrack",g=667):t==="\\lfloor"||t==="⌊"?(d=l="⎢",m="⎣",b="Size4-Regular",f="lfloor",g=667):t==="\\lceil"||t==="⌈"?(l="⎡",d=m="⎢",b="Size4-Regular",f="lceil",g=667):t==="\\rfloor"||t==="⌋"?(d=l="⎥",m="⎦",b="Size4-Regular",f="rfloor",g=667):t==="\\rceil"||t==="⌉"?(l="⎤",d=m="⎥",b="Size4-Regular",f="rceil",g=667):t==="("||t==="\\lparen"?(l="⎛",d="⎜",m="⎝",b="Size4-Regular",f="lparen",g=875):t===")"||t==="\\rparen"?(l="⎞",d="⎟",m="⎠",b="Size4-Regular",f="rparen",g=875):t==="\\{"||t==="\\lbrace"?(l="⎧",u="⎨",m="⎩",d="⎪",b="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(l="⎫",u="⎬",m="⎭",d="⎪",b="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(l="⎧",m="⎩",d="⎪",b="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(l="⎫",m="⎭",d="⎪",b="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(l="⎧",m="⎭",d="⎪",b="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(l="⎫",m="⎩",d="⎪",b="Size4-Regular");var k=sd(l,b,a),S=k.height+k.depth,x=sd(d,b,a),_=x.height+x.depth,w=sd(m,b,a),y=w.height+w.depth,C=0,N=1;if(u!==null){var E=sd(u,b,a);C=E.height+E.depth,N=2}var j=S+y+C,T=Math.max(0,Math.ceil((n-j)/(N*_))),D=j+T*N*_,I=i.fontMetrics().axisHeight;r&&(I*=i.sizeMultiplier);var $=D/2-I,F=[];if(f.length>0){var U=D-S-y,G=Math.round(D*1e3),X=YH(f,Math.round(U*1e3)),Y=new Mo(f,X),Z=Pe(g/1e3),Q=Pe(G/1e3),z=new Da([Y],{width:Z,height:Q,viewBox:"0 0 "+g+" "+G}),O=Ro([],[z],i);O.height=G/1e3,O.style.width=Z,O.style.height=Q,F.push({type:"elem",elem:O})}else{if(F.push(Rg(m,b,a)),F.push(H0),u===null){var H=D-S-y+2*ov;F.push(Dg(d,H,i))}else{var V=(D-S-y-C)/2+2*ov;F.push(Dg(d,V,i)),F.push(H0),F.push(Rg(u,b,a)),F.push(H0),F.push(Dg(d,V,i))}F.push(H0),F.push(Rg(l,b,a))}var W=i.havingBaseStyle(yt.TEXT),re=Yt({positionType:"bottom",positionData:$,children:F});return P_(Ie(["delimsizing","mult"],[re],W),yt.TEXT,i,o)},Lg=80,Og=.08,Ig=function(t,n,r,i,a){var o=VH(t,i,r),l=new Mo(t,o),u=new Da([l],{width:"400em",height:Pe(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return Ro(["hide-tail"],[u],a)},F$=function(t,n){var r=n.havingBaseSizing(),i=Z9("\\surd",t*r.sizeMultiplier,K9,r),a=r.sizeMultiplier,o=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),l,u,d,m,f;return i.type==="small"?(m=1e3+1e3*o+Lg,t<1?a=1:t<1.4&&(a=.7),u=(1+o+Og)/a,d=(1+o)/a,l=Ig("sqrtMain",u,m,o,n),l.style.minWidth="0.853em",f=.833/a):i.type==="large"?(m=(1e3+Lg)*md[i.size],d=(md[i.size]+o)/a,u=(md[i.size]+o+Og)/a,l=Ig("sqrtSize"+i.size,u,m,o,n),l.style.minWidth="1.02em",f=1/a):(u=t+o+Og,d=t+o,m=Math.floor(1e3*t+o)+Lg,l=Ig("sqrtTall",u,m,o,n),l.style.minWidth="0.742em",f=1.056),l.height=d,l.style.height=Pe(u),{span:l,advanceWidth:f,ruleWidth:(n.fontMetrics().sqrtRuleThickness+o)*a}},W9=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),P$=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),Y9=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),md=[0,1.2,1.8,2.4,3],X9=function(t,n,r,i,a){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),W9.has(t)||Y9.has(t))return G9(t,n,!1,r,i,a);if(P$.has(t))return V9(t,md[n],!1,r,i,a);throw new He("Illegal delimiter: '"+t+"'")},U$=[{type:"small",style:yt.SCRIPTSCRIPT},{type:"small",style:yt.SCRIPT},{type:"small",style:yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],q$=[{type:"small",style:yt.SCRIPTSCRIPT},{type:"small",style:yt.SCRIPT},{type:"small",style:yt.TEXT},{type:"stack"}],K9=[{type:"small",style:yt.SCRIPTSCRIPT},{type:"small",style:yt.SCRIPT},{type:"small",style:yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],G$=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")},Z9=function(t,n,r,i){for(var a=Math.min(2,3-i.style.size),o=a;on)return l}return r[r.length-1]},lv=function(t,n,r,i,a,o){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var l;Y9.has(t)?l=U$:W9.has(t)?l=K9:l=q$;var u=Z9(t,n,l,i);return u.type==="small"?z$(t,u.style,r,i,a,o):u.type==="large"?G9(t,u.size,r,i,a,o):V9(t,n,r,i,a,o)},zg=function(t,n,r,i,a,o){var l=i.fontMetrics().axisHeight*i.sizeMultiplier,u=901,d=5/i.fontMetrics().ptPerEm,m=Math.max(n-l,r+l),f=Math.max(m/500*u,2*m-d);return lv(t,f,!0,i,a,o)},N6={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},V$=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function j6(e){return"isMiddle"in e}function yp(e,t){var n=_p(e);if(n&&V$.has(n.text))return n;throw n?new He("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new He("Invalid delimiter type '"+e.type+"'",e)}Ye({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=yp(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:N6[e.funcName].size,mclass:N6[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?Ie([e.mclass]):X9(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(as(e.delim,e.mode));var n=new $e("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Pe(md[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function M6(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ye({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new He("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:yp(t[0],e).text,color:n}}});Ye({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=yp(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var a=Et(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{M6(e);for(var n=cr(e.body,t,!0,["mopen","mclose"]),r=0,i=0,a=!1,o=0;o{M6(e);var n=Pi(e.body,t);if(e.left!=="."){var r=new $e("mo",[as(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(e.right!=="."){var i=new $e("mo",[as(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return H_(n)}});Ye({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=yp(t[0],e);if(!e.parser.leftrightDepth)throw new He("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=Td(t,[]):(n=X9(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?as("|","text"):as(e.delim,e.mode),r=new $e("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var wp=(e,t)=>{var n=Wc(Kt(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,l=Ha(e.body);if(r==="sout")a=Ie(["stretchy","sout"]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r==="phase"){var u=Mn({number:.6,unit:"pt"},t),d=Mn({number:.35,unit:"ex"},t),m=t.havingBaseSizing();i=i/m.sizeMultiplier;var f=n.height+n.depth+u+d;n.style.paddingLeft=Pe(f/2+u);var g=Math.floor(1e3*f*i),b=qH(g),k=new Da([new Mo("phase",b)],{width:"400em",height:Pe(g/1e3),viewBox:"0 0 400000 "+g,preserveAspectRatio:"xMinYMin slice"});a=Ro(["hide-tail"],[k],t),a.style.height=Pe(f),o=n.depth+u+d}else{/cancel/.test(r)?l||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var S,x,_=0;/box/.test(r)?(_=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),S=t.fontMetrics().fboxsep+(r==="colorbox"?0:_),x=S):r==="angl"?(_=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),S=4*_,x=Math.max(0,.25-n.depth)):(S=l?.2:0,x=S),a=A$(n,r,S,x,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle="solid",a.style.borderWidth=Pe(_)):r==="angl"&&_!==.049&&(a.style.borderTopWidth=Pe(_),a.style.borderRightWidth=Pe(_)),o=n.depth+x,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=Yt({positionType:"individualShift",children:[{type:"elem",elem:a,shift:o},{type:"elem",elem:n,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];w=Yt({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:a,shift:o,wrapperClasses:y}]})}return/cancel/.test(r)&&(w.height=n.height,w.depth=n.depth),/cancel/.test(r)&&!l?Ie(["mord","cancel-lap"],[w],t):Ie(["mord"],[w],t)},Sp=(e,t)=>{var n,r=new $e(e.label.includes("colorbox")?"mpadded":"menclose",[fn(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+Pe(i)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};Ye({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Et(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:wp,mathmlBuilder:Sp});Ye({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Et(t[0],"color-token").color,o=Et(t[1],"color-token").color,l=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:l}},htmlBuilder:wp,mathmlBuilder:Sp});Ye({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});Ye({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:wp,mathmlBuilder:Sp});Ye({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:wp,mathmlBuilder:Sp});Ye({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var Q9={};function Ks(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,l={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},u=0;u{var t=e.parser.settings;if(!t.displayMode)throw new He("{"+e.envName+"} can be used only in display mode.")},W$=new Set(["gather","gather*"]);function U_(e){if(!e.includes("ed"))return!e.includes("*")}function zo(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:l,autoTag:u,singleRow:d,emptySingleRow:m,maxNumCols:f,leqno:g}=t;if(e.gullet.beginGroup(),d||e.gullet.macros.set("\\cr","\\\\\\relax"),!o){var b=e.gullet.expandMacroAsText("\\arraystretch");if(b==null)o=1;else if(o=parseFloat(b),!o||o<0)throw new He("Invalid \\arraystretch: "+b)}e.gullet.beginGroup();var k=[],S=[k],x=[],_=[],w=u!=null?[]:void 0;function y(){u&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){w&&(e.gullet.macros.get("\\df@tag")?(w.push(e.subparse([new ks("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!u&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),_.push(R6(e));;){var N=e.parseExpression(!1,d?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var E={type:"ordgroup",mode:e.mode,body:N};n&&(E={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[E]}),k.push(E);var j=e.fetch().text;if(j==="&"){if(f&&k.length===f){if(d||l)throw new He("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(j==="\\end"){C(),k.length===1&&E.type==="styling"&&E.body.length===1&&E.body[0].type==="ordgroup"&&E.body[0].body.length===0&&(S.length>1||!m)&&S.pop(),_.length0&&(y+=.25),d.push({pos:y,isDashed:Ge[Qe]})}for(C(o[0]),r=0;r0&&($+=w,j<$&&(j=$),$=0)),t.addJot&&rGe))for(r=0;r=l)){var ie=void 0;if(i>0||t.hskipBeforeAndAfter){var oe,be;ie=(oe=(be=W)==null?void 0:be.pregap)!=null?oe:g,ie!==0&&(X=Ie(["arraycolsep"],[]),X.style.width=Pe(ie),G.push(X))}var ge=[];for(r=0;r0){for(var Bt=Vc("hline",n,m),on=Vc("hdashline",n,m),Ze=[{type:"elem",elem:ot,shift:0}];d.length>0;){var ct=d.pop(),st=ct.pos-F;ct.isDashed?Ze.push({type:"elem",elem:on,shift:st}):Ze.push({type:"elem",elem:Bt,shift:st})}ot=Yt({positionType:"individualShift",children:Ze})}if(Z.length===0)return Ie(["mord"],[ot],n);var xe=Yt({positionType:"individualShift",children:Z}),Me=Ie(["tag"],[xe],n);return Fa([ot,Me])},Y$={c:"center ",l:"left ",r:"right "},Qs=function(t,n){for(var r=[],i=new $e("mtd",[],["mtr-glue"]),a=new $e("mtd",[],["mml-eqn-num"]),o=0;o0){var k=t.cols,S="",x=!1,_=0,w=k.length;k[0].type==="separator"&&(g+="top ",_=1),k[k.length-1].type==="separator"&&(g+="bottom ",w-=1);for(var y=_;y0?"left ":"",g+=D[D.length-1].length>0?"right ":"";for(var I=1;I0&&b&&(x=1),r[k]={type:"align",align:S,pregap:x,postgap:0}}return o.colSeparationType=b?"align":"alignat",o};Ks({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=_p(t[0]),r=n?[t[0]]:Et(t[0],"ordgroup").body,i=r.map(function(o){var l=vp(o),u=l.text;if("lcr".includes(u))return{type:"align",align:u};if(u==="|")return{type:"separator",separator:"|"};if(u===":")return{type:"separator",separator:":"};throw new He("Unknown column alignment: "+u,o)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return zo(e.parser,a,q_(e.envName))},htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var i=e.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!"lcr".includes(n))throw new He("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var a=zo(e.parser,r,q_(e.envName)),o=Math.max(0,...a.body.map(l=>l.length));return a.cols=new Array(o).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=zo(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=_p(t[0]),r=n?[t[0]]:Et(t[0],"ordgroup").body,i=r.map(function(l){var u=vp(l),d=u.text;if("lc".includes(d))return{type:"align",align:d};throw new He("Unknown column alignment: "+d,l)});if(i.length>1)throw new He("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},o=zo(e.parser,a,"script");if(o.body.length>0&&o.body[0].length>1)throw new He("{subarray} can contain only one column");return o},htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=zo(e.parser,t,q_(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:tk,htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){W$.has(e.envName)&&kp(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:U_(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return zo(e.parser,t,"display")},htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:tk,htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){kp(e);var t={autoTag:U_(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return zo(e.parser,t,"display")},htmlBuilder:Zs,mathmlBuilder:Qs});Ks({type:"array",names:["CD"],props:{numArgs:0},handler(e){return kp(e),O$(e.parser)},htmlBuilder:Zs,mathmlBuilder:Qs});ee("\\nonumber","\\gdef\\@eqnsw{0}");ee("\\notag","\\nonumber");Ye({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new He(e.funcName+" valid only within array environment")}});var D6=Q9;Ye({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!=="ordgroup")throw new He("Invalid environment name",i);for(var a="",o=0;o{var n=e.font,r=t.withFont(n);return Kt(e.body,r)},rk=(e,t)=>{var n=e.font,r=t.withFont(n);return fn(e.body,r)},L6={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Ye({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=Hf(t[0]),a=r;return a in L6&&(a=L6[a]),{type:"font",mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:nk,mathmlBuilder:rk});Ye({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:xp(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:Ha(r)}}});Ye({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,o=n.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:nk,mathmlBuilder:rk});var X$=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a;a=t.havingStyle(r);var o=Kt(e.numer,a,t);if(e.continued){var l=8.5/t.fontMetrics().ptPerEm,u=3.5/t.fontMetrics().ptPerEm;o.height=o.height0?k=3*g:k=7*g,S=t.fontMetrics().denom1):(f>0?(b=t.fontMetrics().num2,k=g):(b=t.fontMetrics().num3,k=3*g),S=t.fontMetrics().denom2);var x;if(m){var w=t.fontMetrics().axisHeight;b-o.depth-(w+.5*f){var n=new $e("mfrac",[fn(e.numer,t),fn(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var r=Mn(e.barSize,t);n.setAttribute("linethickness",Pe(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new $e("mo",[new Yn(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new $e("mo",[new Yn(e.rightDelim.replace("\\",""))]);o.setAttribute("fence","true"),i.push(o)}return H_(i)}return n},ik=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};Ye({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1],o,l=null,u=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,l="(",u=")";break;case"\\\\bracefrac":o=!1,l="\\{",u="\\}";break;case"\\\\brackfrac":o=!1,l="[",u="]";break;default:throw new Error("Unrecognized genfrac command")}var d=r==="\\cfrac",m=null;return d||r.startsWith("\\d")?m="display":r.startsWith("\\t")&&(m="text"),ik({type:"genfrac",mode:n.mode,numer:i,denom:a,continued:d,hasBarLine:o,leftDelim:l,rightDelim:u,barSize:null},m)},htmlBuilder:X$,mathmlBuilder:K$});Ye({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:i,token:r}}});var O6=["display","text","script","scriptscript"],I6=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};Ye({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=Hf(t[0]),o=a.type==="atom"&&a.family==="open"?I6(a.text):null,l=Hf(t[1]),u=l.type==="atom"&&l.family==="close"?I6(l.text):null,d=Et(t[2],"size"),m,f=null;d.isBlank?m=!0:(f=d.value,m=f.number>0);var g=null,b=t[3];if(b.type==="ordgroup"){if(b.body.length>0){var k=Et(b.body[0],"textord");g=O6[Number(k.text)]}}else b=Et(b,"textord"),g=O6[Number(b.text)];return ik({type:"genfrac",mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:m,barSize:f,leftDelim:o,rightDelim:u},g)}});Ye({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Et(t[0],"size").value,token:i}}});Ye({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=Et(t[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var o=t[2],l=a.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:l,barSize:a,leftDelim:null,rightDelim:null}}});var sk=(e,t)=>{var n=t.style,r,i;e.type==="supsub"?(r=e.sup?Kt(e.sup,t.havingStyle(n.sup()),t):Kt(e.sub,t.havingStyle(n.sub()),t),i=Et(e.base,"horizBrace")):i=Et(e,"horizBrace");var a=Kt(i.base,t.havingBaseStyle(yt.DISPLAY)),o=bp(i,t),l;if(i.isOver?l=Yt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:o,wrapperClasses:["svg-align"]}]}):l=Yt({positionType:"bottom",positionData:a.depth+.1+o.height,children:[{type:"elem",elem:o,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),r){var u=Ie(["minner",i.isOver?"mover":"munder"],[l],t);i.isOver?l=Yt({positionType:"firstBaseline",children:[{type:"elem",elem:u},{type:"kern",size:.2},{type:"elem",elem:r}]}):l=Yt({positionType:"bottom",positionData:u.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:u}]})}return Ie(["minner",i.isOver?"mover":"munder"],[l],t)},Z$=(e,t)=>{var n=gp(e.label);return new $e(e.isOver?"mover":"munder",[fn(e.base,t),n])};Ye({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:t[0]}},htmlBuilder:sk,mathmlBuilder:Z$});Ye({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=Et(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:Wn(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=cr(e.body,t,!1);return u$(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Do(e.body,t);return n instanceof $e||(n=new $e("mrow",[n])),n.setAttribute("href",e.href),n}});Ye({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=Et(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:n,funcName:r,token:i}=e,a=Et(t[0],"raw").string,o=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,u={};switch(r){case"\\htmlClass":u.class=a,l={command:"\\htmlClass",class:a};break;case"\\htmlId":u.id=a,l={command:"\\htmlId",id:a};break;case"\\htmlStyle":u.style=a,l={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var d=a.split(","),m=0;m{var n=cr(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=Ie(r,n,t);for(var a in e.attributes)a!=="class"&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>Do(e.body,t)});Ye({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Wn(t[0]),mathml:Wn(t[1])}},htmlBuilder:(e,t)=>{var n=cr(e.html,t,!1);return Fa(n)},mathmlBuilder:(e,t)=>Do(e.mathml,t)});var Bg=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new He("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!y9(r))throw new He("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};Ye({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},a={number:.9,unit:"em"},o={number:0,unit:"em"},l="";if(n[0])for(var u=Et(n[0],"raw").string,d=u.split(","),m=0;m{var n=Mn(e.height,t),r=0;e.totalheight.number>0&&(r=Mn(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=Mn(e.width,t));var a={height:Pe(n+r)};i>0&&(a.width=Pe(i)),r>0&&(a.verticalAlign=Pe(-r));var o=new QH(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new $e("mglyph",[]);n.setAttribute("alt",e.alt);var r=Mn(e.height,t),i=0;if(e.totalheight.number>0&&(i=Mn(e.totalheight,t)-r,n.setAttribute("valign",Pe(-i))),n.setAttribute("height",Pe(r+i)),e.width.number>0){var a=Mn(e.width,t);n.setAttribute("width",Pe(a))}return n.setAttribute("src",e.src),n}});Ye({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=Et(t[0],"size");if(n.settings.strict){var a=r[1]==="m",o=i.value.unit==="mu";a?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+i.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return A9(e.dimension,t)},mathmlBuilder(e,t){var n=Mn(e.dimension,t);return new D9(n)}});Ye({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=Ie([],[Kt(e.body,t)]),n=Ie(["inner"],[n],t)):n=Ie(["inner"],[Kt(e.body,t)]);var r=Ie(["fix"],[]),i=Ie([e.alignment],[n,r],t),a=Ie(["strut"]);return a.style.height=Pe(i.height+i.depth),i.depth&&(a.style.verticalAlign=Pe(-i.depth)),i.children.unshift(a),i=Ie(["thinbox"],[i],t),Ie(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new $e("mpadded",[fn(e.body,t)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});Ye({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var a=n==="\\("?"\\)":"$",o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:o}}});Ye({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new He("Mismatched "+e.funcName)}});var z6=(e,t)=>{switch(t.style.size){case yt.DISPLAY.size:return e.display;case yt.TEXT.size:return e.text;case yt.SCRIPT.size:return e.script;case yt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Ye({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Wn(t[0]),text:Wn(t[1]),script:Wn(t[2]),scriptscript:Wn(t[3])}},htmlBuilder:(e,t)=>{var n=z6(e,t),r=cr(n,t,!1);return Fa(r)},mathmlBuilder:(e,t)=>{var n=z6(e,t);return Do(n,t)}});var ak=(e,t,n,r,i,a,o)=>{e=Ie([],[e]);var l=n&&Ha(n),u,d;if(t){var m=Kt(t,r.havingStyle(i.sup()),r);d={elem:m,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-m.depth)}}if(n){var f=Kt(n,r.havingStyle(i.sub()),r);u={elem:f,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-f.height)}}var g;if(d&&u){var b=r.fontMetrics().bigOpSpacing5+u.elem.height+u.elem.depth+u.kern+e.depth+o;g=Yt({positionType:"bottom",positionData:b,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:Pe(-a)},{type:"kern",size:u.kern},{type:"elem",elem:e},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Pe(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(u){var k=e.height-o;g=Yt({positionType:"top",positionData:k,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:Pe(-a)},{type:"kern",size:u.kern},{type:"elem",elem:e}]})}else if(d){var S=e.depth+o;g=Yt({positionType:"bottom",positionData:S,children:[{type:"elem",elem:e},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Pe(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var x=[g];if(u&&a!==0&&!l){var _=Ie(["mspace"],[],r);_.style.marginRight=Pe(a),x.unshift(_)}return Ie(["mop","op-limits"],x,r)},ok=new Set(["\\smallint"]),ou=(e,t)=>{var n,r,i=!1,a;e.type==="supsub"?(n=e.sup,r=e.sub,a=Et(e.base,"op"),i=!0):a=Et(e,"op");var o=t.style,l=!1;o.size===yt.DISPLAY.size&&a.symbol&&!ok.has(a.name)&&(l=!0);var u,d;if(a.symbol){var m=l?"Size2-Regular":"Size1-Regular",f="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(f=a.name.slice(1),a.name=f==="oiint"?"\\iint":"\\iiint"),u=Ur(a.name,m,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),d=u.italic,f.length>0){var g=N9(f+"Size"+(l?"2":"1"),t);u=Yt({positionType:"individualShift",children:[{type:"elem",elem:u,shift:0},{type:"elem",elem:g,shift:l?.08:0}]}),a.name="\\"+f,u.classes.unshift("mop"),u.italic=d}}else if(a.body){var b=cr(a.body,t,!0);b.length===1&&b[0]instanceof Bi?(u=b[0],u.classes[0]="mop"):u=Ie(["mop"],b,t)}else{for(var k=[],S=1;S{var n;if(e.symbol)n=new $e("mo",[as(e.name,e.mode)]),ok.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new $e("mo",Pi(e.body,t));else{n=new $e("mi",[new Yn(e.name.slice(1))]);var r=new $e("mo",[as("⁡","text")]);e.parentIsSupSub?n=new $e("mrow",[n,r]):n=R9([n,r])}return n},Q$={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ye({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=Q$[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:ou,mathmlBuilder:hh});Ye({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Wn(r)}},htmlBuilder:ou,mathmlBuilder:hh});var J$={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ye({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:ou,mathmlBuilder:hh});Ye({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:ou,mathmlBuilder:hh});Ye({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=J$[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:ou,mathmlBuilder:hh});var lk=(e,t)=>{var n,r,i=!1,a;e.type==="supsub"?(n=e.sup,r=e.sub,a=Et(e.base,"operatorname"),i=!0):a=Et(e,"operatorname");var o;if(a.body.length>0){for(var l=a.body.map(f=>{var g="text"in f?f.text:void 0;return typeof g=="string"?{type:"textord",mode:f.mode,text:g}:f}),u=cr(l,t.withFont("mathrm"),!0),d=0;d{for(var n=Pi(e.body,t.withFont("mathrm")),r=!0,i=0;im.toText()).join("");n=[new Yn(l)]}var u=new $e("mi",n);u.setAttribute("mathvariant","normal");var d=new $e("mo",[as("⁡","text")]);return e.parentIsSupSub?new $e("mrow",[u,d]):R9([u,d])};Ye({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:Wn(i),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:lk,mathmlBuilder:eF});ee("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Ol({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?Fa(cr(e.body,t,!1)):Ie(["mord"],cr(e.body,t,!0),t)},mathmlBuilder(e,t){return Do(e.body,t,!0)}});Ye({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=Kt(e.body,t.havingCrampedStyle()),r=Vc("overline-line",t),i=t.fontMetrics().defaultRuleThickness,a=Yt({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]});return Ie(["mord","overline"],[a],t)},mathmlBuilder(e,t){var n=new $e("mo",[new Yn("‾")]);n.setAttribute("stretchy","true");var r=new $e("mover",[fn(e.body,t),n]);return r.setAttribute("accent","true"),r}});Ye({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:Wn(r)}},htmlBuilder:(e,t)=>{var n=cr(e.body,t.withPhantom(),!1);return Fa(n)},mathmlBuilder:(e,t)=>{var n=Pi(e.body,t);return new $e("mphantom",n)}});ee("\\hphantom","\\smash{\\phantom{#1}}");Ye({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Ie(["inner"],[Kt(e.body,t.withPhantom())]),r=Ie(["fix"],[]);return Ie(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=Pi(Wn(e.body),t),r=new $e("mphantom",n),i=new $e("mpadded",[r]);return i.setAttribute("width","0px"),i}});Ye({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=Et(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=Kt(e.body,t),r=Mn(e.dy,t);return Yt({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new $e("mpadded",[fn(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}});Ye({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Ye({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,i=n[0],a=Et(t[0],"size"),o=Et(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&Et(i,"size").value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=Ie(["mord","rule"],[],t),r=Mn(e.width,t),i=Mn(e.height,t),a=e.shift?Mn(e.shift,t):0;return n.style.borderRightWidth=Pe(r),n.style.borderTopWidth=Pe(i),n.style.bottom=Pe(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=Mn(e.width,t),r=Mn(e.height,t),i=e.shift?Mn(e.shift,t):0,a=t.color&&t.getColor()||"black",o=new $e("mspace");o.setAttribute("mathbackground",a),o.setAttribute("width",Pe(n)),o.setAttribute("height",Pe(r));var l=new $e("mpadded",[o]);return i>=0?l.setAttribute("height",Pe(i)):(l.setAttribute("height",Pe(i)),l.setAttribute("depth",Pe(-i))),l.setAttribute("voffset",Pe(i)),l}});function ck(e,t,n){for(var r=cr(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a{var n=t.havingSize(e.size);return ck(e.body,n,t)};Ye({type:"sizing",names:B6,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:B6.indexOf(r)+1,body:a}},htmlBuilder:tF,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=Pi(e.body,n),i=new $e("mstyle",r);return i.setAttribute("mathsize",Pe(n.sizeMultiplier)),i}});Ye({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,o=n[0]&&Et(n[0],"ordgroup");if(o)for(var l,u=0;u{var n=Ie([],[Kt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return Ie(["mord","smash"],[n],t);if(n.children)for(var r=0;r{var n=new $e("mpadded",[fn(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});Ye({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:"sqrt",mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=Kt(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=Wc(n,t);var r=t.fontMetrics(),i=r.defaultRuleThickness,a=i;t.style.idn.height+n.depth+o&&(o=(o+f-n.height-n.depth)/2);var g=u.height-n.height-o-d;n.style.paddingLeft=Pe(m);var b=Yt({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+g)},{type:"elem",elem:u},{type:"kern",size:d}]});if(e.index){var k=t.havingStyle(yt.SCRIPTSCRIPT),S=Kt(e.index,k,t),x=.6*(b.height-b.depth),_=Yt({positionType:"shift",positionData:-x,children:[{type:"elem",elem:S}]}),w=Ie(["root"],[_]);return Ie(["mord","sqrt"],[w,b],t)}else return Ie(["mord","sqrt"],[b],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new $e("mroot",[fn(n,t),fn(r,t)]):new $e("msqrt",[fn(n,t)])}});var cv={display:yt.DISPLAY,text:yt.TEXT,script:yt.SCRIPT,scriptscript:yt.SCRIPTSCRIPT};function nF(e){return e in cv}Ye({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!nF(o))throw new Error("Unknown style: "+o);return{type:"styling",mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=cv[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont("")),ck(e.body,r,t)},mathmlBuilder(e,t){var n=cv[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(""));var i=Pi(e.body,r),a=new $e("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=o[e.style];return a.setAttribute("scriptlevel",l[0]),a.setAttribute("displaystyle",l[1]),a}});var rF=function(t,n){var r=t.base;if(r)if(r.type==="op"){var i=r.limits&&(n.style.size===yt.DISPLAY.size||r.alwaysHandleSupSub);return i?ou:null}else if(r.type==="operatorname"){var a=r.alwaysHandleSupSub&&(n.style.size===yt.DISPLAY.size||r.limits);return a?lk:null}else{if(r.type==="accent")return Ha(r.base)?F_:null;if(r.type==="horizBrace"){var o=!t.sub;return o===r.isOver?sk:null}else return null}else return null};Ol({type:"supsub",htmlBuilder(e,t){var n=rF(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,o=Kt(r,t),l,u,d=t.fontMetrics(),m=0,f=0,g=r&&Ha(r);if(i){var b=t.havingStyle(t.style.sup());l=Kt(i,b,t),g||(m=o.height-b.fontMetrics().supDrop*b.sizeMultiplier/t.sizeMultiplier)}if(a){var k=t.havingStyle(t.style.sub());u=Kt(a,k,t),g||(f=o.depth+k.fontMetrics().subDrop*k.sizeMultiplier/t.sizeMultiplier)}var S;t.style===yt.DISPLAY?S=d.sup1:t.style.cramped?S=d.sup3:S=d.sup2;var x=t.sizeMultiplier,_=Pe(.5/d.ptPerEm/x),w=null;if(u){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(o instanceof Bi||y){var C;w=Pe(-((C=o.italic)!=null?C:0))}}var N;if(l&&u){m=Math.max(m,S,l.depth+.25*d.xHeight),f=Math.max(f,d.sub2);var E=d.defaultRuleThickness,j=4*E;if(m-l.depth-(u.height-f)0&&(m+=T,f-=T)}var D=[{type:"elem",elem:u,shift:f,marginRight:_,marginLeft:w},{type:"elem",elem:l,shift:-m,marginRight:_}];N=Yt({positionType:"individualShift",children:D})}else if(u){f=Math.max(f,d.sub1,u.height-.8*d.xHeight);var I=[{type:"elem",elem:u,marginLeft:w,marginRight:_}];N=Yt({positionType:"shift",positionData:f,children:I})}else if(l)m=Math.max(m,S,l.depth+.25*d.xHeight),N=Yt({positionType:"shift",positionData:-m,children:[{type:"elem",elem:l,marginRight:_}]});else throw new Error("supsub must have either sup or sub.");var $=iv(o,"right")||"mord";return Ie([$],[o,Ie(["msupsub"],[N])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type==="horizBrace"&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var a=[fn(e.base,t)];e.sub&&a.push(fn(e.sub,t)),e.sup&&a.push(fn(e.sup,t));var o;if(n)o=r?"mover":"munder";else if(e.sub)if(e.sup){var d=e.base;d&&d.type==="op"&&d.limits&&t.style===yt.DISPLAY||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(t.style===yt.DISPLAY||d.limits)?o="munderover":o="msubsup"}else{var u=e.base;u&&u.type==="op"&&u.limits&&(t.style===yt.DISPLAY||u.alwaysHandleSupSub)||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(u.limits||t.style===yt.DISPLAY)?o="munder":o="msub"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(t.style===yt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===yt.DISPLAY)?o="mover":o="msup"}return new $e(o,a)}});Ol({type:"atom",htmlBuilder(e,t){return z_(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new $e("mo",[as(e.text,e.mode)]);if(e.family==="bin"){var r=$_(e,t);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var uk={mi:"italic",mn:"normal",mtext:"normal"};Ol({type:"mathord",htmlBuilder(e,t){return mp(e,t,"mathord")},mathmlBuilder(e,t){var n=new $e("mi",[as(e.text,e.mode,t)]),r=$_(e,t)||"italic";return r!==uk[n.type]&&n.setAttribute("mathvariant",r),n}});Ol({type:"textord",htmlBuilder(e,t){return mp(e,t,"textord")},mathmlBuilder(e,t){var n=as(e.text,e.mode,t),r=$_(e,t)||"normal",i;return e.mode==="text"?i=new $e("mtext",[n]):/[0-9]/.test(e.text)?i=new $e("mn",[n]):e.text==="\\prime"?i=new $e("mo",[n]):i=new $e("mi",[n]),r!==uk[i.type]&&i.setAttribute("mathvariant",r),i}});var Hg={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},$g={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Ol({type:"spacing",htmlBuilder(e,t){if($g.hasOwnProperty(e.text)){var n=$g[e.text].className||"";if(e.mode==="text"){var r=mp(e,t,"textord");return r.classes.push(n),r}else return Ie(["mspace",n],[z_(e.text,e.mode,t)],t)}else{if(Hg.hasOwnProperty(e.text))return Ie(["mspace",Hg[e.text]],[],t);throw new He('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if($g.hasOwnProperty(e.text))n=new $e("mtext",[new Yn(" ")]);else{if(Hg.hasOwnProperty(e.text))return new $e("mspace");throw new He('Unknown type of space "'+e.text+'"')}return n}});var H6=()=>{var e=new $e("mtd",[]);return e.setAttribute("width","50%"),e};Ol({type:"tag",mathmlBuilder(e,t){var n=new $e("mtable",[new $e("mtr",[H6(),new $e("mtd",[Do(e.body,t)]),H6(),new $e("mtd",[Do(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var $6={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},F6={"\\textbf":"textbf","\\textmd":"textmd"},iF={"\\textit":"textit","\\textup":"textup"},P6=(e,t)=>{var n=e.font;if(n){if($6[n])return t.withTextFontFamily($6[n]);if(F6[n])return t.withTextFontWeight(F6[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(iF[n])};Ye({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"text",mode:n.mode,body:Wn(i),font:r}},htmlBuilder(e,t){var n=P6(e,t),r=cr(e.body,n,!0);return Ie(["mord","text"],r,n)},mathmlBuilder(e,t){var n=P6(e,t);return Do(e.body,n)}});Ye({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Kt(e.body,t),r=Vc("underline-line",t),i=t.fontMetrics().defaultRuleThickness,a=Yt({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]});return Ie(["mord","underline"],[a],t)},mathmlBuilder(e,t){var n=new $e("mo",[new Yn("‾")]);n.setAttribute("stretchy","true");var r=new $e("munder",[fn(e.body,t),n]);return r.setAttribute("accentunder","true"),r}});Ye({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Kt(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return Yt({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new $e("mpadded",[fn(e.body,t)],["vcenter"]);return new $e("mrow",[n])}});Ye({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new He("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=U6(e),r=[],i=t.havingStyle(t.style.text()),a=0;ae.body.replace(/ /g,e.star?"␣":" "),To=j9,dk=`[ \r - ]`,sF="\\\\[a-zA-Z@]+",aF="\\\\[^\uD800-\uDFFF]",oF="("+sF+")"+dk+"*",lF=`\\\\( -|[ \r ]+ -?)[ \r ]*`,uv="[̀-ͯ]",cF=new RegExp(uv+"+$"),uF="("+dk+"+)|"+(lF+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(uv+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(uv+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+oF)+("|"+aF+")");class q6{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(uF,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new ks("EOF",new di(this,n,n));var r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new He("Unexpected character: '"+t[n]+"'",new ks(t[n],new di(this,n,n+1)));var i=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=t.indexOf(` -`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new ks(i,new di(this,n,this.tokenRegex.lastIndex))}}class dF{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new He("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,r){if(r===void 0&&(r=!1),r){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(t)&&(a[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var hF=J9;ee("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});ee("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});ee("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});ee("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});ee("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});ee("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ee("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var G6={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ee("\\char",function(e){var t=e.popToken(),n,r=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new He("\\char` missing argument");r=t.text.charCodeAt(0)}else n=10;if(n){if(r=G6[t.text],r==null||r>=n)throw new He("Invalid base-"+n+" digit "+t.text);for(var i;(i=G6[e.future().text])!=null&&i{var i=e.consumeArg().tokens;if(i.length!==1)throw new He("\\newcommand's first argument must be a macro name");var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new He("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!o&&!n)throw new He("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var l=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var u="",d=e.expandNextToken();d.text!=="]"&&d.text!=="EOF";)u+=d.text,d=e.expandNextToken();if(!u.match(/^\s*[0-9]+\s*$/))throw new He("Invalid number of arguments: "+u);l=parseInt(u),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:l}),""};ee("\\newcommand",e=>G_(e,!1,!0,!1));ee("\\renewcommand",e=>G_(e,!0,!1,!1));ee("\\providecommand",e=>G_(e,!0,!0,!0));ee("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});ee("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});ee("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),To[n],En.math[n],En.text[n]),""});ee("\\bgroup","{");ee("\\egroup","}");ee("~","\\nobreakspace");ee("\\lq","`");ee("\\rq","'");ee("\\aa","\\r a");ee("\\AA","\\r A");ee("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ee("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ee("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ee("ℬ","\\mathscr{B}");ee("ℰ","\\mathscr{E}");ee("ℱ","\\mathscr{F}");ee("ℋ","\\mathscr{H}");ee("ℐ","\\mathscr{I}");ee("ℒ","\\mathscr{L}");ee("ℳ","\\mathscr{M}");ee("ℛ","\\mathscr{R}");ee("ℭ","\\mathfrak{C}");ee("ℌ","\\mathfrak{H}");ee("ℨ","\\mathfrak{Z}");ee("\\Bbbk","\\Bbb{k}");ee("\\llap","\\mathllap{\\textrm{#1}}");ee("\\rlap","\\mathrlap{\\textrm{#1}}");ee("\\clap","\\mathclap{\\textrm{#1}}");ee("\\mathstrut","\\vphantom{(}");ee("\\underbar","\\underline{\\text{#1}}");ee("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ee("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ee("\\ne","\\neq");ee("≠","\\neq");ee("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ee("∉","\\notin");ee("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ee("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ee("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ee("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ee("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ee("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ee("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ee("⟂","\\perp");ee("‼","\\mathclose{!\\mkern-0.8mu!}");ee("∌","\\notni");ee("⌜","\\ulcorner");ee("⌝","\\urcorner");ee("⌞","\\llcorner");ee("⌟","\\lrcorner");ee("©","\\copyright");ee("®","\\textregistered");ee("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ee("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ee("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ee("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ee("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ee("⋮","\\vdots");ee("\\varGamma","\\mathit{\\Gamma}");ee("\\varDelta","\\mathit{\\Delta}");ee("\\varTheta","\\mathit{\\Theta}");ee("\\varLambda","\\mathit{\\Lambda}");ee("\\varXi","\\mathit{\\Xi}");ee("\\varPi","\\mathit{\\Pi}");ee("\\varSigma","\\mathit{\\Sigma}");ee("\\varUpsilon","\\mathit{\\Upsilon}");ee("\\varPhi","\\mathit{\\Phi}");ee("\\varPsi","\\mathit{\\Psi}");ee("\\varOmega","\\mathit{\\Omega}");ee("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ee("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ee("\\boxed","\\fbox{$\\displaystyle{#1}$}");ee("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ee("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ee("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ee("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ee("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var V6={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},fF=new Set(["bin","rel"]);ee("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in V6?t=V6[n]:(n.slice(0,4)==="\\not"||n in En.math&&fF.has(En.math[n].group))&&(t="\\dotsb"),t});var V_={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ee("\\dotso",function(e){var t=e.future().text;return t in V_?"\\ldots\\,":"\\ldots"});ee("\\dotsc",function(e){var t=e.future().text;return t in V_&&t!==","?"\\ldots\\,":"\\ldots"});ee("\\cdots",function(e){var t=e.future().text;return t in V_?"\\@cdots\\,":"\\@cdots"});ee("\\dotsb","\\cdots");ee("\\dotsm","\\cdots");ee("\\dotsi","\\!\\cdots");ee("\\dotsx","\\ldots\\,");ee("\\DOTSI","\\relax");ee("\\DOTSB","\\relax");ee("\\DOTSX","\\relax");ee("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ee("\\,","\\tmspace+{3mu}{.1667em}");ee("\\thinspace","\\,");ee("\\>","\\mskip{4mu}");ee("\\:","\\tmspace+{4mu}{.2222em}");ee("\\medspace","\\:");ee("\\;","\\tmspace+{5mu}{.2777em}");ee("\\thickspace","\\;");ee("\\!","\\tmspace-{3mu}{.1667em}");ee("\\negthinspace","\\!");ee("\\negmedspace","\\tmspace-{4mu}{.2222em}");ee("\\negthickspace","\\tmspace-{5mu}{.277em}");ee("\\enspace","\\kern.5em ");ee("\\enskip","\\hskip.5em\\relax");ee("\\quad","\\hskip1em\\relax");ee("\\qquad","\\hskip2em\\relax");ee("\\tag","\\@ifstar\\tag@literal\\tag@paren");ee("\\tag@paren","\\tag@literal{({#1})}");ee("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new He("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ee("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ee("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ee("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ee("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ee("\\newline","\\\\\\relax");ee("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var hk=Pe(Us["Main-Regular"][84][1]-.7*Us["Main-Regular"][65][1]);ee("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+hk+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ee("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+hk+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ee("\\hspace","\\@ifstar\\@hspacer\\@hspace");ee("\\@hspace","\\hskip #1\\relax");ee("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ee("\\ordinarycolon",":");ee("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ee("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ee("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ee("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ee("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ee("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ee("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ee("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ee("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ee("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ee("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ee("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ee("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ee("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ee("∷","\\dblcolon");ee("∹","\\eqcolon");ee("≔","\\coloneqq");ee("≕","\\eqqcolon");ee("⩴","\\Coloneqq");ee("\\ratio","\\vcentcolon");ee("\\coloncolon","\\dblcolon");ee("\\colonequals","\\coloneqq");ee("\\coloncolonequals","\\Coloneqq");ee("\\equalscolon","\\eqqcolon");ee("\\equalscoloncolon","\\Eqqcolon");ee("\\colonminus","\\coloneq");ee("\\coloncolonminus","\\Coloneq");ee("\\minuscolon","\\eqcolon");ee("\\minuscoloncolon","\\Eqcolon");ee("\\coloncolonapprox","\\Colonapprox");ee("\\coloncolonsim","\\Colonsim");ee("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ee("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ee("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ee("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ee("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ee("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ee("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ee("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ee("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ee("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ee("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ee("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ee("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ee("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ee("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ee("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ee("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ee("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ee("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ee("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ee("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ee("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ee("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ee("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ee("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ee("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ee("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ee("\\imath","\\html@mathml{\\@imath}{ı}");ee("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ee("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ee("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ee("⟦","\\llbracket");ee("⟧","\\rrbracket");ee("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ee("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ee("⦃","\\lBrace");ee("⦄","\\rBrace");ee("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ee("⦵","\\minuso");ee("\\darr","\\downarrow");ee("\\dArr","\\Downarrow");ee("\\Darr","\\Downarrow");ee("\\lang","\\langle");ee("\\rang","\\rangle");ee("\\uarr","\\uparrow");ee("\\uArr","\\Uparrow");ee("\\Uarr","\\Uparrow");ee("\\N","\\mathbb{N}");ee("\\R","\\mathbb{R}");ee("\\Z","\\mathbb{Z}");ee("\\alef","\\aleph");ee("\\alefsym","\\aleph");ee("\\Alpha","\\mathrm{A}");ee("\\Beta","\\mathrm{B}");ee("\\bull","\\bullet");ee("\\Chi","\\mathrm{X}");ee("\\clubs","\\clubsuit");ee("\\cnums","\\mathbb{C}");ee("\\Complex","\\mathbb{C}");ee("\\Dagger","\\ddagger");ee("\\diamonds","\\diamondsuit");ee("\\empty","\\emptyset");ee("\\Epsilon","\\mathrm{E}");ee("\\Eta","\\mathrm{H}");ee("\\exist","\\exists");ee("\\harr","\\leftrightarrow");ee("\\hArr","\\Leftrightarrow");ee("\\Harr","\\Leftrightarrow");ee("\\hearts","\\heartsuit");ee("\\image","\\Im");ee("\\infin","\\infty");ee("\\Iota","\\mathrm{I}");ee("\\isin","\\in");ee("\\Kappa","\\mathrm{K}");ee("\\larr","\\leftarrow");ee("\\lArr","\\Leftarrow");ee("\\Larr","\\Leftarrow");ee("\\lrarr","\\leftrightarrow");ee("\\lrArr","\\Leftrightarrow");ee("\\Lrarr","\\Leftrightarrow");ee("\\Mu","\\mathrm{M}");ee("\\natnums","\\mathbb{N}");ee("\\Nu","\\mathrm{N}");ee("\\Omicron","\\mathrm{O}");ee("\\plusmn","\\pm");ee("\\rarr","\\rightarrow");ee("\\rArr","\\Rightarrow");ee("\\Rarr","\\Rightarrow");ee("\\real","\\Re");ee("\\reals","\\mathbb{R}");ee("\\Reals","\\mathbb{R}");ee("\\Rho","\\mathrm{P}");ee("\\sdot","\\cdot");ee("\\sect","\\S");ee("\\spades","\\spadesuit");ee("\\sub","\\subset");ee("\\sube","\\subseteq");ee("\\supe","\\supseteq");ee("\\Tau","\\mathrm{T}");ee("\\thetasym","\\vartheta");ee("\\weierp","\\wp");ee("\\Zeta","\\mathrm{Z}");ee("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ee("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ee("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ee("\\bra","\\mathinner{\\langle{#1}|}");ee("\\ket","\\mathinner{|{#1}\\rangle}");ee("\\braket","\\mathinner{\\langle{#1}\\rangle}");ee("\\Bra","\\left\\langle#1\\right|");ee("\\Ket","\\left|#1\\right\\rangle");var fk=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get("|"),l=t.macros.get("\\|");t.macros.beginGroup();var u=f=>g=>{e&&(g.macros.set("|",o),i.length&&g.macros.set("\\|",l));var b=f;if(!f&&i.length){var k=g.future();k.text==="|"&&(g.popToken(),b=!0)}return{tokens:b?i:r,numArgs:0}};t.macros.set("|",u(!1)),i.length&&t.macros.set("\\|",u(!0));var d=t.consumeArg().tokens,m=t.expandTokens([...a,...d,...n]);return t.macros.endGroup(),{tokens:m.reverse(),numArgs:0}};ee("\\bra@ket",fk(!1));ee("\\bra@set",fk(!0));ee("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ee("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ee("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ee("\\angln","{\\angl n}");ee("\\blue","\\textcolor{##6495ed}{#1}");ee("\\orange","\\textcolor{##ffa500}{#1}");ee("\\pink","\\textcolor{##ff00af}{#1}");ee("\\red","\\textcolor{##df0030}{#1}");ee("\\green","\\textcolor{##28ae7b}{#1}");ee("\\gray","\\textcolor{gray}{#1}");ee("\\purple","\\textcolor{##9d38bd}{#1}");ee("\\blueA","\\textcolor{##ccfaff}{#1}");ee("\\blueB","\\textcolor{##80f6ff}{#1}");ee("\\blueC","\\textcolor{##63d9ea}{#1}");ee("\\blueD","\\textcolor{##11accd}{#1}");ee("\\blueE","\\textcolor{##0c7f99}{#1}");ee("\\tealA","\\textcolor{##94fff5}{#1}");ee("\\tealB","\\textcolor{##26edd5}{#1}");ee("\\tealC","\\textcolor{##01d1c1}{#1}");ee("\\tealD","\\textcolor{##01a995}{#1}");ee("\\tealE","\\textcolor{##208170}{#1}");ee("\\greenA","\\textcolor{##b6ffb0}{#1}");ee("\\greenB","\\textcolor{##8af281}{#1}");ee("\\greenC","\\textcolor{##74cf70}{#1}");ee("\\greenD","\\textcolor{##1fab54}{#1}");ee("\\greenE","\\textcolor{##0d923f}{#1}");ee("\\goldA","\\textcolor{##ffd0a9}{#1}");ee("\\goldB","\\textcolor{##ffbb71}{#1}");ee("\\goldC","\\textcolor{##ff9c39}{#1}");ee("\\goldD","\\textcolor{##e07d10}{#1}");ee("\\goldE","\\textcolor{##a75a05}{#1}");ee("\\redA","\\textcolor{##fca9a9}{#1}");ee("\\redB","\\textcolor{##ff8482}{#1}");ee("\\redC","\\textcolor{##f9685d}{#1}");ee("\\redD","\\textcolor{##e84d39}{#1}");ee("\\redE","\\textcolor{##bc2612}{#1}");ee("\\maroonA","\\textcolor{##ffbde0}{#1}");ee("\\maroonB","\\textcolor{##ff92c6}{#1}");ee("\\maroonC","\\textcolor{##ed5fa6}{#1}");ee("\\maroonD","\\textcolor{##ca337c}{#1}");ee("\\maroonE","\\textcolor{##9e034e}{#1}");ee("\\purpleA","\\textcolor{##ddd7ff}{#1}");ee("\\purpleB","\\textcolor{##c6b9fc}{#1}");ee("\\purpleC","\\textcolor{##aa87ff}{#1}");ee("\\purpleD","\\textcolor{##7854ab}{#1}");ee("\\purpleE","\\textcolor{##543b78}{#1}");ee("\\mintA","\\textcolor{##f5f9e8}{#1}");ee("\\mintB","\\textcolor{##edf2df}{#1}");ee("\\mintC","\\textcolor{##e0e5cc}{#1}");ee("\\grayA","\\textcolor{##f6f7f7}{#1}");ee("\\grayB","\\textcolor{##f0f1f2}{#1}");ee("\\grayC","\\textcolor{##e3e5e6}{#1}");ee("\\grayD","\\textcolor{##d6d8da}{#1}");ee("\\grayE","\\textcolor{##babec2}{#1}");ee("\\grayF","\\textcolor{##888d93}{#1}");ee("\\grayG","\\textcolor{##626569}{#1}");ee("\\grayH","\\textcolor{##3b3e40}{#1}");ee("\\grayI","\\textcolor{##21242c}{#1}");ee("\\kaBlue","\\textcolor{##314453}{#1}");ee("\\kaGreen","\\textcolor{##71B307}{#1}");var pk={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class pF{constructor(t,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new dF(hF,n.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new q6(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,r,i;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:i,end:r}=this.consumeArg(["]"])}else({tokens:i,start:n,end:r}=this.consumeArg());return this.pushToken(new ks("EOF",r.loc)),this.pushTokens(i),new ks("",di.range(n,r))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],r=t&&t.length>0;r||this.consumeSpaces();var i=this.future(),a,o=0,l=0;do{if(a=this.popToken(),n.push(a),a.text==="{")++o;else if(a.text==="}"){if(--o,o===-1)throw new He("Extra }",a)}else if(a.text==="EOF")throw new He("Unexpected end of input in a macro argument, expected '"+(t&&r?t[l]:"}")+"'",a);if(t&&r)if((o===0||o===1&&t[l]==="{")&&a.text===t[l]){if(++l,l===t.length){n.splice(-l,l);break}}else l=0}while(o!==0||r);return i.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:a}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new He("The length of delimiters doesn't match the number of args!");for(var r=n[0],i=0;ithis.settings.maxExpand)throw new He("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),r=n.text,i=n.noexpand?null:this._getExpansion(r);if(i==null||t&&i.unexpandable){if(t&&i==null&&r[0]==="\\"&&!this.isDefined(r))throw new He("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var a=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var l=a.length-1;l>=0;--l){var u=a[l];if(u.text==="#"){if(l===0)throw new He("Incomplete placeholder at end of macro body",u);if(u=a[--l],u.text==="#")a.splice(l+1,1);else if(/^[1-9]$/.test(u.text))a.splice(l,2,...o[+u.text-1]);else throw new He("Not a valid argument number",u)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new ks(t)]):void 0}expandTokens(t){var n=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),n.push(i)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(r=>r.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var r=this.lexer.catcodes[t];if(r!=null&&r!==13)return}var i=typeof n=="function"?n(this):n;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var o=i.replace(/##/g,"");o.includes("#"+(a+1));)++a;for(var l=new q6(i,this.settings),u=[],d=l.lex();d.text!=="EOF";)u.push(d),d=l.lex();u.reverse();var m={tokens:u,numArgs:a};return m}return i}isDefined(t){return this.macros.has(t)||To.hasOwnProperty(t)||En.math.hasOwnProperty(t)||En.text.hasOwnProperty(t)||pk.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:To.hasOwnProperty(t)&&!To[t].primitive}}var W6=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,$0=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Fg={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Y6={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Cp{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new pF(t,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new He("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new ks("}")),this.gullet.pushTokens(t);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(t,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(Cp.endOfExpression.has(i.text)||n&&i.text===n||t&&To[i.text]&&To[i.text].infix)break;var a=this.parseAtom(n);if(a){if(a.type==="internal")continue}else break;r.push(a)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(t){for(var n=-1,r,i=0;i=128)this.settings.strict&&(x9(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),o={type:"textord",mode:"text",loc:di.range(t),text:n};else return null;if(this.consume(),a)for(var m=0;m0?{type:"text",value:E}:void 0),E===!1?g.lastIndex=C+1:(k!==C&&w.push({type:"text",value:d.value.slice(k,C)}),Array.isArray(E)?w.push(...E):E&&w.push(E),k=C+y[0].length,_=!0),!g.global)break;y=g.exec(d.value)}return _?(k?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=K6(e,"(");let a=K6(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function vk(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Cl(n)||lp(n))&&(!t||n!==47)}_k.peek=WF;function HF(){this.buffer()}function $F(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function FF(){this.buffer()}function PF(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function UF(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ws(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qF(e){this.exit(e)}function GF(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ws(this.sliceSerialize(e)).toLowerCase(),n.label=t}function VF(e){this.exit(e)}function WF(){return"["}function _k(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),l(),o(),a+=i.move("]"),a}function YF(){return{enter:{gfmFootnoteCallString:HF,gfmFootnoteCall:$F,gfmFootnoteDefinitionLabelString:FF,gfmFootnoteDefinition:PF},exit:{gfmFootnoteCallString:UF,gfmFootnoteCall:qF,gfmFootnoteDefinitionLabelString:GF,gfmFootnoteDefinition:VF}}}function XF(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:_k},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,o){const l=a.createTracker(o);let u=l.move("[^");const d=a.enter("footnoteDefinition"),m=a.enter("label");return u+=l.move(a.safe(a.associationId(r),{before:u,after:"]"})),m(),u+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),u+=l.move((t?` -`:" ")+a.indentLines(a.containerFlow(r,l.current()),t?xk:KF))),d(),u}}function KF(e,t,n){return t===0?e:xk(e,t,n)}function xk(e,t,n){return(n?"":" ")+e}const ZF=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];yk.peek=nP;function QF(){return{canContainEols:["delete"],enter:{strikethrough:eP},exit:{strikethrough:tP}}}function JF(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ZF}],handlers:{delete:yk}}}function eP(e){this.enter({type:"delete",children:[]},e)}function tP(e){this.exit(e)}function yk(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function nP(){return"~"}function rP(e){return e.length}function iP(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||rP,a=[],o=[],l=[],u=[];let d=0,m=-1;for(;++md&&(d=e[m].length);++_u[_])&&(u[_]=y)}S.push(w)}o[m]=S,l[m]=x}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fu[f]&&(u[f]=w),b[f]=w),g[f]=y}o.splice(1,0,g),l.splice(1,0,b),m=-1;const k=[];for(;++m "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),oP);return i(),o}function oP(e,t,n){return">"+(n?"":" ")+e}function lP(e,t){return Q6(e,t.inConstruct,!0)&&!Q6(e,t.notInConstruct,!1)}function Q6(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ro&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function cP(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 uP(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 dP(e,t,n,r){const i=uP(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(cP(e,n)){const f=n.enter("codeIndented"),g=n.indentLines(a,hP);return f(),g}const l=n.createTracker(r),u=i.repeat(Math.max(wk(a,i)+1,3)),d=n.enter("codeFenced");let m=l.move(u);if(e.lang){const f=n.enter(`codeFencedLang${o}`);m+=l.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);m+=l.move(" "),m+=l.move(n.safe(e.meta,{before:m,after:` -`,encode:["`"],...l.current()})),f()}return m+=l.move(` -`),a&&(m+=l.move(a+` -`)),m+=l.move(u),d(),m}function hP(e,t,n){return(n?"":" ")+e}function X_(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 fP(e,t,n,r){const i=X_(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("[");return d+=u.move(n.safe(n.associationId(e),{before:d,after:"]",...u.current()})),d+=u.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(l=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":` -`,...u.current()}))),l(),e.title&&(l=n.enter(`title${a}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),l()),o(),d}function pP(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 Nd(e){return"&#x"+e.toString(16).toUpperCase()+";"}function $f(e,t,n){const r=qc(e),i=qc(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Sk.peek=mP;function Sk(e,t,n,r){const i=pP(n),a=n.enter("emphasis"),o=n.createTracker(r),l=o.move(i);let u=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const d=u.charCodeAt(0),m=$f(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(u=Nd(d)+u.slice(1));const f=u.charCodeAt(u.length-1),g=$f(r.after.charCodeAt(0),f,i);g.inside&&(u=u.slice(0,-1)+Nd(f));const b=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+u+b}function mP(e,t,n){return n.options.emphasis||"*"}function gP(e,t){let n=!1;return y_(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Lb}),!!((!e.depth||e.depth<3)&&T_(e)&&(t.options.setext||n))}function bP(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(gP(e,n)){const m=n.enter("headingSetext"),f=n.enter("phrasing"),g=n.containerPhrasing(e,{...a.current(),before:` -`,after:` -`});return f(),m(),g+` -`+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(` -`))+1))}const o="#".repeat(i),l=n.enter("headingAtx"),u=n.enter("phrasing");a.move(o+" ");let d=n.containerPhrasing(e,{before:"# ",after:` -`,...a.current()});return/^[\t ]/.test(d)&&(d=Nd(d.charCodeAt(0))+d.slice(1)),d=d?o+" "+d:o,n.options.closeAtx&&(d+=" "+o),u(),l(),d}kk.peek=vP;function kk(e){return e.value||""}function vP(){return"<"}Ck.peek=_P;function Ck(e,t,n,r){const i=X_(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("![");return d+=u.move(n.safe(e.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(l=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),l(),e.title&&(l=n.enter(`title${a}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),l()),d+=u.move(")"),o(),d}function _P(){return"!"}Ek.peek=xP;function Ek(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");const d=n.safe(e.alt,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),o();const m=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return o(),n.stack=m,a(),i==="full"||!d||d!==f?u+=l.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function xP(){return"!"}Ak.peek=yP;function Ak(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a\u007F]/.test(e.url))}Nk.peek=wP;function Nk(e,t,n,r){const i=X_(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,u;if(Tk(e,n)){const m=n.stack;n.stack=[],l=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),l(),n.stack=m,f}l=n.enter("link"),u=n.enter("label");let d=o.move("[");return d+=o.move(n.containerPhrasing(e,{before:d,after:"](",...o.current()})),d+=o.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=o.move("<"),d+=o.move(n.safe(e.url,{before:d,after:">",...o.current()})),d+=o.move(">")):(u=n.enter("destinationRaw"),d+=o.move(n.safe(e.url,{before:d,after:e.title?" ":")",...o.current()}))),u(),e.title&&(u=n.enter(`title${a}`),d+=o.move(" "+i),d+=o.move(n.safe(e.title,{before:d,after:i,...o.current()})),d+=o.move(i),u()),d+=o.move(")"),l(),d}function wP(e,t,n){return Tk(e,n)?"<":"["}jk.peek=SP;function jk(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");const d=n.containerPhrasing(e,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),o();const m=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return o(),n.stack=m,a(),i==="full"||!d||d!==f?u+=l.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function SP(){return"["}function K_(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 kP(e){const t=K_(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 CP(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 Mk(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 EP(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?CP(n):K_(n);const l=e.ordered?o==="."?")":".":kP(n);let u=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&m&&(!m.children||!m.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&&(u=!0),Mk(n)===o&&m){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(a+" ".repeat(o-a.length)),l.shift(o);const u=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,l.current()),m);return u(),d;function m(f,g,b){return g?(b?"":" ".repeat(o))+f:(b?a:a+" ".repeat(o-a.length))+f}}function NP(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const jP=oh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function MP(e,t,n,r){return(e.children.some(function(o){return jP(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function RP(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Rk.peek=DP;function Rk(e,t,n,r){const i=RP(n),a=n.enter("strong"),o=n.createTracker(r),l=o.move(i+i);let u=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const d=u.charCodeAt(0),m=$f(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(u=Nd(d)+u.slice(1));const f=u.charCodeAt(u.length-1),g=$f(r.after.charCodeAt(0),f,i);g.inside&&(u=u.slice(0,-1)+Nd(f));const b=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+u+b}function DP(e,t,n){return n.options.strong||"*"}function LP(e,t,n,r){return n.safe(e.value,r)}function OP(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 IP(e,t,n){const r=(Mk(n)+(n.options.ruleSpaces?" ":"")).repeat(OP(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Dk={blockquote:aP,break:J6,code:dP,definition:fP,emphasis:Sk,hardBreak:J6,heading:bP,html:kk,image:Ck,imageReference:Ek,inlineCode:Ak,link:Nk,linkReference:jk,list:EP,listItem:TP,paragraph:NP,root:MP,strong:Rk,text:LP,thematicBreak:IP};function zP(){return{enter:{table:BP,tableData:ew,tableHeader:ew,tableRow:$P},exit:{codeText:FP,table:HP,tableData:Gg,tableHeader:Gg,tableRow:Gg}}}function BP(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 HP(e){this.exit(e),this.data.inTable=void 0}function $P(e){this.enter({type:"tableRow",children:[]},e)}function Gg(e){this.exit(e)}function ew(e){this.enter({type:"tableCell",children:[]},e)}function FP(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,PP));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function PP(e,t){return t==="|"?t:e}function UP(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=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:g,table:o,tableCell:u,tableRow:l}};function o(b,k,S,x){return d(m(b,S,x),b.align)}function l(b,k,S,x){const _=f(b,S,x),w=d([_]);return w.slice(0,w.indexOf(` -`))}function u(b,k,S,x){const _=S.enter("tableCell"),w=S.enter("phrasing"),y=S.containerPhrasing(b,{...x,before:a,after:a});return w(),_(),y}function d(b,k){return iP(b,{align:k,alignDelimiters:r,padding:n,stringLength:i})}function m(b,k,S){const x=b.children;let _=-1;const w=[],y=k.enter("table");for(;++_0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const oU={tokenize:mU,partial:!0};function lU(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:hU,continuation:{tokenize:fU},exit:pU}},text:{91:{name:"gfmFootnoteCall",tokenize:dU},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:cU,resolveTo:uU}}}}function cU(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){o=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!o||!o._balanced)return n(u);const d=ws(r.sliceSerialize({start:o.end,end:r.now()}));return d.codePointAt(0)!==94||!a.includes(d.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function uU(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)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function dU(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,o;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(f){if(a>999||f===93&&!o||f===null||f===91||hn(f))return n(f);if(f===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return i.includes(ws(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return hn(f)||(o=!0),a++,e.consume(f),f===92?m:d}function m(f){return f===91||f===92||f===93?(e.consume(f),a++,d):d(f)}}function hU(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0,l;return u;function u(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(k)}function m(k){if(o>999||k===93&&!l||k===null||k===91||hn(k))return n(k);if(k===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return a=ws(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return hn(k)||(l=!0),o++,e.consume(k),k===92?f:m}function f(k){return k===91||k===92||k===93?(e.consume(k),o++,m):m(k)}function g(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),i.includes(a)||i.push(a),Mt(e,b,"gfmFootnoteDefinitionWhitespace")):n(k)}function b(k){return t(k)}}function fU(e,t,n){return e.check(uh,t,e.attempt(oU,t,n))}function pU(e){e.exit("gfmFootnoteDefinition")}function mU(e,t,n){const r=this;return Mt(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function gU(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,l){let u=-1;for(;++u1?u(k):(o.consume(k),f++,b);if(f<2&&!n)return u(k);const x=o.exit("strikethroughSequenceTemporary"),_=qc(k);return x._open=!_||_===2&&!!S,x._close=!S||S===2&&!!_,l(k)}}}class bU{constructor(){this.map=[]}add(t,n,r){vU(this,t,n,r)}consume(t){if(this.map.sort(function(a,o){return a[0]-o[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 i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function vU(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const G=r.events[$][1].type;if(G==="lineEnding"||G==="linePrefix")$--;else break}const F=$>-1?r.events[$][1].type:null,U=F==="tableHead"||F==="tableRow"?E:u;return U===E&&r.parser.lazy[r.now().line]?n(I):U(I)}function u(I){return e.enter("tableHead"),e.enter("tableRow"),d(I)}function d(I){return I===124||(o=!0,a+=1),m(I)}function m(I){return I===null?n(I):at(I)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),b):n(I):Lt(I)?Mt(e,m,"whitespace")(I):(a+=1,o&&(o=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),o=!0,m):(e.enter("data"),f(I)))}function f(I){return I===null||I===124||hn(I)?(e.exit("data"),m(I)):(e.consume(I),I===92?g:f)}function g(I){return I===92||I===124?(e.consume(I),f):f(I)}function b(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),o=!1,Lt(I)?Mt(e,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):k(I))}function k(I){return I===45||I===58?x(I):I===124?(o=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),S):N(I)}function S(I){return Lt(I)?Mt(e,x,"whitespace")(I):x(I)}function x(I){return I===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),_):I===45?(a+=1,_(I)):I===null||at(I)?C(I):N(I)}function _(I){return I===45?(e.enter("tableDelimiterFiller"),w(I)):N(I)}function w(I){return I===45?(e.consume(I),w):I===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(I))}function y(I){return Lt(I)?Mt(e,C,"whitespace")(I):C(I)}function C(I){return I===124?k(I):I===null||at(I)?!o||i!==a?N(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):N(I)}function N(I){return n(I)}function E(I){return e.enter("tableRow"),j(I)}function j(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),j):I===null||at(I)?(e.exit("tableRow"),t(I)):Lt(I)?Mt(e,j,"whitespace")(I):(e.enter("data"),T(I))}function T(I){return I===null||I===124||hn(I)?(e.exit("data"),j(I)):(e.consume(I),I===92?D:T)}function D(I){return I===92||I===124?(e.consume(I),T):T(I)}}function wU(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,u=0,d,m,f;const g=new bU;for(;++nn[2]+1){const k=n[2]+1,S=n[3]-n[2]-1;e.add(k,S,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(a.end=Object.assign({},kc(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function nw(e,t,n,r,i){const a=[],o=kc(t.events,n);i&&(i.end=Object.assign({},o),a.push(["exit",i,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function kc(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const SU={name:"tasklistCheck",tokenize:CU};function kU(){return{text:{91:SU}}}function CU(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),a)}function a(u){return hn(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),o):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),o):n(u)}function o(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(u)}function l(u){return at(u)?t(u):Lt(u)?e.check({tokenize:EU},t,n)(u):n(u)}}function EU(e,t,n){return Mt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function AU(e){return WS([QP(),lU(),gU(e),xU(),kU()])}const TU={};function Pk(e){const t=this,n=e||TU,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(AU(n)),a.push(YP()),o.push(XP(n))}function NU(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:o,mathTextData:l}};function e(u){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},u)}function t(){this.buffer()}function n(){const u=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=u}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(u){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),m=this.stack[this.stack.length-1];m.type,this.exit(u),m.value=d;const f=m.data.hChildren[0];f.type,f.tagName,f.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function a(u){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},u),this.buffer()}function o(u){const d=this.resume(),m=this.stack[this.stack.length-1];m.type,this.exit(u),m.value=d,m.data.hChildren.push({type:"text",value:d})}function l(u){this.config.enter.data.call(this,u),this.config.exit.data.call(this,u)}}function jU(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` -`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(a,o,l,u){const d=a.value||"",m=l.createTracker(u),f="$".repeat(Math.max(wk(d,"$")+1,2)),g=l.enter("mathFlow");let b=m.move(f);if(a.meta){const k=l.enter("mathFlowMeta");b+=m.move(l.safe(a.meta,{after:` -`,before:b,encode:["$"],...m.current()})),k()}return b+=m.move(` -`),d&&(b+=m.move(d+` -`)),b+=m.move(f),g(),b}function r(a,o,l){let u=a.value||"",d=1;for(t||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(u);)d++;const m="$".repeat(d);/[^ \r\n]/.test(u)&&(/^[ \r\n]/.test(u)&&/[ \r\n]$/.test(u)||/^\$|\$$/.test(u))&&(u=" "+u+" ");let f=-1;for(;++f]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}fh.displayName="c";fh.aliases=[];function fh(e){e.register(ea),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}Ep.displayName="cpp";Ep.aliases=[];function Ep(e){e.register(fh),(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(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return n.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//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+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//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)}J_.displayName="arduino";J_.aliases=["ino"];function J_(e){e.register(Ep),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}e2.displayName="bash";e2.aliases=["sh","shell"];function e2(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},i={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:i},{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:i},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:i.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:i.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 a=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=i.variable[1].inside,l=0;l>/g,function(V,W){return"(?:"+H[+W]+")"})}function r(O,H,V){return RegExp(n(O,H),"")}function i(O,H){for(var V=0;V>/g,function(){return"(?:"+O+")"});return O.replace(/<>/g,"[^\\s\\S]")}var a={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 o(O){return"\\b(?:"+O.trim().replace(/ /g,"|")+")\\b"}var l=o(a.typeDeclaration),u=RegExp(o(a.type+" "+a.typeDeclaration+" "+a.contextual+" "+a.other)),d=o(a.typeDeclaration+" "+a.contextual+" "+a.other),m=o(a.type+" "+a.typeDeclaration+" "+a.other),f=i(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),g=i(/\((?:[^()]|<>)*\)/.source,2),b=/@?\b[A-Za-z_]\w*\b/.source,k=n(/<<0>>(?:\s*<<1>>)?/.source,[b,f]),S=n(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,k]),x=/\[\s*(?:,\s*)*\]/.source,_=n(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[S,x]),w=n(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[f,g,x]),y=n(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=n(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,S,x]),N={keyword:u,punctuation:/[<>()?,.:[\]]/},E=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,j=/"(?:\\.|[^\\"\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,[j]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[S]),lookbehind:!0,inside:N},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[b,C]),lookbehind:!0,inside:N},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[b]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[l,k]),lookbehind:!0,inside:N},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[S]),lookbehind:!0,inside:N},{pattern:r(/(\bwhere\s+)<<0>>/.source,[b]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[_]),lookbehind:!0,inside:N},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,m,b]),inside:N}],keyword:u,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,[b]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[b]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[g]),lookbehind:!0,alias:"class-name",inside:N},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,S]),inside:N,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:N,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[b,f]),inside:{function:r(/^<<0>>/.source,[b]),generic:{pattern:RegExp(f),alias:"class-name",inside:N}}},"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,[l,k,b,C,u.source,g,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[k,g]),lookbehind:!0,greedy:!0,inside:t.languages.csharp},keyword:u,"class-name":{pattern:RegExp(C),greedy:!0,inside:N},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 D=j+"|"+E,I=n(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[D]),$=i(n(/[^"'/()]|<<0>>|\(<>*\)/.source,[I]),2),F=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,U=n(/<<0>>(?:\s*\(<<1>>*\))?/.source,[S,$]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[F,U]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[F]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[$]),inside:t.languages.csharp},"class-name":{pattern:RegExp(S),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var G=/:[^}\r\n]+/.source,X=i(n(/[^"'/()]|<<0>>|\(<>*\)/.source,[I]),2),Y=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,G]),Z=i(n(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[D]),2),Q=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Z,G]);function z(O,H){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[O]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[H,G]),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,[Y]),lookbehind:!0,greedy:!0,inside:z(Y,X)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[Q]),lookbehind:!0,greedy:!0,inside:z(Q,Z)}],char:{pattern:RegExp(E),greedy:!0}}),t.languages.dotnet=t.languages.cs=t.languages.csharp})(e)}ph.displayName="markup";ph.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function ph(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\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://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 i={};i["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},i.cdata=/^$/i;var a={"included-cdata":{pattern://i,inside:i}};a["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var o={};o[n]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:a},e.languages.insertBefore("markup","cdata",o)}}),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}lu.displayName="css";lu.aliases=[];function lu(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)}n2.displayName="diff";n2.aliases=[];function n2(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 i=n[r],a=[];/^\w+$/.test(r)||a.push(/\w+/.exec(r)[0]),r==="diff"&&a.push("bold"),t.languages.diff[r]={pattern:RegExp("^(?:["+i+`].*(?:\r -?| -|(?![\\s\\S])))+`,"m"),alias:a,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)}r2.displayName="go";r2.aliases=[];function r2(e){e.register(ea),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"]}i2.displayName="ini";i2.aliases=[];function i2(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:/=/}}s2.displayName="java";s2.aliases=[];function s2(e){e.register(ea),(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,i={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":[i,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:i.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:i.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":i,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:i.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:i.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+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}a2.displayName="regex";a2.aliases=[];function a2(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]|.)/,i={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},o="(?:[^\\\\-]|"+r.source+")",l=RegExp(o+"-"+o),u={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:l,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":a,escape:r}},"special-escape":n,"char-set":i,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":u}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{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}o2.displayName="json";o2.aliases=["webmanifest"];function o2(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}l2.displayName="kotlin";l2.aliases=["kt","kts"];function l2(e){e.register(ea),(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)}c2.displayName="less";c2.aliases=[];function c2(e){e.register(lu),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"}})}u2.displayName="lua";u2.aliases=[];function u2(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:/[\[\](){},;]|\.+|:+/}}d2.displayName="makefile";d2.aliases=[];function d2(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:/[:;(){}]/}}h2.displayName="yaml";h2.aliases=["yml"];function h2(e){(function(t){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,i="(?:"+r.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+r.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function l(u,d){d=(d||"").replace(/m/g,"")+"m";var m=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return i}).replace(/<>/g,function(){return u});return RegExp(m,d)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return i})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return i}).replace(/<>/g,function(){return"(?:"+a+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:l(/\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:l(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:l(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:l(o),lookbehind:!0,greedy:!0},number:{pattern:l(/[+-]?(?: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)}f2.displayName="markdown";f2.aliases=["md"];function f2(e){e.register(ph),(function(t){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(l){return l=l.replace(//g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+l+")")}var i=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return i}),o=/\|?[ \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("^"+a+o+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+o+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(i),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(i),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__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\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(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.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(l){["url","bold","italic","strike","code-snippet"].forEach(function(u){l!==u&&(t.languages.markdown[l].inside.content.inside[u]=t.languages.markdown[u])})}),t.hooks.add("after-tokenize",function(l){if(l.language!=="markdown"&&l.language!=="md")return;function u(d){if(!(!d||typeof d=="string"))for(var m=0,f=d.length;m]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}m2.displayName="perl";m2.aliases=[];function m2(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)}Tp.displayName="markup-templating";Tp.aliases=[];function Tp(e){e.register(ph),(function(t){function n(r,i){return"___"+r.toUpperCase()+i+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,i,a,o){if(r.language===i){var l=r.tokenStack=[];r.code=r.code.replace(a,function(u){if(typeof o=="function"&&!o(u))return u;for(var d=l.length,m;r.code.indexOf(m=n(i,d))!==-1;)++d;return l[d]=u,m}),r.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(r,i){if(r.language!==i||!r.tokenStack)return;r.grammar=t.languages[i];var a=0,o=Object.keys(r.tokenStack);function l(u){for(var d=0;d=o.length);d++){var m=u[d];if(typeof m=="string"||m.content&&typeof m.content=="string"){var f=o[a],g=r.tokenStack[f],b=typeof m=="string"?m:m.content,k=n(i,f),S=b.indexOf(k);if(S>-1){++a;var x=b.substring(0,S),_=new t.Token(i,t.tokenize(g,r.grammar),"language-"+i,g),w=b.substring(S+k.length),y=[];x&&y.push.apply(y,l([x])),y.push(_),w&&y.push.apply(y,l([w])),typeof m=="string"?u.splice.apply(u,[d,1].concat(y)):m.content=y}}else m.content&&l(m.content)}return u}l(r.tokens)}}})})(e)}g2.displayName="php";g2.aliases=[];function g2(e){e.register(Tp),(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*\()/],i=/\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,a=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,o=/[{}\[\](),:;]/;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:i,operator:a,punctuation:o};var l={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php},u=[{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:l}},{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:l}}];t.languages.insertBefore("php","variable",{string:u,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:n,string:u,"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:i,operator:a,punctuation:o}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(d){if(/<\?/.test(d.code)){var m=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(d,"php",m)}}),t.hooks.add("after-tokenize",function(d){t.languages["markup-templating"].tokenizePlaceholders(d,"php")})})(e)}b2.displayName="python";b2.aliases=["py"];function b2(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}v2.displayName="r";v2.aliases=[];function v2(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:/[(){}\[\],;]/}}_2.displayName="ruby";_2.aliases=["rb"];function _2(e){e.register(ea),(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("|")+")",i=/(?:"(?:\\.|[^"\\\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+i),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+i+/(?=:(?!:))/.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)}x2.displayName="rust";x2.aliases=[];function x2(e){(function(t){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)n=n.replace(//g,function(){return n});n=n.replace(//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)}y2.displayName="sass";y2.aliases=[];function y2(e){e.register(lu),(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)}w2.displayName="scss";w2.aliases=[];function w2(e){e.register(lu),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}S2.displayName="sql";S2.aliases=[];function S2(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:/[;[\]()`,.]/}}k2.displayName="swift";k2.aliases=[];function k2(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})}C2.displayName="typescript";C2.aliases=["ts"];function C2(e){e.register(Ap),(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)}Np.displayName="basic";Np.aliases=[];function Np(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:/[,;:()]/}}E2.displayName="vbnet";E2.aliases=[];function E2(e){e.register(Np),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 FU=["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"],iw={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 qk(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}function PU(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function UU(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function sw(e){return UU(e)||qk(e)}const qU=["","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 GU(e,t){const n={},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,i=[];let a=0,o=-1,l="",u,d;n.position&&("start"in n.position||"indent"in n.position?(d=n.position.indent,u=n.position.start):u=n.position);let m=(u?u.line:0)||1,f=(u?u.column:0)||1,g=k(),b;for(a--;++a<=e.length;)if(b===10&&(f=(d?d[o]:0)||1),b=e.charCodeAt(a),b===38){const _=e.charCodeAt(a+1);if(_===9||_===10||_===12||_===32||_===38||_===60||Number.isNaN(_)||r&&_===r){l+=String.fromCharCode(b),f++;continue}const w=a+1;let y=w,C=w,N;if(_===35){C=++y;const U=e.charCodeAt(C);U===88||U===120?(N="hexadecimal",C=++y):N="decimal"}else N="named";let E="",j="",T="";const D=N==="named"?sw:N==="decimal"?qk:PU;for(C--;++C<=e.length;){const U=e.charCodeAt(C);if(!D(U))break;T+=String.fromCharCode(U),N==="named"&&FU.includes(T)&&(E=T,j=Ed(T))}let I=e.charCodeAt(C)===59;if(I){C++;const U=N==="named"?Ed(T):!1;U&&(E=T,j=U)}let $=1+C-w,F="";if(!(!I&&n.nonTerminated===!1))if(!T)N!=="named"&&S(4,$);else if(N==="named"){if(I&&!j)S(5,1);else if(E!==T&&(C=y+E.length,$=1+C-y,I=!1),!I){const U=E?1:3;if(n.attribute){const G=e.charCodeAt(C);G===61?(S(U,$),j=""):sw(G)?j="":S(U,$)}else S(U,$)}F=j}else{I||S(2,$);let U=Number.parseInt(T,N==="hexadecimal"?16:10);if(VU(U))S(7,$),F="�";else if(U in iw)S(6,$),F=iw[U];else{let G="";WU(U)&&S(6,$),U>65535&&(U-=65536,G+=String.fromCharCode(U>>>10|55296),U=56320|U&1023),F=G+String.fromCharCode(U)}}if(F){x(),g=k(),a=C-1,f+=C-w+1,i.push(F);const U=k();U.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,F,{start:g,end:U},e.slice(w-1,C)),g=U}else T=e.slice(w-1,C),l+=T,f+=T.length,a=C-1}else b===10&&(m++,o++,f=0),Number.isNaN(b)?x():(l+=String.fromCharCode(b),f++);return i.join("");function k(){return{line:m,column:f,offset:a+((u?u.offset:0)||0)}}function S(_,w){let y;n.warning&&(y=k(),y.column+=w,y.offset+=w,n.warning.call(n.warningContext||void 0,qU[_],y,_))}function x(){l&&(i.push(l),n.text&&n.text.call(n.textContext||void 0,l,{start:g,end:k()}),l="")}}function VU(e){return e>=55296&&e<=57343||e>1114111}function WU(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 YU=0,P0={},fr={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++YU}),e.__id},clone:function e(t,n){n=n||{};var r,i;switch(fr.util.type(t)){case"Object":if(i=fr.util.objId(t),n[i])return n[i];r={},n[i]=r;for(var a in t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case"Array":return i=fr.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(o,l){r[l]=e(o,n)}),r);default:return t}}},languages:{plain:P0,plaintext:P0,text:P0,txt:P0,extend:function(e,t){var n=fr.util.clone(fr.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||fr.languages;var i=r[e],a={};for(var o in i)if(i.hasOwnProperty(o)){if(o==t)for(var l in n)n.hasOwnProperty(l)&&(a[l]=n[l]);n.hasOwnProperty(o)||(a[o]=i[o])}var u=r[e];return r[e]=a,fr.languages.DFS(fr.languages,function(d,m){m===u&&d!=e&&(this[d]=a)}),a},DFS:function e(t,n,r,i){i=i||{};var a=fr.util.objId;for(var o in t)if(t.hasOwnProperty(o)){n.call(t,o,t[o],r||o);var l=t[o],u=fr.util.type(l);u==="Object"&&!i[a(l)]?(i[a(l)]=!0,e(l,n,null,i)):u==="Array"&&!i[a(l)]&&(i[a(l)]=!0,e(l,n,o,i))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(fr.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=fr.tokenize(r.code,r.grammar),fr.hooks.run("after-tokenize",r),gd.stringify(fr.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 i=new XU;return pf(i,i.head,e),Gk(e,i,t,i.head,0),ZU(i)},hooks:{all:{},add:function(e,t){var n=fr.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=fr.hooks.all[e];if(!(!n||!n.length))for(var r=0,i;i=n[r++];)i(t)}},Token:gd};function gd(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||"").length|0}function aw(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function Gk(e,t,n,r,i,a){for(var o in n)if(!(!n.hasOwnProperty(o)||!n[o])){var l=n[o];l=Array.isArray(l)?l:[l];for(var u=0;u=a.reach);_+=x.value.length,x=x.next){var w=x.value;if(t.length>e.length)return;if(!(w instanceof gd)){var y=1,C;if(g){if(C=aw(S,_,e,f),!C||C.index>=e.length)break;var T=C.index,N=C.index+C[0].length,E=_;for(E+=x.value.length;T>=E;)x=x.next,E+=x.value.length;if(E-=x.value.length,_=E,x.value instanceof gd)continue;for(var j=x;j!==t.tail&&(Ea.reach&&(a.reach=F);var U=x.prev;I&&(U=pf(t,U,I),_+=I.length),KU(t,U,y);var G=new gd(o,m?fr.tokenize(D,m):D,b,D);if(x=pf(t,U,G),$&&pf(t,x,$),y>1){var X={cause:o+","+u,reach:F};Gk(e,t,n,x.prev,_,X),a&&X.reach>a.reach&&(a.reach=X.reach)}}}}}}function XU(){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 pf(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function KU(e,t,n){for(var r=t.next,i=0;in)return e;try{return dt.highlight(e,t).children.map(Yk)}catch{return e}}const ow=/^\d+(?:,\d{3})*(?:\.\d+)?(?:\s*[–—-]\s*\$?\d+(?:,\d{3})*(?:\.\d+)?)?(?:\/[A-Za-z][A-Za-z0-9-]*)?/;function Yc(e,t,n){let r=t;for(;e[r]===n;)r+=1;return r-t}function jd(e,t){let n=0;for(let r=t-1;r>=0&&e[r]==="\\";r-=1)n+=1;return n%2===1}function pv(e){var o;let t=!1,n=0,r=0,i=0;for(;r[ \t]?/.exec(e.slice(r));if(l){r+=l[0].length,i+=1;continue}const u=/^ {0,3}(?:[-+*]|\d+[.)])[ \t]+/.exec(e.slice(r));if(!u)break;r+=u[0].length,n+=u[0].length,t=!0}const a=((o=/^[ \t]*/.exec(e.slice(r)))==null?void 0:o[0].length)??0;return{hasListMarker:t,indentation:a,listIndent:n,offset:r+a,quoteDepth:i}}function sq(e,t){const n=e[t];if(n!=="`"&&n!=="~"||jd(e,t)||Yc(e,t,n)<3)return!1;const r=e.lastIndexOf(` -`,t-1)+1,i=e.indexOf(` -`,t),a=e.slice(r,i===-1?e.length:i),o=pv(a);return o.indentation<=3&&r+o.offset===t}function aq(e,t){const n=e[t],r=Yc(e,t,n),i=e.lastIndexOf(` -`,t-1)+1,a=e.indexOf(` -`,t),o=pv(e.slice(i,a===-1?e.length:a));let l=e.indexOf(` -`,t+r);if(l===-1)return e.length;for(l+=1;l=o.listIndent&&f.indentation<=o.listIndent+3&&b>=r&&/^[ \t\r]*$/.test(e.slice(g+b,d)))return u===-1?e.length:u+1;if(u===-1)return e.length;l=u+1}return e.length}function oq(e,t,n){const r=Yc(e,t,"`");let i=t+r;for(;i")return i+1}return n?e.length:null}function cq(e){const t=[];for(let n=0;n|()[\]-]+$/.test(n)?/^[eE][+-]?\d+$/.test(n)||/[+*/=^_{}\\<>|()]/.test(n)?!0:/^[A-Za-z][A-Za-z0-9]*$/.test(n):!1:!0}function dq(e,{predictMath:t=!1}={}){const n=cq(e),r=new Set,i=new Set;for(let d=0;d`$$${i}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,i)=>`$$${i}$$`);return t.predictMath&&(n=n.replace(/\\\[([\s\S]*)$/,(r,i)=>`$$${i}`).replace(/\\\(([\s\S]*)$/,(r,i)=>`$$${i}`)),dq(n,t)}function Xk(e,t={}){let n="",r=0,i=0;for(;i{var a;(a=navigator.clipboard)==null||a.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return h.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[h.jsx("button",{className:"md-code-copy absolute top-1.5 right-1.5 inline-flex items-center justify-center w-6.5 h-6.5 text-muted bg-background border border-border-variant rounded-sm opacity-0 transition-[opacity,color] duration-120 ease-standard [&:hover]:text-text [&:hover]:border-muted",title:"Copy","aria-label":"Copy code",onClick:i,children:n?h.jsx(Di,{size:13}):h.jsx(t_,{size:13})}),h.jsx("pre",{children:h.jsx("code",{children:A2(e,t,hq)})})]})}function pq(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 cw(e,t,n){let r=t.line,i=t.column;for(let a=0;a]*?)\/?>/gi,r=[];let i=0,a=!1;for(const o of t.matchAll(n)){const l=(o[1]??"").toLowerCase(),u=pq(o[2]??"");if(!u[l==="run"?"id":"path"])continue;a=!0,o.index>i&&r.push({type:"text",value:t.slice(i,o.index),position:Vg(e,i,o.index)});const m=o.index+o[0].length;r.push({children:[],data:{hName:l==="run"?"run-mention":"file-mention",hProperties:u},position:Vg(e,o.index,m),type:l==="run"?"runMention":"fileMention"}),i=m}return a?(iKk(e)}function gq(){return e=>{const t=n=>{var r;for(const i of["href","src"])n.properties&&Object.hasOwn(n.properties,i)&&(n.properties[i]=d9(String(n.properties[i]||"")));(r=n.children)==null||r.forEach(t)};t(e)}}function dw({path:e,lines:t,exp:n,onOpenFile:r}){const i=e.split("/").pop()||e,a=t&&Number.parseInt(t,10)||void 0,o=a!=null?`${i}:${a}`:i;return h.jsxs("button",{className:"file-chip",title:`Open ${e}`,onClick:()=>r==null?void 0:r(e,a,n),disabled:!r,children:[h.jsx(J8,{size:12}),h.jsx("span",{className:"file-chip-label",children:o})]})}function bq({id:e,label:t,onOpenRun:n}){return h.jsxs("button",{className:"file-chip run-chip",title:`Open logs for run ${e}`,onClick:()=>n==null?void 0:n(e),disabled:!n,children:[h.jsx(i_,{size:12}),h.jsx("span",{className:"file-chip-label",children:t||"logs"})]})}const Zk={singleDollarTextMath:!0},vq=S_().use(j_).use(Pk).use(Uk,Zk).use(mq).use(Df).use(gq).use(bk);function _q(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const Qk={code:({node:e,className:t,children:n,...r})=>{const i=t??"",a=/language-(\w+)/.exec(i),o=String(n??"").replace(/\n$/,"");if(!(a!=null||o.includes(` -`)))return h.jsx("code",{className:i,...r,children:n});const u=a?hv(a[1]):null;return h.jsx(fq,{code:o,lang:u})},pre:({children:e})=>h.jsx(h.Fragment,{children:e})},La=R.memo(function({text:t,onOpenFile:n,onOpenRun:r,predict:i=!1}){const a=R.useMemo(()=>({"file-mention":o=>h.jsx(dw,{path:o.path,lines:o.lines,exp:o.exp,onOpenFile:n}),"run-mention":o=>h.jsx(bq,{id:o.id,label:o.label,onOpenRun:r}),a:({node:o,href:l,children:u,...d})=>l&&_q(l)&&n?h.jsx(dw,{path:decodeURI(l),onOpenFile:n}):h.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",...d,children:u}),...Qk}),[n,r]);return h.jsx("div",{"data-streaming":i||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-[color-mix(in_oklab,_var(--border)_50%,_transparent)] [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-[0.9em] [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-[1.05em] [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-[0.9em] [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-[1.05em] [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-[1.05em] [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-[1.05em] [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-[1.05em] [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:pl-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:pl-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-md [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-left [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-left [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pr-0 [&_blockquote]:pb-0.5 [&_blockquote]:pl-2.5 [&_blockquote]:border-l-[3px] [&_blockquote]:border-l-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text",children:h.jsx(BB,{content:Xk(t,{predictMath:i}),processor:vq,components:a,predict:i})})}),hw=["prompt-actions flex flex-wrap [&_.btn-primary]:inline-flex","[&_.btn-primary]:items-center [&_.btn-primary]:gap-1.5 [&_.btn-primary]:py-1.5 [&_.btn-primary]:px-[13px]","[&_.btn-primary]:font-[inherit] [&_.btn-primary]:text-sm","[&_.btn-primary]:font-semibold [&_.btn-primary]:rounded-sm","[&_.btn-primary]:cursor-pointer [&_.btn-primary]:transition-[background,border-color] [&_.btn-primary]:duration-80 [&_.btn-primary]:ease-standard","[&_.btn-ghost]:inline-flex [&_.btn-ghost]:items-center [&_.btn-ghost]:gap-1.5","[&_.btn-ghost]:py-1.5 [&_.btn-ghost]:px-[13px] [&_.btn-ghost]:font-[inherit] [&_.btn-ghost]:text-sm","[&_.btn-ghost]:font-semibold [&_.btn-ghost]:rounded-sm","[&_.btn-ghost]:cursor-pointer [&_.btn-ghost]:transition-[background,border-color] [&_.btn-ghost]:duration-80 [&_.btn-ghost]:ease-standard","[&_.btn-ghost]:border-border [&_button:disabled]:opacity-50","[&_button:disabled]:cursor-default plan-strip-actions gap-y-1.5 gap-x-2 justify-end","[&_.btn-primary]:bg-transparent [&_.btn-primary]:border [&_.btn-primary]:border-text","[&_.btn-primary]:text-text [&_.btn-ghost]:bg-transparent","[&_.btn-ghost]:border [&_.btn-ghost]:border-text [&_.btn-ghost]:text-text","[&_.btn-primary:hover:not(:disabled)]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]","[&_.btn-primary:hover:not(:disabled)]:border-text","[&_.btn-primary:hover:not(:disabled)]:text-text [&_.btn-primary:hover:not(:disabled)]:opacity-100","[&_.btn-ghost:hover:not(:disabled)]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]","[&_.btn-ghost:hover:not(:disabled)]:border-text","[&_.btn-ghost:hover:not(:disabled)]:text-text [&_.btn-ghost:hover:not(:disabled)]:opacity-100","[&_.plan-strip-primary]:bg-text [&_.plan-strip-primary]:border-text","[&_.plan-strip-primary]:text-background","[&_.plan-strip-primary:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--text)_85%,_var(--base))]","[&_.plan-strip-primary:hover:not(:disabled)]:border-text","[&_.plan-strip-primary:hover:not(:disabled)]:text-background","[&_.plan-strip-caret]:rounded-tl-none [&_.plan-strip-caret]:rounded-bl-none","[&_.plan-strip-caret]:py-0 [&_.plan-strip-caret]:px-1.5 [&_.plan-strip-caret]:flex","[&_.plan-strip-caret]:items-center","[&_.plan-strip-caret]:border-l [&_.plan-strip-caret]:border-l-[color-mix(in_oklab,_var(--base)_35%,_var(--text))]"].join(" ");function xq({synthesized:e,agentLabel:t,onView:n,onApprove:r,showResumeModes:i,onReject:a,onRevise:o}){const[l,u]=R.useState(!1),d=R.useRef(null),[m,f]=R.useState(!1),[g,b]=R.useState(""),k=R.useRef(null);R.useEffect(()=>{if(!l)return;const x=_=>{d.current&&!d.current.contains(_.target)&&u(!1)};return window.addEventListener("pointerdown",x),()=>window.removeEventListener("pointerdown",x)},[l]),R.useEffect(()=>{var x;m&&((x=k.current)==null||x.focus())},[m]);const S=()=>{o(g.trim()||"no specific feedback — use your judgment"),b(""),f(!1)};return h.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-l-[3px] border-l-accent-blue rounded-md bg-surface shadow-[0_2px_10px_rgb(0_0_0_/_6%)]",children:[h.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[h.jsx(i_,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),h.jsx("span",{className:"plan-strip-title text-md font-semibold whitespace-nowrap",children:e?`${t} is ready to proceed`:`${t} proposed a plan`}),h.jsx("button",{className:"plan-strip-open ml-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-md cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",onClick:n,children:"Open plan"})]}),m?h.jsxs(h.Fragment,{children:[h.jsx("textarea",{ref:k,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-md font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:"What should change? (optional)",rows:2,value:g,onChange:x=>b(x.target.value),onKeyDown:x=>{x.key==="Escape"?(x.preventDefault(),b(""),f(!1)):x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),S())}}),h.jsxs("div",{className:hw,children:[h.jsx("button",{className:"btn-ghost",onClick:()=>{b(""),f(!1)},children:"Back"}),h.jsx("span",{className:"plan-strip-spacer flex-1"}),h.jsxs("button",{className:"btn-primary plan-strip-primary",onClick:S,children:["Revise",h.jsx(Z8,{size:13})]})]})]}):h.jsxs("div",{className:hw,children:[h.jsx("button",{className:"btn-ghost",onClick:a,children:"Reject"}),h.jsx("button",{className:"btn-ghost",onClick:()=>f(!0),children:"Revise…"}),h.jsx("span",{className:"plan-strip-spacer flex-1"}),i?h.jsxs("div",{className:"plan-strip-approve relative flex [&_.btn-primary:first-child]:rounded-tr-none [&_.btn-primary:first-child]:rounded-br-none",ref:d,children:[h.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>r("auto"),children:"Accept and auto mode"}),h.jsx("button",{className:"btn-primary plan-strip-primary plan-strip-caret","aria-label":"More approval options",onClick:()=>u(x=>!x),children:h.jsx(Rl,{size:13})}),l&&h.jsx("div",{className:"plan-strip-menu absolute right-0 bottom-[calc(100%_+_4px)] flex flex-col min-w-47.5 p-1 border border-border rounded-md bg-surface shadow-[0_6px_20px_rgb(0_0_0_/_12%)] z-6 [&_button]:text-left [&_button]:py-[7px] [&_button]:px-[9px] [&_button]:border-0 [&_button]:rounded-sm [&_button]:bg-transparent [&_button]:text-text [&_button]:text-md [&_button]:cursor-pointer [&_button:hover]:bg-[var(--surface-2,_rgb(0_0_0_/_5%))]",children:h.jsx("button",{onClick:()=>{u(!1),r("bypassPermissions")},children:"Accept and bypass all"})})]}):h.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>r(),children:"Accept plan"})]})]})}function Jk(){const[e,t]=R.useState(null),[n,r]=R.useState(null);return R.useEffect(()=>{let i=!1;const a=YD(o=>{i=!0,t(o)});return HR().then(o=>!i&&t(o)).catch(o=>r(o instanceof Error?o.message:String(o))),a},[]),{status:e,error:n,apply:t}}function yq(){const{status:e}=Jk(),[t,n]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null;return!r||t===r?null:h.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-xs text-text bg-surface border-b border-b-border",role:"status",children:[h.jsx(rh,{size:13,className:"shrink-0 text-subtext"}),h.jsxs("span",{className:"min-w-0",children:["Updated to ",h.jsx("strong",{className:"font-semibold",children:r}),". Restart to use it."]}),h.jsx("button",{type:"button",className:"ml-auto shrink-0 p-1 rounded-sm text-subtext hover:text-text hover:bg-highlight","aria-label":"Dismiss",onClick:()=>n(r),children:h.jsx(qr,{size:13})})]})}const eC="orx:theme";function wq(){try{const e=localStorage.getItem(eC);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let Md=wq();const mv=new Set;function Sq(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function T2(){document.documentElement.dataset.theme=Sq(Md)}function kq(e){Md=e;try{localStorage.setItem(eC,e)}catch{}T2();for(const t of mv)t()}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Md==="system"&&T2()});T2();function Cq(e){return mv.add(e),()=>mv.delete(e)}function Eq(){return[R.useSyncExternalStore(Cq,()=>Md,()=>Md),kq]}function tC({onSaved:e}){const[t,n]=R.useState(""),[r,i]=R.useState(!1),[a,o]=R.useState(null);async function l(u){if(u.preventDefault(),!(r||!t.trim())){i(!0),o(null);try{e(await pD(t.trim())),n("")}catch(d){o(d instanceof Error?d.message:String(d))}finally{i(!1)}}}return h.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:font-mono [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap",onSubmit:l,children:[h.jsx("input",{type:"password",value:t,onChange:u=>n(u.target.value),placeholder:"ghp_… personal access token",autoComplete:"off"}),h.jsx("button",{type:"submit",className:fi,disabled:r||!t.trim(),children:r?"Checking…":"Save"}),h.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,workflow&description=orx",target:"_blank",rel:"noreferrer",children:"Create a token ↗"}),a&&h.jsx("div",{className:"error",children:a})]})}function Aq(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"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return"This machine";default:return e||"—"}}function Tq({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[h.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"}),h.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"}),h.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),h.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"}),h.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"}),h.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-0.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-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),h.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-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.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-0.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-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.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-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Nq({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[h.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"}),h.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)"}),h.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)"}),h.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"}),h.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"}),h.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)"}),h.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)"}),h.jsxs("defs",{children:[h.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#BFF9B4"}),h.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),h.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#80EE64"}),h.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),h.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),h.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),h.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),h.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),h.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),h.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#BFF9B4"}),h.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),h.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#80EE64"}),h.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),h.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),h.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),h.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),h.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),h.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function jq({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:h.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-0.5-.623h-.804l-0.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-0.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-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.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-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.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-0.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-0.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-0.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 Mq({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:h.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function Rq({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[h.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),h.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function jp({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:h.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-0.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-0.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 nC({kind:e,size:t=16}){switch(e){case"modal_job":return h.jsx(Nq,{size:t});case"hf_job":return h.jsx(Tq,{size:t});case"k8s_job":return h.jsx(jq,{size:t});case"ssh_job":return h.jsx(n3,{size:t});case"slurm_job":return h.jsx(jj,{size:t});case"ray_job":return h.jsx(Mq,{size:t});case"openresearch_job":return h.jsx(Rq,{size:t});case"local_job":return h.jsx(CM,{size:t});default:return h.jsx(n3,{size:t})}}function N2({backend:e}){const t=o_(e),n=FD(e);return t?h.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[h.jsx(nC,{kind:t}),h.jsx("span",{className:"backend-name",children:Aq(t)}),n&&h.jsx("span",{className:`backend-detail ${tn}`,children:n})]}):h.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function rC({value:e,max:t,label:n,caption:r,fillColor:i}){const a=t>0?Math.min(100,Math.round(e/t*100)):0;return h.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,children:[h.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:h.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${a}%`,background:i}})}),(n!==void 0||r!==void 0)&&h.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[h.jsx("span",{children:n??`${a}%`}),r]})]})}const fw={done:{className:"st-done",live:!1},failed:{className:"st-failed",live:!1},running:{className:"st-running",live:!0},starting:{className:"st-starting",live:!0},cancelling:{className:"st-cancelling",live:!0},cancelled:{className:"st-cancelled",live:!1},editing:{className:"st-editing",live:!0},idle:{className:"st-idle",live:!1}};function Dq(e){return fw[e]??fw.idle}function Lq(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ma({status:e,label:t}){const n=Dq(e);return h.jsxs("span",{className:`${f_} ${n.className}${n.live?" live":""}`,children:[h.jsx("span",{className:"dot"}),t??Lq(e)]})}const Oa=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Vs=["kv grid grid-cols-[auto_1fr] gap-y-[3px] gap-x-3.5 text-md","[&_.k]:text-subtext [&_.v]:font-mono [&_.v]:text-sm","[&_.v]:break-all"].join(" "),Cn=["settings-note mt-2.5 mx-0 mb-0 text-sm py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),mh=["form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-mono","[&_.repo-hint]:font-normal [&_.repo-hint]:text-xs","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-left","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-[0_2px_8px_rgb(0_0_0_/_5%)]","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-semibold [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-semibold","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pr-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:pl-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))]","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-left [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-md","[&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:font-mono [&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-md [&_.paper-pick_.title]:font-semibold","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-xs [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5 [&_.new-project-actions_.primary]:ml-auto","[&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),ml=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_p]:text-muted [&_p]:text-sm"].join(" "),pw=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-md [&_.kv_.v]:break-normal [&_.kv_.v.mono]:font-mono","[&_.kv_.v.mono]:text-sm [&_.kv_.v_.mono]:font-mono","[&_.kv_.v_.mono]:text-sm [&_.kv_.k.mono]:font-mono","[&_.kv_.k.mono]:text-sm [@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),Wg=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Ju=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function Yg(e){return e.agentReady?{cls:"ok",label:"Signed in"}:e.installed?e.authState==="unknown"?{cls:"warn",label:"Unable to verify"}:e.authState==="unsupported"?{cls:"warn",label:"Update required"}:{cls:"warn",label:"Not signed in"}:{cls:"warn",label:"Not installed"}}function Oq({h:e}){return e.authMethod?h.jsx(h.Fragment,{children:e.authMethod==="oauth"?"OAuth (subscription login)":"API key"}):h.jsx(h.Fragment,{children:"—"})}function Iq(){const[e,t]=R.useState(null),[n,r]=R.useState("claude-code"),[i,a]=R.useState(!1),o=(u,d=!1)=>{a(!0),Tf(u,d).then(t).catch(()=>{}).finally(()=>a(!1))};R.useEffect(()=>o(!1),[]),R.useEffect(()=>c_(()=>o(!0)),[]);const l=e==null?void 0:e.find(u=>u.id===n);return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Harnesses"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",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."}),h.jsx("div",{className:"harness-tabs flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-md [&_button]:font-semibold [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(e??[]).map(u=>h.jsxs("button",{className:u.id===n?"active":"",onClick:()=>r(u.id),children:[u.name,h.jsx("span",{className:`harness-dot w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${Yg(u).cls}`})]},u.id))}),e?l?h.jsxs("div",{className:Oa,children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("span",{className:`${lr} ${Yg(l).cls}`,children:Yg(l).label}),h.jsx("div",{className:"spacer",style:{flex:1}}),h.jsxs("button",{className:Kn,onClick:()=>o(!0,!0),disabled:i,children:[h.jsx(rh,{size:12,className:i?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," Refresh"]})]}),h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Binary"}),h.jsx("span",{className:"v",children:l.binPath??"not found on PATH"}),h.jsx("span",{className:"k",children:"Version"}),h.jsx("span",{className:"v",children:l.version??"—"}),h.jsx("span",{className:"k",children:"Auth"}),h.jsx("span",{className:"v",children:h.jsx(Oq,{h:l})}),l.account&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:l.id==="opencode"?"Providers":"Account"}),h.jsx("span",{className:"v",children:l.account})]}),l.org&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:"Org"}),h.jsx("span",{className:"v",children:l.org})]}),l.plan&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:"Plan"}),h.jsx("span",{className:"v",children:l.plan})]}),h.jsx("span",{className:"k",children:"Agent models"}),h.jsx("span",{className:"v",children:l.models.length>0?`${l.models.length} available — ${l.models.slice(0,4).map(u=>Af(u)).join(", ")}${l.models.length>4?", …":""}`:"none"})]}),!l.agentReady&&l.agentNote&&h.jsx("p",{className:Cn,children:l.agentNote})]}):null:h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Detecting harnesses…"]})]})}function zq({s:e}){if(!e.configured)return h.jsx("span",{className:lr,children:"Not configured"});const t=e.preflight;return t.kubectlFound?t.reachable?t.canCreateJobs?h.jsx("span",{className:Cs,children:"Connected"}):h.jsx("span",{className:Li,children:"No job-create permission"}):h.jsx("span",{className:Li,children:"Cluster unreachable"}):h.jsx("span",{className:Li,children:"kubectl not found"})}function Bq(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(""),[u,d]=R.useState(!1),[m,f]=R.useState(null),g=S=>{t(S),a(S.context??""),l(S.namespace)};R.useEffect(()=>{UR().then(g).catch(S=>r(S instanceof Error?S.message:String(S)))},[]);const b=e!==null&&i===(e.context??"")&&o.trim()===e.namespace;async function k(S){if(S.preventDefault(),!u){d(!0),f(null);try{g(await qR({context:i,namespace:o.trim()}))}catch(x){f(x instanceof Error?x.message:String(x))}finally{d(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on your own cluster with ",h.jsx("code",{children:"--backend k8s"}),". The run's resources (image, GPUs, topology) come from a manifest committed on the experiment branch (default ",h.jsx("code",{children:".orx/k8s.yaml"}),"); only the cluster context and namespace live here. Auth comes from your kubeconfig."]}),n?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Cluster"}),h.jsx("span",{className:"v",children:h.jsx(zq,{s:e})})]}),e.preflight.error&&h.jsx("p",{className:Cn,children:e.preflight.error}),h.jsxs("form",{className:mh,onSubmit:k,children:[h.jsxs("div",{className:"row2",children:[h.jsxs("label",{children:["Context",h.jsxs("select",{value:i,onChange:S=>a(S.target.value),children:[h.jsxs("option",{value:"",children:["kubectl default",e.currentContext?` (${e.currentContext})`:""]}),e.contexts.map(S=>h.jsx("option",{value:S,children:S},S))]})]}),h.jsxs("label",{children:["Namespace",h.jsx("input",{className:tn,type:"text",value:o,onChange:S=>l(S.target.value),placeholder:"default",autoComplete:"off",spellCheck:!1})]})]}),m&&h.jsx("div",{className:"error",children:m}),h.jsx("div",{className:"actions",children:h.jsx("button",{type:"submit",className:Wr,disabled:u||b,children:u?"Saving…":"Save"})})]}),h.jsxs("div",{className:Oa,children:[h.jsx("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:h.jsx("h3",{children:"Run manifest"})}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Each run applies the manifest committed on its experiment branch — default"," ",h.jsx("code",{children:".orx/k8s.yaml"}),", or ",h.jsx("code",{children:"--manifest "}),". It declares whatever the run needs (image, GPU requests, an Indexed Job across nodes, extra Services, …); orx injects the run script as ",h.jsx("code",{children:"$ORX_SCRIPT"}),", the"," ",h.jsx("code",{children:"orx-env"})," Secret, run labels, and a default timeout, and requires exactly one Job (or one labelled ",h.jsx("code",{children:'orx-primary: "true"'}),") whose completion is the run's. Logs follow that Job's leader pod. Use"," ",h.jsx("code",{children:"{{ORX_RUN}}"})," in resource names to keep re-runs collision-free."]})]})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Checking kubectl…"]})]})}const Hq={env:"MODAL_TOKEN_ID env var",syncedEnv:"~/.openresearch/env",modalToml:"~/.modal.toml (modal token new)"};function $q({s:e}){return e.ready?h.jsx("span",{className:Cs,children:"Connected"}):!e.tokenConfigured&&!e.modalImportable?h.jsx("span",{className:lr,children:"Not set up"}):e.modalImportable?e.tokenConfigured?h.jsx("span",{className:lr,children:"Unknown"}):h.jsx("span",{className:Li,children:"No token"}):h.jsx("span",{className:Li,children:e.envProvisioned?"Env broken":"Env not built"})}function Fq(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(!1),[o,l]=R.useState(null);R.useEffect(()=>{GR().then(t).catch(d=>r(d instanceof Error?d.message:String(d)))},[]);async function u(){if(!i){a(!0),l(null);try{t(await VR())}catch(d){l(d instanceof Error?d.message:String(d))}finally{a(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Serverless GPUs on your own Modal account with"," ",h.jsx("code",{children:"--backend modal --flavor "})," (t4, a10g, a100-80gb, h100, …). orx manages a dedicated Python env with the Modal SDK; sandboxes scale to zero between runs."]}),n?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Status"}),h.jsx("span",{className:"v",children:h.jsx($q,{s:e})}),h.jsx("span",{className:"k",children:"Environment"}),h.jsx("span",{className:"v",children:e.modalImportable?"Ready":e.envProvisioned?"Provisioned (modal import failing)":"Not built yet"}),h.jsx("span",{className:"k",children:"Token"}),h.jsx("span",{className:"v",children:e.tokenSource?Hq[e.tokenSource]:"Not configured"})]}),!e.tokenConfigured&&h.jsxs("p",{className:Cn,children:["No Modal token found. Run ",h.jsx("code",{children:"modal token new"}),", or add"," ",h.jsx("code",{children:"MODAL_TOKEN_ID"})," and ",h.jsx("code",{children:"MODAL_TOKEN_SECRET"})," in the Environment tab."]}),e.error&&e.envProvisioned&&!e.modalImportable&&h.jsx("p",{className:Cn,children:e.error}),o&&h.jsx("div",{className:"error",children:o}),!e.modalImportable&&h.jsx("div",{className:"actions",children:h.jsx("button",{className:Wr,onClick:()=>void u(),disabled:i,children:i?"Setting up… (~30–60s)":"Set up environment"})})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Checking Modal…"]})]})}function Pq({test:e}){if(e===void 0)return h.jsx("span",{className:"muted text-muted",children:"never tested"});if(e==="testing")return h.jsx("span",{className:qt});const t=e.reachable?e.toolsFound?h.jsx("span",{className:Cs,children:"Ready"}):h.jsx("span",{className:Li,children:"Missing bash/tar"}):h.jsx("span",{className:Li,title:e.error??void 0,children:"Unreachable"});return h.jsxs(h.Fragment,{children:[t,h.jsx("span",{className:"ssh-tested-at block mt-0.5 text-muted text-xs",children:Gs(e.testedAt)})]})}function Uq(){const[e,t]=R.useState(null),[n,r]=R.useState({});R.useEffect(()=>{QR().then(t).catch(()=>t([]))},[]);async function i(a){r(o=>({...o,[a]:"testing"}));try{const o=await JR(a);r(l=>({...l,[a]:o}))}catch(o){r(l=>({...l,[a]:{reachable:!1,toolsFound:!1,error:o instanceof Error?o.message:String(o),testedAt:Date.now()}}))}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run experiments directly on your own boxes with"," ",h.jsx("code",{children:"--backend ssh --host "}),". Hosts come from"," ",h.jsx("code",{children:"~/.ssh/config"}),"; auth uses your keys/agent (orx never reads a key). The host just needs ",h.jsx("code",{children:"git"})," and ",h.jsx("code",{children:"bash"}),"."]}),e===null?h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Reading ~/.ssh/config…"]}):e.length===0?h.jsx("p",{className:"settings-empty text-muted text-md mt-1 mx-0 mb-0",children:"No hosts found in ~/.ssh/config."}):h.jsxs("table",{className:"flavor-table w-full border-collapse text-md [&_th]:pt-[5px] [&_th]:pr-2.5 [&_th]:pb-[5px] [&_th]:pl-0 [&_th]:border-b [&_th]:border-b-border [&_th]:text-left [&_th]:font-medium [&_th]:text-text [&_td]:pt-[5px] [&_td]:pr-2.5 [&_td]:pb-[5px] [&_td]:pl-0 [&_td]:border-b [&_td]:border-b-border-variant ssh-table table-fixed [&_th:nth-child(1)]:w-[20%] [&_th:nth-child(2)]:w-[26%] [&_th:nth-child(4)]:w-27 [&_th:nth-child(5)]:w-13 [&_td]:wrap-anywhere [&_td:last-child]:pr-0 [&_td:last-child]:text-right",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Host"}),h.jsx("th",{children:"Address"}),h.jsx("th",{children:"Identity"}),h.jsx("th",{children:"Status"}),h.jsx("th",{})]})}),h.jsx("tbody",{children:e.map(a=>h.jsxs("tr",{children:[h.jsx("td",{className:tn,children:a.host}),h.jsxs("td",{className:`${tn} muted text-muted`,children:[[a.user,a.hostname??"—"].filter(Boolean).join("@"),a.port?`:${a.port}`:""]}),h.jsx("td",{className:`${tn} muted text-muted`,children:a.identityFile??"—"}),h.jsx("td",{children:h.jsx(Pq,{test:n[a.host]??a.lastTest})}),h.jsx("td",{children:h.jsx("button",{className:Kn,onClick:()=>void i(a.host),disabled:n[a.host]==="testing",children:"Test"})})]},a.host))})]})]})}function qq({test:e}){return e===null?null:e==="testing"?h.jsx("span",{className:qt}):e.reachable?e.slurmFound?e.toolsFound?h.jsx("span",{className:Cs,children:"Ready"}):h.jsx("span",{className:Li,children:"Missing bash/tar"}):h.jsx("span",{className:Li,children:"No Slurm CLI"}):h.jsx("span",{className:Li,title:e.error??void 0,children:"Unreachable"})}function Gq(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(""),[u,d]=R.useState(""),[m,f]=R.useState(""),[g,b]=R.useState(!1),[k,S]=R.useState(null),[x,_]=R.useState(null),w=x!==null&&x!=="testing"?x:null,y=j=>{t(j),a(j.host??""),l(j.partition??""),d(j.account??""),f(j.timeLimit??"")};R.useEffect(()=>{eD().then(y).catch(j=>r(j instanceof Error?j.message:String(j)))},[]);const C=e!==null&&i===(e.host??"")&&o.trim()===(e.partition??"")&&u.trim()===(e.account??"")&&m.trim()===(e.timeLimit??"");async function N(j){if(j.preventDefault(),!g){b(!0),S(null);try{y(await tD({host:i,partition:o.trim(),account:u.trim(),timeLimit:m.trim()}))}catch(T){S(T instanceof Error?T.message:String(T))}finally{b(!1)}}}async function E(j){_("testing");try{_(await nD(j))}catch(T){_({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:T instanceof Error?T.message:String(T)})}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on your own cluster with ",h.jsx("code",{children:"--backend slurm [--flavor h100:2]"}),". orx submits via ",h.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?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[(w==null?void 0:w.error)&&h.jsx("p",{className:Cn,children:w.error}),w&&w.partitions.length>0&&h.jsxs("p",{className:Cn,children:["Partitions: ",h.jsx("code",{children:w.partitions.join(", ")})]}),h.jsxs("form",{className:mh,onSubmit:N,children:[h.jsxs("div",{className:"row2",children:[h.jsxs("label",{children:["Login node",h.jsxs("select",{value:i,onChange:j=>{a(j.target.value),_(null)},children:[h.jsx("option",{value:"",children:"not set (pass --host per launch)"}),i&&!e.hosts.some(j=>j.host===i)&&h.jsxs("option",{value:i,children:[i," (not in ~/.ssh/config)"]}),e.hosts.map(j=>h.jsx("option",{value:j.host,children:j.host},j.host))]})]}),h.jsxs("label",{children:["Partition",h.jsx("input",{className:tn,type:"text",list:"slurm-partitions",value:o,onChange:j=>l(j.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1}),h.jsx("datalist",{id:"slurm-partitions",children:w==null?void 0:w.partitions.map(j=>h.jsx("option",{value:j},j))})]})]}),h.jsxs("div",{className:"row2",children:[h.jsxs("label",{children:["Account",h.jsx("input",{className:tn,type:"text",value:u,onChange:j=>d(j.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1})]}),h.jsxs("label",{children:["Time limit",h.jsx("input",{className:tn,type:"text",value:m,onChange:j=>f(j.target.value),placeholder:"cluster default (e.g. 4h, 30m)",autoComplete:"off",spellCheck:!1})]})]}),k&&h.jsx("div",{className:"error",children:k}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"submit",className:Wr,disabled:g||C,children:g?"Saving…":"Save"}),h.jsx("button",{type:"button",className:fi,onClick:()=>void E(i),disabled:!i||x==="testing",title:i?void 0:"Pick a login node first",children:"Test connection"}),h.jsx(qq,{test:x})]})]})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading slurm settings…"]})]})}function Vq(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,d]=R.useState(null),[m,f]=R.useState(null),g=m!==null&&m!=="testing"?m:null,b=_=>{t(_),a(_.address??"")};R.useEffect(()=>{rD().then(b).catch(_=>r(_ instanceof Error?_.message:String(_)))},[]);const k=e!==null&&i===(e.address??"");async function S(_){if(_.preventDefault(),!o){l(!0),d(null);try{b(await iD({address:i}))}catch(w){d(w instanceof Error?w.message:String(w))}finally{l(!1)}}}async function x(){f("testing");try{f(await sD(i.trim()||void 0))}catch(_){f({reachable:!1,address:i.trim()||"(unknown)",rayVersion:null,error:_ instanceof Error?_.message:String(_)})}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on a Ray cluster with ",h.jsx("code",{children:"--backend ray [--flavor gpu:1]"}),". orx submits via the Ray Jobs API (Dashboard URL). Address resolution: this setting, then ",h.jsx("code",{children:"ASTROAI_RAY_JOBS_ADDRESS"})," /"," ",h.jsx("code",{children:"RAY_DASHBOARD_URL"}),", then ",h.jsx("code",{children:"http://127.0.0.1:8265"}),". Optional flavor maps to entrypoint CPUs/GPUs/memory (e.g."," ",h.jsx("code",{children:"cpu:2"}),", ",h.jsx("code",{children:"gpu:1,mem:8GiB"}),")."]}),n?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:Cn,children:["Effective: ",h.jsx("code",{children:e.resolvedAddress})," (",e.source,")"]}),(g==null?void 0:g.error)&&h.jsx("p",{className:Cn,children:g.error}),(g==null?void 0:g.reachable)&&g.rayVersion&&h.jsxs("p",{className:Cn,children:["Ray version: ",h.jsx("code",{children:g.rayVersion})]}),h.jsxs("form",{className:mh,onSubmit:S,children:[h.jsxs("label",{children:["Jobs / Dashboard URL",h.jsx("input",{className:tn,type:"text",value:i,onChange:_=>{a(_.target.value),f(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),u&&h.jsx("div",{className:"error",children:u}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"submit",className:Wr,disabled:o||k,children:o?"Saving…":"Save"}),h.jsx("button",{type:"button",className:fi,onClick:()=>void x(),disabled:m==="testing",children:"Test connection"}),h.jsx(Wq,{test:m})]})]})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading Ray settings…"]})]})}function Wq({test:e}){return e===null?null:e==="testing"?h.jsx("span",{className:lr,children:"Testing…"}):e.reachable?h.jsx("span",{className:Cs,children:"Reachable"}):h.jsx("span",{className:h_,children:"Unreachable"})}function Yq(){const[e,t]=R.useState(null),[n,r]=R.useState(null);return R.useEffect(()=>{oD().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]),h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run experiments as detached, supervised processes on the machine running orx with"," ",h.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?h.jsx("div",{className:"error",children:n}):e?h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Hostname"}),h.jsx("span",{className:`v ${tn}`,children:e.hostname}),h.jsx("span",{className:"k",children:"System"}),h.jsxs("span",{className:"v",children:[e.os,"/",e.arch,e.chip?` — ${e.chip}`:""]}),h.jsx("span",{className:"k",children:"CPU"}),h.jsx("span",{className:"v",children:e.cpuCount>0?`${e.cpuCount} cores`:"—"}),h.jsx("span",{className:"k",children:"RAM"}),h.jsx("span",{className:"v",children:e.memBytes!==null?Ao(e.memBytes):"—"}),h.jsx("span",{className:"k",children:"GPUs"}),h.jsx("span",{className:"v",children:e.gpus.length===0?"none detected (nvidia-smi)":e.gpus.map(i=>`${i.name}${i.memMib!==null?` — ${Ao(i.memMib*1024*1024)}`:""}`).join(", ")})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Detecting hardware…"]})]})}function Xq(){const[e,t]=R.useState(null),[n,r]=R.useState(null);return R.useEffect(()=>{lD().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]),h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run on an ephemeral OpenResearch box billed to your org with"," ",h.jsx("code",{children:"--backend openresearch --flavor "})," (h100_sxm, cpu5c, …; browse with ",h.jsx("code",{children:"orx compute"}),"). The box is provisioned for the run and deleted when it ends. Needs ",h.jsx("code",{children:"orx login"})," and a registered SSH key."]}),n?h.jsx("div",{className:"error",children:n}):e?e.loggedIn?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Status"}),h.jsx("span",{className:"v",children:h.jsx("span",{className:Cs,children:"Signed in"})}),h.jsx("span",{className:"k",children:"Orgs"}),h.jsx("span",{className:"v",children:e.orgs.length>0?e.orgs.join(", "):"—"}),h.jsx("span",{className:"k",children:"SSH key"}),h.jsx("span",{className:"v",children:e.sshKeyStatus==="matched"?h.jsx("span",{className:Cs,children:"On this computer"}):e.sshKeyStatus==="no_local_match"?h.jsx("span",{className:h_,children:"Not on this computer"}):e.sshKeyStatus==="none_registered"?h.jsx("span",{className:Li,children:"None registered"}):h.jsx("span",{className:lr,children:"Unknown"})})]}),e.sshKeyStatus==="none_registered"&&(e.sshKeyPath?h.jsxs("p",{className:Cn,children:["Add one with ",h.jsxs("code",{children:["orx ssh-key add ",e.sshKeyPath]}),"."]}):h.jsxs("p",{className:Cn,children:["No key on this computer yet — create one with"," ",h.jsx("code",{children:"ssh-keygen -t ed25519"}),", then add it with"," ",h.jsx("code",{children:"orx ssh-key add"}),"."]})),e.sshKeyStatus==="no_local_match"&&(e.sshKeyPath?h.jsxs("p",{className:Cn,children:["Register this computer with ",h.jsxs("code",{children:["orx ssh-key add ",e.sshKeyPath]}),", or load a registered key with ",h.jsx("code",{children:"ssh-add"}),"."]}):h.jsxs("p",{className:Cn,children:["No key on this computer to register — load a registered key with"," ",h.jsx("code",{children:"ssh-add"}),", or create one with"," ",h.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),e.error&&h.jsx("p",{className:Cn,children:e.error})]}):h.jsxs("p",{className:Cn,children:["Not signed in. Run ",h.jsx("code",{children:"orx login"})," in a terminal to connect your OpenResearch account."]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Checking credentials…"]})]})}const mw={local:"This machine",hf:"HF Jobs",modal:"Modal",k8s:"Kubernetes",ssh:"SSH",slurm:"Slurm",ray:"Ray",openresearch:"OpenResearch"},Kq={local:"local_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},Zq=["hf","modal","slurm","ray","openresearch"],gw=["hf","modal","openresearch"],bw={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"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]};function Qq({t:e,isDefault:t}){return e.id==="local"?h.jsx("span",{className:Cs,children:"Ready"}):e.unverified?h.jsx("span",{className:lr,children:"Unknown"}):!e.configured&&t?h.jsx("span",{className:h_,children:"Not configured"}):e.configured?h.jsx("span",{className:Cs,children:"Configured"}):h.jsx("span",{className:lr,children:"Not set up"})}function Jq({target:e,flavor:t,projectId:n,onSaved:r}){var g;const[i,a]=R.useState(t??""),[o,l]=R.useState(!1),[u,d]=R.useState(null);R.useEffect(()=>a(t??""),[t]);async function m(b){if(b.preventDefault(),!o){l(!0),d(null);try{r(await mS({backend:e,flavor:i.trim()||null,projectId:n}))}catch(k){d(k instanceof Error?k.message:String(k))}finally{l(!1)}}}const f=i.trim()===(t??"");return h.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-mono [&_.repo-hint]:font-normal [&_.repo-hint]:text-xs [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-left [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-[0_2px_8px_rgb(0_0_0_/_5%)] [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-semibold [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-semibold [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pr-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:pl-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))] [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-left [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-md [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:font-mono [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-md [&_.paper-pick_.title]:font-semibold flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-xs [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.new-project-actions_.primary]:ml-auto [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap settings-form mt-3.5 pt-3.5 border-t border-t-border compute-flavor-form mb-3.5 [&_label]:max-w-80",onSubmit:m,children:[h.jsxs("label",{children:["Default flavor",h.jsx("input",{className:tn,type:"text",list:`flavors-${e}`,value:i,onChange:b=>a(b.target.value),placeholder:gw.includes(e)?`e.g. ${((g=bw[e])==null?void 0:g[1])??""}`:"none (CPU-only)",autoComplete:"off",spellCheck:!1}),h.jsx("datalist",{id:`flavors-${e}`,children:(bw[e]??[]).map(b=>h.jsx("option",{value:b},b))})]}),u&&h.jsx("div",{className:"error",children:u}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"submit",className:Kn,disabled:o||f,children:o?"Saving…":"Save flavor"}),gw.includes(e)&&!t&&h.jsxs("span",{className:"muted text-muted compute-flavor-hint text-sm",children:["This backend requires a flavor — without a default one, each launch must pass"," ",h.jsx("code",{children:"--flavor"}),"."]})]})]})}function eG({target:e,isDefault:t,isFallbackDefault:n,defaultFlavor:r,open:i,onToggle:a,onSettings:o,onError:l,projectId:u}){const[d,m]=R.useState(!1),[f,g]=R.useState(!1);i&&!d&&m(!0);async function b(k){if(!f){g(!0);try{o(await mS({backend:k,projectId:u}))}catch(S){l(S instanceof Error?S.message:String(S))}finally{g(!1)}}}return h.jsxs("div",{className:`compute-row bg-background border border-border rounded-lg [&.disabled]:opacity-52 [&.disabled_.compute-row-head]:cursor-default [&.open_.compute-row-head:hover]:rounded-[var(--radius-lg)_var(--radius-lg)_0_0] [&.open_.compute-chevron]:rotate-180${i?" open":""}${e.enabled?"":" disabled"}`,children:[h.jsxs("div",{className:"compute-row-head flex items-center gap-2.5 py-3 px-3.5 cursor-pointer select-none [&:hover]:bg-surface [&:hover]:rounded-lg [&_.badge]:flex-none",onClick:e.enabled?a:void 0,children:[h.jsx("span",{className:"compute-row-logo inline-flex items-center flex-none",children:h.jsx(nC,{kind:Kq[e.id],size:18})}),h.jsx("span",{className:"compute-row-name text-md font-semibold text-text flex-none",children:mw[e.id]}),h.jsx("span",{className:"compute-row-summary flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-muted text-sm",children:e.summary}),h.jsx(Qq,{t:e,isDefault:t}),t?h.jsx("span",{className:"badge inline-flex items-center font-sans text-xs font-medium py-px px-[7px] border border-border rounded-sm [&.ok]:text-accent-green [&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle [&.err]:text-accent-red [&.err]:border-accent-red [&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber [&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle compute-default-pill flex-none text-primary border-primary",children:n?"Local fallback":"Default"}):h.jsx("button",{type:"button",className:`${Kn} compute-make-default flex-none`,onClick:k=>{k.stopPropagation(),b(e.id)},disabled:f||!e.enabled,children:"Make default"}),h.jsx("button",{type:"button",className:"compute-chevron-btn flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":i,"aria-label":`${i?"Collapse":"Expand"} ${mw[e.id]}`,disabled:!e.enabled,onClick:k=>{k.stopPropagation(),e.enabled&&a()},children:h.jsx(Rl,{size:16,className:"compute-chevron text-muted transition-transform duration-120 ease-standard"})})]}),d&&e.enabled&&h.jsxs("div",{className:"compute-row-body border-t border-t-border p-3.5 [&_.settings-card]:mb-0 [&_.settings-card]:mt-3.5",hidden:!i,children:[t&&!n&&h.jsxs("p",{className:"settings-note mt-2.5 mx-0 mb-0 text-sm py-2 px-2.5 border border-accent-amber rounded-md bg-accent-amber-subtle text-accent-amber font-medium compute-default-note flex items-center gap-2.5 flex-wrap",children:["The agent launches runs here unless you tell it otherwise, and so does"," ",h.jsx("code",{children:"orx exp run"})," with no ",h.jsx("code",{children:"--backend"})," flag."," ",h.jsx("button",{type:"button",className:Kn,onClick:()=>void b(null),disabled:f,children:"Clear default"})]}),t&&!e.configured&&h.jsx("p",{className:Cn,children:"This target is the default but isn't configured — launches will fail until it's set up below."}),t&&Zq.includes(e.id)&&h.jsx(Jq,{target:e.id,flavor:r,projectId:u,onSaved:o}),e.id==="local"&&h.jsx(Yq,{}),e.id==="hf"&&h.jsx(sG,{}),e.id==="modal"&&h.jsx(Fq,{}),e.id==="k8s"&&h.jsx(Bq,{}),e.id==="ssh"&&h.jsx(Uq,{}),e.id==="slurm"&&h.jsx(Gq,{}),e.id==="ray"&&h.jsx(Vq,{}),e.id==="openresearch"&&h.jsx(Xq,{})]})]})}function tG({project:e,onViewHistory:t}){const[n,r]=R.useState(null),[i,a]=R.useState(null),[o,l]=R.useState(null),[u,d]=R.useState(null),m=R.useRef(0);R.useEffect(()=>{m.current++,r(null),l(null),a(null),d(null)},[e==null?void 0:e.id]),R.useEffect(()=>{const S=++m.current;aD(e==null?void 0:e.id).then(x=>{S===m.current&&(r(x),a(null))}).catch(x=>{if(S!==m.current)return;const _=x instanceof Error?x.message:String(x);r(w=>(w===null?a(_):d(_),w))})},[o,e==null?void 0:e.id]);const f=S=>{m.current++,r(S),d(null)},g=n?n.targets:null,b=(n==null?void 0:n.defaultBackend)==="local"&&n.configuredDefaultBackend!==null&&n.configuredDefaultBackend!==void 0&&n.configuredDefaultBackend!=="local",k=S=>h.jsx(eG,{target:S,isDefault:(n==null?void 0:n.defaultBackend)===S.id,isFallbackDefault:!!(b&&S.id==="local"),defaultFlavor:(n==null?void 0:n.defaultFlavor)??null,open:S.enabled&&o===S.id,onToggle:()=>l(x=>x===S.id?null:S.id),onSettings:f,onError:d,projectId:e==null?void 0:e.id},`${(e==null?void 0:e.id)??"none"}:${S.id}`);return h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:"Compute"}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Where ",h.jsx("code",{children:"orx exp run"})," executes. Pick a default target; the agent uses it when a launch doesn't name a backend (",h.jsx("code",{children:"--backend "})," always wins)."]}),h.jsx(_G,{onViewHistory:t}),h.jsx("h2",{className:"compute-section-title mt-0 mx-0 mb-2.5 text-lg",children:"Targets"}),i?h.jsx("div",{className:"error",children:i}):g?h.jsxs(h.Fragment,{children:[u&&h.jsx("div",{className:"error",children:u}),h.jsxs("div",{className:"compute-list flex flex-col gap-2.5 mb-3.5",children:[g.filter(S=>S.id==="local").map(k),g.filter(S=>S.id!=="local").map(k)]}),b&&h.jsxs("p",{className:Cn,children:["Using this machine because the saved ",n==null?void 0:n.configuredDefaultBackend," default is not currently configured."]}),h.jsxs("p",{className:"compute-footnote flex items-start gap-1.5 mt-0.5 mx-0 mb-0 text-sm text-muted [&_svg]:flex-none [&_svg]:mt-px",children:[h.jsx(SM,{size:14,"aria-hidden":"true"}),h.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."})]})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Checking compute targets…"]})]})}const nG={env:"HF_TOKEN env var",openresearchEnv:"~/.openresearch/env",hfCache:"~/.cache/huggingface/token (hf auth login)"};function rG({settings:e}){return e.configured?e.valid?h.jsx("span",{className:Cs,children:"Connected"}):h.jsx("span",{className:Li,children:"Invalid token"}):h.jsx("span",{className:lr,children:"Not configured"})}function iG({settings:e}){return!e.configured||!e.valid?null:e.jobsWrite===!0?h.jsx("span",{className:Cs,children:"Jobs: write OK"}):e.jobsWrite===!1?h.jsx("span",{className:Li,children:"No job.write permission"}):h.jsx("span",{className:lr,children:"Jobs permission unknown"})}function sG(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,d]=R.useState(null),m=R.useRef(!1);R.useEffect(()=>{zR().then(g=>{m.current||t(g)}).catch(g=>{m.current||r(g instanceof Error?g.message:String(g))})},[]);async function f(g){if(g.preventDefault(),!(!i.trim()||o)){l(!0),d(null);try{const b=await BR(i.trim());m.current=!0,t(b),r(null),a("")}catch(b){d(b instanceof Error?b.message:String(b))}finally{l(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Run experiments on your Hugging Face account with"," ",h.jsx("code",{children:"--backend hf --flavor "})," (t4-small, a10g-small, a100-large, …). Billed to HF per minute."]}),n?h.jsx("div",{className:"error",children:n}):e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Status"}),h.jsx("span",{className:"v",children:h.jsx(rG,{settings:e})}),h.jsx("span",{className:"k",children:"Account"}),h.jsx("span",{className:"v",children:e.username??"—"}),h.jsx("span",{className:"k",children:"Token"}),h.jsx("span",{className:"v",children:e.maskedToken??"—"}),h.jsx("span",{className:"k",children:"Source"}),h.jsx("span",{className:"v",children:e.source?nG[e.source]:"Not configured"}),h.jsx("span",{className:"k",children:"Jobs"}),h.jsxs("span",{className:"v",children:[h.jsx(iG,{settings:e}),(!e.configured||!e.valid)&&"—"]})]}),e.source==="env"&&h.jsx("p",{className:Cn,children:"HF_TOKEN is set in the environment and overrides any token saved here."}),e.valid&&e.jobsWrite===null&&h.jsxs("p",{className:Cn,children:["This token is valid but doesn't report whether it can launch Jobs — OAuth tokens from ",h.jsx("code",{children:"hf auth login"})," never do. Launches may still work; for a definitive check, save a write-scoped token from"," ",h.jsx("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",children:"huggingface.co/settings/tokens"}),"."]})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading status…"]}),h.jsxs("form",{className:mh,onSubmit:f,children:[h.jsxs("label",{children:[e!=null&&e.configured?"Replace token":"New token",h.jsx("input",{type:"password",value:i,onChange:g=>a(g.target.value),placeholder:"hf_…",autoComplete:"off"})]}),u&&h.jsx("div",{className:"error",children:u}),h.jsx("div",{className:"actions",children:h.jsx("button",{type:"submit",className:Wr,disabled:!i.trim()||o,children:o?"Validating…":"Save"})})]})]})}const iC=/^hf_[A-Za-z0-9]{10,}$/;function sC(){return h.jsx("tr",{children:h.jsx("td",{colSpan:3,children:h.jsxs("p",{className:Cn,children:["This value looks like a Hugging Face token — compute runs only read it from"," ",h.jsx("code",{children:"HF_TOKEN"}),". Save it under that key if it's meant for HF Jobs."]})})})}const vw=["HF_TOKEN","WANDB_API_KEY"];function aG({name:e,entry:t,onVars:n,onError:r}){const[i,a]=R.useState(""),[o,l]=R.useState(!1),u=f=>r(`${e}: ${f instanceof Error?f.message:String(f)}`);async function d(){if(!(!i.trim()||o)){l(!0);try{n(await pS(e,i.trim())),a("")}catch(f){u(f)}finally{l(!1)}}}async function m(){if(!o){l(!0);try{n(await YR(e))}catch(f){u(f)}finally{l(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("tr",{children:[h.jsx("td",{className:tn,children:e}),h.jsx("td",{className:`${tn} muted text-muted`,children:t?h.jsxs(h.Fragment,{children:[t.maskedValue,t.inProcessEnv&&h.jsx("span",{className:lr,children:"Overridden by env"})]}):h.jsx("input",{className:tn,type:"password",value:i,onChange:f=>a(f.target.value),onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),d()),f.key==="Escape"&&!o&&a("")},placeholder:"value","aria-label":`Value for ${e}`,autoComplete:"new-password",disabled:o})}),h.jsx("td",{children:t?h.jsx("button",{className:Xn,title:`Delete ${e}`,"aria-label":`Delete ${e}`,onClick:()=>void m(),disabled:o,children:h.jsx(ih,{size:13})}):i.trim()&&h.jsx("button",{className:Kn,onClick:()=>void d(),disabled:o,children:o?"Saving…":"Save"})})]}),!t&&e!=="HF_TOKEN"&&iC.test(i.trim())&&h.jsx(sC,{})]})}function oG({onVars:e,onError:t,onDone:n}){const[r,i]=R.useState(""),[a,o]=R.useState(""),[l,u]=R.useState(!1);async function d(){if(!(!r.trim()||!a.trim()||l)){u(!0);try{e(await pS(r.trim(),a.trim())),n()}catch(f){t(`${r.trim()}: ${f instanceof Error?f.message:String(f)}`)}finally{u(!1)}}}const m=f=>{f.key==="Enter"&&(f.preventDefault(),d()),f.key==="Escape"&&!l&&n()};return h.jsxs(h.Fragment,{children:[h.jsxs("tr",{children:[h.jsx("td",{children:h.jsx("input",{autoFocus:!0,className:tn,type:"text",value:r,onChange:f=>i(f.target.value),onKeyDown:m,placeholder:"MY_API_KEY","aria-label":"New variable key",autoComplete:"off",spellCheck:!1,disabled:l})}),h.jsx("td",{children:h.jsx("input",{className:tn,type:"password",value:a,onChange:f=>o(f.target.value),onKeyDown:m,placeholder:"value","aria-label":"New variable value",autoComplete:"new-password",disabled:l})}),h.jsxs("td",{children:[h.jsx("button",{className:Kn,onClick:()=>void d(),disabled:l||!r.trim()||!a.trim(),children:l?"Saving…":"Save"}),h.jsx("button",{className:Xn,title:"Cancel","aria-label":"Cancel new variable",onClick:n,disabled:l,children:h.jsx(qr,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&iC.test(a.trim())&&h.jsx(sC,{})]})}function lG(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(!1),[o,l]=R.useState(null);R.useEffect(()=>{WR().then(t).catch(f=>r(f instanceof Error?f.message:String(f)))},[]);const u=f=>{t(f),l(null)},d=e===null?[]:e.map(f=>f.key).filter(f=>!vw.includes(f)),m=[...vw,...d];return h.jsxs("div",{className:Oa,children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("h3",{children:"Environment variables"}),h.jsx("div",{className:"spacer",style:{flex:1}}),h.jsxs("button",{className:Kn,onClick:()=>a(!0),disabled:i||e===null,children:[h.jsx(r_,{size:12})," Add variable"]})]}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Stored in ",h.jsx("code",{children:"~/.openresearch/env"})," and passed to runs and the research agent."," ",h.jsx("code",{children:"HF_TOKEN"})," and ",h.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?h.jsx("div",{className:"error",children:n}):e===null?h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading…"]}):h.jsx("table",{className:"env-table w-full border-collapse text-md table-fixed [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ml-2 [&_input]:w-full [&_input]:border-0 [&_input]:bg-transparent [&_input]:p-0 [&_input:focus]:shadow-[0_1px_0_0_var(--text)] [&_td]:h-9 [&_td]:pt-0 [&_td]:pr-2.5 [&_td]:pb-0 [&_td]:pl-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-right [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-left [&_.icon-btn]:ml-2 [&_.icon-btn]:align-middle [&_.icon-btn:hover]:text-accent-red",children:h.jsxs("tbody",{children:[m.map(f=>h.jsx(aG,{name:f,entry:e.find(g=>g.key===f),onVars:u,onError:l},f)),i&&h.jsx(oG,{onVars:u,onError:l,onDone:()=>a(!1)})]})}),o&&h.jsx("div",{className:"error",children:o})]})}const ed=[{value:"system",label:"System",icon:OM},{value:"light",label:"Light",icon:aR},{value:"dark",label:"Dark",icon:zM}];function cG(){const[e,t]=Eq(),n=r=>{var d;const i=r.key==="ArrowRight"||r.key==="ArrowDown"?1:r.key==="ArrowLeft"||r.key==="ArrowUp"?-1:0;if(!i)return;r.preventDefault();const a=[...r.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(m=>m===document.activeElement),u=((o===-1?ed.findIndex(m=>m.value===e):o)+i+ed.length)%ed.length;t(ed[u].value),(d=a[u])==null||d.focus()};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Appearance"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"How the interface looks on this device."}),h.jsx("div",{className:Oa,children:h.jsxs("div",{className:ml,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"Theme"}),h.jsx("p",{children:"System follows your operating system's light or dark setting."})]}),h.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":"Theme",onKeyDown:n,children:ed.map(({value:r,label:i,icon:a})=>h.jsxs("button",{type:"button",role:"radio","aria-checked":e===r,tabIndex:e===r?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${e===r?"on":""}`,onClick:()=>t(r),children:[h.jsx(a,{size:14}),i]},r))})]})})]})}const uG={installer:"Installed with the orx installer","app-bundle":"macOS app",cargo:"Installed with cargo",homebrew:"Installed with Homebrew",nix:"Managed by Nix",unknown:"Unknown install"},dG={cargo:"Re-run your cargo install to update.",homebrew:"Run brew upgrade to update.",nix:"Update it through your Nix configuration."};function hG(){const{status:e,error:t,apply:n}=Jk(),[r,i]=R.useState(null),[a,o]=R.useState(null);if(!e)return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Updates"}),t?h.jsx("div",{className:Oa,children:h.jsx("div",{className:"error",children:t})}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading…"]})]});const l=async(u,d)=>{i(u),o(null);try{await d()}catch(m){o(m instanceof Error?m.message:String(m))}finally{i(null)}};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Updates"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"Keeping this copy of orx on the latest release."}),h.jsxs("div",{className:Oa,children:[h.jsxs("div",{className:Vs,children:[h.jsx("div",{className:"k",children:"Version"}),h.jsx("div",{className:"v",children:e.current}),h.jsx("div",{className:"k",children:"Latest"}),h.jsx("div",{className:"v",children:e.latest??"—"}),h.jsx("div",{className:"k",children:"Install"}),h.jsx("div",{className:"v",children:uG[e.channel]})]}),e.restartRequired&&h.jsx("div",{className:ml,children:h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"Restart to finish updating"}),h.jsxs("p",{children:["Version ",e.installedVersion," is installed. This window is still running"," ",e.current,"."]})]})}),e.selfUpdates?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:ml,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"Install updates automatically"}),h.jsxs("p",{children:["New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",e.envDisabled&&" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect."]})]}),h.jsx("button",{type:"button",role:"switch","aria-checked":e.autoUpdate,"aria-label":"Install updates automatically",className:`${p_} ${e.autoUpdate?"on":""}`,disabled:r!==null,onClick:()=>void l("auto",()=>FR(!e.autoUpdate).then(n)),children:h.jsx("span",{})})]}),h.jsxs("div",{className:ml,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:e.updateAvailable?`Update to ${e.latest}`:"Check for updates"}),h.jsx("p",{children:e.updateAvailable?"Install the new release now instead of waiting for the background update.":"orx checks a few times a day on its own."})]}),h.jsx("button",{type:"button",className:Kn,disabled:r!==null,onClick:()=>void l("apply",()=>$R().then(n)),children:r==="apply"?"Working…":e.updateAvailable?"Update now":"Check now"})]})]}):h.jsx("div",{className:ml,children:h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"orx can't update this install"}),h.jsx("p",{children:dG[e.channel]??"Reinstall with the orx installer to get automatic updates."})]})}),e.channel==="app-bundle"&&h.jsx(fG,{busy:r,run:l}),a&&h.jsx("div",{className:"error",children:a})]})]})}function fG({busy:e,run:t}){const[n,r]=R.useState(null),[i,a]=R.useState(!1),o=l=>void t("cli",()=>PR(l).then(u=>{r(u),a(!1)}).catch(u=>{throw a(!l&&String((u==null?void 0:u.message)??u).includes("--force")),u}));return h.jsxs("div",{className:ml,children:[h.jsxs("div",{children:[h.jsxs("div",{className:"project-default-title text-md font-semibold",children:["Install the ",h.jsx("code",{children:"orx"})," command"]}),n?h.jsxs("p",{children:[n.alreadyCurrent?"Already linked at ":"Linked ",h.jsx("code",{children:n.link}),".",!n.onPath&&` Add ${n.dir} to your PATH to use it.`]}):h.jsxs("p",{children:["Adds ",h.jsx("code",{children:"orx"})," to your terminal, pointing at this app — so the CLI and the app are always the same version."]})]}),h.jsx("button",{type:"button",className:Kn,disabled:e!==null,onClick:()=>o(i),children:e==="cli"?"Working…":i?"Replace anyway":n?"Re-link":"Install"})]})}function pG(){const[e,t]=R.useState(null),[n,r]=R.useState(!1),[i,a]=R.useState(null),o=()=>{a(null),a_().then(t).catch(u=>a(u instanceof Error?u.message:String(u)))};R.useEffect(o,[]);const l=()=>{if(!e||n)return;const u=!e.githubForNewProjects;r(!0),a(null),vS(u,!0).then(t).catch(d=>a(d instanceof Error?d.message:String(d))).finally(()=>r(!1))};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"General"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"Defaults applied when you create a project."}),e?h.jsxs("div",{className:"settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-md [&_>_.error]:whitespace-pre-wrap bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5 [&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0",children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("h3",{children:"GitHub publishing"}),h.jsx("span",{className:`${lr} ${e.githubAuthenticated?"ok":""}`,children:e.githubAuthenticated?`Connected via ${e.githubTokenSource}`:"Not connected"})]}),h.jsxs("div",{className:ml,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-md font-semibold",children:"Enable GitHub syncing for new projects"}),h.jsx("p",{children:"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots."})]}),h.jsx("button",{type:"button",role:"switch","aria-checked":e.githubForNewProjects,"aria-label":"Enable GitHub syncing for new projects",className:`${p_} ${e.githubForNewProjects?"on":""}`,disabled:n||!e.githubAuthenticated&&!e.githubForNewProjects,onClick:l,children:h.jsx("span",{})})]}),!e.githubAuthenticated&&h.jsxs("div",{className:"project-default-connect [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0 [&_p]:text-muted [&_p]:text-sm mt-3.5 pt-3.5 border-t border-t-border-variant [&_.onb-token-form]:mt-2.5",children:[h.jsx("p",{children:"Connect GitHub to make publishing the default for new projects."}),h.jsx(tC,{onSaved:o})]}),i&&h.jsx("div",{className:"error",children:i})]}):i?h.jsx("div",{className:"error",children:i}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading…"]})]})}function mG({project:e,publicationError:t,onProjectUpdate:n}){const[r,i]=R.useState(null),[a,o]=R.useState(!1),[l,u]=R.useState(null),[d,m]=R.useState(!1),[f,g]=R.useState(!1),[b,k]=R.useState(null),S=R.useRef(0),x=!!(r!=null&&r.github.owner&&r.github.repo),_=()=>{const N=++S.current;i(null),u(null),e&&vD(e.id).then(E=>{N===S.current&&i(E)}).catch(E=>{N===S.current&&u(E instanceof Error?E.message:String(E))})};R.useEffect(_,[e==null?void 0:e.id]);const w=N=>{const E=N instanceof Error?N.message:String(N);return E.toLowerCase().includes("archived")?"GitHub rejected the push because this repository is archived and read-only. The local project is still available. Unarchive the repository on GitHub, then enable syncing here.":E.includes("(fetch first)")||E.includes("non-fast-forward")?"GitHub contains changes that are not in this local project. Pull the latest GitHub changes and resolve any conflicts in Git, then try enabling syncing again.":E.includes("403")||E.toLowerCase().includes("permission denied")?"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.":E},y=()=>{e&&(o(!0),u(null),xD(e.id).then(N=>{i(N.git),n(N.project),a_().then(E=>{!E.githubForNewProjects&&!E.githubDefaultPromptSeen&&m(!0)}).catch(()=>{})}).catch(N=>u(w(N))).finally(()=>o(!1)))},C=N=>{g(!0),k(null),vS(N,!0).then(()=>m(!1)).catch(E=>k(E instanceof Error?E.message:String(E))).finally(()=>g(!1))};return h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:"Repository"}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Git and GitHub settings for ",h.jsx("strong",{children:(e==null?void 0:e.name)??"the current project"}),". Local Git powers experiments; publishing is optional."]}),e?l&&!r?h.jsx("div",{className:"error",children:l}):r?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:pw,children:[h.jsx("h3",{children:"Local repository"}),h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Path"}),h.jsx("span",{className:`v ${tn}`,children:r.path}),h.jsx("span",{className:"k",children:"Git"}),h.jsx("span",{className:"v",children:r.gitVersion??"not found"}),h.jsx("span",{className:"k",children:"State"}),h.jsx("span",{className:"v",children:r.initialized?`${r.currentBranch??"detached"} · ${r.clean?"clean":"has changes"}`:"not initialized"}),h.jsx("span",{className:"k",children:"Baseline"}),h.jsx("span",{className:`v ${tn}`,children:r.baselineBranch}),h.jsx("span",{className:"k",children:"Remotes"}),h.jsx("span",{className:"v",children:r.remotes.length?r.remotes.map(N=>`${N.name}: ${N.url}`).join(" · "):"none"})]}),!r.initialized&&h.jsx("div",{className:Wg,children:h.jsx("button",{className:Wr,onClick:()=>void _D(e.id).then(i).catch(N=>u(String(N))),children:"Initialize Git"})})]}),h.jsxs("div",{className:pw,children:[h.jsx("h3",{children:"GitHub"}),h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Authentication"}),h.jsxs("span",{className:"v",children:[h.jsx("span",{className:`${lr} ${r.github.authenticated?"ok":""}`,children:r.github.authenticated?"Connected":"Not connected"}),r.github.authenticated&&h.jsxs("span",{className:"git-detail-meta text-muted text-sm",children:["via ",r.github.tokenSource]})]}),h.jsx("span",{className:"k",children:"Project"}),h.jsx("span",{className:"v",children:x?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:tn,children:[r.github.owner,"/",r.github.repo]}),!r.github.enabled&&h.jsx("span",{className:"badge inline-flex items-center font-sans font-medium py-px px-[7px] border border-border rounded-sm [&.ok]:text-accent-green [&.ok]:border-accent-green [&.ok]:bg-accent-green-subtle [&.err]:text-accent-red [&.err]:border-accent-red [&.err]:bg-accent-red-subtle [&.warn]:text-accent-amber [&.warn]:border-accent-amber [&.warn]:bg-accent-amber-subtle git-detail-meta text-muted text-sm",children:"Syncing off"})]}):h.jsx("span",{className:lr,children:"Local only"})}),r.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:"Sync"}),h.jsx("span",{className:"v",children:r.github.syncStatus})]})]}),!r.github.authenticated&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:"GitHub is optional. Connect only when you want a hosted copy for collaboration."}),h.jsx(tC,{onSaved:()=>_()})]}),r.github.authenticated&&!r.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:x?"Use this repository for automatic experiment-branch pushes when your connected account can write to it. Otherwise, OpenResearch creates a separate private repository for collaboration.":"Create a private repository and automatically push experiment branches for collaborator visibility."}),h.jsxs("div",{className:Wg,children:[x&&r.github.url&&h.jsxs("a",{className:fi,href:r.github.url,target:"_blank",rel:"noreferrer",children:["Open on GitHub ",h.jsx(xd,{size:12})]}),h.jsx("button",{className:Wr,disabled:a,onClick:y,children:a?"Enabling…":"Enable GitHub syncing"})]})]}),r.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper text-muted text-sm mt-3.5 mx-0 mb-0",children:"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed."}),h.jsxs("div",{className:Wg,children:[r.github.url&&h.jsxs("a",{className:fi,href:r.github.url,target:"_blank",rel:"noreferrer",children:["Open on GitHub ",h.jsx(xd,{size:12})]}),h.jsx("button",{className:fi,disabled:a,onClick:()=>{o(!0),yD(e.id).then(N=>{i(N.git),n(N.project)}).catch(N=>u(N instanceof Error?N.message:String(N))).finally(()=>o(!1))},children:a?"Updating…":"Disable syncing"})]})]})]}),t&&h.jsx("div",{className:"error",children:w(t)}),l&&h.jsx("div",{className:"error",children:w(l)})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading…"]}):h.jsx("div",{className:Oa,children:h.jsx("p",{className:Cn,children:"Open a project to inspect its repository and GitHub publication state."})}),d&&h.jsx("div",{className:"modal-backdrop fixed inset-0 bg-[rgba(29,_27,_26,_0.4)] flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>C(!1),children:h.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)] p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-muted [&_>_p]:text-md [&_>_p]:leading-normal [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:N=>N.stopPropagation(),children:[h.jsx("h2",{id:"github-default-title",children:"Make GitHub syncing the default?"}),h.jsx("p",{children:"This is useful when collaborators follow project changes on GitHub. New projects will enable syncing automatically, creating a private repository when needed and pushing experiment branches for visibility."}),b&&h.jsx("div",{className:"error",children:b}),h.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[h.jsx("button",{className:fi,disabled:f,onClick:()=>C(!1),children:"Not now"}),h.jsx("button",{className:Wr,disabled:f,onClick:()=>C(!0),children:f?"Saving…":"Make default"})]})]})})]})}const gG={env:"ORX_DATA_DIR environment variable",config:"your saved setting",xdg:"XDG_DATA_HOME",default:"default location"};function bG(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,d]=R.useState(null),[m,f]=R.useState({kind:"idle"}),[g,b]=R.useState(null),k=()=>XR().then(C=>{t(C),a(N=>N||C.current)}).catch(C=>r(C instanceof Error?C.message:String(C)));R.useEffect(()=>{k()},[]),R.useEffect(()=>WD(C=>{C.type==="progress"?f(N=>{const E=N.kind==="moving"?N.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||E}}):C.type==="done"?(f({kind:"done",oldPathLeft:C.oldPathLeft}),d(null),a(""),k()):C.type==="error"&&f({kind:"error",message:C.error})}),[]);const S=(e==null?void 0:e.source)==="env",x=i.trim(),_=e!==null&&x===e.current;async function w(){if(!(o||!x)){l(!0),b(null),d(null);try{d(await KR(x))}catch(C){b(C instanceof Error?C.message:String(C))}finally{l(!1)}}}async function y(C){if(C.preventDefault(),!(m.kind==="moving"||!x||_)&&(b(null),!!window.confirm(`Move all orx data to: -${x} - -The store is copied to the new location and activated there. Active runs or chats will block the move.`))){f({kind:"moving",phase:"preparing",copied:0,total:(u==null?void 0:u.treeBytes)??0});try{await ZR(x)}catch(N){f({kind:"idle"}),b(N instanceof Error?N.message:String(N))}}}return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:"Storage"}),h.jsxs("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:["Where orx keeps everything on this machine — the local database, run logs, artifacts, and chat attachments for ",h.jsx("strong",{children:"all"})," projects. Moving it copies the whole store to the new location and activates it there."]}),n?h.jsx("div",{className:Oa,children:h.jsx("div",{className:"error",children:n})}):e?h.jsxs("div",{className:Oa,children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("h3",{children:"Data directory"}),h.jsx("div",{className:"spacer",style:{flex:1}}),h.jsx("span",{className:lr,children:e.isDefault?"Default":"Custom"})]}),h.jsxs("div",{className:Vs,children:[h.jsx("span",{className:"k",children:"Current"}),h.jsx("span",{className:`v ${tn}`,children:e.current}),h.jsx("span",{className:"k",children:"Source"}),h.jsx("span",{className:"v",children:gG[e.source]}),!e.isDefault&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:"Default"}),h.jsx("span",{className:`v ${tn}`,children:e.defaultPath})]})]}),S?h.jsxs("p",{className:Cn,children:["The data directory is pinned by the ",h.jsx("code",{children:"ORX_DATA_DIR"})," environment variable, which overrides this setting. Unset it to choose a location here."]}):h.jsxs("form",{className:mh,onSubmit:y,children:[h.jsxs("label",{children:["New location",h.jsx("input",{className:tn,type:"text",value:i,onChange:C=>{a(C.target.value),d(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:m.kind==="moving"})]}),u&&!u.error&&u.ok&&h.jsxs("p",{className:Cn,children:["Ready to move ",Ao(u.treeBytes??0),u.freeBytes!=null&&` — ${Ao(u.freeBytes)} free at target`,u.sameFilesystem?" (same disk, instant)":"","."]}),u&&u.ok===!1&&u.error&&h.jsx("div",{className:"error",children:u.error}),g&&h.jsx("div",{className:"error",children:g}),m.kind==="moving"&&h.jsx(rC,{value:m.copied,max:m.total,label:`${m.phase.charAt(0).toUpperCase()}${m.phase.slice(1)}…`,caption:m.total>0?h.jsxs("span",{className:tn,children:[Ao(m.copied)," / ",Ao(m.total)]}):void 0}),m.kind==="done"&&h.jsxs("p",{className:Cn,children:["Moved. orx is now using the new location.",m.oldPathLeft&&h.jsxs(h.Fragment,{children:[" ","The old copy was left at ",h.jsx("code",{children:m.oldPathLeft})," (different disk) — you can delete it once you've confirmed everything works."]})]}),m.kind==="error"&&h.jsxs("div",{className:"error",children:["Move failed: ",m.message]}),h.jsxs("div",{className:"actions",children:[h.jsx("button",{type:"button",className:fi,onClick:w,disabled:o||!x||_||m.kind==="moving",children:o?"Checking…":"Check"}),h.jsx("button",{type:"submit",className:Wr,disabled:!x||_||m.kind==="moving",children:m.kind==="moving"?"Moving…":"Move data here"})]})]})]}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading…"]})]})}const gv=e=>e==="running"||e==="starting";function vG(e){return gv(e.status)?Nf(Date.now()-e.createdAt):e.endedAt?Nf(e.endedAt-e.createdAt):"—"}function aC({instances:e,emptyLabel:t}){return e.length===0?h.jsx("p",{className:"instances-empty m-0 py-3.5 px-4 border border-border rounded-lg bg-background text-subtext text-md",children:t}):h.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:h.jsxs("table",{className:"runs-table w-full border-collapse text-md bg-background [&_th]:text-left [&_th]:text-text [&_th]:text-xs [&_th]:font-semibold [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-[color-mix(in_oklab,_var(--text)_6%,_transparent)] [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Backend"}),h.jsx("th",{children:"Project"}),h.jsx("th",{children:"Status"}),h.jsx("th",{children:"Started"}),h.jsx("th",{children:"Runtime"})]})}),h.jsx("tbody",{children:e.map(n=>{var i;const r=typeof((i=n.backend)==null?void 0:i.url)=="string"?n.backend.url:void 0;return h.jsxs("tr",{children:[h.jsx("td",{children:h.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5 [&_.icon-btn]:w-5.5 [&_.icon-btn]:h-5.5",children:[h.jsx(N2,{backend:n.backend}),r&&h.jsx("a",{className:Xn,href:r,target:"_blank",rel:"noreferrer",title:"Open job page","aria-label":"Open job page",onClick:a=>a.stopPropagation(),children:h.jsx(xd,{size:12})})]})}),h.jsx("td",{children:n.projectName??$D(n.projectId)}),h.jsx("td",{children:h.jsx(Ma,{status:ss(n)})}),h.jsx("td",{children:Gs(n.createdAt)}),h.jsx("td",{children:vG(n)})]},n.id)})})]})})}function _G({onViewHistory:e}){const[t,n]=R.useState(null),[r,i]=R.useState(null),[a,o]=R.useState(!1),[,l]=R.useState(0);R.useEffect(()=>{const g=setInterval(()=>l(b=>b+1),3e4);return()=>clearInterval(g)},[]);const u=()=>{o(!0),dS().then(g=>{n(g),i(null)}).catch(g=>{i(g instanceof Error?g.message:String(g)),n(b=>b??[])}).finally(()=>o(!1))};R.useEffect(()=>u(),[]);const d=(g,b)=>b.createdAt-g.createdAt,m=t==null?void 0:t.filter(g=>gv(g.status)).sort(d),f=t==null?void 0:t.filter(g=>!gv(g.status)).sort(d);return h.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-6.5",children:[h.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0 [&_p]:text-muted [&_p]:text-sm [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[h.jsxs("div",{children:[h.jsxs("h2",{children:["Running instances",m&&m.length>0&&h.jsx("span",{className:"count-badge",children:m.length})]}),h.jsx("p",{children:"Compute currently active across all projects."})]}),h.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[h.jsxs("button",{className:Kn,onClick:u,disabled:a,children:[h.jsx(rh,{size:12,className:a?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," Refresh"]}),h.jsx("button",{className:Kn,onClick:e,children:`View history${f!=null&&f.length?` (${f.length})`:""}`})]})]}),r&&h.jsx("div",{className:"error",children:r}),!m||!f?h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading…"]}):h.jsx(aC,{instances:m,emptyLabel:"Nothing running right now."})]})}function xG({onBack:e}){const[t,n]=R.useState(null),[r,i]=R.useState(null),[a,o]=R.useState(!1),[,l]=R.useState(0);R.useEffect(()=>{const d=setInterval(()=>l(m=>m+1),3e4);return()=>clearInterval(d)},[]);const u=()=>{o(!0),dS().then(d=>{n(d.sort((m,f)=>f.createdAt-m.createdAt)),i(null)}).catch(d=>{i(d instanceof Error?d.message:String(d)),n(m=>m??[])}).finally(()=>o(!1))};return R.useEffect(u,[]),h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:e,children:[h.jsx(Cf,{size:14})," Back to Compute"]}),h.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[h.jsx("h1",{children:"Instance history"}),h.jsxs("button",{className:Kn,onClick:u,disabled:a,children:[h.jsx(rh,{size:12,className:a?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," Refresh"]})]}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"Every compute instance spun up across your projects."}),r&&h.jsx("div",{className:"error",children:r}),t?h.jsx(aC,{instances:t,emptyLabel:"No instances yet."}):h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading…"]})]})}const oC=["projects","harnesses","storage"],yG=[{id:"compute",label:"Compute",icon:h.jsx(Qj,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:"Environment",icon:h.jsx(iS,{size:15}),activeTabs:["environment"]},{id:"settings",label:"Settings",icon:h.jsx(tR,{size:15}),activeTabs:["settings",...oC]}];function wG(e){return oC.includes(e)}function SG({tab:e,project:t,githubPublicationError:n,onProjectUpdate:r,onSelectTab:i}){const a=e==="settings"||wG(e);return h.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-md [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[a&&h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:"Settings"}),h.jsxs("div",{className:"settings-stack mt-4.5",children:[h.jsx("section",{className:Ju,children:h.jsx(cG,{})}),h.jsx("section",{className:Ju,children:h.jsx(pG,{})}),h.jsx("section",{className:Ju,children:h.jsx(Iq,{})}),h.jsx("section",{className:Ju,children:h.jsx(bG,{})}),h.jsx("section",{className:Ju,children:h.jsx(hG,{})})]})]}),e==="compute"&&h.jsx(tG,{project:t,onViewHistory:()=>i("instances")}),e==="instances"&&h.jsx(xG,{onBack:()=>i("compute")}),e==="environment"&&h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:"Environment"}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-text text-md",children:"Variables available to runs and the research agent (API keys, tokens)."}),h.jsx(lG,{})]}),e==="git"&&h.jsx(mG,{project:t,publicationError:n,onProjectUpdate:r})]})}function kG({skills:e,activeIndex:t,onPick:n,onHover:r}){return h.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] left-0 min-w-85 max-w-full p-1.5 bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden",children:e.map((i,a)=>h.jsxs("button",{type:"button",className:`skill-item flex flex-col gap-0.5 w-full text-left py-[7px] px-2 rounded-sm [&.active]:bg-surface [&_.skill-name]:text-md [&_.skill-hint]:text-muted [&_.skill-desc]:text-sm [&_.skill-desc]:text-subtext ${a===t?"active":""}`,onMouseDown:o=>{o.preventDefault(),n(i)},onMouseEnter:()=>r(a),children:[h.jsxs("span",{className:"skill-name",children:["/",i.name," ",h.jsx("span",{className:"skill-hint",children:i.argHint})]}),h.jsx("span",{className:"skill-desc",children:i.description})]},i.name))})}function CG({cmd:e}){const[t,n]=R.useState(!1);return h.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[h.jsx("code",{className:tn,children:e}),h.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)}).catch(()=>{})},"aria-label":t?"Copied":`Copy ${e}`,title:t?"Copied":"Copy",children:t?h.jsx(Di,{size:11,strokeWidth:3}):h.jsx(t_,{size:11})})]})}function j2(e){return e?e.split(/`([^`]+)`/).map((t,n)=>n%2===1?h.jsx(CG,{cmd:t},n):t):null}function bv({harness:e,size:t=16}){const n=`block shrink-0${e==="claude-code"?" text-[#d97757]":""}`;return e==="claude-code"?h.jsx("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?h.jsx("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):h.jsx("svg",{className:n,width:t,height:t,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const EG=["model-group flex items-center justify-between gap-2","text-md font-semibold text-text pt-2.5 px-2 pb-1.5"].join(" "),_w=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-xs text-muted"].join(" "),ad={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"};function AG(e){var r,i;const t=e.find(a=>a.agentReady);if(!t)return null;const n=((r=t.models[0])==null?void 0:r.id)??null;return{harness:t.id,model:n,permissionMode:((i=t.options)==null?void 0:i.defaultPermissionMode)??null,reasoningLevel:op(t,n).defaultId}}function Bo(e){const[t,n]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!t)return;const i=o=>{var l;(l=r.current)!=null&&l.contains(o.target)||n(!1)},a=o=>{var l;o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),n(!1),(l=e==null?void 0:e.current)==null||l.focus())};return document.addEventListener("mousedown",i,!0),document.addEventListener("keydown",a,!0),()=>{document.removeEventListener("mousedown",i,!0),document.removeEventListener("keydown",a,!0)}},[t,e]),{open:t,setOpen:n,ref:r}}function TG({value:e,onSelect:t,permissionChoices:n=[],defaultPermissionId:r,onSelectPermission:i,reasoningChoices:a=[],defaultReasoningId:o,onSelectReasoning:l,onHarnesses:u,lockHarness:d=!1}){var O,H,V,W,re;const[m,f]=R.useState([]),g=R.useRef(null),b=R.useRef(null),{open:k,setOpen:S,ref:x}=Bo(g),[_,w]=R.useState(""),[y,C]=R.useState("root"),N=()=>{S(!1),C("root"),w("")};R.useEffect(()=>{var le;k&&(y==="reasoning"||y==="permissions")&&((le=b.current)==null||le.focus())},[k,y]),R.useEffect(()=>{let le=!0;const pe=(B=!1)=>Tf(B).then(ie=>{le&&(f(ie),u==null||u(ie))}).catch(()=>{});pe();const te=c_(()=>void pe(!0));return()=>{le=!1,te()}},[]);const E=R.useMemo(()=>{const le=_.trim().toLowerCase();return(d&&e?m.filter(te=>te.id===e.harness):m).map(te=>{let B=te.models;return le?B=B.filter(ie=>ie.id.toLowerCase().includes(le)):te.id==="opencode"&&(B=B.slice(0,6)),{harness:te,models:B,hidden:le?0:te.models.length-B.length}})},[m,_,d,e]),j=(le,pe)=>{var B;const te=(e==null?void 0:e.harness)===le.id;t({harness:le.id,model:pe,permissionMode:te?e.permissionMode:((B=le.options)==null?void 0:B.defaultPermissionMode)??null,reasoningLevel:_S(le,pe,te?e.reasoningLevel:null)}),N()},T=(e==null?void 0:e.model)!=null?(O=m.find(le=>le.id===e.harness))==null?void 0:O.models.find(le=>le.id===e.model):void 0,D=e?e.model?T?Af(T):xS(e.model):"Default model":"Model",I=(e==null?void 0:e.reasoningLevel)??o??((H=a[0])==null?void 0:H.id),$=(V=a.find(le=>le.id===I))==null?void 0:V.label,F=(e==null?void 0:e.permissionMode)??r??((W=n[0])==null?void 0:W.id),U=(re=n.find(le=>le.id===F))==null?void 0:re.label,G=(e==null?void 0:e.harness)==="opencode"?"Variant":"Effort",X=le=>{l==null||l(le),N()},Y=le=>{i==null||i(le),N()},Z=(le,pe,te)=>h.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-md text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>C(te),children:[h.jsx("span",{className:"flex-1",children:le}),pe&&h.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:pe}),h.jsx(Xs,{size:14,className:"shrink-0 text-muted"})]}),Q=le=>h.jsxs("button",{ref:b,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-left text-sm font-medium text-text hover:bg-surface",onClick:()=>{C("root"),w("")},children:[h.jsx(W8,{size:15}),le]}),z=(le,pe,te,B)=>h.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:le.map(ie=>h.jsxs("button",{className:hi,onClick:()=>B(ie.id),children:[h.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[h.jsxs("span",{children:[ie.label,ie.id===te&&h.jsx("span",{className:"font-normal text-muted",children:" · Default"})]}),ie.description&&h.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:ie.description})]}),ie.id===pe&&h.jsx(Di,{size:13})]},ie.id))});return h.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:x,children:[h.jsxs("button",{ref:g,type:"button",className:"composer-pill inline-flex min-w-0 max-w-full items-center gap-[5px] text-md text-text py-[5px] px-2 rounded-sm whitespace-nowrap transition-[background] duration-150 ease-standard [&:hover]:bg-surface",title:`Harness + model for this chat: ${D}${$?` · ${$}`:""}`,"aria-haspopup":"menu","aria-expanded":k,onClick:()=>{k?N():(C("root"),S(!0))},children:[(e==null?void 0:e.harness)&&h.jsx(bv,{harness:e.harness,size:14}),h.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[D,$&&h.jsx("span",{className:"model-picker-reasoning ml-1 text-muted",children:$})]}),h.jsx(Rl,{size:14,className:"shrink-0 text-muted"})]}),k&&h.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-[0_10px_26px_rgba(0,_0,_0,_0.16)] z-50 overflow-hidden w-72 [&.align-right]:left-auto [&.align-right]:right-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[y==="root"&&h.jsxs("div",{className:"model-root-menu p-1",children:[Z("Model",D,"models"),a.length>0&&Z(G,$,"reasoning"),n.length>0&&Z("Mode",U,"permissions")]}),y==="models"&&h.jsxs(h.Fragment,{children:[Q("Model"),h.jsx("input",{autoFocus:!0,type:"text",placeholder:"Search models…",value:_,onChange:le=>w(le.target.value)}),h.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[E.map(({harness:le,models:pe,hidden:te})=>h.jsxs("div",{className:"[&_.model-item]:pl-6",children:[h.jsxs("div",{className:EG,children:[h.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[h.jsx(bv,{harness:le.id,size:14}),le.name]}),!le.agentReady&&h.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[h.jsx(t3,{size:10})," Unavailable"]})]}),le.agentReady?h.jsxs(h.Fragment,{children:[le.models.length===0&&h.jsxs("button",{className:hi,onClick:()=>j(le,null),children:[h.jsxs("span",{children:["Default model",h.jsx("span",{className:"model-id",children:"CLI configuration"})]}),(e==null?void 0:e.harness)===le.id&&(e==null?void 0:e.model)===null&&h.jsx(Di,{size:13})]}),pe.map(B=>h.jsxs("button",{className:hi,title:B.id,onClick:()=>j(le,B.id),children:[h.jsx("span",{children:Af(B)}),(e==null?void 0:e.harness)===le.id&&(e==null?void 0:e.model)===B.id&&h.jsx(Di,{size:13})]},B.id)),te>0&&h.jsxs("div",{className:_w,children:[te," more — search to find"]}),_.trim().length>0&&!le.models.some(B=>B.id===_.trim())&&h.jsx("button",{className:hi,onClick:()=>j(le,_.trim()),children:h.jsxs("span",{children:["Use “",_.trim(),"”",h.jsx("span",{className:"model-id",children:"pass as the model id"})]})})]}):h.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-xs text-muted model-unavailable leading-normal border-b border-b-border-variant",children:le.agentNote?j2(le.agentNote):"Not available"})]},le.id)),m.length===0&&h.jsx("div",{className:_w,children:"Detecting harnesses…"})]}),d&&e&&m.length>1&&h.jsxs("div",{className:"model-locked-note flex items-center gap-1.5 py-[7px] px-3 text-xs text-muted border-t border-t-border-variant [&_svg]:shrink-0",children:[h.jsx(t3,{size:11}),"Sessions keep their harness — new chat to switch"]})]}),y==="reasoning"&&h.jsxs(h.Fragment,{children:[Q(G),z(a,I,o,X)]}),y==="permissions"&&h.jsxs(h.Fragment,{children:[Q("Mode"),z(n,F,r,Y)]})]})]})}function NG(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const vv=6.5,xw=2*Math.PI*vv;function jG({usage:e}){return!e||e.usedTokens<=0?null:h.jsx(MG,{usage:e})}function MG({usage:e}){const{open:t,setOpen:n,ref:r}=Bo(),{usedTokens:i,contextWindow:a}=e,o=a&&a>0?Math.min(100,Math.round(i/a*100)):null,l=o===null?"var(--accent)":NG(o);return h.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[h.jsx("button",{type:"button",className:"composer-bare inline-flex items-center gap-[3px] text-md text-text py-[5px] px-1 rounded-sm transition-[background] duration-150 ease-standard [&:hover]:bg-surface [&.context-ring]:inline-flex [&.context-ring]:items-center [&.context-ring]:mr-2 context-ring",title:"Context window used",onClick:()=>n(u=>!u),children:o===null?N0(i):h.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[h.jsx("circle",{cx:"8",cy:"8",r:vv,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),h.jsx("circle",{cx:"8",cy:"8",r:vv,fill:"none",stroke:l,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${xw*Math.max(o,2)/100} ${xw}`,transform:"rotate(-90 8 8)"})]})}),t&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 align-right context-meter-menu w-70 pt-2.5 px-3 pb-3 [&_.progress]:mt-2 [&_.progress]:mx-0 [&_.progress]:mb-0 [&_.progress-track]:h-[5px] [&_.progress-track]:border-0 [&_.progress-track]:bg-border",children:[h.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[h.jsx("span",{children:"Context window"}),h.jsx("span",{className:"context-meter-value text-text tabular-nums",children:o===null?`${N0(i)} tokens`:`${N0(i)} / ${N0(a)} (${o}%)`})]}),o!==null&&h.jsx(rC,{value:i,max:a,fillColor:l})]})]})}const _v={name:"plan",description:"Toggle Plan mode for this chat",argHint:"",source:"command"},RG=new Set([_v.name]);function yw(e,t){if(t<0||t>e.length)return null;let n=t;for(;n>0&&!/\s/.test(e[n-1]);)n-=1;if(e[n]!=="/")return null;let r=t;for(;r0}}function DG(e,t){return t?e.filter(n=>n.source==="command"&&RG.has(n.name.toLowerCase())):e}function LG(e,t){let n=e.slice(0,t.start),r=e.slice(t.end);return n?r?/\s$/.test(n)&&/^\s/.test(r)&&(r=r.slice(1)):n=n.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:n+r,cursor:n.length}}function OG(e,t){const n=e.filter(r=>r.name.toLowerCase()!==_v.name);return t?[_v,...n]:n}function IG(e,t){if(!t)return null;const n=/(^|\s)\/plan(?=\s|$)/gi;return n.test(e)?{prompt:e.replace(n,"").trim()}:null}function zG(e,t,n){if(e==="command")return t!==void 0?t:n??void 0}const M2="orx:demo-read-sessions";function lC(){try{const e=JSON.parse(sessionStorage.getItem(M2)??"[]");return new Set(Array.isArray(e)?e.filter(t=>typeof t=="string"):[])}catch{return new Set}}function BG(e){try{const t=lC();t.add(e),sessionStorage.setItem(M2,JSON.stringify([...t]))}catch{}}function HG(){try{sessionStorage.removeItem(M2)}catch{}}function $G(e){return e.replace(/([\\`*_[\]<>$~])/g,"\\$1").replace(/(^|\n)(\s*)(#{1,6}|>|[-+]|\d+\.)\s/g,"$1$2\\$3 ").replace(/(^|\n)(\s*)(=+|-{1,2})(?=\s*(?:\n|$))/g,"$1$2\\$3").replace(/(^|\n)(\s*)(-{3,})(?=\s*(?:\n|$))/g,"$1$2\\$3")}function FG(e){const t=Math.max(0,...Array.from(e.matchAll(/`+/g),i=>i[0].length)),n="`".repeat(t+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${n}${r}${n}`}function PG(e){const t=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),n="`".repeat(Math.max(3,t+1));return` - -${n} -${e.replace(/^\n|\n$/g,"")} -${n} - -`}function xv(e,t){return t?` - -\\[ -${e} -\\] - -`:`\\(${e}\\)`}function UG(e,t){const n=t.trim().split(` -`),r=" ".repeat(e.length+1);return[`${e} ${n[0]??""}`,...n.slice(1).map(i=>i?`${r}${i}`:"")].join(` -`)}function qG(e,t){if(e.length===0)return"";const n=Math.max(...e.map(o=>o.length)),r=o=>`| ${Array.from({length:n},(l,u)=>o[u]??"").join(" | ")} |`,i=t?e[0]:Array.from({length:n},()=>""),a=t?e.slice(1):e;return[r(i),r(Array.from({length:n},()=>"---")),...a.map(r)].join(` -`)}function GG(e,t){const n=Number(e.slice(1));return Number.isInteger(n)&&n>=1&&n<=6?`${"#".repeat(n)} ${t.trim()}`:void 0}function VG(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function WG(e,t){return Math.min(e.length,t.length)/Math.max(e.length,t.length)>=.8&&(e.includes(t)||t.includes(e))}const YG=["tool-line flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap","text-lg"].join(" "),El=256,cC=1024,XG=2e4,Xg=8,U0="chat-annotations";function gl(e){return e instanceof Element?e:e.parentElement}function ww(e){const t=document.createRange();return t.setStart(e.container,e.offset),t.collapse(!0),t}function Kg(e,t){return ww(e).compareBoundaryPoints(Range.START_TO_START,ww(t))<0}function Sw(e,t){const n=document.createRange();return n.setStart(e.container,e.offset),n.setEnd(t.container,t.offset),n.cloneContents()}const KG=new Set(["A","B","CODE","EM","I","STRONG"]);function ZG(e,t){var i,a;const n=gl(e.endContainer);if(Array.from(t.childNodes).every(o=>o.nodeType===Node.TEXT_NODE)){let o=gl(e.startContainer);for(;o&&o.matches(".md *")&&o.contains(n);){if(KG.has(o.tagName)){const l=o.cloneNode(!1);l instanceof HTMLElement&&(l.replaceChildren(...Array.from(t.childNodes)),t.replaceChildren(l))}o=o.parentElement}}const r=(i=gl(e.startContainer))==null?void 0:i.closest("pre");if(r!=null&&r.contains(n)){const o=(a=r.querySelector("code"))==null?void 0:a.cloneNode(!1),l=r.cloneNode(!1);l instanceof HTMLElement&&o instanceof HTMLElement&&(o.replaceChildren(...Array.from(t.childNodes)),l.replaceChildren(o),t.replaceChildren(l))}}function QG(e){e.querySelectorAll("button").forEach(t=>{t.replaceWith(document.createTextNode(t.textContent??""))}),e.querySelectorAll("script, style, iframe, object, embed, input, textarea, select").forEach(t=>t.remove()),e.querySelectorAll("*").forEach(t=>{for(const n of Array.from(t.attributes))(n.name.toLowerCase().startsWith("on")||n.name==="contenteditable"||n.name==="tabindex")&&t.removeAttribute(n.name)})}function JG(e,t){const n=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let i={container:e.startContainer,offset:e.startOffset};const a=Array.from(t.querySelectorAll(".katex")).filter(o=>e.intersectsNode(o));for(const o of a){const l=o.closest(".katex-display")??o,u=document.createRange();u.selectNode(l);const d={container:u.startContainer,offset:u.startOffset},m={container:u.endContainer,offset:u.endOffset};if(Kg(i,d)&&n.append(Sw(i,d)),n.append(l.cloneNode(!0)),i=m,!Kg(i,r))break}return a.length===0?n.append(e.cloneContents()):Kg(i,r)&&n.append(Sw(i,r)),ZG(e,n),QG(n),n}function eV(e){const t=Array.from(e.querySelectorAll("tr")).map(n=>Array.from(n.querySelectorAll(":scope > th, :scope > td")).map(r=>Rd(r).trim().replaceAll("|","\\|"))).filter(n=>n.length>0);return t.length>0?` - -${qG(t,!!e.querySelector("tr:first-child th"))} - -`:""}function uC(e){const t=e.tagName==="OL",n=e.getAttribute("start"),r=n===null?1:Number(n);let i=Number.isFinite(r)?r:1;const a=[];for(const o of Array.from(e.children).filter(l=>l instanceof HTMLElement&&l.tagName==="LI")){const l=o.getAttribute("value"),u=l===null?i:Number(l),d=Number.isFinite(u)?u:i;i=d+1;const m=Array.from(o.childNodes).map(f=>f instanceof HTMLElement&&f.matches("UL, OL")?` -${uC(f).trim()} -`:Rd(f)).join("").trim();a.push(UG(t?`${d}.`:"-",m))}return` - -${a.join(` -`)} - -`}function Rd(e){var r,i,a,o,l;if(e.nodeType===Node.TEXT_NODE)return $G(e.textContent??"");if(!(e instanceof HTMLElement))return Array.from(e.childNodes).map(Rd).join("");if(e.matches(".katex-display")){const u=(i=(r=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:r.textContent)==null?void 0:i.trim();return u?xv(u,!0):""}if(e.matches(".katex")){const u=(o=(a=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:a.textContent)==null?void 0:o.trim();return u?xv(u,!1):""}if(e.tagName==="BR")return` -`;if(e.tagName==="TABLE")return eV(e);if(e.matches("UL, OL"))return uC(e);if(e.tagName==="CODE"&&((l=e.parentElement)==null?void 0:l.tagName)!=="PRE")return FG(e.textContent??"");if(e.tagName==="PRE")return PG(e.textContent??"");const t=Array.from(e.childNodes).map(Rd).join("");if(!t)return"";if(e.matches("strong, b"))return`**${t}**`;if(e.matches("em, i"))return`*${t}*`;if(e.tagName==="A"){const u=e.getAttribute("href");return u?`[${t}](${u})`:t}if(e.tagName==="LI")return`${t.trim()} -`;if(e.matches("TH, TD"))return`${t.trim()} | `;if(e.tagName==="TR")return`${t.replace(/ \| $/,"")} -`;if(e.tagName==="BLOCKQUOTE")return` - -${t.trim().split(` -`).map(u=>`> ${u}`).join(` -`)} - -`;const n=GG(e.tagName,t);return n?` - -${n} - -`:e.matches("P, DIV, UL, OL, TABLE")?` - -${t.trim()} - -`:t}function tV(e,t){return Rd(e).replace(/\r\n?/g,` -`).replace(/[ \t]+\n/g,` -`).replace(/\n{3,}/g,` - -`).trim()||t}function kw(e){return e.normalize("NFKC").replace(/[\s\u200B-\u200D\u2060\uFEFF]/g,"").toLowerCase()}function nV(e,t){var i,a,o,l;if(!VG(e))return;const n=kw(e);if(n.length<8)return;let r;for(const u of t.querySelectorAll(".msg-assistant > .md .katex")){const m=[(i=u.querySelector(".katex-mathml"))==null?void 0:i.textContent,(a=u.querySelector(".katex-html"))==null?void 0:a.textContent,u.textContent].filter(k=>!!k).map(kw).find(k=>WG(k,n));if(!m)continue;const f=(l=(o=u.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:o.textContent)==null?void 0:l.trim();if(!f)continue;const g=!!u.closest(".katex-display"),b={markdown:xv(f,g).trim(),delta:Math.abs(m.length-n.length)};(!r||b.deltaT.width>0&&T.height>0),k=b[0]??n.getBoundingClientRect(),S=b.filter(T=>T.topk.top),x=S.length>0?S:[k],_=Math.min(...x.map(T=>T.left)),w=Math.max(...x.map(T=>T.right)),y=Math.min(...x.map(T=>T.top)),C=Math.max(...x.map(T=>T.bottom)),N=34,E=74,j=y>=N+Xg?y-N-Xg:C+Xg;return{text:tV(g,f),range:n.cloneRange(),x:Math.min(window.innerWidth-E,Math.max(E,_+(w-_)/2)),top:j}}function iV(e,t){const[n,r]=R.useState(null),i=R.useRef(!1),a=R.useCallback(()=>{const u=e.current;r(u?rV(u):null)},[e]);R.useEffect(()=>{let u=null;const d=()=>{i.current||a()},m=g=>{const b=e.current,k=g.target;!g.isPrimary||g.button!==0||!b||!(k instanceof Node)||!b.contains(k)||(i.current=!0,r(null))},f=g=>{!g.isPrimary||!i.current||(i.current=!1,u=window.requestAnimationFrame(a))};return document.addEventListener("selectionchange",d),document.addEventListener("pointerdown",m,!0),window.addEventListener("pointerup",f,!0),window.addEventListener("pointercancel",f,!0),()=>{document.removeEventListener("selectionchange",d),document.removeEventListener("pointerdown",m,!0),window.removeEventListener("pointerup",f,!0),window.removeEventListener("pointercancel",f,!0),u!==null&&window.cancelAnimationFrame(u),i.current=!1}},[a]),R.useEffect(()=>{if(!n)return;const u=d=>{const m=d.target;m instanceof Element&&m.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",u,!0),window.addEventListener("resize",a),()=>{document.removeEventListener("mousedown",u,!0),window.removeEventListener("resize",a)}},[n,a]);const o=R.useCallback(()=>{var u;n&&(t({text:n.text,range:n.range}),r(null),(u=window.getSelection())==null||u.removeAllRanges())},[n,t]),l=R.useCallback(()=>r(null),[]);return{action:n,add:o,dismiss:l}}function sV(e){R.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const t=e.flatMap(r=>r.range?[r.range]:[]);if(t.length===0){CSS.highlights.delete(U0);return}const n=new Highlight(...t);return CSS.highlights.set(U0,n),()=>{CSS.highlights.get(U0)===n&&CSS.highlights.delete(U0)}},[e])}function aV({annotation:e}){const t=R.useRef(null),[n,r]=R.useState();return R.useLayoutEffect(()=>{var a;const i=(a=t.current)==null?void 0:a.closest(".chat-thread-inner");r(i?nV(e.text,i):void 0)},[e.id,e.text]),h.jsx("div",{ref:t,children:h.jsx(La,{text:n??e.text})})}function oV({annotations:e,onRemove:t}){return e.map((n,r)=>h.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${t?"grid-cols-[24px_minmax(0,_1fr)_24px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[h.jsxs("span",{className:"text-sm text-muted text-right",children:[r+1,"."]}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"text-sm text-muted mb-1",children:"Selected text:"}),h.jsx(aV,{annotation:n})]}),t&&h.jsx("button",{type:"button",className:"inline-flex items-center justify-center w-6 h-6 rounded-sm text-muted [&:hover]:bg-surface [&:hover]:text-text",title:"Remove annotation","aria-label":`Remove annotation ${r+1}`,onClick:()=>t(n.id),children:h.jsx(qr,{size:13})})]},n.id))}function R2({annotations:e,variant:t,onClear:n,onRemove:r}){const i=R.useRef(null),a=R.useRef(null),o=R.useId(),l=Bo(i),u=t==="sent",d=R.useRef(null),m=()=>{d.current!==null&&window.clearTimeout(d.current),d.current=null,l.setOpen(!0)},f=()=>{d.current=window.setTimeout(()=>{var k;(k=a.current)!=null&&k.contains(document.activeElement)||l.setOpen(!1)},160)},g=()=>{const k=u||!l.open;l.setOpen(k),k&&window.requestAnimationFrame(()=>{var S;return(S=a.current)==null?void 0:S.focus()})},b=k=>{r==null||r(k),window.requestAnimationFrame(()=>{var x,_;(_=((x=a.current)==null?void 0:x.querySelector("button[aria-label^='Remove annotation']"))??a.current??i.current)==null||_.focus()})};return R.useEffect(()=>()=>{d.current!==null&&window.clearTimeout(d.current)},[]),h.jsxs("div",{className:u?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:l.ref,onMouseEnter:u?m:void 0,onMouseLeave:u?f:void 0,children:[h.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${u?"rounded-full":"rounded-sm"}`,children:[h.jsxs("button",{ref:i,type:"button",className:`inline-flex items-center gap-1.5 py-1 text-sm font-medium text-text [&:hover]:bg-surface ${u?"px-2.5":"pl-2 pr-1.5"}`,"aria-expanded":l.open,"aria-haspopup":"dialog","aria-controls":o,onClick:g,children:[h.jsx(tS,{size:u?13:14,className:"text-muted"}),e.length," ",e.length===1?"annotation":"annotations"]}),n&&h.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-l border-border [&:hover]:bg-surface [&:hover]:text-text",title:"Clear annotations","aria-label":"Clear annotations",onClick:n,children:h.jsx(qr,{size:13})})]}),l.open&&h.jsx("div",{id:o,ref:a,tabIndex:-1,className:`annotation-menu absolute bottom-[calc(100%_+_8px)] z-50 w-[min(440px,_calc(100vw_-_48px))] max-h-80 overflow-y-auto overscroll-contain bg-background border border-border rounded-lg shadow-[0_4px_16px_rgba(0,_0,_0,_0.10)] p-2 text-left ${u?"right-0 after:absolute after:top-full after:left-0 after:right-0 after:h-2 after:content-['']":"left-3"}`,role:"dialog","aria-label":"Selected chat text",children:h.jsx(oV,{annotations:e,onRemove:r?b:void 0})})]})}function lV(e){return h.jsx(R2,{...e,variant:"composer"})}const cV=["prompt-collapsed text-muted text-lg font-[375] my-3.5 mx-0 [&_summary]:flex","[&_summary]:items-center [&_summary]:gap-2 [&_summary]:cursor-pointer","[&_summary]:list-none [&_summary]:select-none [&_summary::-webkit-details-marker]:hidden","[&_summary::after]:content-['›'] [&_summary::after]:text-muted","[&_summary::after]:transition-transform [&_summary::after]:duration-80 [&_summary::after]:ease-standard [&[open]_summary::after]:rotate-90"].join(" "),Cw=["prompt-collapsed-body mt-1.5 pl-3 border-l-2 border-l-border","text-md text-subtext"].join(" "),uV=["prompt-collapsed plan-resolved text-subtext my-3.5 mx-0","[&_summary]:flex [&_summary]:items-center [&_summary]:gap-2 [&_summary]:w-fit [&_summary]:max-w-full","[&_summary]:py-[3px] [&_summary]:px-1 [&_summary]:cursor-pointer [&_summary]:rounded-sm","[&_summary]:list-none [&_summary]:select-none [&_summary:hover]:bg-surface","[&_summary::-webkit-details-marker]:hidden","[&_summary_.plan-chevron]:transition-transform [&_summary_.plan-chevron]:duration-120","[&_summary_.plan-chevron]:ease-standard [&[open]_summary_.plan-chevron]:rotate-90"].join(" "),dV=["prompt-head text-xs font-semibold text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),yv=["prompt-actions flex flex-wrap gap-2 [&_.btn-primary]:inline-flex","[&_.btn-primary]:items-center [&_.btn-primary]:gap-1.5 [&_.btn-primary]:py-1.5 [&_.btn-primary]:px-[13px]","[&_.btn-primary]:font-[inherit] [&_.btn-primary]:text-sm","[&_.btn-primary]:font-semibold [&_.btn-primary]:border [&_.btn-primary]:border-transparent","[&_.btn-primary]:rounded-sm [&_.btn-primary]:cursor-pointer","[&_.btn-primary]:transition-[background,border-color] [&_.btn-primary]:duration-80 [&_.btn-primary]:ease-standard [&_.btn-ghost]:inline-flex","[&_.btn-ghost]:items-center [&_.btn-ghost]:gap-1.5 [&_.btn-ghost]:py-1.5 [&_.btn-ghost]:px-[13px]","[&_.btn-ghost]:font-[inherit] [&_.btn-ghost]:text-sm","[&_.btn-ghost]:font-semibold [&_.btn-ghost]:border [&_.btn-ghost]:border-transparent","[&_.btn-ghost]:rounded-sm [&_.btn-ghost]:cursor-pointer","[&_.btn-ghost]:transition-[background,border-color] [&_.btn-ghost]:duration-80 [&_.btn-ghost]:ease-standard","[&_.btn-primary]:bg-primary [&_.btn-primary]:text-background","[&_.btn-primary:hover:not(:disabled)]:opacity-90 [&_.btn-ghost]:bg-transparent","[&_.btn-ghost]:border-border [&_.btn-ghost]:text-subtext","[&_.btn-ghost:hover:not(:disabled)]:border-border-strong","[&_.btn-ghost:hover:not(:disabled)]:text-text","[&_.btn-ghost:hover:not(:disabled)]:bg-surface [&_button:disabled]:opacity-50","[&_button:disabled]:cursor-default"].join(" "),Ic="local-",Ew=[];function hV(e,t){const n=e.findIndex(r=>r.id===t.id);if(n>=0){const r=e.slice();return r[n]=t,r}return t.role!=="user"?[...e,t]:[...e.filter(r=>!r.id.startsWith(Ic)),t]}function fV(e,t){switch(t.type){case"reset":return{messagesBySession:{},busySessions:new Set,queuedBySession:{},activeLeafBySession:{}};case"seed":return t.onlyIfAbsent&&t.sessionId in e.messagesBySession?e:{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:t.messages},queuedBySession:{...e.queuedBySession,[t.sessionId]:t.queued??[]},activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:t.activeLeafId??null}};case"upsertMessage":{const n=e.messagesBySession[t.sessionId]??[],r=n.some(l=>l.id===t.message.id),i=e.activeLeafBySession[t.sessionId]??null,a=t.message.role==="user"&&i!==null&&i.startsWith(Ic),o=t.message.parentId!=null&&t.message.parentId===i;return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:hV(n,t.message)},activeLeafBySession:r&&!a&&!o?e.activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:t.message.id}}}case"localError":{const n=e.messagesBySession[t.sessionId]??[],r={id:`${Ic}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:t.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[t.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:[...n,r]},activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:r.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:t.leafId}};case"optimisticUser":{const n=e.messagesBySession[t.sessionId]??[],r=t.text?[{id:"p0",type:"text",text:t.text}]:[];t.attachments.forEach((a,o)=>r.push({id:`img${o}`,type:"image",text:a.url,name:a.name})),t.annotations.forEach((a,o)=>r.push({id:`annotation${o}`,type:"annotation",text:a.text}));const i={id:`${Ic}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[t.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:[...n,i]},activeLeafBySession:{...e.activeLeafBySession,[t.sessionId]:i.id}}}case"busy":{const n=new Set(e.busySessions);return t.busy?n.add(t.sessionId):n.delete(t.sessionId),{...e,busySessions:n}}case"seedBusy":{const n=new Set(t.sessions),r=new Set(t.known);for(const i of e.busySessions)r.has(i)||n.add(i);return{...e,busySessions:n}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[t.sessionId]:t.items}};case"forget":{const n={...e.messagesBySession};delete n[t.sessionId];const r=new Set(e.busySessions);r.delete(t.sessionId);const i={...e.queuedBySession};delete i[t.sessionId];const a={...e.activeLeafBySession};return delete a[t.sessionId],{messagesBySession:n,busySessions:r,queuedBySession:i,activeLeafBySession:a}}}}function pV(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 dl(e){const t=e.replace(/\/+$/,"");return t.slice(t.lastIndexOf("/")+1)||t}function ji(e,...t){for(const n of t){const r=e[n];if(typeof r=="string"&&r)return r}return null}function Zg(e,t,n){const r=e[t];if(!Array.isArray(r))return null;for(const i of r){if(!i||typeof i!="object"||!(n in i))continue;const a=i[n];if(typeof a=="string"&&a)return a}return null}function Qg(e,t){const n=e[t];if(!Array.isArray(n))return[];const r=[];for(let i=0;i=El));i++);return r}function zc(...e){const t=new Set,n=new RegExp(`^${wl}$`,"i");let r=0;for(const i of e)for(const a of i){if(t.size>=El||r++>=cC)return[...t];n.test(a)&&t.add(a.toLowerCase())}return[...t]}function D2(e){return e.replace(/^Exit code \d+\s*/i,"").split(` -`).filter(t=>!/^\s*\[orx-(?:run|experiment):[^\]]+\]\s*$/.test(t)).join(` -`).trim()}function mV(e){const t=e.changes;if(!Array.isArray(t))return null;for(const n of t){if(!n||typeof n!="object"||!("path"in n)||typeof n.path!="string")continue;const r="kind"in n?n.kind:null,i=r&&typeof r=="object"&&"type"in r&&typeof r.type=="string"?r.type:null;return{path:n.path,type:i}}return null}function gV(e){const t=e.trim(),n=t.match(/^\/bin\/(?:ba|z)?sh\s+-lc\s+([\s\S]+)$/);let r=((n==null?void 0:n[1])??t).trim();const i=r[0];return(i==='"'||i==="'")&&r[r.length-1]===i&&(r=r.slice(1,-1)),vV(r).replace(/[\t\r ]+/g," ").trim()}function bV(e){let t=null,n=!1;for(let r=0;r{n&&t.push(n),n=""};for(const o of e){if(i){n+=o,i=!1;continue}if(o==="\\"&&r!=="'"){i=!0;continue}if(r){o===r?r=null:n+=o;continue}if(o==='"'||o==="'"){r=o;continue}/\s/.test(o)?a():n+=o}return a(),t}function hC(e){const t=e==null?void 0:e.replace(/[)'\"]+$/,"");return!t||t==="-"||/^\d+$/.test(t)||/[$`]/.test(t)?null:t}function fC(e){const t=hC(e);if(!t)return null;const n=dl(t);return t.includes("/")||t.startsWith(".")||/\.[A-Za-z0-9][A-Za-z0-9_-]*$/.test(n)||/^(?:Dockerfile|Makefile|README|LICENSE|NOTICE|CHANGELOG)$/i.test(n)?t:null}function pC(e){var i,a;const t=dC(e);let n=0;for(;["do","then","else","if","while","until"].includes(t[n]);)n++;for(;/^[A-Za-z_][A-Za-z0-9_]*=/.test(t[n]??"");)n++;if(t[n]==="command")for(n++;(i=t[n])!=null&&i.startsWith("-");)n++;if(t[n]==="env")for(n++;(a=t[n])!=null&&a.startsWith("-")||/^[A-Za-z_][A-Za-z0-9_]*=/.test(t[n]??"");)n++;const r=t[n];return r?{name:r.split("/").pop()??r,args:t.slice(n+1)}:null}function _V(e){const{name:t,args:n}=e;if(t==="sed"){let i=0,a=!1;for(;i!a.startsWith("-")&&a.includes(":"));if(!t)return null;const n=t.indexOf(":"),r=t.slice(0,n),i=t.slice(n+1);return r&&fC(i)?{ref:r,path:i}:null}function yV(e){const t=e.match(/\b(?:rg|grep)\b(?:\s+-[^\s]+)*\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/);return(t==null?void 0:t[1])??(t==null?void 0:t[2])??(t==null?void 0:t[3])??null}function Aw(e,t){if(/[$`~]/.test(e)||/[$`~]/.test(t))return null;const n=t.startsWith("/")||!t.startsWith("/")&&e.startsWith("/"),r=t.startsWith("/")?[]:e.split("/").filter(Boolean);for(const a of t.split("/"))if(!(!a||a===".")){if(a===".."){r.length>0&&r[r.length-1]!==".."?r.pop():n||r.push(a);continue}r.push(a)}return`${n?"/":""}${r.join("/")}`||(n?"/":null)}function wV(e,t,n,r){if(e.startsWith("/"))return e;let i=r??"";for(let a=0;a!d.startsWith("-"));if(!l)return null;const u=Aw(i,l);if(!u)return null;i=u}return i?Aw(i,e):e}const Ca="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",wl=`(?:${Ca}|[0-9a-f]{8})`;function bd(e){const t=[];let n="",r="",i=null,a=!1;const o=()=>{(n.trim()||r.trim())&&t.push({raw:n.trim(),code:r.trim()}),n="",r=""},l=d=>{let m=1,f=null,g=!1;for(let b=d;b{let m=!1;for(let f=d;fn.test(r.code))}function Ea(e,t){return Dd(e,t).length>0?!0:new RegExp(`(?:^|[\\s($;])orx\\s+${t}\\b`,"i").test(e)}function wv(e,t){if(!e)return[];const n=new Set,r=e.slice(0,XG),i=t==="runs"?[new RegExp(`/runs/(${Ca})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${Ca})`,"gi"),new RegExp(`^\\s*RUN\\s+(${Ca})\\b`,"gim"),new RegExp(`={3,}\\s*(${Ca})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${Ca})`,"gi"),new RegExp(`^\\s*id:\\s*(${Ca})`,"gim"),new RegExp(`={3,}\\s*(${Ca})\\s*={3,}`,"gi")];for(const o of i)for(const l of r.matchAll(o))if(n.add(l[1]),n.size>=El)return[...n];const a=new RegExp(`^\\s*(${Ca})(?:\\s|$)`,"gim");for(const o of r.matchAll(a))if(n.add(o[1]),n.size>=El)break;return[...n]}function mC(e,t){let n=0;return t.map(r=>{const i=e.indexOf(r.raw,n),a=i===-1?e.indexOf(r.raw):i;return n=Math.max(n,a+r.raw.length),{invocation:r,offset:Math.max(0,a)}})}function gC(e,t,n,r){const i=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let a="";for(const o of e.matchAll(i)){if((o.index??0)>=n)break;a=o[1]??o[2]??o[3]??""}return[...a.matchAll(new RegExp(r,"gi"))].map(o=>o[0])}function bC(e,t,n,r){const i=new RegExp(`\\bfor\\s+${t}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let a="";for(const o of e.matchAll(i)){const l=o.index??0;if(l>=n)break;const u=l+o[0].length;u<=n&&/\bdone\b/.test(e.slice(u,n))||(a=o[1])}return/\$\(|`/.test(a)?[]:[...a.matchAll(new RegExp(r,"gi"))].map(o=>o[0])}function SV(e,t,n=[],r=[]){const i=Dd(e,"logs"),a=new Set;if(i.length===0){if(!Ea(e,"logs"))return[];const l=n.length>0?[]:wv(t,"runs");for(const u of n.length>0?n:l.length>0?l:r)if(a.add(u),a.size>=El)break;return zc([...a])}let o=!1;for(const{invocation:l,offset:u}of mC(e,i)){const d=/\borx\s+logs\b/i.exec(l.raw);if(!d)continue;const m=dC(l.raw.slice(d.index+d[0].length));let f=null;for(let x=0;x0?[]:wv(t,"runs"),u=n.length>0?n:l.length>0?l:r;for(const d of u)if(a.add(d),a.size>=El)break}return zc([...a])}function yc(e,t,n=[],r=[]){const i=Dd(e,"exp\\s+(?:status|desc)");if(i.length===0)return[];const a=new Set;let o=!1;for(const{invocation:l,offset:u}of mC(e,i)){let d=!1;for(const f of l.raw.matchAll(new RegExp(`\\borx\\s+exp\\s+(?:status|desc)\\s+["']?(${wl})`,"gi")))a.add(f[1]),d=!0;const m=/\borx\s+exp\s+(?:status|desc)\s+["']?\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?/.exec(l.raw);if(m){const f=m[1],g=gC(e,f,u,wl);if(g.length>0){for(const k of g)a.add(k);d=!0}const b=bC(e,f,u,wl);for(const k of b)a.add(k);b.length>0&&(d=!0)}d||(o=!0)}if(a.size===0||o){const l=n.length>0?[]:wv(t,"experiments"),u=n.length>0?n:l.length>0?l:r;for(const d of u)if(a.add(d),a.size>=El)break}return zc([...a])}function Ws(e){var x,_,w,y;const t=e.tool??"tool",n=((x=e.state)==null?void 0:x.input)??{},r=n.arguments,i=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},a={...n,...i},o=ji(a,"command","cmd"),l=((_=e.state)==null?void 0:_.output)||((w=e.state)==null?void 0:w.error),u=zc(Qg(a,"targetIds")),d=zc(Qg(a,"runTargetIds")),m=zc(Qg(a,"experimentTargetIds")),f=ji(a,"filePath","file_path","notebookPath","notebook_path","path"),g=ji(a,"description"),b=t.toLowerCase().split(/(?::|\.|__)+/),k=b.at(-1)??t.toLowerCase();if(k==="run"&&b.includes("web")){const C=Zg(a,"search_query","q"),N=Zg(a,"image_query","q"),E=Zg(a,"find","pattern");return C?{kind:"web",label:`Searched the web for “${C}”`}:N?{kind:"web",label:`Searched images for “${N}”`}:E?{kind:"web",label:`Searched a web page for “${E}”`}:Array.isArray(a.open)?{kind:"web",label:"Opened web pages"}:Array.isArray(a.weather)?{kind:"web",label:"Checked the weather"}:Array.isArray(a.finance)?{kind:"web",label:"Checked market data"}:Array.isArray(a.sports)?{kind:"web",label:"Checked sports data"}:Array.isArray(a.time)?{kind:"web",label:"Checked local times"}:{kind:"web",label:"Browsed the web"}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(k)??k){case"bash":{if(!o)return{kind:"command",label:"Ran a command"};const C=gV(o),N=Dd(C,"(?:lit|paper)")[0],E=N?sL(N.raw):null;if(E){const re=E.kind==="lit"?E.query?`Searched for “${E.query}”`:"Searched the literature":E.id?`Read ${E.id}`:"Read a paper";return{kind:E.kind==="lit"?"search":"read",label:re,litCall:E}}const j=bd(C),T=j.map(re=>pC(re.raw)),D=Ea(C,"exp\\s+status"),I=Ea(C,"exp\\s+desc"),$=Dd(C,"exp\\s+desc").some(re=>/(?:^|\s)--(?:set(?:=|\s)|stdin\b)/.test(re.raw)),F=$?"Updated experiment notes":"Read experiment notes",U=$?"Checked experiment status and updated notes":"Reviewed experiment status and notes";if(Ea(C,"logs")){const re=SV(C,l,d,u);return{kind:"project",label:re.length===1?"Reviewed run log":"Reviewed run logs",runIds:re}}if(Ea(C,"exp\\s+run"))return{kind:"project",label:"Started an experiment run"};if(Ea(C,"exp\\s+wait"))return{kind:"project",label:"Waited for an experiment run"};if(Ea(C,"exp\\s+cancel"))return{kind:"project",label:"Cancelled an experiment run"};const G=Ea(C,"project\\s+view");if(G&&D&&I)return{kind:"project",label:U,experimentIds:yc(C,l,m,u)};if(G&&I)return{kind:"project",label:F,experimentIds:yc(C,l,m,u)};if(G&&D)return{kind:"project",label:"Checked experiment status",experimentIds:yc(C,l,m,u)};if(G)return{kind:"project",label:"Read project details"};if(D&&I)return{kind:"project",label:U,experimentIds:yc(C,l,m,u)};if(D)return{kind:"project",label:"Checked experiment status",experimentIds:yc(C,l,m,u)};if(I)return{kind:"project",label:F,experimentIds:yc(C,l,m,u)};if(Ea(C,"runs?"))return{kind:"project",label:"Listed project runs"};const X=T.map(xV).find(re=>re!=null);if(X)return{kind:"read",label:`Read ${dl(X.path)}`,filePath:X.path,fileRef:X.ref,labelPrefix:"Read ",labelTarget:dl(X.path)};const Y=T.findIndex(re=>re!=null&&["sed","cat","head","tail"].includes(re.name)),Z=Y>=0?T[Y]:null,Q=Z?_V(Z):null,z=Q?wV(Q,j,Y,ji(a,"cwd","workdir")):null;if(Q&&z)return{kind:"read",label:`Read ${dl(Q)}`,filePath:z,labelPrefix:"Read ",labelTarget:dl(Q)};if(T.some(re=>(re==null?void 0:re.name)==="find"||(re==null?void 0:re.name)==="ls"||(re==null?void 0:re.name)==="rg"&&re.args.includes("--files")))return{kind:"search",label:"Listed files"};const O=T.findIndex(re=>(re==null?void 0:re.name)==="rg"||(re==null?void 0:re.name)==="grep");if(O>=0){const re=yV(j[O].raw);return{kind:"search",label:re?`Searched code for “${re}”`:"Searched code",searchPattern:re??void 0}}const H=T.find(re=>(re==null?void 0:re.name)==="git"),V=H==null?void 0:H.args[0];if(V==="grep"){const re=H==null?void 0:H.args.slice(1).find(le=>!le.startsWith("-"));return{kind:"search",label:re?`Searched code for “${re}”`:"Searched code",searchPattern:re}}if(Z)return{kind:"read",label:"Read a file"};if(V==="status")return{kind:"command",label:"Checked Git status"};if(V==="diff")return{kind:"command",label:"Reviewed code changes"};if(V==="log")return{kind:"command",label:"Read Git history"};const W=re=>T.some(le=>!le||!["cargo","pnpm","npm","yarn"].includes(le.name)?!1:le.args[0]===re||le.args[0]==="run"&&le.args[1]===re);return W("test")?{kind:"command",label:"Ran tests"}:T.some(re=>(re==null?void 0:re.name)==="tsc")||W("typecheck")?{kind:"command",label:"Checked types"}:W("lint")?{kind:"command",label:"Checked code style"}:W("build")?{kind:"command",label:"Built the project"}:{kind:"command",label:`Ran ${C}`}}case"read":{const C=f?dl(f):null;return C?{kind:"read",label:`Read ${C}`,filePath:f??void 0,labelPrefix:"Read ",labelTarget:C}:{kind:"read",label:"Read a file"}}case"edit":case"write":case"notebookedit":{const C=mV(a),N=f??(C==null?void 0:C.path)??null,E=N?dl(N):null,j=(C==null?void 0:C.type)==="add"?"Created":(C==null?void 0:C.type)==="delete"?"Deleted":"Edited";return E?{kind:"edit",label:`${j} ${E}`,filePath:N??void 0,labelPrefix:`${j} `,labelTarget:E}:{kind:"edit",label:"Edited a file"}}case"grep":{const C=ji(a,"pattern");return{kind:"search",label:C?`Searched code for “${C}”`:"Searched code",searchPattern:C??void 0}}case"glob":{const C=ji(a,"pattern");return{kind:"search",label:C?`Listed files matching ${C}`:"Listed files"}}case"websearch":{const C=ji(a,"query"),N=ji(a,"url"),E=ji(a,"pattern");return C?{kind:"web",label:`Searched the web for “${C}”`}:E&&N?{kind:"web",label:`Searched “${E}” on a page`}:N?{kind:"web",label:`Opened ${N}`}:{kind:"web",label:g??"Browsed the web"}}case"webfetch":{const C=ji(a,"url");return{kind:"web",label:C?`Read ${C}`:g??"Read a web page"}}case"task":return{kind:"agent",label:g??"Ran a subagent"};case"subagent":return{kind:"agent",label:kV(a)};case"error":return{kind:"command",label:"Tool failed"};case"interrupted":return{kind:"command",label:"Tool was interrupted"};default:{const C=g??f??o??((y=e.state)==null?void 0:y.title)??"";return{kind:"command",label:C?`${t}: ${C}`:t}}}}function kV(e){const t=a=>a.length>60?`${a.slice(0,60)}…`:a,n=typeof e.prompt=="string"&&e.prompt?` — “${t(e.prompt)}”`:"",r=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",i=r&&r.charAt(0).toUpperCase()+r.slice(1);switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return i||`Spawned agent${n}`;case"sendInput":return r?`Sent input to ${r}`:`Sent input to agent${n}`;case"resumeAgent":return r?`Resumed ${r}`:"Resumed agent";case"wait":return`Waiting on ${r||"agent"}`;case"closeAgent":return`Closed ${r||"agent"}`}switch(typeof e.kind=="string"?e.kind:""){case"started":return i||"Sub-agent started";case"interacted":return r?`${i} reported back`:"Agent reported back";case"interrupted":return r?`${i} interrupted`:"Sub-agent interrupted"}return i||"Sub-agent"}function Ff({activity:e,className:t=""}){if(e.litCall)return h.jsx(d_,{source:e.litCall.source,size:16,className:`tool-kind-icon shrink-0 ${t}`});const n={size:16,strokeWidth:1.75,className:`tool-kind-icon shrink-0 ${t}`};switch(e.kind){case"read":case"project":return h.jsx(G8,{...n});case"search":return h.jsx(KM,{...n});case"edit":return h.jsx(ip,{...n});case"web":return h.jsx(_M,{...n});case"agent":return h.jsx(sS,{...n});case"command":return h.jsx(iS,{...n})}}function Tw({items:e,onOpen:t,targetType:n}){const[r,i]=R.useState(!1),a=R.useRef(null),o=R.useRef(!1);return R.useEffect(()=>{var l,u;!r||!o.current||(o.current=!1,(u=(l=a.current)==null?void 0:l.querySelector("button"))==null||u.focus())},[r]),h.jsxs("span",{className:"tool-target-overflow inline",children:[r&&h.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((l,u)=>h.jsxs("span",{children:[u>0&&", ",t?h.jsx("button",{className:"tool-target",onClick:d=>{d.preventDefault(),d.stopPropagation(),t(l.id)},children:l.label}):h.jsx("span",{children:l.label})]},l.id))}),r&&", ",h.jsx("button",{className:"tool-target-more","aria-expanded":r,"aria-label":r?`Hide additional ${n}`:`Show ${e.length} more ${n}`,onClick:l=>{l.preventDefault(),l.stopPropagation(),o.current=!r&&l.detail===0,i(u=>!u)},children:r?"show less":`+ ${e.length} more`})]})}function Sv({activity:e,onOpenFile:t,onOpenRun:n,runExperimentName:r,onOpenExperiment:i,experimentName:a}){var o,l,u;if(e.searchPattern){const d=e.label.indexOf(e.searchPattern),m=d>=0?e.label.slice(0,d):"Searched code for “",f=d>=0?e.label.slice(d+e.searchPattern.length):"”";return h.jsxs(h.Fragment,{children:[m,e.searchPattern.split(/([|/_-])/).map((g,b)=>h.jsxs("span",{children:[g,/^[|/_-]$/.test(g)&&h.jsx("wbr",{})]},`${b}-${g}`)),f]})}if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return h.jsxs("a",{className:"tool-target",href:rL(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,h.jsx(Cj,{className:"inline ml-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&t){const d=e.filePath;return h.jsxs(h.Fragment,{children:[e.labelPrefix,h.jsx("button",{className:"tool-target",onClick:m=>{m.preventDefault(),m.stopPropagation(),t(d,void 0,void 0,e.fileRef)},children:e.labelTarget})]})}if((l=e.runIds)!=null&&l.length){const d=r?e.runIds.filter(b=>!!r(b)):e.runIds;if(d.length===0)return e.label;const m=d.length>1,f=d.slice(0,3),g=d.slice(f.length).map(b=>({id:b,label:(r==null?void 0:r(b))||"Experiment"}));return h.jsxs(h.Fragment,{children:[m?"Reviewed run logs for ":"Reviewed run log ",f.map((b,k)=>h.jsxs("span",{children:[k>0&&", ",n?h.jsx("button",{className:"tool-target",title:`Open logs for run ${b}`,onClick:S=>{S.preventDefault(),S.stopPropagation(),n(b)},children:(r==null?void 0:r(b))||"Experiment"}):h.jsx("span",{children:(r==null?void 0:r(b))||"Experiment"})]},b)),g.length>0&&h.jsxs(h.Fragment,{children:[", ",h.jsx(Tw,{items:g,onOpen:n,targetType:"run logs"})]})]})}if((u=e.experimentIds)!=null&&u.length){const d=a?e.experimentIds.filter(g=>!!a(g)):e.experimentIds;if(d.length===0)return e.label;const m=d.slice(0,3),f=d.slice(m.length).map(g=>({id:g,label:(a==null?void 0:a(g))||"Experiment"}));return h.jsxs(h.Fragment,{children:[e.label," for ",m.map((g,b)=>h.jsxs("span",{children:[b>0&&", ",i?h.jsx("button",{className:"tool-target",title:`Open experiment ${(a==null?void 0:a(g))||""}`.trim(),onClick:k=>{k.preventDefault(),k.stopPropagation(),i(g)},children:(a==null?void 0:a(g))||"Experiment"}):h.jsx("span",{children:(a==null?void 0:a(g))||"Experiment"})]},g)),f.length>0&&h.jsxs(h.Fragment,{children:[", ",h.jsx(Tw,{items:f,onOpen:i,targetType:"experiments"})]})]})}return e.label}function CV(e){const t=f=>e.filter(g=>g.kind===f).length,n=[],r=t("read"),i=t("search"),a=t("edit"),o=t("project"),l=t("web"),u=t("command"),d=t("agent");r&&n.push(r===1?"Read a file":"Read files"),i&&n.push("searched code"),a&&n.push(a===1?"edited a file":"edited files"),o&&n.push("reviewed project data"),l&&n.push("browsed the web"),u&&n.push(u===1?"ran a command":"ran commands"),d&&n.push(d===1?"worked with a subagent":"worked with subagents");const m=n.join(", ");return m?`${m[0].toUpperCase()}${m.slice(1)}`:"Used tools"}function L2(e){const t=[[/^Reviewed run logs?/,e.label.startsWith("Reviewed run logs")?"Reading run logs":"Reading run log"],[/^Reviewed /,"Reviewing "],[/^Read /,"Reading "],[/^Searched /,"Searching "],[/^Listed /,"Listing "],[/^Edited /,"Editing "],[/^Updated /,"Updating "],[/^Created /,"Creating "],[/^Deleted /,"Deleting "],[/^Ran /,"Running "],[/^Started /,"Starting "],[/^Waited /,"Waiting "],[/^Checked /,"Checking "],[/^Built /,"Building "],[/^Cancelled /,"Cancelling "]];let n=e.label;for(const[r,i]of t)if(r.test(n)){n=n.replace(r,i);break}return{...e,label:n}}function vC(e,t){const n=Ws({tool:e,state:{status:"running",input:t}}),r=[[/^Reviewed /,"Review "],[/^Searched /,"Search "],[/^Listed /,"List "],[/^Edited /,"Edit "],[/^Updated /,"Update "],[/^Created /,"Create "],[/^Deleted /,"Delete "],[/^Ran /,"Run "],[/^Started /,"Start "],[/^Waited /,"Wait "],[/^Checked /,"Check "],[/^Built /,"Build "],[/^Cancelled /,"Cancel "]];for(const[i,a]of r)if(i.test(n.label))return n.label.replace(i,a);return n.label}function EV(e,t,n){var i,a;const r=o=>{const l=o.slice(0,3),u=o.length-l.length;return`${l.join(", ")}${u>0?`, + ${u} more`:""}`};if((i=e.runIds)!=null&&i.length){const o=e.runIds.map(l=>(t==null?void 0:t(l))||"").filter(Boolean);return o.length===0?e.label:`${e.label}${o.length>1?" for ":" "}${r(o)}`}if((a=e.experimentIds)!=null&&a.length){const o=e.experimentIds.map(l=>(n==null?void 0:n(l))||"").filter(Boolean);return o.length===0?e.label:`${e.label} for ${r(o)}`}return e.label}function AV(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const TV=250;function NV(e,t){const[n,r]=R.useState(e),i=R.useRef(Date.now()),a=R.useRef(e);return R.useEffect(()=>{if(a.current=e,(e==null?void 0:e.label)===(n==null?void 0:n.label)||t&&e!=null&&n!=null)return;if(e==null||n==null){i.current=Date.now(),r(e);return}const o=TV-(Date.now()-i.current);if(o<=0){i.current=Date.now(),r(e);return}const l=window.setTimeout(()=>{i.current=Date.now(),r(a.current)},o);return()=>window.clearTimeout(l)},[e,n,t]),e!=null&&e.label===(n==null?void 0:n.label)?e:n}const jV=160;function _C(e){const[t,n]=R.useState(!1);return R.useEffect(()=>{if(!e){n(!1);return}const r=window.setTimeout(()=>n(!0),jV);return()=>window.clearTimeout(r)},[e]),e&&t}function MV(e){const t=["read","search","edit","project","web","command","agent"];for(const n of t){const r=e.find(i=>i.kind===n);if(r)return r}return e[0]??{kind:"command",label:"Used tools"}}function Nw(e){var n,r;if(((n=e.state)==null?void 0:n.status)!=="completed")return null;const t=Ws(e);return JSON.stringify([t.kind,t.label,t.filePath??null,t.fileRef??null,((r=t.litCall)==null?void 0:r.kind)==="paper"?t.litCall.id??null:null,t.runIds??null,t.experimentIds??null])}function RV(e){const t=[];for(const n of e){const r=Nw(n),i=t[t.length-1];r&&i&&Nw(i.part)===r?i.count++:t.push({part:n,count:1})}return t}function jw({part:e,repeatCount:t=1,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o}){const l=e.state,u=Ws(e),d=(l==null?void 0:l.status)==="error",m=D2((l==null?void 0:l.error)||(l==null?void 0:l.output)||""),f=d&&!!m,[g,b]=R.useState(!1),k=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`,S=h.jsxs(h.Fragment,{children:[d&&h.jsx("span",{className:"sr-only",children:"Failed: "}),d?h.jsx(X8,{size:16,strokeWidth:1.75,className:"tool-kind-icon shrink-0 text-accent-red self-start mt-[5px]","aria-hidden":"true"}):h.jsx(Ff,{activity:u,className:"text-muted self-start mt-[5px]"}),h.jsxs("span",{className:`tool-line flex-1 min-w-0 whitespace-normal break-words text-lg ${d?"text-accent-red":"text-subtext"}`,children:[h.jsx(Sv,{activity:u,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o}),t>1&&h.jsxs("span",{className:"tool-repeat-count ml-1 text-muted font-normal",title:`${t} consecutive identical calls`,children:["×",t]})]})]});return f?h.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[S,h.jsx("button",{type:"button",className:"tool-row-detail-toggle shrink-0 inline-flex items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":g,"aria-controls":k,"aria-label":`${g?"Hide":"Show"} error details for ${u.label}`,onClick:()=>b(x=>!x),children:h.jsx(Xs,{size:12,className:`text-accent-red transition-transform duration-120 ease-standard ${g?"rotate-90":""}`})})]}),g&&h.jsx("div",{className:"tool-detail mt-1 mr-0 mb-1 ml-6",id:k,children:h.jsx("div",{className:"tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",children:m.slice(0,2e4)})})]}):h.jsx("div",{className:"tool-row flex items-center gap-2 min-w-0 py-[3px] px-1",children:S})}function DV({parts:e,pendingTail:t,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var C,N,E;const[l,u]=R.useState(!1),d=RV(e),m=d.map(({part:j})=>Ws(j)),f=t?e.at(-1):void 0,g=((C=f==null?void 0:f.state)==null?void 0:C.status)!=="error"?(f&&L2(Ws(f)))??null:null,b=!!f&&((N=f.state)==null?void 0:N.status)==="running"&&(AV((E=f.state)==null?void 0:E.input)||(g==null?void 0:g.label)==="Running a command"),k=NV(g,b),S=_C(k!=null),x=CV(m),_=k??MV(m),w=k?EV(k,i,o):x;if(e.length===1)return k?h.jsx("div",{className:"tool-group my-3.5 mx-0",children:h.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-lg text-subtext",children:[h.jsx(Ff,{activity:k,className:`${S?"tool-running-shimmer-icon":"text-muted"} self-start mt-[5px]`}),h.jsx("span",{className:`${S?"tool-running-shimmer":""} tool-active-label min-w-0 whitespace-normal break-words`,title:w,children:h.jsx(Sv,{activity:k,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):h.jsx("div",{className:"tool-group my-3.5 mx-0",children:h.jsx(jw,{part:e[0],onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o})});const y=l;return h.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[h.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-lg text-subtext text-left",children:[h.jsx(Ff,{activity:_,className:`${S?"tool-running-shimmer-icon":"text-muted"} mt-[5px]`}),k?h.jsx("span",{className:`tool-group-label tool-active-label min-w-0 whitespace-normal break-words ${S?"tool-running-shimmer":""}`,title:w,children:h.jsx(Sv,{activity:k,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):h.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-left",onClick:()=>u(j=>!j),"aria-expanded":y,children:w}),h.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex items-center justify-center self-center shrink-0 p-px cursor-pointer rounded-sm",onClick:()=>u(j=>!j),"aria-expanded":y,"aria-label":y?"Collapse tool activity":"Expand tool activity",children:h.jsx(Xs,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${y?"open":""}`})})]}),h.jsx("div",{className:`tool-group-disclosure ${y?"open":""}`,"aria-hidden":!y,inert:!y,children:h.jsx("div",{className:"tool-group-disclosure-inner",children:h.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 mr-0 mb-1 ml-6",children:d.map(({part:j,count:T})=>h.jsx(jw,{part:j,repeatCount:T,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o},j.id))})})})]})}function LV({part:e,onRespond:t,onOpenFile:n,onOpenPlan:r}){var m;const i=e.prompt,[a,o]=R.useState([]),l=!t,u=f=>t==null?void 0:t({promptId:e.id,...f});if(i.resolved){if(i.kind==="permission")return null;if(i.kind==="plan"){const b=i.approved===!0?{label:"Plan approved",icon:Di,iconClass:"text-accent-green"}:i.approved===!1&&i.note?{label:"Plan revision requested",icon:ip,iconClass:"text-accent-amber"}:i.approved===!1?{label:"Plan rejected",icon:qr,iconClass:"text-accent-red"}:{label:"Plan resolved",icon:th,iconClass:"text-muted"},k=b.icon;return h.jsxs("details",{className:uV,children:[h.jsxs("summary",{children:[h.jsx("span",{className:"plan-resolved-label text-lg font-[375] wrap-anywhere",children:i.synthesized?"Plan":"Proposed plan"}),h.jsx(k,{size:17,strokeWidth:1.8,className:`shrink-0 ${b.iconClass}`}),h.jsx("span",{className:"plan-resolved-label prompt-outcome text-lg font-[375] wrap-anywhere",children:b.label}),h.jsx(Xs,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),h.jsxs("div",{className:`${Cw} ml-6`,children:[h.jsx(La,{text:i.plan??"",onOpenFile:n}),i.note&&h.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:i.note})]})]})}const f=(i.answers??[]).join(", ")||i.note||"",g=(i.annotations??[]).map((b,k)=>({id:`${e.id}-annotation-${k}`,text:b.text}));return h.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[g.length>0&&h.jsx(R2,{annotations:g,variant:"sent"}),h.jsxs("details",{className:cV,children:[h.jsxs("summary",{children:[h.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:i.header||i.question||"Question"}),h.jsx("span",{className:`prompt-outcome font-[375] text-subtext wrap-anywhere [&.approved]:text-accent-green [&.chosen]:text-accent-green [&.approved::before]:content-['✓_'] [&.chosen::before]:content-['✓_'] [&.revised]:text-accent-amber [&.rejected]:text-accent-amber ${f?"chosen":""}`,children:f||"Resolved"})]}),h.jsxs("div",{className:Cw,children:[i.header&&i.question&&h.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:i.question}),(i.options??[]).length>0&&h.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 pl-4.5 [&_.sel]:text-text [&_.sel]:font-semibold",children:(i.options??[]).map(b=>{var k;return h.jsx("li",{className:(k=i.answers)!=null&&k.includes(b.label)?"sel":"",children:b.label},b.label)})}),i.note&&i.note!==f&&h.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:i.note})]})]})]})}if(i.kind==="plan"){const f=!!r;return h.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-l-[3px] border-l-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-l-accent-blue [&.permission]:border-l-accent-amber [&.question]:border-l-accent-purple [&.readonly]:opacity-60 plan ${l?"readonly":""}`,children:[h.jsx("div",{className:"prompt-head text-lg font-semibold text-text",children:i.synthesized?"Plan mode — ready to proceed?":"Proposed plan"}),h.jsx("div",{className:`prompt-plan text-base leading-[1.6] text-text max-h-85 overflow-y-auto [&.clamped]:max-h-[9.5em] [&.clamped]:overflow-hidden [&.clamped]:relative [&.clamped::after]:content-[''] [&.clamped::after]:absolute [&.clamped::after]:inset-x-0 [&.clamped::after]:bottom-0 [&.clamped::after]:top-auto [&.clamped::after]:h-8.5 [&.clamped::after]:bg-[linear-gradient(to_bottom,_transparent,_var(--surface))] [&.clamped::after]:pointer-events-none ${f?"clamped":""}`,children:h.jsx(La,{text:i.plan??"",onOpenFile:n})}),f&&h.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",onClick:()=>r(i.plan??"",e.id),children:"View full plan"}),!l&&!f&&h.jsxs("div",{className:yv,children:[h.jsx("button",{className:"btn-primary",onClick:()=>u({approve:!0,resumeMode:"auto"}),children:"Accept and auto mode"}),h.jsx("button",{className:"btn-ghost",onClick:()=>u({approve:!0,resumeMode:"bypassPermissions"}),children:"Accept and bypass all"}),h.jsx("button",{className:"btn-ghost",onClick:()=>u({approve:!1}),children:"Reject"})]})]})}if(i.kind==="permission"){const f=i.toolInput??{},g=ji(f,"command","cmd","filePath","file_path","path")||"",b=typeof((m=i.toolInput)==null?void 0:m.reason)=="string"&&i.toolInput.reason||"",k=ji(f,"description")||"",S=b||k||vC(i.tool,f),x=`permission-heading-${e.id}`;return h.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-[0_1px_2px_rgb(0_0_0_/_4%)] [&.readonly]:opacity-60 ${l?"readonly":""}`,role:"group","aria-labelledby":x,children:[h.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[h.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:h.jsx(hR,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),h.jsx("span",{id:x,className:"text-base font-semibold text-text",children:"Approval required"})]}),h.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[h.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:S}),g&&h.jsx("code",{className:"prompt-command block max-h-36 overflow-auto whitespace-pre-wrap wrap-anywhere rounded-md border border-border-variant bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-text",children:g}),!l&&h.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[h.jsx("button",{className:"rounded-sm border border-transparent bg-transparent px-3 py-1.5 text-sm font-semibold text-subtext transition-[background,color] duration-80 ease-standard hover:bg-surface hover:text-text",onClick:()=>u({approve:!1}),children:"Deny"}),h.jsx("button",{className:"rounded-sm border border-text bg-text px-3 py-1.5 text-sm font-semibold text-background transition-opacity duration-80 ease-standard hover:opacity-85",onClick:()=>u({approve:!0}),children:"Allow"})]})]})]})}const d=f=>o(g=>i.multiSelect?g.includes(f)?g.filter(b=>b!==f):[...g,f]:[f]);return h.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-l-[3px] border-l-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-l-accent-blue [&.permission]:border-l-accent-amber [&.question]:border-l-accent-purple [&.readonly]:opacity-60 question ${l?"readonly":""}`,children:[i.header&&h.jsx("div",{className:dV,children:i.header}),i.question&&h.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:i.question}),h.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(i.options??[]).map(f=>{const g=a.includes(f.label);return h.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-left border border-border rounded-sm bg-background text-text cursor-pointer transition-[border-color,background] duration-80 ease-standard [&:hover:not(:disabled)]:border-border-strong [&:hover:not(:disabled)]:bg-surface [&.sel]:border-primary [&.sel]:bg-primary-subtle [&:disabled]:cursor-default ${g?"sel":""}`,disabled:l,onClick:()=>l?void 0:i.multiSelect?d(f.label):u({answers:[f.label]}),children:[h.jsx("span",{className:"prompt-option-label block text-md font-semibold",children:f.label}),f.description&&h.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:f.description})]},f.label)})}),i.multiSelect&&!l&&h.jsx("div",{className:yv,children:h.jsx("button",{className:"btn-primary",disabled:a.length===0,onClick:()=>u({answers:a}),children:"Submit"})})]})}function Pf(e,t){if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(t!==void 0)return e.id===t}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function OV(e,t){return e.role==="user"?!0:e.parts.some(n=>Pf(n,t))}function IV(e){const t=e.text??"",n=t.startsWith("data:")?t:OD(t),r=t.startsWith("data:")?"":t.includes("__")?t.slice(t.indexOf("__")+2):t,i=e.name||r||"attachment",a=t.startsWith("data:application/pdf")||/\.pdf$/i.test(i)||/\.pdf$/i.test(t);return{src:n,isPdf:a,name:i}}const Jg=[ah,"w-6 h-6 rounded-sm [&:disabled]:opacity-40 [&:disabled]:cursor-default","[&:disabled:hover]:bg-transparent [&:disabled:hover]:text-subtext"].join(" ");function zV({count:e,index:t,prevId:n,nextId:r,onSelect:i,pagerDisabled:a,onEdit:o,editDisabled:l}){const u=e>1;return h.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${u?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[u&&h.jsxs(h.Fragment,{children:[h.jsx("button",{className:Jg,title:"Previous version","aria-label":"Previous version",disabled:a||!n,onClick:()=>n&&i(n),children:h.jsx(W8,{size:14})}),h.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[t+1,"/",e]}),h.jsx("button",{className:Jg,title:"Next version","aria-label":"Next version",disabled:a||!r,onClick:()=>r&&i(r),children:h.jsx(Xs,{size:14})})]}),h.jsx("button",{className:Jg,title:"Edit and re-send","aria-label":"Edit and re-send",disabled:l,onClick:o,children:h.jsx(ip,{size:13})})]})}const BV=R.memo(function({message:t,activePermissionId:n,pendingTailToolId:r,onOpenFile:i,onOpenRun:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:d,onOpenPlan:m,onOpenSubagent:f,skills:g,predictTextTail:b=!1,forkCount:k,forkIndex:S=0,forkPrevId:x,forkNextId:_,forkDisabled:w,branchDisabled:y,onFork:C,onSelectFork:N}){const[E,j]=R.useState(null);if(t.role==="user"){const T=t.parts.filter(X=>X.type==="text").map(X=>X.text??"").join(` -`),D=T.match(/^\/(\S+)([\s\S]*)$/),I=D?g==null?void 0:g.find(X=>X.name===D[1]):void 0,$=t.parts.filter(X=>X.type==="image"&&X.text).map(IV),F=$.filter(X=>!X.isPdf),U=$.filter(X=>X.isPdf),G=t.parts.filter(X=>X.type==="annotation"&&X.text).map(X=>({id:X.id,text:X.text??""}));if(E!==null){const X=()=>{const Y=E.trim();!Y||w||(j(null),C(t.id,Y))};return h.jsx("div",{className:"msg-user-group self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:h.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[h.jsx("textarea",{className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":"Edit message",value:E,autoFocus:!0,onChange:Y=>j(Y.target.value),onKeyDown:Y=>{Y.key==="Escape"?(Y.preventDefault(),j(null)):Y.key==="Enter"&&!Y.shiftKey&&!Y.nativeEvent.isComposing&&(Y.preventDefault(),X())}}),h.jsxs("div",{className:`${yv} justify-end`,children:[h.jsx("button",{className:"btn-ghost",onClick:()=>j(null),children:"Cancel"}),h.jsx("button",{className:"btn-primary",onClick:X,disabled:w||!E.trim(),children:"Send"})]})]})})}return h.jsxs("div",{className:"msg-user-group group/turn self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[G.length>0&&h.jsx(R2,{annotations:G,variant:"sent"}),h.jsxs("div",{className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:mr-0.5 [&_.skill-chip]:align-baseline",children:[I?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"skill-chip inline-flex items-center py-px px-[7px] font-mono text-md font-medium text-primary bg-primary-subtle border border-border-variant rounded-sm",children:["/",I.name]}),D[2]]}):T,F.length>0&&h.jsx("div",{className:"msg-images flex flex-wrap gap-1.5 mt-2 [&_img]:max-w-55 [&_img]:max-h-40 [&_img]:border [&_img]:border-border-variant [&_img]:rounded-xs [&_img]:block",children:F.map((X,Y)=>h.jsx("a",{href:X.src,target:"_blank",rel:"noreferrer",children:h.jsx("img",{src:X.src,alt:"attachment"})},Y))}),U.length>0&&h.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:U.map((X,Y)=>h.jsxs("a",{className:"msg-file inline-flex items-center gap-1.5 max-w-60 py-1.5 px-2.5 border border-border-variant rounded-sm text-text no-underline [&:hover]:border-text [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap",href:X.src,target:"_blank",rel:"noreferrer",children:[h.jsx(th,{size:15}),h.jsx("span",{children:X.name})]},Y))})]}),k!==void 0&&h.jsx(zV,{count:k,index:S,prevId:x,nextId:_,onSelect:N,pagerDisabled:y,onEdit:()=>j(T),editDisabled:w})]})}return h.jsx("div",{className:"msg-assistant text-lg leading-[1.62] text-text min-w-0",children:xC(t.parts,{activePermissionId:n,pendingTailToolId:r,onOpenFile:i,onOpenRun:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:d,onOpenPlan:m,onOpenSubagent:f,predictTextTail:b})})});function xC(e,t){var _,w;const{activePermissionId:n,pendingTailToolId:r,onOpenFile:i,onOpenRun:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:d,onOpenPlan:m,onOpenSubagent:f,predictTextTail:g=!1}=t,b=e.filter(y=>y.type!=="steer"&&Pf(y,n)).at(-1),k=[];let S=[];const x=()=>{S.length!==0&&(k.push(h.jsx(DV,{parts:S,pendingTail:S.some(y=>y.id===r),onOpenFile:i,onOpenRun:a,runExperimentName:o,onOpenExperiment:l,experimentName:u},`tg-${S[0].id}`)),S=[])};for(const y of e)if(Pf(y,n)){if(y.type==="tool"&&($V(y.tool)||(((_=y.children)==null?void 0:_.length)??0)>0)){x(),k.push(h.jsx(PV,{part:y,pendingTail:g&&((w=y.state)==null?void 0:w.status)==="running"||y.id===r,onOpenSubagent:f},y.id));continue}if(y.type==="tool"){S.push(y);continue}x(),y.type==="text"?k.push(h.jsx(La,{text:y.text,onOpenFile:i,onOpenRun:a,predict:g&&y.id===(b==null?void 0:b.id)},y.id)):y.type==="steer"?k.push(h.jsx("div",{role:"note","aria-label":"You, mid-task",className:"msg-steer my-2 ml-auto w-fit max-w-[88%] bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere",children:y.text},y.id)):y.type==="prompt"&&y.prompt&&k.push(h.jsx(LV,{part:y,onRespond:d,onOpenFile:i,onOpenPlan:m},y.id))}return x(),k}function HV(e){return Ws(e).label}function $V(e){const t=(e??"").toLowerCase();return t==="subagent"||t==="task"||t==="agent"}function yC(e){var n,r;const t=((n=e.state)==null?void 0:n.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return t.startsWith("Async agent launched")?"":t}function O2(e,t){for(const n of e){if(n.id===t)return n;const r=n.children&&O2(n.children,t);if(r)return r}return null}function FV({spawn:e,onOpenFile:t,onOpenRun:n,runExperimentName:r,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}){var k,S,x,_;const l=e.children??[],u=((k=e.state)==null?void 0:k.status)==="running",d=((S=e.state)==null?void 0:S.status)==="error",m=d?D2(((x=e.state)==null?void 0:x.error)||((_=e.state)==null?void 0:_.output)||""):"",f=xC(l,{onOpenFile:t,onOpenRun:n,runExperimentName:r,onOpenExperiment:i,experimentName:a,onOpenSubagent:o,predictTextTail:u,pendingTailToolId:u?wC(l):null}),b=l.some(w=>w.type==="text"&&!!w.text)?"":yC(e);return h.jsxs("div",{className:"msg-assistant text-lg leading-[1.62] text-text min-w-0",children:[d&&h.jsx("span",{className:"sr-only",children:"Failed: "}),m&&h.jsx("div",{className:"tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",children:m.slice(0,2e4)}),f.length===0&&!b&&!m?h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:u?"Working…":"No activity"}):h.jsxs(h.Fragment,{children:[f,b&&h.jsx(La,{text:b,onOpenFile:t,onOpenRun:n})]})]})}function PV({part:e,pendingTail:t,onOpenSubagent:n}){var d,m,f,g;const r=((d=e.state)==null?void 0:d.status)==="error",i=D2(((m=e.state)==null?void 0:m.error)||((f=e.state)==null?void 0:f.output)||""),a=t&&!r?L2(Ws(e)):Ws(e),o=_C(!!(t&&!r)),l=(((g=e.children)==null?void 0:g.length)??0)===0&&!r&&!yC(e),u=h.jsxs(h.Fragment,{children:[r&&h.jsx("span",{className:"sr-only",children:"Failed: "}),r?h.jsx(X8,{size:16,strokeWidth:1.75,className:"subagent-icon shrink-0 text-accent-red","aria-hidden":"true"}):h.jsx(Ff,{activity:a,className:`subagent-icon shrink-0 ${o?"tool-running-shimmer-icon":"text-muted"}`}),h.jsx("span",{className:`${YG} ${o?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:a.label})]});return l?h.jsx("div",{className:"subagent-row flex items-center gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-lg text-left rounded-sm [&_.tool-line]:text-lg",children:u}):h.jsxs("button",{className:"subagent-row flex items-center gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-lg text-left rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default [&_.tool-line]:text-lg",title:r&&i?i:"Open sub-agent transcript",onClick:()=>n==null?void 0:n(e.id,a.label),disabled:!n,children:[u,h.jsx(Xs,{size:12,className:"subagent-row-chevron shrink-0 text-muted"})]})}function UV(e){const t=new Map;let n;for(let i=e.length-1;i>=0;i--)if(e[i].role==="assistant"){n=e[i];break}if(!n)return{messageId:"",states:t};const r=(i,a)=>{var o,l;for(const u of i){const d=`${a}/${u.id}`;u.type==="tool"&&((o=u.state)!=null&&o.status)&&t.set(d,{status:u.state.status,part:u}),(l=u.children)!=null&&l.length&&r(u.children,d)}};return r(n.parts,n.id),{messageId:n.id,states:t}}function I2(e){const t=(n,r)=>{var i;for(const a of n){const o=a.prompt;if(a.type==="prompt"&&(o==null?void 0:o.kind)==="permission"&&!o.resolved){const l=o.toolInput??{},d=ji(l,"reason","description")||vC(o.tool,l);return{id:a.id,path:`${r}/${a.id}`,label:d}}if((i=a.children)!=null&&i.length){const l=t(a.children,`${r}/${a.id}`);if(l)return l}}return null};for(const n of e){if(n.role!=="assistant")continue;const r=t(n.parts,n.id);if(r)return r}return null}function qV(e){const[t,n]=R.useState({text:"",sequence:0}),r=R.useRef(null);return R.useEffect(()=>{var b,k;const i=((b=e[0])==null?void 0:b.id)??"",{messageId:a,states:o}=UV(e),l=I2(e);if(!r.current||r.current.transcript!==i){r.current={transcript:i,messageId:a,states:o,permissionPath:(l==null?void 0:l.path)??null},n(S=>({text:l?`Approval required: ${l.label}`:"",sequence:S.sequence+1}));return}const u=r.current.messageId===a?r.current.states:new Map,d=r.current.permissionPath,m=[...o].filter(([S,x])=>{var _;return((_=u.get(S))==null?void 0:_.status)!==x.status});if(r.current={transcript:i,messageId:a,states:o,permissionPath:(l==null?void 0:l.path)??null},l&&l.path!==d){n(S=>({text:`Approval required: ${l.label}`,sequence:S.sequence+1}));return}const f=m.filter(([,S])=>S.status==="error");if(f.length>0){const S=f.slice(0,2).map(([,x])=>Ws(x.part).label).join(", ");n(x=>({text:`${f.length===1?"Tool activity failed":`${f.length} tool activities failed`}: ${S}`,sequence:x.sequence+1}));return}const g=m.filter(([,S])=>S.status==="running");if(g.length>0){const S=(k=g.at(-1))==null?void 0:k[1].part;n(x=>({text:S?L2(Ws(S)).label:"Running a tool",sequence:x.sequence+1}));return}m.some(([,S])=>S.status==="completed")&&n(S=>({text:"Tool activity completed",sequence:S.sequence+1}))},[e]),t}function wC(e){var t;for(let n=e.length-1;n>=0;n--){const r=e[n];if(!(r.type==="steer"||!Pf(r)))return r.type!=="tool"||((t=r.state)==null?void 0:t.status)==="error"?null:r.id}return null}function SC(e){const t=e.at(-1);if((t==null?void 0:t.role)!=="assistant")return null;const n=wC(t.parts);return n?{messageId:t.id,toolId:n}:null}const GV=R.memo(function({messages:t,allMessages:n,canFork:r,onFork:i,onSelectFork:a,busy:o,onOpenFile:l,onOpenRun:u,runExperimentName:d,onOpenExperiment:m,experimentName:f,onRespond:g,onOpenPlan:b,onOpenSubagent:k,skills:S}){var E;const x=((E=I2(t))==null?void 0:E.id)??null,_=R.useMemo(()=>t.filter(j=>OV(j,x)),[t,x]),w=R.useMemo(()=>{const j=_.filter(T=>T.role==="user"&&!T.id.startsWith(Ic));return qD(n,t,j,T=>T.startsWith(Ic))},[t,_,n]),y=_.at(-1),C=qV(t),N=o?SC(t):null;return h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:h.jsx("span",{children:C.text},C.sequence)}),_.map(j=>{var T,D,I,$;return h.jsx(BV,{message:j,forkCount:(T=w.get(j.id))==null?void 0:T.count,forkIndex:(D=w.get(j.id))==null?void 0:D.index,forkPrevId:(I=w.get(j.id))==null?void 0:I.prevId,forkNextId:($=w.get(j.id))==null?void 0:$.nextId,forkDisabled:!r,branchDisabled:o,onFork:i,onSelectFork:a,activePermissionId:x,pendingTailToolId:(N==null?void 0:N.messageId)===j.id?N.toolId:null,onOpenFile:l,onOpenRun:u,runExperimentName:d,onOpenExperiment:m,experimentName:f,onRespond:g,onOpenPlan:b,onOpenSubagent:k,skills:S,predictTextTail:o&&j===y&&j.role==="assistant"},j.id)})]})}),Mw=(e,t)=>e==="all"?!0:e==="archived"?t:!t,kC=[{id:"active",label:"Active",railLabel:"Recents"},{id:"archived",label:"Archived",railLabel:"Archived"},{id:"all",label:"All",railLabel:"All sessions"}];function VV({value:e,onChange:t}){const{open:n,setOpen:r,ref:i}=Bo();return h.jsxs("div",{className:"rail-filter relative inline-flex",ref:i,children:[h.jsx("button",{className:`${ah} rail-filter-btn w-6 h-6 rounded-sm ${e!=="active"?"active":""}`,title:"Filter sessions","aria-label":"Filter sessions",onClick:()=>r(a=>!a),children:h.jsx(rR,{size:13})}),n&&h.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:kC.map(a=>h.jsxs("button",{className:hi,onClick:()=>{t(a.id),r(!1)},children:[h.jsx("span",{children:a.label}),e===a.id&&h.jsx(Di,{size:13})]},a.id))})]})}const WV=14,YV=500,XV=1200;function CC({title:e,animate:t}){return t?h.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((n,r)=>n===" "?h.jsx("span",{"aria-hidden":!0,children:n},r):h.jsx("span",{"aria-hidden":!0,className:"title-reveal-char inline-block animate-[title-char-in_240ms_ease-out_both] [@media((prefers-reduced-motion:_reduce))]:animate-none",style:{animationDelay:`${Math.min(r*WV,YV)}ms`},children:n},r))}):h.jsx(h.Fragment,{children:e})}function KV({session:e,active:t,unread:n,busy:r,waiting:i,revealTitle:a,onOpen:o,onRename:l,onSetArchived:u,onDelete:d}){var N;const{open:m,setOpen:f,ref:g}=Bo(),b=((N=e.title)==null?void 0:N.trim())||"Untitled",[k,S]=R.useState(!1),[x,_]=R.useState(""),w=R.useRef(null);function y(){var E;_(((E=e.title)==null?void 0:E.trim())||""),S(!0)}function C(){var j;const E=x.trim();S(!1),E&&E!==(((j=e.title)==null?void 0:j.trim())||"")&&l(E)}return R.useEffect(()=>{var E,j;k&&((E=w.current)==null||E.focus(),(j=w.current)==null||j.select())},[k]),h.jsxs("div",{ref:g,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-left py-[7px] px-2.5 rounded-md text-md text-text cursor-pointer select-none [&:hover]:bg-surface [&.active]:bg-surface [&.active]:font-medium [&_.session-dot]:w-3.5 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:text-ellipsis [&_.session-title]:whitespace-nowrap [&.unread_.session-title]:font-semibold [&_.session-time]:text-2xs [&_.session-time]:text-muted [&_.session-time]:shrink-0 [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-within_.session-menu-btn]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-time]:hidden [&:focus-within_.session-time]:hidden [&.menu-open_.session-time]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-time]:hidden ${t?"active":""} ${n?"unread":""} ${m?"menu-open":""} ${k?"editing":""}`,title:`${ad[e.harness]}${e.model?` · ${e.model}`:""}`,onClick:()=>{k||(m?f(!1):o())},onKeyDown:E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),m?f(!1):o())},children:[h.jsx("span",{className:"session-dot",children:r?h.jsx("span",{className:`busy-dot ${i?"waiting":""}`}):n&&h.jsx("span",{className:"unread-dot"})}),k?h.jsx("input",{ref:w,className:"session-title-input","aria-label":"Session title",value:x,onChange:E=>_(E.target.value),onClick:E=>E.stopPropagation(),onBlur:C,onKeyDown:E=>{E.stopPropagation(),E.key==="Enter"?(E.preventDefault(),C()):E.key==="Escape"&&(E.preventDefault(),S(!1))}}):h.jsx("span",{className:"session-title",children:h.jsx(CC,{title:b,animate:a!==void 0},a??"static")}),h.jsx("span",{className:"session-time",children:pV(e.updatedAt)}),h.jsx("button",{className:"session-menu-btn",title:"Session options","aria-label":"Session options",onClick:E=>{E.stopPropagation(),f(j=>!j)},children:h.jsx(Q8,{size:14})}),m&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[h.jsx("button",{className:hi,onClick:E=>{E.stopPropagation(),f(!1),y()},children:h.jsx("span",{children:"Rename"})}),h.jsx("button",{className:hi,onClick:E=>{E.stopPropagation(),f(!1),u(!e.archived)},children:h.jsx("span",{children:e.archived?"Unarchive":"Archive"})}),h.jsx("button",{className:`${hi} danger`,onClick:E=>{E.stopPropagation(),f(!1),d()},children:h.jsx("span",{children:"Delete"})})]})]})}function ZV({projectId:e,projectName:t,paperId:n,railHeader:r,railOpen:i,onShowRail:a,mainView:o,onSelectMainView:l,experimentsActive:u,filesActive:d,artifactsActive:m,onOpenExperiments:f,onOpenArtifacts:g,onOpenFile:b,onOpenRun:k,runExperimentName:S,onOpenExperiment:x,experimentName:_,onOpenPlan:w,onOpenSubagent:y,onOpenWorktree:C,onOpenDemoWelcome:N,onActiveSessionChange:E,preferredAgent:j,onPreferredAgentChange:T,children:D}){var Ve,qe,vt;const[I,$]=R.useState([]),[F,U]=R.useState(null),[G,X]=R.useState(new Set),[Y,Z]=R.useState("active"),[Q,z]=R.useState(""),[O,H]=R.useState([]),V=R.useRef(0),W=R.useRef({projectId:e,activeId:F});W.current={projectId:e,activeId:F};const[re,le]=R.useState([]),[pe,te]=R.useState(null),[B,ie]=R.useState(null),oe=R.useRef(Promise.resolve()),be=R.useRef(0),ge=R.useRef(0),[Ce,Le]=R.useState(null),Ue=R.useRef(null),We=R.useRef(!1),Fe=R.useRef(null),[mt,De]=R.useReducer(fV,{messagesBySession:{},busySessions:new Set,queuedBySession:{},activeLeafBySession:{}}),[ot,Bt]=R.useState([]),[on,Ze]=R.useState(j);R.useEffect(()=>Ze(j),[j]);const[ct,st]=R.useState({}),[xe,Me]=R.useState(new Map),Ge=R.useRef(new Map),Qe=R.useRef(new Set),Oe=R.useRef(new Set),tt=R.useRef(0),it=R.useRef([]),jt=R.useRef(null),_t=R.useRef(null),Tt=R.useRef(!0),ut=R.useRef(null),xn=Bo(),dr=R.useCallback(ne=>{var fe;V.current+=1,H(Se=>[...Se,{id:`annotation-${V.current}`,...ne}]),(fe=ut.current)==null||fe.focus()},[]),Or=iV(_t,dr);sV(O),R.useEffect(()=>{H([]),Or.dismiss()},[F,e,Or.dismiss]);const[os,ls]=R.useState([]),[gi,pr]=R.useState(0),[Ts,Jn]=R.useState(!1),[Xr,Kr]=R.useState(0),[yn,mn]=R.useState(null),bi=R.useRef(null),[Ns,Ui]=R.useState(0);R.useLayoutEffect(()=>{Ui(yn&&bi.current?bi.current.offsetWidth+8:0),Sr()},[yn]);function Sr(){var ne;bi.current&&(bi.current.style.transform=`translateY(${-(((ne=ut.current)==null?void 0:ne.scrollTop)??0)}px)`)}const mr=R.useRef(!1);R.useEffect(()=>{wD(e).then(ls).catch(()=>{})},[e,o]);function Pt(ne){var fe;if(ne.source==="command"&&ne.name==="plan"&&pn){js(Q,pn);return}if(pn!=null&&pn.inline){const Se=Q.slice(0,pn.start),Te=Q.slice(pn.end),ze=`/${ne.name}`,nt=Te?"":" ",Zt=Se.length+ze.length+nt.length;z(`${Se}${ze}${nt}${Te}`),Jn(!0),window.requestAnimationFrame(()=>{var Nr,$n;(Nr=ut.current)==null||Nr.focus(),($n=ut.current)==null||$n.setSelectionRange(Zt,Zt),Kr(Zt)});return}mn(ne),z(""),(fe=ut.current)==null||fe.focus()}function er(){var ne;mn(null),(ne=ut.current)==null||ne.focus()}function Zr(ne){te(null);let Te=re.reduce((ze,nt)=>ze+nt.size,0);for(const ze of ne){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(ze.type))continue;if(ze.size>31457280){te(`${ze.name} is too large — each attachment must be under 30 MB.`);continue}if(Te+ze.size>41943040){te("Attachments exceed the 40 MB total limit — remove one and try again.");continue}Te+=ze.size;const nt=new FileReader;nt.onload=()=>{const Zt=nt.result;le(Nr=>[...Nr,{dataUrl:Zt,mediaType:ze.type,name:ze.name,size:ze.size}])},nt.readAsDataURL(ze)}}function Qr(ne){const fe=Array.from(ne.clipboardData.items).filter(Se=>Se.kind==="file"&&(Se.type.startsWith("image/")||Se.type==="application/pdf")).map(Se=>Se.getAsFile()).filter(Se=>Se!==null);fe.length>0&&(ne.preventDefault(),Zr(fe))}const ft=I.find(ne=>ne.id===F),In=on??AG(ot),tr=ft?{harness:ft.harness,model:ct.model??ft.model,permissionMode:ct.permissionMode??ft.permissionMode,reasoningLevel:ct.reasoningLevel??ft.reasoningLevel}:In?{...In,...ct}:null,Je=tr?ot.find(ne=>ne.id===tr.harness):void 0,Nt=Je==null?void 0:Je.options,na=OG(os,Nt==null?void 0:Nt.planActivation),pn=yn?null:yw(Q,Xr),kr=(pn==null?void 0:pn.query)??null,Cr=kr!==null&&!Ts?DG(na,(pn==null?void 0:pn.inline)??!1).filter(ne=>ne.name.startsWith(kr)):[],Jr=Cr.length>0,Er=Math.min(gi,Math.max(0,Cr.length-1));R.useEffect(()=>pr(0),[kr]);const Ut=tr&&{...tr,reasoningLevel:_S(Je,tr.model,tr.reasoningLevel)},Ir=op(Je,Ut==null?void 0:Ut.model),Qt=ne=>{if(!Ut)return;const fe={...Ut,...ne};Ze(fe),T(fe).catch(()=>{}),ft?st(Se=>({...Se,...ne})):ne.harness&&ne.harness!==Ut.harness&&st({})},gr=R.useCallback(ne=>{const fe=oe.current.catch(()=>{}).then(ne);return oe.current=fe.then(()=>{},()=>{}),fe},[]),qi=ne=>{if(ne==="plan"&&(Je==null?void 0:Je.id)==="claude-code"?st(Te=>({...Te,permissionMode:ne})):(st(Te=>{const ze={...Te};return delete ze.permissionMode,ze}),Qt({permissionMode:ne})),!ft)return;const fe=ft.id,Se=++be.current;ie(null),gr(()=>DD(fe,ne)).then(Te=>{$(ze=>ze.map(nt=>nt.id===Te.id?Te:nt)),be.current===Se&&st(ze=>{const nt={...ze};return delete nt.permissionMode,nt})}).catch(()=>{be.current===Se&&(st(Te=>{const ze={...Te};return delete ze.permissionMode,ze}),ie("Could not update permissions. Try again."))})},Hn=ne=>Qt({reasoningLevel:ne}),zr=(Ut==null?void 0:Ut.harness)==="claude-code"?Ut.permissionMode==="plan":(Nt==null?void 0:Nt.planActivation)==="command"?Ce??(ft==null?void 0:ft.planMode)??!1:!1;R.useEffect(()=>{Ce===null||(ft==null?void 0:ft.planMode)!==Ce||(Ue.current=null,Le(null))},[ft==null?void 0:ft.planMode,Ce]);async function ra(ne){if(Ue.current=ne,Le(ne),!ft)return;const fe=ft.id,Se=++ge.current;ie(null);try{const Te=await gr(()=>RD(fe,ne));$(ze=>ze.map(nt=>nt.id===Te.id?Te:nt)),ge.current===Se&&(Ue.current=null,Le(null),ie(null))}catch(Te){throw ge.current===Se&&(Ue.current=null,Le(null)),Te}}async function Gi(){if((Ut==null?void 0:Ut.harness)==="claude-code"){qi("auto");return}if(ft)try{await ra(!1)}catch{ie("Could not exit Plan mode. Try again.")}}async function ia(){const ne=!zr;try{if((Ut==null?void 0:Ut.harness)==="claude-code")qi(ne?"plan":"auto");else if((Nt==null?void 0:Nt.planActivation)==="command")await ra(ne);else throw new Error("The selected harness is unavailable")}catch{ie("Could not toggle Plan mode. Try again.")}}function js(ne,fe){const Se=LG(ne,fe);z(Se.text),mn(null),Jn(!0),ia(),window.requestAnimationFrame(()=>{var Te,ze;(Te=ut.current)==null||Te.focus(),(ze=ut.current)==null||ze.setSelectionRange(Se.cursor,Se.cursor),Kr(Se.cursor)})}it.current=I;const ei=R.useCallback(async()=>{const ne=it.current.map(fe=>fe.id);try{const fe=(await lf(e)).filter(Te=>!Oe.current.has(Te.id)),Se=new Set(fe.map(Te=>Te.id));for(const Te of ne)Se.has(Te)||Hr(Te);return $(Te=>{const ze=new Map(Te.map(nt=>[nt.id,nt.contextUsage]));return fe.map(nt=>({...nt,contextUsage:nt.contextUsage??ze.get(nt.id)}))}),Ge.current=new Map(fe.map(Te=>[Te.id,Te.title])),De({type:"seedBusy",sessions:fe.filter(Te=>Te.busy).map(Te=>Te.id),known:fe.map(Te=>Te.id)}),fe}catch{return null}},[e]);R.useEffect(()=>{$([]),it.current=[],U(null);const ne=lC();X(e===ag?new Set([aS,oS].filter(fe=>!ne.has(fe))):new Set),z(""),mn(null),le([]),De({type:"reset"}),Qe.current=new Set,Me(new Map),Ge.current=new Map,ei().then(fe=>{fe&&U(Se=>{var Te,ze;return Se??(e===ag?(Te=fe.find(nt=>nt.id===cd))==null?void 0:Te.id:void 0)??((ze=fe.find(nt=>!nt.archived))==null?void 0:ze.id)??null})})},[e,ei]),R.useEffect(()=>{!F||Qe.current.has(F)||(Qe.current.add(F),ud(F).then(({messages:ne,queued:fe,activeLeafId:Se})=>De({type:"seed",sessionId:F,messages:ne,queued:fe,activeLeafId:Se})).catch(()=>{De({type:"seed",sessionId:F,messages:[],onlyIfAbsent:!0}),Qe.current.delete(F)}))},[F]),R.useEffect(()=>wd(ne=>{switch(ne.type){case"session":{if(ne.session.projectId!==e||Oe.current.has(ne.session.id))return;const fe=Ge.current.has(ne.session.id),Se=Ge.current.get(ne.session.id)!==ne.session.title;Ge.current.set(ne.session.id,ne.session.title),fe&&Se&&ne.session.titleSource==="generated"&&(Me(Te=>{const ze=new Map(Te);return ze.set(ne.session.id,(Te.get(ne.session.id)??0)+1),ze}),window.setTimeout(()=>{Me(Te=>{if(!Te.has(ne.session.id))return Te;const ze=new Map(Te);return ze.delete(ne.session.id),ze})},XV)),$(Te=>{const ze=Te.findIndex(Zt=>Zt.id===ne.session.id);if(ze<0)return[ne.session,...Te];const nt=Te.slice();return nt[ze]={...ne.session,contextUsage:ne.session.contextUsage??Te[ze].contextUsage},nt});break}case"sessionDeleted":Hr(ne.sessionId);break;case"message":tt.current++,De({type:"upsertMessage",sessionId:ne.sessionId,message:ne.message});break;case"busy":De({type:"busy",sessionId:ne.sessionId,busy:ne.busy});break;case"queued":De({type:"setQueued",sessionId:ne.sessionId,items:ne.items});break;case"branch":De({type:"activeLeaf",sessionId:ne.sessionId,leafId:ne.activeLeafId});break;case"usage":$(fe=>fe.map(Se=>Se.id===ne.sessionId?{...Se,contextUsage:ne.usage}:Se));break}}),[e]),R.useEffect(()=>wd(ne=>{if(ne.type!=="reconnected"||(ei(),!F||!Qe.current.has(F)))return;const fe=Se=>{const Te=tt.current;ud(F).then(({messages:ze,queued:nt,activeLeafId:Zt})=>{De({type:"seed",sessionId:F,messages:ze,queued:nt,activeLeafId:Zt}),Se&&tt.current!==Te&&fe(!1)}).catch(()=>{})};fe(!0)}),[F,ei]);const vi=F?mt.messagesBySession[F]??Ew:Ew,nr=F?mt.activeLeafBySession[F]??null:null,rr=R.useRef(nr);rr.current=nr;const Rn=R.useMemo(()=>PD(vi,nr),[vi,nr]),ln=F?mt.busySessions.has(F):!1,sa=!ln&&!!(Je!=null&&Je.agentReady),cs=ln&&SC(Rn)!=null,ti=F?mt.queuedBySession[F]??[]:[];R.useEffect(()=>{const ne=ti.reduce((fe,Se)=>Se.planMode??fe,void 0);ne!==void 0?(We.current=!0,Ue.current=ne,Le(ne)):We.current&&(We.current=!1,Ue.current=null,Le(null))},[ti]);const Ga=!!F&&!(F in mt.messagesBySession),ir=R.useMemo(()=>{const ne=new Set;for(const fe of mt.busySessions)(mt.messagesBySession[fe]??[]).some(Se=>Se.parts.some(Te=>Te.type==="prompt"&&Te.prompt&&!Te.prompt.resolved&&Te.prompt.nativeId))&&ne.add(fe);return ne},[mt.busySessions,mt.messagesBySession]),aa=F?ir.has(F):!1,cn=ft,Ms=cn?xe.get(cn.id):void 0,gn=R.useMemo(()=>{var ne;for(let fe=Rn.length-1;fe>=0;fe--)for(const Se of Rn[fe].parts)if(Se.type==="prompt"&&((ne=Se.prompt)==null?void 0:ne.kind)==="plan"&&!Se.prompt.resolved)return{promptId:Se.id,plan:Se.prompt.plan??"",synthesized:!!Se.prompt.synthesized};return null},[Rn]),Ar=R.useMemo(()=>{const ne=cn==null?void 0:cn.harness;if(!F||ne!=="claude-code"&&ne!=="codex")return null;for(let fe=Rn.length-1;fe>=0;fe--)for(const Se of Rn[fe].parts)if(!(Se.type!=="prompt"||!Se.prompt||Se.prompt.resolved)&&Se.prompt.kind==="question")return Se.prompt.nativeId&&!mt.busySessions.has(F)?null:Se.id;return null},[Rn,cn==null?void 0:cn.harness,F,mt.busySessions]),[Br,Vi]=R.useState(null),Bl=Br&&Br.sessionId===F?Br:null;R.useEffect(()=>{if(!Br)return;const ne=mt.busySessions.has(Br.sessionId),fe=Br.sessionId===F&&gn&&gn.promptId!==Br.promptId;(!ne||fe)&&Vi(null)},[Br,gn,mt.busySessions,F]);const Hl=R.useMemo(()=>I2(Rn),[Rn]),oa=ln&&!!(Je!=null&&Je.supportsSteering)&&!!(Je!=null&&Je.agentReady)&&!gn&&!Ar&&!Hl&&re.length===0&&O.length===0,Rs=R.useMemo(()=>w&&F?(ne,fe)=>w(ne,F,fe):void 0,[w,F]),$o=R.useMemo(()=>y&&F?(ne,fe)=>y(F,ne,fe):void 0,[y,F]),$l=R.useMemo(()=>b&&((ne,fe,Se,Te)=>b(ne,F??void 0,fe,Se,Te)),[b,F]);R.useEffect(()=>{be.current+=1,ge.current+=1;const ne=(F?mt.queuedBySession[F]??[]:[]).reduce((fe,Se)=>Se.planMode??fe,void 0);We.current=ne!==void 0,Ue.current=ne??null,Le(ne??null),st({}),ie(null)},[F]),R.useEffect(()=>{E==null||E(F)},[F,E]);const br=o==="chat"&&(Rn.length>0||ln);R.useLayoutEffect(()=>{Tt.current=!0;const ne=jt.current;ne&&(ne.scrollTop=ne.scrollHeight)},[F,br]),R.useLayoutEffect(()=>{const ne=jt.current;ne&&Tt.current&&(ne.scrollTop=ne.scrollHeight)},[Rn,ln]),R.useEffect(()=>{const ne=jt.current,fe=_t.current;if(!ne||!fe)return;const Se=new ResizeObserver(()=>{Tt.current&&(ne.scrollTop=ne.scrollHeight)});return Se.observe(fe),Se.observe(ne),()=>Se.disconnect()},[br]);async function nn({queue:ne=!1}={}){const fe=Q.trim(),Se=yn?`/${yn.name}${fe?` ${fe}`:""}`:fe,Te=Ar?null:IG(Se,Nt==null?void 0:Nt.planActivation),ze=!!Te,nt=!zr,Zt=zG(Nt==null?void 0:Nt.planActivation,ze?nt:void 0,Ue.current),Nr=ze&&(Je==null?void 0:Je.id)==="claude-code"?nt?"plan":"auto":void 0,$n=Te?Te.prompt:Se,ri=re,xi=O,Po=xi.map(wn=>({text:wn.text})),rm=e;let Sh=F;const kh=()=>{const wn=W.current;return wn.projectId===rm&&wn.activeId===Sh},Fl=()=>{kh()&&(z(wn=>wn||Se),le(wn=>wn.length?wn:ri),H(wn=>wn.length?wn:xi))};if(ze&&!$n&&ri.length===0&&xi.length===0){z(""),mn(null),Jn(!1);try{if((Je==null?void 0:Je.id)==="claude-code")qi(nt?"plan":"auto");else if((Nt==null?void 0:Nt.planActivation)==="command")await ra(nt);else throw new Error("The selected harness is unavailable")}catch{ie("Could not toggle Plan mode. Try again."),Fl()}return}const $r=Ut?{...Ut,...Nr?{permissionMode:Nr}:{}}:null;Nr&&qi(Nr);let Pl=null;const Ch=Ue.current;ze&&(Nt==null?void 0:Nt.planActivation)==="command"&&(Pl=++ge.current,Ue.current=nt,Le(nt));const Uo=()=>{Pl===null||ge.current!==Pl||(Ue.current=Ch,Le(Ch))};if(!$n&&ri.length===0&&xi.length===0)return;if(($n||xi.length>0)&&Ar&&ri.length===0){z(""),mn(null),H([]),St({promptId:Ar,answers:[],note:$n||void 0,annotations:Po}).then(wn=>{wn||Fl()});return}if(ln){if(!F||!(Je!=null&&Je.agentReady)){Uo();return}const wn=F;z(""),mn(null),le([]),H([]),te(null);const fs=$r?{model:$r.model,permissionMode:$r.permissionMode,planMode:(Nt==null?void 0:Nt.planActivation)==="command"?Zt??(ft==null?void 0:ft.planMode):Zt,reasoningLevel:$r.reasoningLevel}:{};st({});const Ya=ri.map(sr=>({mediaType:sr.mediaType,dataBase64:sr.dataUrl.slice(sr.dataUrl.indexOf(",")+1),name:sr.name}));try{await gr(()=>a3(wn,$n,fs,Ya.length?Ya:void 0,Po,oa&&!ne&&!ze?"steer":void 0))}catch{Uo(),Fl()}return}if(!(Je!=null&&Je.agentReady)){Uo();return}if(!$r){Uo();return}z(""),mn(null),le([]),H([]),te(null);let hs=F;try{if(!hs){const Fn=await TD(e,$r.harness,{model:$r.model,permissionMode:$r.permissionMode,planMode:Zt,reasoningLevel:$r.reasoningLevel});Qe.current.add(Fn.id),$(Ul=>[Fn,...Ul]),U(Fn.id),hs=Fn.id,Sh=Fn.id,W.current={projectId:e,activeId:Fn.id}}De({type:"optimisticUser",sessionId:hs,text:$n||"Asked about selected text",attachments:ri.map(Fn=>({url:Fn.dataUrl,mediaType:Fn.mediaType,name:Fn.name})),annotations:xi}),De({type:"busy",sessionId:hs,busy:!0}),Tt.current=!0,Y==="archived"&&Z("active");const wn=$r?{model:$r.model,permissionMode:$r.permissionMode,planMode:Zt,reasoningLevel:$r.reasoningLevel}:{};st({});const fs=ri.map(Fn=>({mediaType:Fn.mediaType,dataBase64:Fn.dataUrl.slice(Fn.dataUrl.indexOf(",")+1),name:Fn.name})),Ya=hs;if(!Ya)throw new Error("chat session was not created");await gr(()=>a3(Ya,$n,wn,fs.length?fs:void 0,Po))}catch(wn){if(Fl(),Uo(),!hs)return;const fs=wn instanceof Error?wn.message:String(wn);if(!/session is busy/i.test(fs)&&await lf(e).then(sr=>{var Fn;return!!((Fn=sr.find(Ul=>Ul.id===hs))!=null&&Fn.busy)}).catch(()=>!1)){kh()&&(z(sr=>sr===$n?"":sr),le(sr=>sr===ri?[]:sr),H(sr=>sr===xi?[]:sr));return}De({type:"busy",sessionId:hs,busy:!1}),De({type:"localError",sessionId:hs,text:`Message not sent: ${fs}`})}}function us(){F&&BD(F)}const Fo=R.useCallback((ne,fe)=>{if(!F||ln||!(Je!=null&&Je.agentReady))return;const Se=F;De({type:"busy",sessionId:Se,busy:!0}),Tt.current=!0,gr(()=>ID(Se,ne,fe)).catch(Te=>{De({type:"busy",sessionId:Se,busy:!1});const ze=Te instanceof Error?Te.message:String(Te);De({type:"localError",sessionId:Se,text:`Could not re-send: ${ze}`})})},[F,ln,Je==null?void 0:Je.agentReady,gr]),Ds=R.useCallback(ne=>{if(!F||ln)return;const fe=F,Se=rr.current;De({type:"activeLeaf",sessionId:fe,leafId:ne}),gr(()=>zD(fe,ne)).catch(Te=>{De({type:"activeLeaf",sessionId:fe,leafId:Se});const ze=Te instanceof Error?Te.message:String(Te);De({type:"localError",sessionId:fe,text:`Could not switch fork: ${ze}`})})},[F,ln,gr]);function ni(ne){if(!F)return;const fe=F;De({type:"setQueued",sessionId:fe,items:ti.filter(Se=>Se.id!==ne)}),LD(fe,ne).catch(()=>{})}R.useEffect(()=>{if(!ln||o!=="chat")return;function ne(fe){var Se;fe.key!=="Escape"||fe.defaultPrevented||(fe.preventDefault(),us(),(Se=ut.current)==null||Se.focus())}return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[ln,F,o]);function Hr(ne){Oe.current.add(ne),$(fe=>fe.filter(Se=>Se.id!==ne)),U(fe=>fe===ne?null:fe),X(fe=>{if(!fe.has(ne))return fe;const Se=new Set(fe);return Se.delete(ne),Se}),Qe.current.delete(ne),Ge.current.delete(ne),De({type:"forget",sessionId:ne})}function Va(ne,fe){const Se=ne.archived;$(Te=>Te.map(ze=>ze.id===ne.id?{...ze,archived:fe}:ze)),Mw(Y,fe)||U(Te=>Te===ne.id?null:Te),jD(ne.id,fe).catch(()=>{$(Te=>Te.map(ze=>ze.id===ne.id?{...ze,archived:Se}:ze))})}function Tr(ne,fe){const Se=ne.title;$(Te=>Te.map(ze=>ze.id===ne.id?{...ze,title:fe}:ze)),MD(ne.id,fe).catch(()=>{$(Te=>Te.map(ze=>ze.id===ne.id?{...ze,title:Se}:ze))})}async function Ls(ne){var Se;const fe=((Se=ne.title)==null?void 0:Se.trim())||"Untitled";if(window.confirm(`Delete "${fe}"? - -Its transcript is permanently removed.`)){try{await ND(ne.id)}catch(Te){window.alert(`Failed to delete "${fe}": ${Te instanceof Error?Te.message:String(Te)}`);return}Hr(ne.id)}}const St=R.useCallback(ne=>{if(!F)return Promise.resolve(!1);const fe=F;return De({type:"busy",sessionId:fe,busy:!0}),gr(()=>HD(fe,ne)).then(()=>!0).catch(()=>!1).finally(()=>{ud(fe).then(({messages:Se,queued:Te,activeLeafId:ze})=>De({type:"seed",sessionId:fe,messages:Se,queued:Te,activeLeafId:ze})).catch(()=>{}),lf(e).then(Se=>{var Te;return De({type:"busy",sessionId:fe,busy:!!((Te=Se.find(ze=>ze.id===fe))!=null&&Te.busy)})}).catch(()=>{})})},[F,e,gr]),_i=I.filter(ne=>Mw(Y,ne.archived)),Wi=/Mac|iPhone|iPad/.test(navigator.platform),Yi=Wi?"⌘ ⇧ Enter":"Ctrl + Shift + Enter",Wa=Wi?"⌘ Enter":"Ctrl + Enter",ds=R.useCallback(()=>{Z("active"),U(null),l("chat")},[l]);R.useEffect(()=>{const ne=fe=>{fe.repeat||fe.key!=="Enter"||!fe.metaKey&&!fe.ctrlKey||fe.altKey||!fe.shiftKey||(fe.preventDefault(),ds())};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[ds]);const se=h.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-2.5 mr-3.5 mb-2.5 ml-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:py-1 [&_.rail-body]:px-2 floating-panel border border-border rounded-lg shadow-[0_6px_24px_color-mix(in_oklab,_var(--text)_5%,_transparent),_0_1px_4px_color-mix(in_oklab,_var(--text)_4%,_transparent)] overflow-visible",children:[r,h.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${d?"active":""}`,onClick:C,children:[h.jsx(yd,{size:15}),"Files"]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${m?"active":""}`,"data-onboarding":"nav-artifacts",onClick:g,children:[h.jsx(n_,{size:15}),"Artifacts"]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${u?"active":""}`,onClick:f,children:[h.jsx(Cb,{size:15}),"Experiments"]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${o==="skills"?"active":""}`,onClick:()=>l("skills"),children:[h.jsx(Aj,{size:15}),"Skills"]}),yG.map(ne=>h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-left [&:hover]:bg-surface [&.active]:bg-panel [&.active]:font-semibold ${o!=="chat"&&o!=="skills"&&ne.activeTabs.includes(o)?"active":""}`,"data-onboarding":ne.id==="compute"?"nav-compute":void 0,onClick:()=>l(ne.id),children:[ne.icon,ne.label]},ne.id))]}),h.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pr-2.5 pb-1.5 pl-4.5",children:[h.jsx("div",{className:"rail-section-label p-0 text-md font-medium text-subtext",children:((Ve=kC.find(ne=>ne.id===Y))==null?void 0:Ve.railLabel)??"Recents"}),h.jsxs("div",{className:"rail-section-actions flex items-center gap-0.5",children:[h.jsxs("button",{className:"rail-section-new inline-flex items-center gap-1 py-[3px] px-1.5 rounded-sm text-subtext text-xs font-medium [&:hover]:text-text [&:hover]:bg-surface tip-up [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":Yi,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:ds,children:[h.jsx(r_,{size:13}),"Task"]}),h.jsx(VV,{value:Y,onChange:Z})]})]}),h.jsxs("div",{className:"rail-body",children:[_i.map(ne=>h.jsx(KV,{session:ne,active:ne.id===F&&o==="chat",unread:G.has(ne.id),busy:mt.busySessions.has(ne.id),waiting:ir.has(ne.id),revealTitle:xe.get(ne.id),onOpen:()=>{U(ne.id),e===ag&&BG(ne.id),X(fe=>{if(!fe.has(ne.id))return fe;const Se=new Set(fe);return Se.delete(ne.id),Se}),l("chat")},onRename:fe=>Tr(ne,fe),onSetArchived:fe=>Va(ne,fe),onDelete:()=>void Ls(ne)},ne.id)),_i.length===0&&h.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-md text-muted",children:Y==="archived"?"No archived sessions":I.length>0?"No active sessions":"No sessions yet"})]})]}),we=`chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&.rail-hidden]:max-w-none [&.rail-hidden]:py-0 [&.rail-hidden]:px-0.5 [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:left-0 [&::after]:right-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none${i?"":" rail-hidden"}`,Ee=!i&&h.jsx("button",{className:Xn,title:"Show sidebar","aria-label":"Show sidebar",onClick:a,children:h.jsx(nS,{size:15})});return o!=="chat"?h.jsxs(h.Fragment,{children:[i&&se,h.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!i&&h.jsx("div",{className:we,children:Ee}),h.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:D})]})]}):h.jsxs(h.Fragment,{children:[i&&se,h.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[h.jsxs("div",{className:we,children:[Ee,h.jsx("div",{className:Sd,title:cn?((qe=cn.title)==null?void 0:qe.trim())||"Untitled":"New session",children:cn?h.jsx(CC,{title:((vt=cn.title)==null?void 0:vt.trim())||"Untitled",animate:Ms!==void 0},Ms??"static"):"New session"}),N&&h.jsx("button",{className:Xn,"data-tip":"About this demo","aria-label":"About this demo",onClick:N,children:h.jsx(Fj,{size:15})})]}),Ga?h.jsxs("div",{className:"chat-loading flex-1 flex items-center justify-center gap-3 text-subtext text-xl p-5 [&_.spinner]:w-5.5 [&_.spinner]:h-5.5 [&_.spinner]:border-[3px]","aria-live":"polite","aria-busy":"true",children:[h.jsx("span",{className:qt}),h.jsx("span",{children:"Loading conversation…"})]}):br?h.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:jt,onScroll:ne=>{const fe=ne.currentTarget;Tt.current=fe.scrollHeight-fe.scrollTop-fe.clientHeight<60,Or.dismiss()},children:h.jsxs("div",{className:"chat-thread-inner max-w-readable my-0 mx-auto pt-4 px-4 pb-8 flex flex-col gap-4",ref:_t,children:[h.jsx(GV,{messages:Rn,allMessages:vi,canFork:sa,onFork:Fo,onSelectFork:Ds,busy:ln,onOpenFile:$l,onOpenRun:k,runExperimentName:S,onOpenExperiment:x,experimentName:_,onRespond:St,onOpenPlan:Rs,onOpenSubagent:$o,skills:na}),ln&&(aa?h.jsx("div",{className:"working flex items-center gap-2 text-subtext text-md pt-0.5 px-0 pb-2 [&.awaiting]:italic awaiting",children:"Waiting for your input…"}):h.jsxs("div",{className:"working flex items-center gap-2 text-subtext text-md pt-0.5 px-0 pb-2 [&.awaiting]:italic",children:[h.jsx("span",{className:qt})," ",cs?"Working…":"Thinking…"]}))]})}):h.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center @container text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[h.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:h.jsx(l_,{})}),h.jsx("h2",{children:"What should we research?"}),h.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-semibold",children:[h.jsx(yd,{size:19}),h.jsx("span",{children:t})]}),h.jsxs("div",{className:"chat-empty-starters grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2.5 w-[min(100%,_620px)] mt-19 [@container((min-width:_500px))]:grid-cols-[repeat(4,_minmax(0,_1fr))] [@container((min-width:_500px))]:w-[min(100%,_720px)]",children:[h.jsxs("button",{type:"button",className:"chat-empty-starter min-h-28 flex flex-col items-start justify-between gap-5 p-4 border border-border rounded-lg text-text bg-background shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_5%,_transparent)] text-left text-md font-medium leading-[1.35] transition-[border-color,background,translate] duration-120 ease-standard [&:hover]:border-muted [&:hover]:bg-surface [&:hover]:-translate-y-px [&.blue_svg]:text-accent-blue [&.purple_svg]:text-accent-purple [&.green_svg]:text-accent-green [&.orange_svg]:text-accent-orange blue",onClick:()=>{var ne;mn(null),z("Explore this codebase and explain its architecture, key components, and open research questions."),(ne=ut.current)==null||ne.focus()},children:[h.jsx(G8,{size:16}),h.jsx("span",{children:"Explore this codebase"})]}),h.jsxs("button",{type:"button",className:"chat-empty-starter min-h-28 flex flex-col items-start justify-between gap-5 p-4 border border-border rounded-lg text-text bg-background shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_5%,_transparent)] text-left text-md font-medium leading-[1.35] transition-[border-color,background,translate] duration-120 ease-standard [&:hover]:border-muted [&:hover]:bg-surface [&:hover]:-translate-y-px [&.blue_svg]:text-accent-blue [&.purple_svg]:text-accent-purple [&.green_svg]:text-accent-green [&.orange_svg]:text-accent-orange purple",onClick:()=>{var fe;const ne=os.find(Se=>Se.name==="reproduce-paper");n&&ne?(mn(ne),z("")):(mn(null),z(n?"/reproduce-paper ":"Find and summarize the research most relevant to this project.")),(fe=ut.current)==null||fe.focus()},children:[h.jsx(nh,{size:16}),h.jsx("span",{children:n?"Reproduce the linked paper":"Review relevant literature"})]}),h.jsxs("button",{type:"button",className:"chat-empty-starter min-h-28 flex flex-col items-start justify-between gap-5 p-4 border border-border rounded-lg text-text bg-background shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_5%,_transparent)] text-left text-md font-medium leading-[1.35] transition-[border-color,background,translate] duration-120 ease-standard [&:hover]:border-muted [&:hover]:bg-surface [&:hover]:-translate-y-px [&.blue_svg]:text-accent-blue [&.purple_svg]:text-accent-purple [&.green_svg]:text-accent-green [&.orange_svg]:text-accent-orange green",onClick:()=>{var ne;mn(null),z("Set up and run an experiment for this project, including a baseline and meaningful variants."),(ne=ut.current)==null||ne.focus()},children:[h.jsx(Cb,{size:16}),h.jsx("span",{children:"Run an experiment"})]}),h.jsxs("button",{type:"button",className:"chat-empty-starter min-h-28 flex flex-col items-start justify-between gap-5 p-4 border border-border rounded-lg text-text bg-background shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_5%,_transparent)] text-left text-md font-medium leading-[1.35] transition-[border-color,background,translate] duration-120 ease-standard [&:hover]:border-muted [&:hover]:bg-surface [&:hover]:-translate-y-px [&.blue_svg]:text-accent-blue [&.purple_svg]:text-accent-purple [&.green_svg]:text-accent-green [&.orange_svg]:text-accent-orange orange",onClick:()=>{var ne;mn(null),z("Analyze the latest experiment results and recommend the most useful next iteration."),(ne=ut.current)==null||ne.focus()},children:[h.jsx(V8,{size:16}),h.jsx("span",{children:"Analyze results"})]})]})]}),Or.action&&h.jsxs("button",{type:"button",className:"chat-selection-action fixed z-50 inline-flex items-center gap-1.5 py-1.5 px-3 border border-border rounded-md bg-background text-text text-sm font-medium shadow-[0_2px_8px_rgba(0,_0,_0,_0.10)] whitespace-nowrap [&:hover]:bg-surface",style:{left:Or.action.x,top:Or.action.top,transform:"translateX(-50%)"},onMouseDown:ne=>ne.preventDefault(),onClick:Or.add,children:[h.jsx(tS,{size:14}),"Ask about this"]}),h.jsxs("div",{className:"composer pt-0 px-3 pb-3 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&::before]:content-[''] [&::before]:absolute [&::before]:bottom-full [&::before]:left-0 [&::before]:right-0 [&::before]:h-6 [&::before]:bg-[linear-gradient(to_top,_var(--base),_transparent)] [&::before]:pointer-events-none [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[gn&&!(Bl&&gn.promptId===Bl.promptId)&&h.jsx(xq,{synthesized:gn.synthesized,agentLabel:cn?ad[cn.harness]:"The agent",showResumeModes:(cn==null?void 0:cn.harness)==="claude-code",onView:()=>Rs==null?void 0:Rs(gn.plan,gn.promptId),onApprove:ne=>St({promptId:gn.promptId,approve:!0,...ne?{resumeMode:ne}:{}}),onReject:()=>St({promptId:gn.promptId,approve:!1}),onRevise:ne=>{F&&Vi({sessionId:F,promptId:gn.promptId}),St({promptId:gn.promptId,approve:!1,note:ne})}}),ti.length>0&&h.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:ti.map(ne=>h.jsxs("div",{className:"queued-chip flex items-center gap-2 py-1.5 px-2.5 text-sm text-subtext bg-surface border border-border rounded-sm",title:ne.text,children:[h.jsx(Wj,{size:13,className:"shrink-0 text-muted"}),h.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:ne.text}),h.jsx("span",{className:"shrink-0 text-xs text-muted uppercase tracking-wide",children:"Queued"}),h.jsx("button",{title:"Cancel queued message","aria-label":"Cancel queued message",onClick:()=>ni(ne.id),className:"shrink-0 inline-flex items-center justify-center w-4 h-4 p-0 border-0 rounded-full text-muted cursor-pointer [&:hover]:bg-text [&:hover]:text-background",children:h.jsx(qr,{size:11})})]},ne.id))}),h.jsxs("div",{className:"composer-box relative flex flex-col border border-border rounded-md bg-background","data-onboarding":"composer",children:[Je&&!Je.agentReady&&h.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-xs leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[h.jsxs("strong",{children:[Je.name," is unavailable."]})," ",Je.agentNote?j2(Je.agentNote):"Re-check its setup."]}),Jr&&h.jsx(kG,{skills:Cr,activeIndex:Er,onPick:Pt,onHover:pr}),O.length>0&&h.jsx(lV,{annotations:O,onClear:()=>{H([]),window.requestAnimationFrame(()=>{var ne;return(ne=ut.current)==null?void 0:ne.focus()})},onRemove:ne=>{const fe=O.filter(Se=>Se.id!==ne);H(fe),fe.length===0&&window.requestAnimationFrame(()=>{var Se;return(Se=ut.current)==null?void 0:Se.focus()})}}),re.length>0&&h.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:re.map((ne,fe)=>{const Se=()=>le(Te=>Te.filter((ze,nt)=>nt!==fe));return ne.mediaType==="application/pdf"?h.jsxs("div",{className:"attachment-file [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background relative inline-flex items-center gap-2 max-w-55 py-2 px-2.5 border border-border rounded-sm text-text bg-surface [&_svg]:shrink-0 [&_svg]:text-muted",title:ne.name,children:[h.jsx(th,{size:22}),h.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:ne.name??"document.pdf"}),h.jsx("button",{title:"Remove file","aria-label":"Remove file",onClick:Se,children:h.jsx(qr,{size:11})})]},fe):h.jsxs("div",{className:"attachment-thumb relative [&_img]:w-13 [&_img]:h-13 [&_img]:object-cover [&_img]:border [&_img]:border-border [&_img]:rounded-sm [&_img]:block [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background",children:[h.jsx("img",{src:ne.dataUrl,alt:"pasted"}),h.jsx("button",{title:"Remove image","aria-label":"Remove image",onClick:Se,children:h.jsx(qr,{size:11})})]},fe)})}),pe&&h.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:pe}),B&&h.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:B}),h.jsxs("div",{className:"composer-input relative flex overflow-hidden [&_textarea]:flex-1",children:[yn&&h.jsxs("span",{ref:bi,className:"skill-chip inline-flex items-center py-px px-[7px] font-mono text-md font-medium text-primary bg-primary-subtle border border-border-variant rounded-sm composer-chip absolute top-[9px] left-3 z-1 pointer-events-none",children:["/",yn.name]}),h.jsx("textarea",{ref:ut,value:Q,style:yn?{textIndent:Ns}:void 0,onScroll:Sr,placeholder:Ar?"Type a custom answer…":yn?["reproduce-paper","paper-to-marimo"].includes(yn.name)&&n?`[optional — defaults to ${n} on your default compute]`:yn.argHint:oa&&Je?`Steer ${ad[Je.id]}… (${Wa} to queue)`:Ut?Je!=null&&Je.agentReady?`Message ${ad[Ut.harness]}… ( / for commands)`:`${ad[Ut.harness]} is unavailable — open the model picker`:"Ask the research agent… ( / for commands)",rows:2,onPaste:Qr,onDragOver:ne=>{ne.dataTransfer.types.includes("Files")&&ne.preventDefault()},onDrop:ne=>{ne.dataTransfer.files.length!==0&&(ne.preventDefault(),Zr(Array.from(ne.dataTransfer.files)))},onChange:ne=>{const fe=ne.target.value,Se=ne.target.selectionStart;Kr(Se);const Te=Se>0&&/\s/.test(fe[Se-1])?yw(fe,Se-1):null;if((Te==null?void 0:Te.query)==="plan"){js(fe,Te);return}if(!yn&&!Ar&&!mr.current){const ze=fe.match(/^\/(\S+)\s([\s\S]*)$/),nt=ze&&na.find(Zt=>Zt.name===ze[1].toLowerCase());if(nt){mn(nt),z(ze[2]),Jn(!1);return}}z(fe),Jn(!1)},onSelect:ne=>Kr(ne.currentTarget.selectionStart),onCompositionStart:()=>{mr.current=!0},onCompositionEnd:()=>{mr.current=!1},onKeyDown:ne=>{if(Jr){if(ne.key==="ArrowDown"||ne.key==="ArrowUp"){ne.preventDefault();const fe=ne.key==="ArrowDown"?1:-1;pr((Er+fe+Cr.length)%Cr.length);return}if(ne.key==="Enter"||ne.key==="Tab"){ne.preventDefault(),Pt(Cr[Er]);return}if(ne.key==="Escape"){ne.preventDefault(),Jn(!0);return}}if(yn&&ne.key==="Backspace"&&ne.currentTarget.selectionStart===0&&ne.currentTarget.selectionEnd===0){ne.preventDefault(),er();return}ne.key==="Enter"&&!ne.shiftKey&&!ne.nativeEvent.isComposing&&(ne.preventDefault(),nn({queue:ne.metaKey||ne.ctrlKey}))}})]}),h.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[h.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:xn.ref,children:[h.jsx("button",{type:"button",className:"composer-bare inline-flex items-center justify-center rounded-sm p-1.5 text-text transition-[background] duration-150 ease-standard hover:bg-surface",title:"Data sources","aria-label":"Data sources","aria-haspopup":"dialog","aria-expanded":xn.open,onClick:()=>xn.setOpen(ne=>!ne),children:h.jsx(cR,{size:16})}),xn.open&&h.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] left-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-[0_10px_26px_rgba(0,_0,_0,_0.16)]",children:[h.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:"Data sources"}),h.jsx(lL,{})]})]}),h.jsx("input",{ref:Fe,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:ne=>{Zr(Array.from(ne.target.files??[])),ne.target.value=""}}),h.jsx("button",{type:"button",className:"composer-attach inline-flex shrink-0 items-center justify-center w-7.5 h-7.5 rounded-sm text-text cursor-pointer transition-[background] duration-150 ease-standard [&:hover]:bg-surface",title:"Attach a PDF or image","aria-label":"Attach a PDF or image",onClick:()=>{var ne;return(ne=Fe.current)==null?void 0:ne.click()},children:h.jsx(UM,{size:16})}),zr&&h.jsxs("button",{type:"button",className:"plan-indicator group inline-flex h-7.5 shrink-0 items-center gap-1.5 rounded-sm bg-surface px-2 text-sm text-muted transition-colors hover:text-text focus-visible:text-text",title:"Exit Plan mode","aria-label":"Exit Plan mode",onClick:()=>void Gi(),children:[h.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[h.jsx(AM,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),h.jsx(qr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),h.jsx("span",{children:"Plan"})]}),h.jsx("div",{className:"min-w-0 flex-1"}),h.jsx(TG,{value:Ut,onSelect:Qt,permissionChoices:Je!=null&&Je.agentReady?(Nt==null?void 0:Nt.permissionModes)??[]:[],defaultPermissionId:(Nt==null?void 0:Nt.defaultPermissionMode)??null,onSelectPermission:qi,reasoningChoices:Je!=null&&Je.agentReady?Ir.choices:[],defaultReasoningId:Ir.defaultId,onSelectReasoning:Hn,onHarnesses:Bt,lockHarness:!!ft}),h.jsx(jG,{usage:ft==null?void 0:ft.contextUsage}),ln&&!Ar?h.jsx("button",{className:"send-btn inline-flex shrink-0 items-center justify-center w-8 h-8 rounded-md bg-primary text-background transition-[background,opacity] duration-100 ease-standard [&:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))] [&:disabled]:opacity-40 [&:disabled]:cursor-default [&.stop]:bg-surface [&.stop]:text-text [&.stop:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--surface)_88%,_var(--text))] stop",title:"Stop","aria-label":"Stop",onClick:us,children:h.jsx(qr,{size:16})}):h.jsx("button",{className:"send-btn inline-flex shrink-0 items-center justify-center w-8 h-8 rounded-md bg-primary text-background transition-[background,opacity] duration-100 ease-standard [&:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--primary)_88%,_var(--text))] [&:disabled]:opacity-40 [&:disabled]:cursor-default [&.stop]:bg-surface [&.stop]:text-text [&.stop:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--surface)_88%,_var(--text))]",title:"Send","aria-label":"Send",onClick:()=>void nn(),disabled:!(Je!=null&&Je.agentReady)||!yn&&!Q.trim()&&re.length===0&&O.length===0,children:h.jsx(Z8,{size:16})})]})]})]})]})]})}const Rw=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function QV({sessionId:e,spawnPartId:t,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:l}){const[u,d]=R.useState(null),m=R.useRef(null),f=R.useRef(null),g=R.useRef(!0);if(R.useLayoutEffect(()=>{g.current=!0;const k=m.current;k&&(k.scrollTop=k.scrollHeight)},[e,t]),R.useLayoutEffect(()=>{const k=m.current;k&&g.current&&(k.scrollTop=k.scrollHeight)},[u]),R.useEffect(()=>{const k=m.current,S=f.current;if(!k||!S)return;const x=new ResizeObserver(()=>{g.current&&(k.scrollTop=k.scrollHeight)});return x.observe(S),x.observe(k),()=>x.disconnect()},[u===null]),R.useEffect(()=>{let k=!0;const S=new Set;let x=0;const _=()=>{const y=++x;ud(e).then(({messages:C})=>{!k||y!==x||d(N=>{if(!N)return C;const E=C.map(T=>S.has(T.id)?N.find(D=>D.id===T.id)??T:T),j=new Set(C.map(T=>T.id));return[...E,...N.filter(T=>!j.has(T.id))]})}).catch(()=>k&&d(C=>C??[]))};_();const w=wd(y=>{if(y.type==="reconnected"){S.clear(),_();return}y.type!=="message"||y.sessionId!==e||(S.add(y.message.id),d(C=>{const N=C?C.slice():[],E=N.findIndex(j=>j.id===y.message.id);return E===-1?N.push(y.message):N[E]=y.message,N}))});return()=>{k=!1,w()}},[e]),u===null)return h.jsx("div",{className:Aa,children:h.jsx("div",{className:Rw,children:h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:"Loading…"})})});let b=null;for(const k of u)if(b=O2(k.parts,t),b)break;return h.jsx("div",{className:Aa,children:h.jsx("div",{className:Rw,ref:m,onScroll:k=>{const S=k.currentTarget;g.current=S.scrollHeight-S.scrollTop-S.clientHeight<60},children:h.jsx("div",{ref:f,children:b?h.jsx(FV,{spawn:b,onOpenFile:n,onOpenRun:r,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:l}):h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-md text-muted",children:"This sub-agent is no longer available."})})})})}function Dw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.push.apply(n,r)}return n}function Xt(e){for(var t=1;t=0||(m[u]=o[u]);return m})(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $t(e,t){return AC(e)||(function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var a,o,l,u,d=[],m=!0,f=!1;try{if(l=(i=i.call(n)).next,r===0){if(Object(i)!==i)return;m=!1}else for(;!(m=(a=l.call(i)).done)&&(d.push(a.value),d.length!==r);m=!0);}catch(g){f=!0,o=g}finally{try{if(!m&&i.return!=null&&(u=i.return(),Object(u)!==u))return}finally{if(f)throw o}}return d}})(e,t)||Mp(e,t)||NC()}function EC(e){return AC(e)||TC(e)||Mp(e)||NC()}function Ii(e){return(function(t){if(Array.isArray(t))return Cv(t)})(e)||TC(e)||Mp(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 AC(e){if(Array.isArray(e))return e}function TC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Mp(e,t){if(e){if(typeof e=="string")return Cv(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)?Cv(e,t):void 0}}function Cv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:i}}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 a,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return o=u.done,u},e:function(u){l=!0,a=u},f:function(){try{o||n.return==null||n.return()}finally{if(l)throw a}}}}var q0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gh(e,t){return e(t={exports:{}},t.exports),t.exports}var Ri=gh((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=[],i=0;i-1?_.slice(0,y):C;switch(C){case"diff":S--;break e;case"deleted":case"new":var N=_.slice(y+1);N.indexOf("file mode")===0&&(o[C==="new"?"newMode":"oldMode"]=N.slice(10));break;case"similarity":o.similarity=parseInt(_.split(" ")[2],10);break;case"index":var E=_.slice(y+1).split(" "),j=E[0].split("..");o.oldRevision=j[0],o.newRevision=j[1],E[1]&&(o.oldMode=o.newMode=E[1]);break;case"copy":case"rename":var T=_.slice(y+1);T.indexOf("from")===0?o.oldPath=T.slice(5):o.newPath=T.slice(3),w=C;break;case"---":var D=_.slice(y+1),I=b[++S].slice(4);D==="/dev/null"?(I=I.slice(2),w="add"):I==="/dev/null"?(D=D.slice(2),w="delete"):(w="modify",D=D.slice(2),I=I.slice(2)),D&&(o.oldPath=D),I&&(o.newPath=I),g=5;break e}}o.type=w||"modify"}else if(x.indexOf("Binary")===0)o.isBinary=!0,o.type=x.indexOf("/dev/null and")>=0?"add":x.indexOf("and /dev/null")>=0?"delete":"modify",g=2,o=null;else if(g===5)if(x.indexOf("@@")===0){var $=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(x);l={content:x,oldStart:$[1]-0,newStart:$[4]-0,oldLines:$[3]-0||1,newLines:$[6]-0||1,changes:[]},o.hunks.push(l),u=l.oldStart,d=l.newStart}else{var F=x.slice(0,1),U={content:x.slice(1)};switch(F){case"+":U.type="insert",U.isInsert=!0,U.lineNumber=d,d++;break;case"-":U.type="delete",U.isDelete=!0,U.lineNumber=u,u++;break;case" ":U.type="normal",U.isNormal=!0,U.oldLineNumber=u,U.newLineNumber=d,u++,d++;break;case"\\":var G=l.changes[l.changes.length-1];G.isDelete||(o.newEndingNewLine=!1),G.isInsert||(o.oldEndingNewLine=!1)}U.type&&l.changes.push(U)}S++}return f}};e.exports=i})()}));function Ho(e){return e.type==="insert"}function zi(e){return e.type==="delete"}function Ia(e){return e.type==="normal"}function nW(e,t){var n=t.nearbySequences==="zip"?(function(r){var i=r.reduce((function(a,o,l){var u=$t(a,3),d=u[0],m=u[1],f=u[2];return m?Ho(o)&&f>=0?(d.splice(f+1,0,o),[d,o,f+2]):(d.push(o),[d,o,zi(o)&&zi(m)?f:l]):(d.push(o),[d,o,zi(o)?l:-1])}),[[],null,-1]);return $t(i,1)[0]})(e.changes):e.changes;return Xt(Xt({},e),{},{isPlain:!1,changes:n})}function Ev(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=(function(r){if(r.startsWith("diff --git"))return r;var i=r.indexOf(` -`),a=r.indexOf(` -`,i+1),o=r.slice(0,i),l=r.slice(i+1,a),u=o.split(" ").slice(1,-3).join(" "),d=l.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(u," b/").concat(d),"index 1111111..2222222 100644","--- a/".concat(u),"+++ b/".concat(d),r.slice(a+1)].join(` -`)})(e.trimStart());return tW.parse(n).map((function(r){return(function(i,a){var o=i.hunks.map((function(l){return nW(l,a)}));return Xt(Xt({},i),{},{hunks:o})})(r,t)}))}function rW(e){return e[0]}function iW(e){return e[e.length-1]}function Av(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function Ld(e){return e==="old"?function(t){return Ho(t)?-1:Ia(t)?t.oldLineNumber:t.lineNumber}:function(t){return zi(t)?-1:Ia(t)?t.newLineNumber:t.lineNumber}}function MC(e,t){return function(n,r){var i=n[e],a=i+n[t];return r>=i&&r=a&&i-1},hW=function(e,t){var n=this.__data__,r=Rp(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Cc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tl))return!1;var d=a.get(e),m=a.get(t);if(d&&m)return d==t&&m==e;var f=-1,g=!0,b=2&n?new XW:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},_n={};_n["[object Float32Array]"]=_n["[object Float64Array]"]=_n["[object Int8Array]"]=_n["[object Int16Array]"]=_n["[object Int32Array]"]=_n["[object Uint8Array]"]=_n["[object Uint8ClampedArray]"]=_n["[object Uint16Array]"]=_n["[object Uint32Array]"]=!0,_n["[object Arguments]"]=_n["[object Array]"]=_n["[object ArrayBuffer]"]=_n["[object Boolean]"]=_n["[object DataView]"]=_n["[object Date]"]=_n["[object Error]"]=_n["[object Function]"]=_n["[object Map]"]=_n["[object Number]"]=_n["[object Object]"]=_n["[object RegExp]"]=_n["[object Set]"]=_n["[object String]"]=_n["[object WeakMap]"]=!1;var dY=function(e){return Xc(e)&&H2(e.length)&&!!_n[cu(e)]},hY=function(e){return function(t){return e(t)}},Fw=gh((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,i=r&&r.exports===n&&LC.process,a=(function(){try{var o=r&&r.require&&r.require("util").types;return o||i&&i.binding&&i.binding("util")}catch{}})();e.exports=a})),Pw=Fw&&Fw.isTypedArray,$2=Pw?hY(Pw):dY,fY=Object.prototype.hasOwnProperty,pY=function(e,t){var n=Hi(e),r=!n&&Ip(e),i=!n&&!r&&Uf(e),a=!n&&!r&&!i&&$2(e),o=n||r||i||a,l=o?aY(e.length,String):[],u=l.length;for(var d in e)!fY.call(e,d)||o&&(d=="length"||i&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||$C(d,u))||l.push(d);return l},mY=Object.prototype,FC=function(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||mY)},gY=(function(e,t){return function(n){return e(t(n))}})(Object.keys,Object),bY=Object.prototype.hasOwnProperty,PC=function(e){if(!FC(e))return gY(e);var t=[];for(var n in Object(e))bY.call(e,n)&&n!="constructor"&&t.push(n);return t},zp=function(e){return e!=null&&H2(e.length)&&!IC(e)},F2=function(e){return zp(e)?pY(e):PC(e)},Uw=function(e){return tY(e,F2,sY)},vY=Object.prototype.hasOwnProperty,_Y=function(e,t,n,r,i,a){var o=1&n,l=Uw(e),u=l.length;if(u!=Uw(t).length&&!o)return!1;for(var d=u;d--;){var m=l[d];if(!(o?m in t:vY.call(t,m)))return!1}var f=a.get(e),g=a.get(t);if(f&&g)return f==t&&g==e;var b=!0;a.set(e,t),a.set(t,e);for(var k=o;++d1)return!1;if(e.length===1){var t=$t(e,1)[0];return t.type==="text"&&!t.value}return!0}function oX(e){var t=e.changeKey,n=e.text,r=e.tokens,i=e.renderToken,a=Lo(e,sX),o=i?function(l,u){return i(l,Yw,u)}:Yw;return h.jsx("td",Xt(Xt({},a),{},{"data-change-key":t,children:r?aX(r)?" ":r.map(o):n||" "}))}var KC=R.memo(oX);function ZC(e,t){return function(){var n=t==="old"?Pp(e):Up(e);return n===-1?void 0:n}}function QC(e,t){return function(n){return e&&n?h.jsx("a",{href:t?"#"+t:void 0,children:n}):n}}function qf(e,t){return t?function(n){e(),t(n)}:e}function Xw(e,t,n,r){return R.useMemo((function(){var i=XC(e,(function(a){return function(o){return a&&a(t,o)}}));return i.onMouseEnter=qf(n,i.onMouseEnter),i.onMouseLeave=qf(r,i.onMouseLeave),i}),[e,n,r,t])}function Kw(e,t,n,r,i,a,o,l,u){var d={change:t,side:r,inHoverState:l,renderDefault:ZC(t,r),wrapInAnchor:QC(i,a)};return h.jsx("td",Xt(Xt({className:e},o),{},{"data-change-key":n,children:u(d)}))}function lX(e){var t,n,r,i=e.change,a=e.selected,o=e.tokens,l=e.className,u=e.generateLineClassName,d=e.gutterClassName,m=e.codeClassName,f=e.gutterEvents,g=e.codeEvents,b=e.hideGutter,k=e.gutterAnchor,S=e.generateAnchorID,x=e.renderToken,_=e.renderGutter,w=i.type,y=i.content,C=No(i),N=(t=$t(R.useState(!1),2),n=t[0],r=t[1],[n,R.useCallback((function(){return r(!0)}),[]),R.useCallback((function(){return r(!1)}),[])]),E=$t(N,3),j=E[0],T=E[1],D=E[2],I=R.useMemo((function(){return{change:i}}),[i]),$=Xw(f,I,T,D),F=Xw(g,I,T,D),U=S(i),G=u({changes:[i],defaultGenerate:function(){return l}}),X=Ri("diff-gutter","diff-gutter-".concat(w),d,{"diff-gutter-selected":a}),Y=Ri("diff-code","diff-code-".concat(w),m,{"diff-code-selected":a});return h.jsxs("tr",{id:U,className:Ri("diff-line",G),children:[!b&&Kw(X,i,C,"old",k,U,$,j,_),!b&&Kw(X,i,C,"new",k,U,$,j,_),h.jsx(KC,Xt({className:Y,changeKey:C,text:y,tokens:o,renderToken:x},F))]})}var cX=R.memo(lX);function uX(e){var t=e.hideGutter,n=e.element;return h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:t?1:3,className:"diff-widget-content",children:n})})}var dX=["hideGutter","selectedChanges","tokens","lineClassName"],hX=["hunk","widgets","className"];function fX(e){var t=e.hunk,n=e.widgets,r=e.className,i=Lo(e,hX),a=(function(o,l){return o.reduce((function(u,d){var m=No(d);u.push(["change",m,d]);var f=l[m];return f&&u.push(["widget",m,f]),u}),[])})(t.changes,n);return h.jsx("tbody",{className:Ri("diff-hunk",r),children:a.map((function(o){return(function(l,u){var d=$t(l,3),m=d[0],f=d[1],g=d[2],b=u.hideGutter,k=u.selectedChanges,S=u.tokens,x=u.lineClassName,_=Lo(u,dX);if(m==="change"){var w=zi(g)?"old":"new",y=zi(g)?Pp(g):Up(g),C=S?S[w][y-1]:null;return h.jsx(cX,Xt({className:x,change:g,hideGutter:b,selected:k.includes(f),tokens:C},_),"change".concat(f))}return m==="widget"?h.jsx(uX,{hideGutter:b,element:g},"widget".concat(f)):null})(o,i)}))})}var JC=0;function V0(e,t,n,r){var i=R.useCallback((function(){return t(e)}),[e,t]),a=R.useCallback((function(){return t("")}),[t]);return R.useMemo((function(){var o=XC(r,(function(l){return function(u){return l&&l({side:e,change:n},u)}}));return o.onMouseEnter=qf(i,o.onMouseEnter),o.onMouseLeave=qf(a,o.onMouseLeave),o}),[n,r,i,e,a])}function nb(e){var t=e.change,n=e.side,r=e.selected,i=e.tokens,a=e.gutterClassName,o=e.codeClassName,l=e.gutterEvents,u=e.codeEvents,d=e.anchorID,m=e.gutterAnchor,f=e.gutterAnchorTarget,g=e.hideGutter,b=e.hover,k=e.renderToken,S=e.renderGutter;if(!t){var x=Ri("diff-gutter","diff-gutter-omit",a),_=Ri("diff-code","diff-code-omit",o);return[!g&&h.jsx("td",{className:x},"gutter"),h.jsx("td",{className:_},"code")]}var w=t.type,y=t.content,C=No(t),N=n===JC?"old":"new",E=Xt({id:d||void 0,className:Ri("diff-gutter","diff-gutter-".concat(w),kv({"diff-gutter-selected":r},"diff-line-hover-"+N,b),a),children:S({change:t,side:N,inHoverState:b,renderDefault:ZC(t,N),wrapInAnchor:QC(m,f)})},l),j=Ri("diff-code","diff-code-".concat(w),kv({"diff-code-selected":r},"diff-line-hover-"+N,b),o);return[!g&&h.jsx("td",Xt(Xt({},E),{},{"data-change-key":C}),"gutter"),h.jsx(KC,Xt({className:j,changeKey:C,text:y,tokens:i,renderToken:k},u),"code")]}function pX(e){var t=e.className,n=e.oldChange,r=e.newChange,i=e.oldSelected,a=e.newSelected,o=e.oldTokens,l=e.newTokens,u=e.monotonous,d=e.gutterClassName,m=e.codeClassName,f=e.gutterEvents,g=e.codeEvents,b=e.hideGutter,k=e.generateAnchorID,S=e.generateLineClassName,x=e.gutterAnchor,_=e.renderToken,w=e.renderGutter,y=$t(R.useState(""),2),C=y[0],N=y[1],E=V0("old",N,n,f),j=V0("new",N,r,f),T=V0("old",N,n,g),D=V0("new",N,r,g),I=n&&k(n),$=r&&k(r),F=S({changes:[n,r],defaultGenerate:function(){return t}}),U={monotonous:u,hideGutter:b,gutterClassName:d,codeClassName:m,gutterEvents:f,codeEvents:g,renderToken:_,renderGutter:w},G=Xt(Xt({},U),{},{change:n,side:JC,selected:i,tokens:o,gutterEvents:E,codeEvents:T,anchorID:I,gutterAnchor:x,gutterAnchorTarget:I,hover:C==="old"}),X=Xt(Xt({},U),{},{change:r,side:1,selected:a,tokens:l,gutterEvents:j,codeEvents:D,anchorID:n===r?null:$,gutterAnchor:x,gutterAnchorTarget:n===r?I:$,hover:C==="new"});if(u)return h.jsx("tr",{className:Ri("diff-line",F),children:nb(n?G:X)});var Y=(function(Z,Q){return Z&&!Q?"diff-line-old-only":!Z&&Q?"diff-line-new-only":Z===Q?"diff-line-normal":"diff-line-compare"})(n,r);return h.jsxs("tr",{className:Ri("diff-line",Y,F),children:[nb(G),nb(X)]})}var mX=R.memo(pX);function gX(e){var t=e.hideGutter,n=e.oldElement,r=e.newElement;return e.monotonous?h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n||r})}):n===r?h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:t?2:4,className:"diff-widget-content",children:n})}):h.jsxs("tr",{className:"diff-widget",children:[h.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n}),h.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:r})]})}var bX=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],vX=["hunk","widgets","className"];function W0(e,t){return(e?No(e):"00")+(t?No(t):"00")}function _X(e){var t=e.hunk,n=e.widgets,r=e.className,i=Lo(e,vX),a=(function(o,l){for(var u=function(_){if(!_)return null;var w=No(_);return l[w]||null},d=[],m=0;m=(a==null?void 0:a.value.length))return[e];var l=function(f,g){var b=a.value.slice(f,g);return[].concat(Ii(i),[Xt(Xt({},a),{},{value:b})])};if(t>0){var u=l(0,t);o.push(jc(u))}var d=l(Math.max(t,0),n);if(o.push(r?(function(f,g){return[g].concat(Ii(jc(f)))})(d,r):jc(d)),n1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,i=Lo(e,HX);n.push(i);var a,o=z2(r);try{for(o.s();!(a=o.n()).done;)rE(a.value,t,n)}catch(l){o.e(l)}finally{o.f()}n.pop()}else t.push(jc([].concat(Ii(n.slice(1)),[e])));return t}function $X(e){return e.reduce((function(t,n){var r=t[t.length-1],i=(function(u){var d=V2(u);return d.value.includes(` -`)?d.value.split(` -`).map((function(m){return IX(u,Xt(Xt({},d),{},{value:m}))})):[u]})(n),a=EC(i),o=a[0],l=a.slice(1);return[].concat(Ii(t.slice(0,-1)),[[].concat(Ii(r),[o])],Ii(l.map((function(u){return[u]}))))}),[[]])}function e7(e){return $X(rE(e))}var FX=function(e,t,n){var r=(n=typeof n=="function"?n:void 0)?n(e,t):void 0;return r===void 0?Bp(e,t,void 0,n):!!r},PX=function(e,t){return Bp(e,t)},UX=function(e){var t=e==null?0:e.length;return t?e[t-1]:void 0};function qX(e,t){if(!e.children)throw new Error("parent node missing children property");var n,r,i=UX(e.children);return i&&(r=t,(n=i).type===r.type&&(n.type==="text"||n.children&&r.children&&FX(n,r,(function(a,o,l){return l==="chlidren"||PX(a,o)}))))?e.children[e.children.length-1]=(function(a,o){return"value"in a&&"value"in o?Xt(Xt({},a),{},{value:"".concat(a.value).concat(o.value)}):a})(i,t):e.children.push(t),e.children[e.children.length-1]}function t7(e){var t,n={type:"root",children:[]},r=z2(e);try{var i=function(){var a=t.value;a.reduce((function(o,l,u){return qX(o,u===a.length-1?Xt({},l):Xt(Xt({},l),{},{children:[]}))}),n)};for(r.s();!(t=r.n()).done;)i()}catch(a){r.e(a)}finally{r.f()}return n}var GX=Object.prototype.hasOwnProperty,VX=tE((function(e,t,n){GX.call(e,n)?e[n].push(t):q2(e,n,[t])})),WX=Object.prototype.hasOwnProperty,YX=function(e){if(e==null)return!0;if(zp(e)&&(Hi(e)||typeof e=="string"||typeof e.splice=="function"||Uf(e)||$2(e)||Ip(e)))return!e.length;var t=Rv(e);if(t=="[object Map]"||t=="[object Set]")return!e.size;if(FC(e))return!PC(e).length;for(var n in e)if(WX.call(e,n))return!1;return!0},XX=function(e,t){var n=t.start,r=t.length,i=n+r,a=e.reduce((function(o,l){var u=$t(o,2),d=u[0],m=u[1],f=m+V2(l).value.length;if(m>i||fr.length?n:r,u=n.length>r.length?r:n,d=l.indexOf(u);if(d!=-1)return o=[new t.Diff(1,l.substring(0,d)),new t.Diff(0,u),new t.Diff(1,l.substring(d+u.length))],n.length>r.length&&(o[0][0]=o[2][0]=-1),o;if(u.length==1)return[new t.Diff(-1,n),new t.Diff(1,r)];var m=this.diff_halfMatch_(n,r);if(m){var f=m[0],g=m[1],b=m[2],k=m[3],S=m[4],x=this.diff_main(f,b,i,a),_=this.diff_main(g,k,i,a);return x.concat([new t.Diff(0,S)],_)}return i&&n.length>100&&r.length>100?this.diff_lineMode_(n,r,a):this.diff_bisect_(n,r,a)},t.prototype.diff_lineMode_=function(n,r,i){var a=this.diff_linesToChars_(n,r);n=a.chars1,r=a.chars2;var o=a.lineArray,l=this.diff_main(n,r,!1,i);this.diff_charsToLines_(l,o),this.diff_cleanupSemantic(l),l.push(new t.Diff(0,""));for(var u=0,d=0,m=0,f="",g="";u=1&&m>=1){l.splice(u-d-m,d+m),u=u-d-m;for(var b=this.diff_main(f,g,!1,i),k=b.length-1;k>=0;k--)l.splice(u,0,b[k]);u+=b.length}m=0,d=0,f="",g=""}u++}return l.pop(),l},t.prototype.diff_bisect_=function(n,r,i){for(var a=n.length,o=r.length,l=Math.ceil((a+o)/2),u=l,d=2*l,m=new Array(d),f=new Array(d),g=0;gi);y++){for(var C=-y+S;C<=y-x;C+=2){for(var N=u+C,E=($=C==-y||C!=y&&m[N-1]a)x+=2;else if(E>o)S+=2;else if(k&&(D=u+b-C)>=0&&D=(T=a-f[D]))return this.diff_bisectSplit_(n,r,$,E,i)}for(var j=-y+_;j<=y-w;j+=2){for(var T,D=u+j,I=(T=j==-y||j!=y&&f[D-1]a)w+=2;else if(I>o)_+=2;else if(!k&&(N=u+b-j)>=0&&N=(T=a-T))return this.diff_bisectSplit_(n,r,$,E,i)}}}return[new t.Diff(-1,n),new t.Diff(1,r)]},t.prototype.diff_bisectSplit_=function(n,r,i,a,o){var l=n.substring(0,i),u=r.substring(0,a),d=n.substring(i),m=r.substring(a),f=this.diff_main(l,u,!1,o),g=this.diff_main(d,m,!1,o);return f.concat(g)},t.prototype.diff_linesToChars_=function(n,r){var i=[],a={};function o(d){for(var m="",f=0,g=-1,b=i.length;ga?n=n.substring(i-a):ir.length?n:r,a=n.length>r.length?r:n;if(i.length<4||2*a.length=S.length?[w,y,C,N,T]:null}var u,d,m,f,g,b=l(i,a,Math.ceil(i.length/4)),k=l(i,a,Math.ceil(i.length/2));return b||k?(u=k?b&&b[4].length>k[4].length?b:k:b,n.length>r.length?(d=u[0],m=u[1],f=u[2],g=u[3]):(f=u[0],g=u[1],d=u[2],m=u[3]),[d,m,f,g,u[4]]):null},t.prototype.diff_cleanupSemantic=function(n){for(var r=!1,i=[],a=0,o=null,l=0,u=0,d=0,m=0,f=0;l0?i[a-1]:-1,u=0,d=0,m=0,f=0,o=null,r=!0)),l++;for(r&&this.diff_cleanupMerge(n),this.diff_cleanupSemanticLossless(n),l=1;l=S?(k>=g.length/2||k>=b.length/2)&&(n.splice(l,0,new t.Diff(0,b.substring(0,k))),n[l-1][1]=g.substring(0,g.length-k),n[l+1][1]=b.substring(k),l++):(S>=g.length/2||S>=b.length/2)&&(n.splice(l,0,new t.Diff(0,g.substring(0,S))),n[l-1][0]=1,n[l-1][1]=b.substring(0,b.length-S),n[l+1][0]=-1,n[l+1][1]=g.substring(S),l++),l++}l++}},t.prototype.diff_cleanupSemanticLossless=function(n){function r(S,x){if(!S||!x)return 6;var _=S.charAt(S.length-1),w=x.charAt(0),y=_.match(t.nonAlphaNumericRegex_),C=w.match(t.nonAlphaNumericRegex_),N=y&&_.match(t.whitespaceRegex_),E=C&&w.match(t.whitespaceRegex_),j=N&&_.match(t.linebreakRegex_),T=E&&w.match(t.linebreakRegex_),D=j&&S.match(t.blanklineEndRegex_),I=T&&x.match(t.blanklineStartRegex_);return D||I?5:j||T?4:y&&!N&&E?3:N||E?2:y||C?1:0}for(var i=1;i=b&&(b=k,m=a,f=o,g=l)}n[i-1][1]!=m&&(m?n[i-1][1]=m:(n.splice(i-1,1),i--),n[i][1]=f,g?n[i+1][1]=g:(n.splice(i+1,1),i--))}i++}},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,i=[],a=0,o=null,l=0,u=!1,d=!1,m=!1,f=!1;l0?i[a-1]:-1,m=f=!1),r=!0)),l++;r&&this.diff_cleanupMerge(n)},t.prototype.diff_cleanupMerge=function(n){n.push(new t.Diff(0,""));for(var r,i=0,a=0,o=0,l="",u="";i1?(a!==0&&o!==0&&((r=this.diff_commonPrefix(u,l))!==0&&(i-a-o>0&&n[i-a-o-1][0]==0?n[i-a-o-1][1]+=u.substring(0,r):(n.splice(0,0,new t.Diff(0,u.substring(0,r))),i++),u=u.substring(r),l=l.substring(r)),(r=this.diff_commonSuffix(u,l))!==0&&(n[i][1]=u.substring(u.length-r)+n[i][1],u=u.substring(0,u.length-r),l=l.substring(0,l.length-r))),i-=a+o,n.splice(i,a+o),l.length&&(n.splice(i,0,new t.Diff(-1,l)),i++),u.length&&(n.splice(i,0,new t.Diff(1,u)),i++),i++):i!==0&&n[i-1][0]==0?(n[i-1][1]+=n[i][1],n.splice(i,1)):i++,o=0,a=0,l="",u=""}n[n.length-1][1]===""&&n.pop();var d=!1;for(i=1;ir));i++)l=a,u=o;return n.length!=i&&n[i][0]===-1?u:u+(r-l)},t.prototype.diff_prettyHtml=function(n){for(var r=[],i=/&/g,a=//g,l=/\n/g,u=0;u");switch(d){case 1:r[u]=''+m+"";break;case-1:r[u]=''+m+"";break;case 0:r[u]=""+m+""}}return r.join("")},t.prototype.diff_text1=function(n){for(var r=[],i=0;ithis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var a=this.match_alphabet_(r),o=this;function l(E,j){var T=E/r.length,D=Math.abs(i-j);return o.Match_Distance?T+D/o.Match_Distance:D?1:T}var u=this.Match_Threshold,d=n.indexOf(r,i);d!=-1&&(u=Math.min(l(0,d),u),(d=n.lastIndexOf(r,i+r.length))!=-1&&(u=Math.min(l(0,d),u)));var m,f,g=1<=x;y--){var C=a[n.charAt(y-1)];if(w[y]=S===0?(w[y+1]<<1|1)&C:(w[y+1]<<1|1)&C|(b[y+1]|b[y])<<1|1|b[y+1],w[y]&g){var N=l(S,y-1);if(N<=u){if(u=N,!((d=y-1)>i))break;x=Math.max(1,2*i-d)}}}if(l(S+1,i)>u)break;b=w}return d},t.prototype.match_alphabet_=function(n){for(var r={},i=0;i2&&(this.diff_cleanupSemantic(o),this.diff_cleanupEfficiency(o));else if(n&&typeof n=="object"&&r===void 0&&i===void 0)o=n,a=this.diff_text1(o);else if(typeof n=="string"&&r&&typeof r=="object"&&i===void 0)a=n,o=r;else{if(typeof n!="string"||typeof r!="string"||!i||typeof i!="object")throw new Error("Unknown call format to patch_make.");a=n,o=i}if(o.length===0)return[];for(var l=[],u=new t.patch_obj,d=0,m=0,f=0,g=a,b=a,k=0;k=2*this.Patch_Margin&&d&&(this.patch_addContext_(u,g),l.push(u),u=new t.patch_obj,d=0,g=b,m=f)}S!==1&&(m+=x.length),S!==-1&&(f+=x.length)}return d&&(this.patch_addContext_(u,g),l.push(u)),l},t.prototype.patch_deepCopy=function(n){for(var r=[],i=0;ithis.Match_MaxBits?(u=this.match_main(r,f.substring(0,this.Match_MaxBits),m))!=-1&&((g=this.match_main(r,f.substring(f.length-this.Match_MaxBits),m+f.length-this.Match_MaxBits))==-1||u>=g)&&(u=-1):u=this.match_main(r,f,m),u==-1)o[l]=!1,a-=n[l].length2-n[l].length1;else if(o[l]=!0,a=u-m,f==(d=g==-1?r.substring(u,u+f.length):r.substring(u,g+this.Match_MaxBits)))r=r.substring(0,u)+this.diff_text2(n[l].diffs)+r.substring(u+f.length);else{var b=this.diff_main(f,d,!1);if(f.length>this.Match_MaxBits&&this.diff_levenshtein(b)/f.length>this.Patch_DeleteThreshold)o[l]=!1;else{this.diff_cleanupSemanticLossless(b);for(var k,S=0,x=0;xl[0][1].length){var u=r-l[0][1].length;l[0][1]=i.substring(l[0][1].length)+l[0][1],o.start1-=u,o.start2-=u,o.length1+=u,o.length2+=u}return(l=(o=n[n.length-1]).diffs).length==0||l[l.length-1][0]!=0?(l.push(new t.Diff(0,i)),o.length1+=r,o.length2+=r):r>l[l.length-1][1].length&&(u=r-l[l.length-1][1].length,l[l.length-1][1]+=i.substring(0,u),o.length1+=u,o.length2+=u),i},t.prototype.patch_splitMax=function(n){for(var r=this.Match_MaxBits,i=0;i2*r?(d.length1+=g.length,o+=g.length,m=!1,d.diffs.push(new t.Diff(f,g)),a.diffs.shift()):(g=g.substring(0,r-d.length1-this.Patch_Margin),d.length1+=g.length,o+=g.length,f===0?(d.length2+=g.length,l+=g.length):m=!1,d.diffs.push(new t.Diff(f,g)),g==a.diffs[0][1]?a.diffs.shift():a.diffs[0][1]=a.diffs[0][1].substring(g.length))}u=(u=this.diff_text2(d.diffs)).substring(u.length-this.Patch_Margin);var b=this.diff_text1(a.diffs).substring(0,this.Patch_Margin);b!==""&&(d.length1+=b.length,d.length2+=b.length,d.diffs.length!==0&&d.diffs[d.diffs.length-1][0]===0?d.diffs[d.diffs.length-1][1]+=b:d.diffs.push(new t.Diff(0,b))),m||n.splice(++i,0,d)}}},t.prototype.patch_toText=function(n){for(var r=[],i=0;i1&&arguments[1]!==void 0?arguments[1]:{}).type,n=(t===void 0?"block":t)==="block"?tK:nK,r=G2(e.map((function(l){return l.changes})),iE).map(n).reduce((function(l,u){var d=$t(l,2),m=d[0],f=d[1],g=$t(u,2),b=g[0],k=g[1];return[m.concat(b),f.concat(k)]}),[[],[]]),i=$t(r,2),a=i[0],o=i[1];return KX(r7(a),r7(o))}var iK=["enhancers"],o7=function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.enhancers,i=r===void 0?[]:r,a=$t(OX(e,Lo(n,iK)),2),o=a[0],l=a[1],u=[e7(o),e7(l)],d=(t=[u[0],u[1]],i.reduce((function(S,x){return x(S)}),t)),m=$t(d,2),f=m[0],g=m[1],b=[f.map(t7),g.map(t7)],k=b[1];return{old:b[0].map((function(S){var x;return(x=S.children)!==null&&x!==void 0?x:[]})),new:k.map((function(S){var x;return(x=S.children)!==null&&x!==void 0?x:[]}))}};const Lv=["openresearch-diff flex flex-col gap-4","[&_.openresearch-diff-file]:[--openresearch-diff-selection-background-color:color-mix(_in_oklab,_var(--surface)_76%,_var(--primary)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-gutter-selection-background-color:color-mix(_in_oklab,_var(--surface)_68%,_var(--primary)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-gutter-background-color:color-mix(_in_oklab,_var(--base)_84%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-gutter-background-color:color-mix(_in_oklab,_var(--base)_86%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-code-background-color:color-mix(_in_oklab,_var(--base)_91%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-code-background-color:color-mix(_in_oklab,_var(--base)_92%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-insert-edit-background-color:color-mix(_in_oklab,_var(--base)_72%,_var(--accent-green)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-delete-edit-background-color:color-mix(_in_oklab,_var(--base)_78%,_var(--accent-red)_)]","[&_.openresearch-diff-file]:[--openresearch-diff-divider-color:var(--border)]","[&_.openresearch-diff-file]:[--openresearch-diff-omit-gutter-line-color:color-mix(in_oklab,_var(--base)_86%,_var(--text))]","[&_.openresearch-diff-file]:[--openresearch-diff-unified-gutter-text-color:color-mix(in_oklab,_var(--text)_45%,_var(--base))]","[&_.openresearch-diff-file]:[--diff-background-color:var(--base)]","[&_.openresearch-diff-file]:[--diff-text-color:var(--text)]","[&_.openresearch-diff-file]:[--diff-font-family:var(--mono)]","[&_.openresearch-diff-file]:[--diff-selection-text-color:var(--primary)]","[&_.openresearch-diff-file]:[--diff-selection-background-color:var(--openresearch-diff-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-background-color:var(--openresearch-diff-gutter-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-code-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-code-selected-background-color:var(--diff-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-insert-text-color:var(--accent-green)]","[&_.openresearch-diff-file]:[--diff-gutter-insert-background-color:var(--openresearch-diff-insert-gutter-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-text-color:var(--accent-red)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-background-color:var(--openresearch-diff-delete-gutter-background-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-background-color:var(--openresearch-diff-insert-code-background-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-background-color:var(--openresearch-diff-delete-code-background-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-background-color:var(--openresearch-diff-insert-edit-background-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-background-color:var(--openresearch-diff-delete-edit-background-color)]","[&_.openresearch-diff-file]:[--diff-omit-gutter-line-color:var(--openresearch-diff-omit-gutter-line-color)]","[&_.openresearch-diff-file]:w-full [&_.openresearch-diff-file]:text-sm","[&_.openresearch-diff-file]:leading-[1.55] [&_.openresearch-diff-file.diff-unified]:table-auto","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:first-child]:collapse","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:first-child]:w-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[1%]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:first-child]:hidden","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:sticky","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:left-0","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:z-1","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[1%]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pr-2.5 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pb-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pl-3.5","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:whitespace-nowrap","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-right","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-[var(--openresearch-diff-unified-gutter-text-color)]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-r [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-r-[var(--openresearch-diff-divider-color)]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line]:leading-[1.55]","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-[var(--openresearch-diff-insert-code-background-color)]","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-[var(--openresearch-diff-delete-code-background-color)]","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:px-4","[&_.openresearch-diff-file_.diff-code]:whitespace-pre","[&_.openresearch-diff-file_.diff-code]:break-normal","[&_.openresearch-diff-file_.diff-code]:wrap-normal","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-[var(--openresearch-diff-divider-color)]"].join(" "),sK=2e3,aK={highlight(e,t){return dt.highlight(e,t).children}};function oK(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function W2(e){let t=0,n=0;for(const r of e.hunks)for(const i of r.changes)i.type==="insert"?t++:i.type==="delete"&&n++;return{additions:t,deletions:n}}function lK(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function Ov(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 cK(e){const t=[rK(e.hunks,{type:"line"})],n=Q_(lK(e));return n&&dt.registered(n)?o7(e.hunks,{enhancers:t,highlight:!0,language:n,refractor:aK}):o7(e.hunks,{enhancers:t,highlight:!1})}function uK(e,t){if(!e.trim())return{files:[],failed:!1};try{return{files:Ev(e,{nearbySequences:"zip"}),failed:!1}}catch{if(t){const n=Array.from(e.matchAll(/^diff --git /gm),i=>i.index),r=n[n.length-1];if(n.length>1&&r!==void 0)try{return{files:Ev(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const dK=({change:e,side:t})=>t==="old"?null:oK(e);function l7(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/1024).toFixed(1)} KB`}function aE({bytesRead:e,byteLimit:t}){return h.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-md [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-md [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[h.jsx("h4",{children:"Diff preview truncated"}),h.jsxs("p",{children:["Showing the first ",l7(t)," (",l7(e)," read). View the complete diff locally with git."]})]})}function oE({file:e,defaultExpanded:t}){const[n,r]=R.useState(t),{additions:i,deletions:a}=R.useMemo(()=>W2(e),[e]),o=n&&i+a<=sK,l=R.useMemo(()=>{if(o)try{return cK(e)}catch{return}},[e,o]);return h.jsxs("section",{className:`diff-file-card overflow-hidden border border-border rounded-md bg-background [&.expanded_.diff-file-header]:border-b [&.expanded_.diff-file-header]:border-b-border ${n?"expanded":""}`,children:[h.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-left py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-2xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-semibold [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-2xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":n,onClick:()=>r(u=>!u),children:[h.jsx("span",{className:"chev",children:n?h.jsx(Rl,{size:14}):h.jsx(Xs,{size:14})}),h.jsx("span",{className:"path",children:h.jsx("code",{children:Ov(e)})}),h.jsxs("span",{className:"stats",children:[h.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",i]}),h.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",a]})]})]}),n&&(e.hunks.length===0?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:"No textual diff for this file."}):h.jsx("div",{className:"diff-file-body overflow-x-auto bg-background",children:h.jsx(CX,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:dK,tokens:l,viewType:"unified"})}))]})}function hK({files:e,className:t}){return h.jsx("div",{className:t?`${Lv} ${t}`:Lv,children:e.map((n,r)=>h.jsx(oE,{file:n,defaultExpanded:r===0},`${n.oldPath}→${n.newPath}#${r}`))})}function fK(e){switch(e.type){case"add":return"A";case"delete":return"D";case"rename":return"R";case"copy":return"C";case"modify":return"M"}}function lE({diff:e,partial:t=!1}){var g;const n=R.useMemo(()=>uK(e,t),[e,t]),r=n.files,i=R.useMemo(()=>r.map((b,k)=>({file:b,key:`${b.oldPath}→${b.newPath}#${k}`,changes:W2(b)})),[r]),[a,o]=R.useState(null),[l,u]=R.useState(!1),d=l&&!t,m=i.some(b=>b.key===a)?a:((g=i[0])==null?void 0:g.key)??null,f=i.find(b=>b.key===m)??null;return n.failed?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:t?"No complete file preview was available before the cutoff.":"Unable to parse this diff."}):i.length===0?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-md",children:"No changes."}):h.jsxs("div",{className:"diff-explorer @container",children:[h.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-xs [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[h.jsx("strong",{children:t?`${i.length} ${i.length===1?"file":"files"} shown (partial)`:i.length===1?"1 changed file":`${i.length} changed files`}),!t&&h.jsx("button",{type:"button",onClick:()=>u(b=>!b),children:d?"Back to preview":"View full diff"})]}),d?h.jsx(hK,{files:r}):h.jsxs("div",{className:"diff-explorer-layout grid grid-cols-[minmax(180px,_260px)_minmax(0,_1fr)] items-start gap-3.5 [@container((max-width:_960px))]:grid-cols-1",children:[h.jsx("div",{className:"diff-explorer-files sticky top-0 max-h-[min(70vh,_720px)] overflow-auto border border-border rounded-md bg-background [&_button]:grid [&_button]:grid-cols-[18px_minmax(0,_1fr)_auto_auto] [&_button]:items-center [&_button]:gap-[7px] [&_button]:w-full [&_button]:py-2 [&_button]:px-[9px] [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-left [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-[inset_2px_0_0_var(--text)] [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":"Changed files",children:i.map(b=>h.jsxs("button",{type:"button",className:b.key===m?"active":"","aria-pressed":b.key===m,onClick:()=>o(b.key),children:[h.jsx("span",{className:`diff-file-status font-mono text-xs font-semibold text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${b.file.type}`,children:fK(b.file)}),h.jsx("code",{title:Ov(b.file),children:Ov(b.file)}),h.jsxs("span",{className:"diff-explorer-stat font-mono text-2xs diff-stat-add text-accent-green",children:["+",b.changes.additions]}),h.jsxs("span",{className:"diff-explorer-stat font-mono text-2xs diff-stat-del text-accent-red",children:["−",b.changes.deletions]})]},b.key))}),h.jsx("div",{className:`${Lv} diff-explorer-preview min-w-0`,children:f&&h.jsx(oE,{file:f.file,defaultExpanded:!0},f.key)})]})]})}function pK({experiment:e,refreshKey:t,onLoadingChange:n}){const[r,i]=R.useState(null),[a,o]=R.useState(null);return R.useEffect(()=>{let l=!1;return n(!0),o(null),i(null),MR(e.id).then(u=>{l||i(u)}).catch(u=>{l||o(u.message)}).finally(()=>{l||n(!1)}),()=>{l=!0}},[e.id,t,n]),h.jsx("div",{className:`${Dc} branch-changes [&_>_.changes-note]:my-3.5 [&_>_.changes-note]:mx-4 [&_>_.openresearch-diff]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.truncated-notice]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0`,children:a?h.jsxs("div",{className:vs,children:["Failed to load changes: ",a]}):r?r.diff.trim()?h.jsxs(h.Fragment,{children:[r.truncated&&h.jsx(aE,{bytesRead:r.bytesRead,byteLimit:r.byteLimit}),h.jsx(lE,{diff:r.diff,partial:r.truncated})]}):h.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?"No committed changes from the parent branch.":"This is the baseline branch, so there is no parent comparison."}):h.jsx("div",{className:vs,children:"Loading changes…"})})}function cE({view:e,onViewChange:t,showViewToggle:n=!0,branchLabel:r,branchTitle:i,githubHref:a,githubTitle:o,refreshing:l,onRefresh:u}){return h.jsxs("div",{className:"code-tab-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant shrink-0 [&_>_.seg]:p-0.5 [&_>_.seg]:rounded-sm [&_>_.seg_button]:py-0.5 [&_>_.seg_button]:px-2 [&_>_.seg_button]:text-sm [&_>_.seg_button]:font-medium",children:[n&&h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-md [&_button]:font-semibold [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":"Code browser view",children:[h.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>t("files"),children:"Files"}),h.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>t("changes"),children:"Changes"})]}),r&&h.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-[color-mix(in_oklab,_var(--text)_8%,_transparent)] text-subtext text-xs [&_>_svg]:shrink-0",title:i,children:[h.jsx(nh,{size:12}),h.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap font-mono",children:r})]}),a&&h.jsx("a",{className:Xn,href:a,target:"_blank",rel:"noopener noreferrer",title:o,"aria-label":o,children:h.jsx(jp,{size:13})}),h.jsx("span",{style:{flex:1}}),h.jsx("button",{className:Xn,title:"Refresh","aria-label":"Refresh",onClick:u,children:l?h.jsx("span",{className:qt}):h.jsx(rS,{size:13})})]})}const mK=/\.(md|mdx|markdown)$/i,gK=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,bK=/\.(csv|tsv|xlsx?|ods)$/i,vK=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,_K=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,xK=/\.pdf$/i,yK=/\.(docx?|log|rtf|txt)$/i;function wK(e){return gK.test(e)}function Y2(e){return mK.test(e)}function uE({name:e}){const t=Y2(e)?"markdown":wK(e)?"image":bK.test(e)?"spreadsheet":vK.test(e)?"code":_K.test(e)?"archive":xK.test(e)?"pdf":yK.test(e)?"document":"file";let n;return t==="markdown"?n=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),h.jsx("path",{d:"M2.6 10.5v-5h1.2l1.6 2 1.6-2h1.2v5H6.8V7.6L5.4 9.3 4 7.6v2.9H2.6Zm8.5-5v2.4h1.3L10.5 10 8.6 7.9h1.3V5.5h1.2Z",fill:"currentColor"})]}):t==="image"?n=h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),h.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),h.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):t==="spreadsheet"?n=h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),h.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):t==="code"?n=h.jsx("path",{d:"M6.2 3 1.8 8l4.4 5 1.3-1.2L4.2 8l3.3-3.8L6.2 3Zm3.6 0-1.3 1.2L11.8 8l-3.3 3.8 1.3 1.2 4.4-5-4.4-5Z",fill:"currentColor"}):t==="archive"?n=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),h.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):n=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),h.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),h.jsx("svg",{className:`file-tree-icon w-[15px] h-[15px] shrink-0 text-muted overflow-visible [&.markdown]:text-accent-blue [&.image]:text-accent-purple [&.spreadsheet]:text-accent-green [&.code]:text-accent-orange [&.archive]:text-accent-amber [&.pdf]:text-accent-red [&.document]:text-subtext ${t}`,viewBox:"0 0 16 16","aria-hidden":"true",children:n})}const dE=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-left cursor-pointer font-[inherit]","text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),c7=["file-tree-chevron text-muted shrink-0 [button&]:inline-flex","[button&]:items-center [button&]:justify-center [button&]:w-[13px]","[button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent","[button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90"].join(" ");function u7(){return{dirs:new Map,files:[]}}function hE(e){const t=u7();for(const n of e){const r=n.split("/");let i=t;for(let a=0;aa(n),title:n,children:[u?h.jsx(Rl,{size:13,className:c7}):h.jsx(Xs,{size:13,className:c7}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),u&&h.jsx(X2,{node:t,parentPath:n,depth:r+1,toggled:i,onToggle:a,onOpenFile:o})]})}function X2({node:e,parentPath:t,depth:n,toggled:r,onToggle:i,onOpenFile:a}){const o=[...e.dirs.keys()].sort((u,d)=>u.localeCompare(d)),l=[...e.files].sort((u,d)=>u.localeCompare(d));return h.jsxs(h.Fragment,{children:[o.map(u=>{const d=t?`${t}/${u}`:u;return h.jsx(SK,{name:u,node:e.dirs.get(u),path:d,depth:n,toggled:r,onToggle:i,onOpenFile:a},`d:${d}`)}),l.map(u=>{const d=t?`${t}/${u}`:u;return h.jsxs("button",{type:"button",className:dE,style:{paddingLeft:8+n*14},onClick:()=>a(d),title:d,children:[h.jsx(uE,{name:u}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:u})]},`f:${d}`)})]})}function kK({projectId:e,project:t,experiment:n,view:r,toggled:i,onViewChange:a,onToggledChange:o,onOpenFile:l}){const u=n.branchName,d=`${e}:${u}`,[m,f]=R.useState(null),[g,b]=R.useState(null),[k,S]=R.useState(!1),[x,_]=R.useState(!1),[w,y]=R.useState(0),[C,N]=R.useState(void 0),E=R.useRef(0),j=R.useRef(null),T=R.useCallback(()=>{j.current=d;const F=++E.current;S(!0),Ab(e,{ref:u}).then(U=>{F===E.current&&(f(U),b(null))}).catch(U=>{F===E.current&&b(U.message)}).finally(()=>{F===E.current&&S(!1)})},[e,u,d]);R.useEffect(()=>(E.current++,j.current=null,f(null),b(null),S(!1),()=>{E.current++}),[d]),R.useEffect(()=>{r==="files"&&j.current!==d&&T()},[r,d,T]),R.useEffect(()=>{N(void 0);const F=n.chatSessionId;if(!F)return;let U=!1;return fS(F).then(G=>{!U&&G.exists&&G.branch===u&&N(F)}).catch(()=>{}),()=>{U=!0}},[n.chatSessionId,u]);const D=R.useMemo(()=>m?hE(m.entries):null,[m]),I=r==="files"?k:x,$=R.useCallback(F=>{const U=new Set(i);U.has(F)?U.delete(F):U.add(F),o(U)},[i,o]);return h.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[h.jsx(cE,{view:r,onViewChange:a,branchLabel:u,branchTitle:`Committed branch ${u}`,githubHref:t.githubEnabled?ap(t.githubOwner,t.githubRepo,u):void 0,githubTitle:`Open ${u} on GitHub`,refreshing:I,onRefresh:()=>r==="files"?T():y(F=>F+1)}),r==="changes"?h.jsx(pK,{experiment:n,refreshKey:w,onLoadingChange:_},n.id):h.jsxs(h.Fragment,{children:[(m==null?void 0:m.truncated)&&h.jsx("div",{className:vs,children:"listing truncated"}),g&&D&&h.jsxs("div",{className:vs,children:["Refresh failed: ",g]}),h.jsx("div",{className:Dc,children:D?D.dirs.size===0&&D.files.length===0?h.jsx("div",{className:vs,children:"No files."}):h.jsx("div",{className:"file-tree py-1.5 px-0 text-md",children:h.jsx(X2,{node:D,parentPath:"",depth:0,toggled:i,onToggle:$,onOpenFile:F=>C?l(F,C):l(F,void 0,u)})}):h.jsx("div",{className:vs,children:g?`Failed to load: ${g}`:"Loading…"})})]})]})}const CK=5e3;function EK({sessionId:e,project:t,view:n,toggled:r,onViewChange:i,onToggledChange:a,onOpenFile:o}){var D;const l=t.id,[u,d]=R.useState(null),[m,f]=R.useState(null),[g,b]=R.useState(null),[k,S]=R.useState(!0),x=R.useRef(0),_=R.useCallback(()=>{const I=++x.current;S(!0),(async()=>{if(!e)return[null,await Ab(l,{ref:t.baselineBranch})];const F=await fS(e),U=F.exists?{sessionId:e}:{ref:t.baselineBranch};return[F,await Ab(l,U)]})().then(([F,U])=>{I===x.current&&(d(F),f(U),b(null))}).catch(F=>{I===x.current&&b(F.message)}).finally(()=>{I===x.current&&S(!1)})},[e,l,t.baselineBranch]);R.useEffect(()=>(d(null),f(null),b(null),_(),()=>{x.current++}),[_]),R.useEffect(()=>{if(!e)return;let I=!1,$=!1,F=!1,U=null;const G=()=>{U||(U=setInterval(_,CK))},X=()=>{U&&(clearInterval(U),U=null)},Y=wd(Z=>{Z.type!=="busy"||Z.sessionId!==e||($=!0,Z.busy&&!I?(I=!0,G()):!Z.busy&&I&&(I=!1,X(),_()))});return lf(l).then(Z=>{var Q;F||$||I||(Q=Z.find(z=>z.id===e))!=null&&Q.busy&&(I=!0,G())}).catch(()=>{}),()=>{F=!0,Y(),X()}},[e,l,_]);const w=R.useMemo(()=>m?hE(m.entries):null,[m]),y=R.useCallback(I=>{const $=new Set(r);$.has(I)?$.delete(I):$.add(I),a($)},[r,a]),C=e&&(u!=null&&u.exists)?u:null,N=(C==null?void 0:C.branch)??(C!=null&&C.baselineBranch?`detached @ ${C.baselineBranch}`:"detached"),E=((D=C==null?void 0:C.files)==null?void 0:D.length)??0,j=C?`Current worktree · ${N}${E>0?"*":""}`:`Default branch · ${t.baselineBranch}`,T=C?C.branch:t.baselineBranch;return h.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[h.jsx(cE,{view:C?n:"files",onViewChange:i,showViewToggle:!!C,branchLabel:j,branchTitle:j,githubHref:t.githubEnabled&&T?ap(t.githubOwner,t.githubRepo,T):void 0,githubTitle:T?`Open ${T} on GitHub`:void 0,refreshing:k,onRefresh:_}),g&&(u||m)&&h.jsxs("div",{className:vs,children:["Refresh failed: ",g]}),!m||e&&!u?h.jsx("div",{className:Dc,children:h.jsx("div",{className:vs,children:g?`Failed to load: ${g}`:"Loading…"})}):C&&n==="changes"?h.jsx("div",{className:`${Dc} wt-changes pt-0 px-4 pb-6 [&_>_:first-child]:mt-3.5`,children:E===0||!C.diff?h.jsx("div",{className:"changes-note text-sm text-muted",children:"No changes yet."}):h.jsxs(h.Fragment,{children:[C.diff.truncated&&h.jsx(aE,{bytesRead:C.diff.bytesRead,byteLimit:C.diff.byteLimit}),h.jsx(lE,{diff:C.diff.diff,partial:C.diff.truncated})]})}):h.jsxs("div",{className:Dc,children:[m.truncated&&h.jsx("div",{className:vs,children:"Listing truncated."}),w?w.dirs.size===0&&w.files.length===0?h.jsx("div",{className:vs,children:"No files."}):h.jsx("div",{className:"file-tree py-1.5 px-0 text-md",children:h.jsx(X2,{node:w,parentPath:"",depth:0,toggled:r,onToggle:y,onOpenFile:I=>C?o(I,e):o(I,void 0,t.baselineBranch)})}):h.jsx("div",{className:vs,children:"Loading…"})]})]})}function fE({text:e,path:t,highlightLine:n,scrollRequest:r,onScrollRequestHandled:i}){const a=R.useMemo(()=>A2(e,Q_(t)),[e,t]),o=e?e.split(` -`).length-(e.endsWith(` -`)?1:0):0,l=n&&o>0?Math.min(Math.max(Math.trunc(n),1),o):void 0,u=R.useRef(null),d=R.useRef(null),[m,f]=R.useState(null);return R.useLayoutEffect(()=>{const g=u.current;if(!l||!g){f(null);return}const b=getComputedStyle(g),k=Number.parseFloat(b.paddingTop)||0,S=Number.parseFloat(b.lineHeight)||0;if(!S){f(null);return}f({line:l,top:k+(l-1)*S,height:S})},[a,l]),R.useLayoutEffect(()=>{var g;r!==void 0&&(m&&m.line===l?((g=d.current)==null||g.scrollIntoView({block:"center"}),i==null||i()):o===0&&(i==null||i()))},[m,o,i,r,l]),h.jsxs("div",{className:"file-view-codewrap flex items-start min-w-max relative",children:[o>0&&h.jsx("pre",{className:"file-view-gutter m-0 pt-3.5 pb-3.5 font-mono text-sm leading-[1.55] pl-3.5 pr-2.5 text-right text-muted select-none sticky left-0 bg-background border-r border-r-border-variant shrink-0","aria-hidden":"true",children:Array.from({length:o},(g,b)=>b+1).join(` -`)}),h.jsx("pre",{className:"file-view-code m-0 pt-3.5 pb-3.5 font-mono text-sm leading-[1.55] pl-4 pr-4 [tab-size:4] min-w-max",ref:u,children:h.jsx("code",{children:a})}),m&&h.jsx("div",{ref:d,className:"file-view-line-highlight absolute left-0 right-0 pointer-events-none bg-[color-mix(in_srgb,_var(--primary)_16%,_transparent)] shadow-[inset_2px_0_0_var(--primary)]",style:{top:m.top,height:m.height},"aria-hidden":"true"})]})}function pE(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function d7({url:e,name:t}){return h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["This browser can’t preview this media format."," ",h.jsxs("a",{href:e,download:t,children:["Download ",t]})]})}function mE({kind:e,url:t,name:n}){const[r,i]=R.useState(!1);if(R.useEffect(()=>i(!1),[e,t]),r)return h.jsx(d7,{url:t,name:n});let a;return e==="image"?a=h.jsx("div",{className:"fpreview-image flex min-h-0 flex-1 items-start justify-center overflow-auto p-6 [&_img]:max-w-full [&_img]:h-auto [&_img]:border [&_img]:border-border [&_img]:rounded-sm",children:h.jsx("img",{src:t,alt:n,onError:()=>i(!0)})}):e==="audio"?a=h.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:h.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:t,"aria-label":n,onError:()=>i(!0)})}):e==="video"?a=h.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:h.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:t,"aria-label":n,onError:()=>i(!0)})}):a=h.jsx("object",{className:"fpreview-pdf block min-h-0 flex-1 w-full border-0","aria-label":n,data:t,type:"application/pdf",onError:()=>i(!0),children:h.jsx(d7,{url:t,name:n})}),h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a,h.jsx("div",{className:"shrink-0 border-t border-border-variant py-1.5 px-3 text-right text-xs",children:h.jsxs("a",{href:t,download:n,children:["Download ",n]})})]})}const h7=`${Xn} tip-up [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]`;function AK(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function TK(e,t,n){const r=n.indexOf("#"),i=r===-1?n:n.slice(0,r),a=r===-1?"":n.slice(r),o=i.indexOf("?"),l=o===-1?i:i.slice(0,o),u=o===-1?"":i.slice(o+1),d=l.startsWith("/")?[]:t.split("/").filter(b=>b.length>0);for(const b of l.split("/"))if(!(!b||b==="."))if(b===".."){if(d.length===0)return null;d.pop()}else d.push(b);const m=d.join("/");if(!m)return null;const f=new URLSearchParams(u);f.delete("path");const g=f.toString();return`${sh(e,m)}${g?`&${g}`:""}${a}`}function NK(e){if(!e.startsWith("---"))return e;const t=e.indexOf(` ----`,3);return t===-1?e:e.slice(t+4).replace(/^\r?\n/,"")}const gE="orx:files-tree-width",bE="orx:artifacts-collapsed:",vE=180,_E=560,jK=8,MK=280;function RK(){try{const e=Number(localStorage.getItem(gE));if(Number.isFinite(e)&&e>=vE&&e<=_E)return e}catch{}return MK}function DK(e){try{const t=localStorage.getItem(`${bE}${e}`);if(!t)return new Set;const n=JSON.parse(t);return Array.isArray(n)?new Set(n.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function Iv(e,t){for(const n of e){if(n.path===t)return n;if(n.isDir&&t.startsWith(n.path+"/")){const r=Iv(n.children??[],t);if(r)return r}}return null}function xE({projectId:e,folder:t,markdown:n}){const r=i=>AK(i)?i:TK(e,t,i);return h.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-[color-mix(in_oklab,_var(--border)_50%,_transparent)] [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-[0.9em] [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-[1.05em] [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-[0.9em] [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:pl-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:pl-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-md [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-left [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-left [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pr-0 [&_blockquote]:pb-0.5 [&_blockquote]:pl-2.5 [&_blockquote]:border-l-[3px] [&_blockquote]:border-l-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text artifact-md text-lg [&_h1]:text-[2em] [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-[1.5em] [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-[1.2em] [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-[1em] [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:h.jsx(GB,{remarkPlugins:[Pk,[Uk,Zk]],rehypePlugins:[bk],components:{a:({href:i,children:a,...o})=>{const l=!i||i.startsWith("#"),u=l?i:r(i);return u?h.jsx("a",{...o,href:u,...l?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):h.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=r(i);return o?h.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[h.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&h.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...Qk},children:Xk(NK(n))})})}function LK(e){return e.presentation==="text"&&Y2(e.name)?"markdown":pE(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function yE(e){return e.toLowerCase()===Ef.toLowerCase()}function OK(e,t,n){const[r,i]=R.useState(null),[a,o]=R.useState(!1),[l,u]=R.useState(!1),[d,m]=R.useState(null),f=R.useRef(0),g=R.useRef(!1),b=n==="markdown"||n==="text"&&t.size<=gS;return R.useEffect(()=>{if(o(!1),u(!1),m(null),!b)return;let S=!1;const x=++f.current;return bS(e,t.path).then(w=>{if(!w)throw new Error("Artifact not found");return w}).then(w=>{S||x!==f.current||(w.binary?o(!0):(g.current=!0,i(w.content)),u(w.truncated))}).catch(w=>{!S&&x===f.current&&!g.current&&m(w instanceof Error?w.message:String(w))}),()=>{S=!0}},[e,t.path,t.modifiedAt,n,b]),{text:r,replaceText:S=>{f.current+=1,g.current=!0,i(S)},binary:a,truncated:l,error:d,wantsText:b}}function IK({projectId:e,entry:t,onDelete:n,onChanged:r}){const i=LK(t),{text:a,replaceText:o,binary:l,truncated:u,error:d,wantsText:m}=OK(e,t,i),[f,g]=R.useState(!1),[b,k]=R.useState(!1),[S,x]=R.useState(""),[_,w]=R.useState(!1),[y,C]=R.useState(null),N=i==="markdown",E=yE(t.path),j=t.path.split("/").slice(0,-1).join("/"),T=`${sh(e,t.path)}&v=${t.modifiedAt}`,D=async()=>{w(!0),C(null);try{await dD(e,S),o(S),k(!1),g(!1),r()}catch($){C($ instanceof Error?$.message:String($))}finally{w(!1)}};let I;return b?I=h.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2 p-4",children:[h.jsx("textarea",{className:"min-h-0 flex-1 resize-none font-mono text-sm leading-relaxed","aria-label":"Edit project brief",value:S,onChange:$=>x($.target.value)}),y&&h.jsxs("div",{className:"text-sm text-accent-red",children:["Could not save: ",y]})]}):i==="image"||i==="audio"||i==="video"||i==="pdf"?I=h.jsx(mE,{kind:i,url:T,name:t.name}):i==="download"||!m||l?I=h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[i==="download"||l?"Binary or unsupported file — no inline preview.":"File too large to preview inline."," ",h.jsx("a",{href:T,...i==="download"||l?{download:t.name}:{target:"_blank",rel:"noopener noreferrer"},children:i==="download"||l?"Download":"Open raw"})]}):d?I=h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["Failed to load: ",d]}):a===null?I=h.jsxs("div",{className:ur,children:[h.jsx("span",{className:qt})," Loading…"]}):N&&!f?I=h.jsx(xE,{projectId:e,folder:j,markdown:a}):I=h.jsx(fE,{text:a,path:t.path}),h.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0",children:[h.jsxs("div",{className:"fpreview-head h-10 flex items-center gap-2 py-0 px-3.5 border-b border-b-border-variant text-subtext shrink-0",children:[h.jsx(th,{size:13,style:{flexShrink:0}}),h.jsx("code",{className:"fpreview-path font-mono text-sm text-text flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",title:t.path,children:t.path}),h.jsxs("span",{className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:["Modified"," ",new Date(t.modifiedAt).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})]}),(i==="text"||i==="download")&&h.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:Ao(t.size)}),E&&!b&&a!==null&&!u&&h.jsxs("button",{className:Kn,"data-tip":"Edit project brief","data-tip-align":"end","aria-label":"Edit project brief",onClick:()=>{x(a),C(null),k(!0)},children:[h.jsx(ip,{size:13})," Edit"]}),E&&b&&h.jsxs(h.Fragment,{children:[h.jsxs("button",{className:Kn,"data-tip":"Cancel editing","data-tip-align":"end","aria-label":"Cancel editing",disabled:_,onClick:()=>{k(!1),C(null)},children:[h.jsx(qr,{size:13})," Cancel"]}),h.jsxs("button",{className:aL,"data-tip":_?"Saving…":"Save project brief","data-tip-align":"end","aria-label":_?"Saving project brief":"Save project brief",disabled:_,onClick:()=>void D(),children:[h.jsx(Di,{size:13})," ",_?"Saving…":"Save"]})]}),N&&!b&&h.jsx("button",{className:`${Xn} ${f?"active":""}`,"data-tip":f?"Rendered view":"View source","data-tip-align":"end","aria-label":f?"Rendered view":"View source",onClick:()=>g($=>!$),children:h.jsx(K8,{size:13})}),h.jsx("a",{className:Xn,href:T,target:"_blank",rel:"noopener noreferrer","data-tip":"Open raw in new tab","data-tip-align":"end","aria-label":"Open raw in new tab",children:h.jsx(xd,{size:13})}),!E&&h.jsx("button",{className:Xn,"data-tip":"Delete artifact","data-tip-align":"end","aria-label":"Delete artifact",onClick:()=>{window.confirm(`Delete "${t.path}" from the artifacts directory?`)&&n(t.path)},children:h.jsx(ih,{size:13})})]}),h.jsxs("div",{className:`fpreview-body flex-1 min-h-0 overflow-auto [&.doc]:pt-4.5 [&.doc]:px-7 [&.doc]:pb-12 [&.doc_.artifact-md]:max-w-readable [&.doc_.artifact-md]:my-0 [&.doc_.artifact-md]:mx-auto ${N&&!f&&!b?"doc":""}`,children:[I,u&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:"File truncated — showing the first 512 KB."})]})]})}function wE({entries:e,depth:t,collapsed:n,selected:r,onToggle:i,onSelect:a,onOpenFile:o,onDelete:l}){return h.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(u=>{var m;const d={paddingLeft:8+Math.min(t,jK)*14};if(u.isDir){const f=!n.has(u.path);return h.jsxs("div",{className:"min-w-0 max-w-full",children:[h.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-left cursor-pointer font-[inherit] text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:d,onClick:()=>i(u.path),children:[h.jsx("button",{className:"file-tree-chevron text-muted shrink-0 [button&]:inline-flex [button&]:items-center [button&]:justify-center [button&]:w-[13px] [button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent [button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90","aria-label":f?`Collapse ${u.name}`:`Expand ${u.name}`,onClick:g=>{g.stopPropagation(),i(u.path)},children:h.jsx(Xs,{size:13,className:f?"open":""})}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:u.name}),h.jsx("button",{className:`${ah} ft-row-delete w-4.5 h-4.5 opacity-35 [&:focus-visible]:opacity-100`,"data-tip":"Delete folder","data-tip-align":"end","aria-label":`Delete folder ${u.name}`,onClick:g=>{g.stopPropagation(),window.confirm(`Delete "${u.path}" from the artifacts directory?`)&&l(u.path)},children:h.jsx(ih,{size:12})})]}),f&&(((m=u.children)==null?void 0:m.length)??0)>0&&h.jsx(wE,{entries:u.children??[],depth:t+1,collapsed:n,selected:r,onToggle:i,onSelect:a,onOpenFile:o,onDelete:l})]},u.path)}return h.jsxs("button",{type:"button",className:`file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-left cursor-pointer font-[inherit] text-[length:inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===u.path?"selected":""}`,style:d,title:`${u.path} — double-click or Command/Ctrl+Enter to open in a tab`,"aria-keyshortcuts":"Meta+Enter Control+Enter","aria-pressed":r===u.path,onClick:()=>a(u.path),onDoubleClick:()=>o(u.path),onKeyDown:f=>{f.key!=="Enter"||!f.metaKey&&!f.ctrlKey||(f.preventDefault(),f.stopPropagation(),a(u.path),o(u.path))},children:[h.jsx(uE,{name:u.name}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:u.name})]},u.path)})})}function f7({dir:e,onOpenStorage:t}){const[n,r]=R.useState(!1);return h.jsxs("div",{className:"ftree-footer shrink-0 flex items-center gap-0.5 py-[5px] px-2 border-t border-t-border-variant [&_code]:flex-1 [&_code]:min-w-0 [&_code]:[direction:rtl] [&_code]:text-left [&_code]:font-mono [&_code]:text-xs [&_code]:text-muted [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_.icon-btn]:w-5.5 [&_.icon-btn]:h-5.5",title:e,children:[h.jsx("code",{children:e}),h.jsx("button",{className:h7,"data-tip":n?"Copied!":"Copy path","aria-label":"Copy artifacts directory path",onClick:()=>{var i;(i=navigator.clipboard)==null||i.writeText(e),r(!0),setTimeout(()=>r(!1),1200)},children:n?h.jsx(Di,{size:12}):h.jsx(t_,{size:12})}),h.jsx("button",{className:h7,"data-tip":"Storage settings","data-tip-align":"end","aria-label":"Storage settings",onClick:t,children:h.jsx(JM,{size:12})})]})}function zK({project:e,artifacts:t,onChanged:n,onOpenFile:r,onOpenStorage:i}){var w;const[a,o]=R.useState(null),[l,u]=R.useState(()=>DK(e.id)),[d,m]=R.useState(RK),f=R.useRef(null),g=((w=t==null?void 0:t.entries.find(y=>!y.isDir&&yE(y.path)))==null?void 0:w.path)??null;R.useEffect(()=>{!a&&g&&o(g)},[a,g]),R.useEffect(()=>{try{localStorage.setItem(`${bE}${e.id}`,JSON.stringify([...l]))}catch{}},[e.id,l]);const b=y=>{var T;y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId);const C=((T=f.current)==null?void 0:T.getBoundingClientRect().left)??0,N=document.body.style.userSelect;document.body.style.userSelect="none";const E=D=>{const I=Math.round(D.clientX-C),$=Math.min(Math.max(I,vE),_E);m($);try{localStorage.setItem(gE,String($))}catch{}},j=()=>{window.removeEventListener("pointermove",E),window.removeEventListener("pointerup",j),window.removeEventListener("pointercancel",j),document.body.style.userSelect=N};window.addEventListener("pointermove",E),window.addEventListener("pointerup",j),window.addEventListener("pointercancel",j)};R.useEffect(()=>{if(!a||!t)return;const y=Iv(t.entries,a);(!y||y.isDir)&&o(null)},[a,t]);const k=y=>u(C=>{const N=new Set(C);return N.has(y)?N.delete(y):N.add(y),N}),S=y=>{(a===y||a!=null&&a.startsWith(y+"/"))&&o(null),cD(e.id,y).catch(()=>{}).finally(n)};if(!t)return h.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:h.jsxs("div",{className:ur,style:{padding:20},children:[h.jsx("span",{className:qt})," Loading artifacts…"]})});const x=y=>h.jsx(wE,{entries:y,depth:0,collapsed:l,selected:a,onToggle:k,onSelect:o,onOpenFile:r,onDelete:S}),_=a?Iv(t.entries,a):null;return t.entries.length===0?h.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:h.jsxs("div",{className:"files-empty-state flex-1 flex flex-col items-center justify-center gap-1.5 p-6 text-center text-muted [&_h3]:mt-1.5 [&_h3]:mx-0 [&_h3]:mb-0 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text [&_p]:m-0 [&_p]:max-w-105 [&_p]:text-md [&_p]:leading-[1.55] [&_p]:text-subtext [&_.ftree-footer]:mt-2.5 [&_.ftree-footer]:max-w-full [&_.ftree-footer]:border [&_.ftree-footer]:border-border [&_.ftree-footer]:rounded-md [&_.ftree-footer]:py-1.5 [&_.ftree-footer]:px-2.5 [&_.ftree-footer]:bg-background [&_.ftree-footer_code]:max-w-95",children:[h.jsx(n_,{size:28,strokeWidth:1.5}),h.jsx("h3",{children:"No artifacts yet"}),h.jsx("p",{children:"This is the project's durable output space for reports, figures, images, CSVs, PDFs, and other research artifacts. Ask the agent for a write-up or add your own files:"}),h.jsx(f7,{dir:t.dir,onOpenStorage:i})]})}):h.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background",children:[h.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-l border-l-border-variant border-r border-r-border-variant bg-background",ref:f,style:{width:d},children:[h.jsx("div",{className:"ftree-resizer absolute -right-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] [&:active]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)]",onPointerDown:b}),h.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-md",children:[x(t.entries),t.truncated&&h.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-xs text-muted",children:"Listing truncated — the folder has more artifacts."})]}),h.jsx(f7,{dir:t.dir,onOpenStorage:i})]}),_?h.jsx(IK,{projectId:e.id,entry:_,onDelete:S,onChanged:n},_.path):h.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-md text-muted",children:[h.jsx(HM,{size:22,strokeWidth:1.5}),h.jsx("span",{children:"Click an artifact to view it"})]})]})}const BK=20*1024*1024,zv="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-text",SE="mt-0 mx-0 mb-3 text-muted text-md leading-normal",kE="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",CE="font-mono text-sm font-medium text-text",EE="mt-0.5 mb-0 text-xs leading-relaxed text-muted";function HK(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const i=r.result;if(typeof i!="string"){n(new Error("could not read file"));return}const a=i.indexOf(",");t(a>=0?i.slice(a+1):i)},r.onerror=()=>n(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function $K(e){const t=e.toLowerCase();return t.endsWith(".md")||t.endsWith(".markdown")||t.endsWith(".zip")}function FK({skill:e,projectId:t,onDeleted:n,onError:r}){const[i,a]=R.useState(!1);return h.jsxs("div",{className:kE,children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("code",{className:CE,children:["/",e.name]}),h.jsx("p",{className:EE,children:e.description})]}),h.jsxs("div",{className:"shrink-0 text-right whitespace-nowrap pt-0.5",children:[h.jsx("div",{className:"text-2xs text-subtext",children:Ao(e.bytes)}),e.updatedAt>0&&h.jsx("div",{className:"text-2xs text-muted",children:Gs(e.updatedAt)})]}),h.jsx("button",{className:Xn,"data-tip":"Delete skill","data-tip-align":"end","aria-label":`Delete skill ${e.name}`,disabled:i,onClick:()=>{window.confirm(`Delete the "${e.name}" skill?`)&&(a(!0),CD({scope:e.scope,name:e.name,projectId:e.scope==="project"?t:void 0}).then(n).catch(o=>{a(!1),r(o instanceof Error?o.message:String(o))}))},children:h.jsx(ih,{size:13})})]})}function p7({title:e,hint:t,skills:n,projectId:r,onChanged:i,onError:a}){return h.jsxs("section",{className:zv,children:[h.jsx("h3",{children:e}),h.jsx("p",{className:SE,children:t}),n.length===0?h.jsx("div",{className:"text-muted text-sm",children:"No skills yet."}):h.jsx("div",{className:"flex flex-col",children:n.map(o=>h.jsx(FK,{skill:o,projectId:r,onDeleted:i,onError:a},o.name))})]})}function PK({skill:e,scopeLabel:t,alreadyImported:n,onImport:r}){const[i,a]=R.useState(!1);return h.jsxs("div",{className:kE,children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("code",{className:CE,children:["/",e.name]}),h.jsx("span",{className:lr,children:e.harnessName})]}),h.jsx("p",{className:EE,children:e.description})]}),h.jsxs("button",{className:Kn,disabled:i,title:`Import into ${t}`,onClick:async()=>{a(!0);try{await r(e)}finally{a(!1)}},children:[i?h.jsx("span",{className:qt}):h.jsx(eM,{size:13}),n?"Re-import":"Import"]})]})}function UK({project:e}){const[t,n]=R.useState(null),[r,i]=R.useState([]),[a,o]=R.useState("global"),[l,u]=R.useState(!1),[d,m]=R.useState(null),[f,g]=R.useState(!1),b=R.useRef(null),k=R.useCallback(()=>{SD(e==null?void 0:e.id).then(n).catch(()=>n([]))},[e==null?void 0:e.id]);R.useEffect(()=>{k()},[k]),R.useEffect(()=>{ED().then(i).catch(()=>i([]))},[]),R.useEffect(()=>{!e&&a==="project"&&o("global")},[e,a]);const S=R.useRef(!1),x=R.useCallback(async T=>{if(!S.current){if(m(null),!$K(T.name)){m("Upload a SKILL.md file or a .zip of a skill folder.");return}if(T.size>BK){m("File too large (max 20 MB).");return}S.current=!0,u(!0);try{const D=await HK(T);await kD({scope:a,projectId:a==="project"?e==null?void 0:e.id:void 0,filename:T.name,contentBase64:D}),k()}catch(D){m(D instanceof Error?D.message:String(D))}finally{S.current=!1,u(!1)}}},[a,e==null?void 0:e.id,k]),_=T=>{var I;T.preventDefault(),g(!1);const D=(I=T.dataTransfer.files)==null?void 0:I[0];D&&x(D)},w=R.useCallback(async T=>{m(null);try{await AD({harness:T.harnessId,name:T.name,scope:a,projectId:a==="project"?e==null?void 0:e.id:void 0}),k()}catch(D){m(D instanceof Error?D.message:String(D))}},[a,e==null?void 0:e.id,k]),y=(t??[]).filter(T=>T.scope==="global"),C=(t??[]).filter(T=>T.scope==="project"),N=a==="global"?"Global":(e==null?void 0:e.name)??"this project",E=new Set((t??[]).filter(T=>T.scope===a).map(T=>T.name)),j=T=>`flex-1 flex flex-col gap-0.5 py-2.5 px-3 border rounded-md text-left text-sm font-medium cursor-pointer transition-[border-color,background] duration-120 disabled:opacity-50 disabled:cursor-not-allowed ${T?"border-primary bg-surface":"border-border bg-background text-text [&:hover:not(:disabled)]:border-border-variant"}`;return h.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl",children:[h.jsx("h1",{children:"Skills"}),h.jsxs("p",{className:"mt-0 mx-0 mb-5 text-muted text-md leading-normal [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text",children:["Upload ",h.jsx("code",{children:"SKILL.md"})," skills your agent discovers automatically in every session and you can invoke with ",h.jsx("code",{children:"/name"})," in chat. Add a single ",h.jsx("code",{children:"SKILL.md"})," or a"," ",h.jsx("code",{children:".zip"})," of a skill folder (with supporting scripts and resources)."]}),h.jsxs("section",{className:zv,children:[h.jsx("h3",{children:"Add a skill"}),h.jsxs("div",{className:"flex gap-2 mb-3.5",role:"group","aria-label":"Skill scope",children:[h.jsxs("button",{type:"button","aria-pressed":a==="global",className:j(a==="global"),onClick:()=>o("global"),children:["Global",h.jsx("span",{className:"text-2xs font-normal text-muted",children:"Every project"})]}),h.jsxs("button",{type:"button","aria-pressed":a==="project",className:j(a==="project"),disabled:!e,title:e?void 0:"Open a project to add a project skill",onClick:()=>o("project"),children:["This project",h.jsx("span",{className:"text-2xs font-normal text-muted",children:e?e.name:"No project open"})]})]}),h.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm transition-[border-color,background] duration-120 [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text ${l?"cursor-default":"cursor-pointer"} ${f?"border-primary bg-surface text-text":"border-border-variant bg-surface text-muted [&:hover]:border-primary [&:hover]:text-text"}`,onDragOver:T=>{T.preventDefault(),g(!0)},onDragLeave:()=>g(!1),onDrop:_,onClick:()=>{var T;return(T=b.current)==null?void 0:T.click()},role:"button",tabIndex:0,onKeyDown:T=>{var D;(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),(D=b.current)==null||D.click())},children:[h.jsx("input",{ref:b,type:"file",accept:".md,.markdown,.zip",hidden:!0,onChange:T=>{var I;const D=(I=T.target.files)==null?void 0:I[0];D&&x(D),T.target.value=""}}),l?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:qt}),h.jsx("span",{children:"Uploading…"})]}):h.jsxs(h.Fragment,{children:[h.jsx(pR,{size:20,strokeWidth:1.5}),h.jsxs("span",{children:["Drop a ",h.jsx("code",{children:"SKILL.md"})," or ",h.jsx("code",{children:".zip"})," here, or click to choose"]}),h.jsxs("span",{className:"inline-flex items-center gap-1.5 text-2xs text-subtext",children:[h.jsx(aM,{size:12})," Adding to"," ",h.jsx("strong",{className:"text-text font-semibold",children:a==="global"?"Global":e==null?void 0:e.name})]})]})]}),d&&h.jsx("div",{className:"mt-2.5 text-accent-red text-sm whitespace-pre-wrap",children:d})]}),r.length>0&&h.jsxs("section",{className:zv,children:[h.jsx("h3",{children:"Import from your agent"}),h.jsxs("p",{className:`${SE} [&_code]:font-mono [&_code]:text-[0.92em] [&_code]:text-text [&_strong]:text-text [&_strong]:font-semibold`,children:["Skills already installed in your coding agents. Import a copy into"," ",h.jsx("strong",{children:N})," so it's managed here and invocable with ",h.jsx("code",{children:"/name"}),"."]}),h.jsx("div",{className:"flex flex-col",children:r.map(T=>h.jsx(PK,{skill:T,scopeLabel:N,alreadyImported:E.has(T.name),onImport:w},`${T.harnessId}:${T.name}`))})]}),t===null?h.jsxs("div",{className:"flex items-center gap-2 text-subtext text-md p-3",children:[h.jsx("span",{className:qt})," Loading skills…"]}):h.jsxs(h.Fragment,{children:[h.jsx(p7,{title:"Global skills",hint:"Available to the agent in every project.",skills:y,onChanged:k,onError:m}),e&&h.jsx(p7,{title:`${e.name} skills`,hint:"Available only in this project's sessions. Shadows a global skill of the same name.",skills:C,projectId:e.id,onChanged:k,onError:m})]})]})}function wo({active:e,label:t,icon:n,shimmer:r=!1,onSelect:i,onClose:a}){return h.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pr-0.5 [&_.tab-label]:grid [&_.tab-label]:grid-cols-[minmax(0,_1fr)] [&_.tab-label]:min-w-0 [&_.tab-label]:overflow-hidden [&_.tab-label_>_span]:[grid-area:1_/_1] [&_.tab-label_>_span]:overflow-hidden [&_.tab-label_>_span]:text-ellipsis [&_.tab-label_>_span]:whitespace-nowrap [&_.tab-label::after]:[grid-area:1_/_1] [&_.tab-label::after]:overflow-hidden [&_.tab-label::after]:text-ellipsis [&_.tab-label::after]:whitespace-nowrap [&_.tab-label::after]:content-[attr(data-label)] [&_.tab-label::after]:invisible [&_.tab-label::after]:font-medium [&_.tab-close]:inline-flex [&_.tab-close]:items-center [&_.tab-close]:justify-center [&_.tab-close]:w-3.5 [&_.tab-close]:h-3.5 [&_.tab-close]:rounded-xs [&_.tab-close]:text-muted [&_.tab-close]:shrink-0 [&_.tab-close:hover]:bg-[color-mix(in_oklab,_var(--text)_15%,_transparent)] [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap min-w-24 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-left-px [&:not(.active)_+_.tab:not(.active)::before]:w-px [&:not(.active)_+_.tab:not(.active)::before]:bg-border [&.active]:border-border [&.active]:bg-background [&.active]:text-text [&.active]:font-medium [&.active::after]:content-[''] [&.active::after]:absolute [&.active::after]:right-0 [&.active::after]:-bottom-px [&.active::after]:left-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""}`,onClick:i,title:t,children:[n,h.jsx("span",{className:"tab-label","data-label":t,children:h.jsx("span",{className:r?"tool-running-shimmer":"",children:t})}),h.jsx("span",{role:"button",className:"tab-close",title:"Close tab",onClick:o=>{o.stopPropagation(),a()},children:h.jsx(qr,{size:12})})]})}const m7=["files-pill inline-flex items-center gap-2 min-w-0 border border-border","rounded-md py-[7px] px-[11px] bg-background text-text","no-underline [&_code]:font-mono [&_code]:text-sm","[&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap","[&_>_svg]:shrink-0 [&_>_svg]:text-muted [a&:hover]:border-muted"].join(" ");function qK({owner:e,repo:t,branch:n}){return!e||!t?h.jsx("span",{className:m7,children:h.jsx("code",{children:n})}):h.jsxs("a",{className:m7,href:ap(e,t,n),target:"_blank",rel:"noopener noreferrer",title:`Open ${n} on GitHub`,children:[h.jsx("code",{children:n}),h.jsx(jp,{size:12})]})}const g7=["experiment-overview-action inline-flex items-center justify-center gap-[7px]","min-h-9 py-[7px] px-3 border border-border-variant rounded-sm","bg-background text-text text-sm font-semibold","transition-[background,border-color] duration-120 ease-standard","[&:hover]:border-[color-mix(in_oklab,_var(--text)_34%,_var(--border))]","[&:hover]:bg-surface"].join(" "),rb=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-md","[&_h2]:font-semibold"].join(" "),b7=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function v7(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function _7(e,t){return Nf((e.endedAt??t)-e.createdAt)}function GK({experiment:e,parentExperiment:t,project:n,runs:r,onOpenLogs:i,onOpenCode:a}){const o=r[0]??null,l=r.some(m=>m.status==="running"||m.status==="starting"),[u,d]=R.useState(()=>Date.now());return R.useEffect(()=>{if(!l)return;d(Date.now());const m=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(m)},[l]),h.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-[22px] [&_h1]:leading-tight",children:h.jsxs("div",{className:"experiment-overview-inner w-full max-w-230 my-0 mx-auto pt-6.5 px-7 pb-10 [@media((max-width:_720px))]:pt-5 [@media((max-width:_720px))]:px-4.5 [@media((max-width:_720px))]:pb-8",children:[h.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[h.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[h.jsx("h1",{children:e.title||e.slug}),h.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted font-mono text-sm",children:e.slug})]}),h.jsx(Ma,{status:o?ss(o):"idle"})]}),h.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[o&&h.jsxs("button",{className:g7,onClick:()=>i(o.id),children:[h.jsx(Uc,{size:15}),"Logs"]}),h.jsxs("button",{className:g7,onClick:a,children:[h.jsx(rp,{size:15}),"Code"]})]}),e.description&&h.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-md [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[h.jsx("h2",{children:"Description"}),h.jsx(La,{text:e.description})]}),h.jsxs("section",{className:rb,children:[h.jsx("h2",{children:o?"Latest run":"Runs"}),o&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap gap-y-2.5 gap-x-4.5 text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs",children:[h.jsx(Ma,{status:ss(o)}),h.jsx(N2,{backend:o.backend}),h.jsxs("span",{title:"Started",children:[h.jsx(Rj,{size:13}),v7(o.createdAt)]}),h.jsxs("span",{title:"Duration",children:[h.jsx(Gj,{size:13}),_7(o,u)]}),o.commitSha&&h.jsxs("span",{title:"Commit",children:[h.jsx(bM,{size:14}),h.jsx("code",{children:o.commitSha.slice(0,7)})]}),o.exitCode!==null&&o.exitCode!==void 0&&o.exitCode!==0&&h.jsxs("span",{children:["exit ",o.exitCode]})]}),o.command&&h.jsxs("code",{className:b7,children:["$ ",o.command]}),o.resultMarkdown&&h.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${o.status==="failed"?"failed":""}`,children:h.jsx(La,{text:o.resultMarkdown})})]})]}),h.jsxs("section",{className:rb,children:[h.jsx("h2",{children:"Git"}),h.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs experiment-overview-git-meta gap-y-[9px] gap-x-3.5 [&_.files-pill]:py-[5px] [&_.files-pill]:px-2 [&_.files-pill]:rounded-sm [&_.files-pill_code]:text-xs",children:[h.jsx(qK,{owner:n.githubEnabled?n.githubOwner:"",repo:n.githubEnabled?n.githubRepo:"",branch:e.branchName}),t&&h.jsxs("span",{children:["from ",h.jsx("code",{children:t.slug})]}),h.jsxs("span",{title:v7(e.createdAt),children:["created ",Gs(e.createdAt)]})]}),e.runCommand!==(o==null?void 0:o.command)&&h.jsxs("code",{className:b7,children:["$ ",e.runCommand]})]}),r.length>0&&h.jsxs("section",{className:rb,children:[h.jsx("h2",{children:"Run history"}),h.jsx("div",{className:"experiment-run-history border-t border-t-border-variant [&_button]:w-full [&_button]:grid [&_button]:grid-cols-[minmax(72px,_0.7fr)_minmax(100px,_1fr)_minmax(70px,_0.7fr)_60px_16px] [&_button]:items-center [&_button]:gap-3.5 [&_button]:py-[11px] [&_button]:px-0.5 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-left [&_button]:text-sm [&_button:hover]:bg-surface [@media((max-width:_720px))]:[&_button]:grid-cols-[65px_1fr_60px_16px] [@media((max-width:_720px))]:[&_button_>_:nth-child(3)]:hidden",children:r.map((m,f)=>h.jsxs("button",{onClick:()=>i(m.id),children:[h.jsxs("span",{className:"experiment-run-number font-mono text-xs font-semibold",children:["Run ",r.length-f]}),h.jsx(Ma,{status:ss(m)}),h.jsx("span",{children:Gs(m.createdAt)}),h.jsx("span",{children:_7(m,u)}),h.jsx(Uc,{size:13})]},m.id))})]})]})})}var ib={exports:{}},x7;function VK(){return x7||(x7=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(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const a=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(a._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,a=i._renderService.dimensions;if(a.css.cell.width===0||a.css.cell.height===0)return;const o=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(l.getPropertyValue("height")),d=Math.max(0,parseInt(l.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),f=u-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),g=d-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-o;return{cols:Math.max(2,Math.floor(g/a.css.cell.width)),rows:Math.max(1,Math.floor(f/a.css.cell.height))}}}})(),n})()))})(ib)),ib.exports}var WK=VK(),sb={exports:{}},y7;function YK(){return y7||(y7=1,(function(e,t){(function(n,r){e.exports=r()})(globalThis,(()=>(()=>{var n={4567:function(o,l,u){var d=this&&this.__decorate||function(w,y,C,N){var E,j=arguments.length,T=j<3?y:N===null?N=Object.getOwnPropertyDescriptor(y,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,C,N);else for(var D=w.length-1;D>=0;D--)(E=w[D])&&(T=(j<3?E(T):j>3?E(y,C,T):E(y,C))||T);return j>3&&T&&Object.defineProperty(y,C,T),T},m=this&&this.__param||function(w,y){return function(C,N){y(C,N,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const f=u(9042),g=u(9924),b=u(844),k=u(4725),S=u(2585),x=u(3656);let _=l.AccessibilityManager=class extends b.Disposable{constructor(w,y,C,N){super(),this._terminal=w,this._coreBrowserService=C,this._renderService=N,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 E=0;Ethis._handleBoundaryFocus(E,0),this._bottomBoundaryFocusListener=E=>this._handleBoundaryFocus(E,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 g.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((E=>this._handleResize(E.rows)))),this.register(this._terminal.onRender((E=>this._refreshRows(E.start,E.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((E=>this._handleChar(E)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` -`)))),this.register(this._terminal.onA11yTab((E=>this._handleTab(E)))),this.register(this._terminal.onKey((E=>this._handleKey(E.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,x.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(w){for(let y=0;y0?this._charsToConsume.shift()!==w&&(this._charsToAnnounce+=w):this._charsToAnnounce+=w,w===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(w){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(w)||this._charsToConsume.push(w)}_refreshRows(w,y){this._liveRegionDebouncer.refresh(w,y,this._terminal.rows)}_renderRows(w,y){const C=this._terminal.buffer,N=C.lines.length.toString();for(let E=w;E<=y;E++){const j=C.lines.get(C.ydisp+E),T=[],D=(j==null?void 0:j.translateToString(!0,void 0,void 0,T))||"",I=(C.ydisp+E+1).toString(),$=this._rowElements[E];$&&(D.length===0?($.innerText=" ",this._rowColumns.set($,[0,1])):($.textContent=D,this._rowColumns.set($,T)),$.setAttribute("aria-posinset",I),$.setAttribute("aria-setsize",N))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(w,y){const C=w.target,N=this._rowElements[y===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||w.relatedTarget!==N)return;let E,j;if(y===0?(E=C,j=this._rowElements.pop(),this._rowContainer.removeChild(j)):(E=this._rowElements.shift(),j=C,this._rowContainer.removeChild(E)),E.removeEventListener("focus",this._topBoundaryFocusListener),j.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(),w.preventDefault(),w.stopImmediatePropagation()}_handleSelectionChange(){var D;if(this._rowElements.length===0)return;const w=document.getSelection();if(!w)return;if(w.isCollapsed)return void(this._rowContainer.contains(w.anchorNode)&&this._terminal.clearSelection());if(!w.anchorNode||!w.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:w.anchorNode,offset:w.anchorOffset},C={node:w.focusNode,offset:w.focusOffset};if((y.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===C.node&&y.offset>C.offset)&&([y,C]=[C,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 N=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(N)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:N,offset:((D=N.textContent)==null?void 0:D.length)??0}),!this._rowContainer.contains(C.node))return;const E=({node:I,offset:$})=>{const F=I instanceof Text?I.parentNode:I;let U=parseInt(F==null?void 0:F.getAttribute("aria-posinset"),10)-1;if(isNaN(U))return console.warn("row is invalid. Race condition?"),null;const G=this._rowColumns.get(F);if(!G)return console.warn("columns is null. Race condition?"),null;let X=$=this._terminal.cols&&(++U,X=0),{row:U,column:X}},j=E(y),T=E(C);if(j&&T){if(j.row>T.row||j.row===T.row&&j.column>=T.column)throw new Error("invalid range");this._terminal.select(j.column,j.row,(T.row-j.row)*this._terminal.cols-j.column+T.column)}}_handleResize(w){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;yw;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const w=this._coreBrowserService.mainDocument.createElement("div");return w.setAttribute("role","listitem"),w.tabIndex=-1,this._refreshRowDimensions(w),w}_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 w=0;w{function u(g){return g.replace(/\r?\n/g,"\r")}function d(g,b){return b?"\x1B[200~"+g+"\x1B[201~":g}function m(g,b,k,S){g=d(g=u(g),k.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(g,!0),b.value=""}function f(g,b,k){const S=k.getBoundingClientRect(),x=g.clientX-S.left-10,_=g.clientY-S.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${x}px`,b.style.top=`${_}px`,b.style.zIndex="1000",b.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=u,l.bracketTextForPaste=d,l.copyHandler=function(g,b){g.clipboardData&&g.clipboardData.setData("text/plain",b.selectionText),g.preventDefault()},l.handlePasteEvent=function(g,b,k,S){g.stopPropagation(),g.clipboardData&&m(g.clipboardData.getData("text/plain"),b,k,S)},l.paste=m,l.moveTextAreaUnderMouseCursor=f,l.rightClickHandler=function(g,b,k,S,x){f(g,b,k),x&&S.rightClickSelect(g),b.value=S.selectionText,b.select()}},7239:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const d=u(1505);l.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(m,f,g){this._css.set(m,f,g)}getCss(m,f){return this._css.get(m,f)}setColor(m,f,g){this._color.set(m,f,g)}getColor(m,f){return this._color.get(m,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(u,d,m,f){u.addEventListener(d,m,f);let g=!1;return{dispose:()=>{g||(g=!0,u.removeEventListener(d,m,f))}}}},3551:function(o,l,u){var d=this&&this.__decorate||function(_,w,y,C){var N,E=arguments.length,j=E<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(_,w,y,C);else for(var T=_.length-1;T>=0;T--)(N=_[T])&&(j=(E<3?N(j):E>3?N(w,y,j):N(w,y))||j);return E>3&&j&&Object.defineProperty(w,y,j),j},m=this&&this.__param||function(_,w){return function(y,C){w(y,C,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const f=u(3656),g=u(8460),b=u(844),k=u(2585),S=u(4725);let x=l.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(_,w,y,C,N){super(),this._element=_,this._mouseService=w,this._renderService=y,this._bufferService=C,this._linkProviderService=N,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{var E;this._lastMouseEvent=void 0,(E=this._activeProviderReplies)==null||E.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(_){this._lastMouseEvent=_;const w=this._positionFromMouseEvent(_,this._element,this._mouseService);if(!w)return;this._isMouseOut=!1;const y=_.composedPath();for(let C=0;C{E==null||E.forEach((j=>{j.link.dispose&&j.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=_.y);let y=!1;for(const[E,j]of this._linkProviderService.linkProviders.entries())w?(N=this._activeProviderReplies)!=null&&N.get(E)&&(y=this._checkLinkProviderResult(E,_,y)):j.provideLinks(_.y,(T=>{var I,$;if(this._isMouseOut)return;const D=T==null?void 0:T.map((F=>({link:F})));(I=this._activeProviderReplies)==null||I.set(E,D),y=this._checkLinkProviderResult(E,_,y),(($=this._activeProviderReplies)==null?void 0:$.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(_.y,this._activeProviderReplies)}))}_removeIntersectingLinks(_,w){const y=new Set;for(let C=0;C_?this._bufferService.cols:j.link.range.end.x;for(let I=T;I<=D;I++){if(y.has(I)){N.splice(E--,1);break}y.add(I)}}}}_checkLinkProviderResult(_,w,y){var E;if(!this._activeProviderReplies)return y;const C=this._activeProviderReplies.get(_);let N=!1;for(let j=0;j<_;j++)this._activeProviderReplies.has(j)&&!this._activeProviderReplies.get(j)||(N=!0);if(!N&&C){const j=C.find((T=>this._linkAtPosition(T.link,w)));j&&(y=!0,this._handleNewLink(j))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let j=0;jthis._linkAtPosition(D.link,w)));if(T){y=!0,this._handleNewLink(T);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(_){if(!this._currentLink)return;const w=this._positionFromMouseEvent(_,this._element,this._mouseService);w&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,w)&&this._currentLink.link.activate(_,this._currentLink.link.text)}_clearCurrentLink(_,w){this._currentLink&&this._lastMouseEvent&&(!_||!w||this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=w)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(_){if(!this._lastMouseEvent)return;const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._linkAtPosition(_.link,w)&&(this._currentLink=_,this._currentLink.state={decorations:{underline:_.link.decorations===void 0||_.link.decorations.underline,pointerCursor:_.link.decorations===void 0||_.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,_.link,this._lastMouseEvent),_.link.decorations={},Object.defineProperties(_.link.decorations,{pointerCursor:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.pointerCursor},set:y=>{var C;(C=this._currentLink)!=null&&C.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,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.underline},set:y=>{var C,N,E;(C=this._currentLink)!=null&&C.state&&((E=(N=this._currentLink)==null?void 0:N.state)==null?void 0:E.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(_.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const C=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,N=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=N&&(this._clearCurrentLink(C,N),this._lastMouseEvent)){const E=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);E&&this._askForLink(E,!1)}}))))}_linkHover(_,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!0),this._currentLink.state.decorations.pointerCursor&&_.classList.add("xterm-cursor-pointer")),w.hover&&w.hover(y,w.text)}_fireUnderlineEvent(_,w){const y=_.range,C=this._bufferService.buffer.ydisp,N=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-C-1,y.end.x,y.end.y-C-1,void 0);(w?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(N)}_linkLeave(_,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!1),this._currentLink.state.decorations.pointerCursor&&_.classList.remove("xterm-cursor-pointer")),w.leave&&w.leave(y,w.text)}_linkAtPosition(_,w){const y=_.range.start.y*this._bufferService.cols+_.range.start.x,C=_.range.end.y*this._bufferService.cols+_.range.end.x,N=w.y*this._bufferService.cols+w.x;return y<=N&&N<=C}_positionFromMouseEvent(_,w,y){const C=y.getCoords(_,w,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(_,w,y,C,N){return{x1:_,y1:w,x2:y,y2:C,cols:this._bufferService.cols,fg:N}}};l.Linkifier=x=d([m(1,S.IMouseService),m(2,S.IRenderService),m(3,k.IBufferService),m(4,S.ILinkProviderService)],x)},9042:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(o,l,u){var d=this&&this.__decorate||function(S,x,_,w){var y,C=arguments.length,N=C<3?x:w===null?w=Object.getOwnPropertyDescriptor(x,_):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,x,_,w);else for(var E=S.length-1;E>=0;E--)(y=S[E])&&(N=(C<3?y(N):C>3?y(x,_,N):y(x,_))||N);return C>3&&N&&Object.defineProperty(x,_,N),N},m=this&&this.__param||function(S,x){return function(_,w){x(_,w,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const f=u(511),g=u(2585);let b=l.OscLinkProvider=class{constructor(S,x,_){this._bufferService=S,this._optionsService=x,this._oscLinkService=_}provideLinks(S,x){var D;const _=this._bufferService.buffer.lines.get(S-1);if(!_)return void x(void 0);const w=[],y=this._optionsService.rawOptions.linkHandler,C=new f.CellData,N=_.getTrimmedLength();let E=-1,j=-1,T=!1;for(let I=0;Iy?y.activate(G,X,F):k(0,X),hover:(G,X)=>{var Y;return(Y=y==null?void 0:y.hover)==null?void 0:Y.call(y,G,X,F)},leave:(G,X)=>{var Y;return(Y=y==null?void 0:y.leave)==null?void 0:Y.call(y,G,X,F)}})}T=!1,C.hasExtendedAttrs()&&C.extended.urlId?(j=I,E=C.extended.urlId):(j=-1,E=-1)}}x(w)}};function k(S,x){if(confirm(`Do you want to navigate to ${x}? - -WARNING: This link could potentially be dangerous`)){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=x}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=b=d([m(0,g.IBufferService),m(1,g.IOptionsService),m(2,g.IOscLinkService)],b)},6193:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,d,m){this._rowCount=m,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,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 u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const d=u(3614),m=u(3656),f=u(3551),g=u(9042),b=u(3730),k=u(1680),S=u(3107),x=u(5744),_=u(2950),w=u(1296),y=u(428),C=u(4269),N=u(5114),E=u(8934),j=u(3230),T=u(9312),D=u(4725),I=u(6731),$=u(8055),F=u(8969),U=u(8460),G=u(844),X=u(6114),Y=u(8437),Z=u(2584),Q=u(7399),z=u(5941),O=u(9074),H=u(2585),V=u(5435),W=u(4567),re=u(779);class le extends F.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(te={}){super(te),this.browser=X,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new G.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(O.DecorationService),this._instantiationService.setService(H.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(re.LinkProviderService),this._instantiationService.setService(D.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((B,ie)=>this.refresh(B,ie)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((B=>this._reportWindowsOptions(B)))),this.register(this._inputHandler.onColor((B=>this._handleColorEvent(B)))),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((B=>this._afterResize(B.cols,B.rows)))),this.register((0,G.toDisposable)((()=>{var B,ie;this._customKeyEventHandler=void 0,(ie=(B=this.element)==null?void 0:B.parentNode)==null||ie.removeChild(this.element)})))}_handleColorEvent(te){if(this._themeService)for(const B of te){let ie,oe="";switch(B.index){case 256:ie="foreground",oe="10";break;case 257:ie="background",oe="11";break;case 258:ie="cursor",oe="12";break;default:ie="ansi",oe="4;"+B.index}switch(B.type){case 0:const be=$.color.toColorRGB(ie==="ansi"?this._themeService.colors.ansi[B.index]:this._themeService.colors[ie]);this.coreService.triggerDataEvent(`${Z.C0.ESC}]${oe};${(0,z.toRgbString)(be)}${Z.C1_ESCAPED.ST}`);break;case 1:if(ie==="ansi")this._themeService.modifyColors((ge=>ge.ansi[B.index]=$.channels.toColor(...B.color)));else{const ge=ie;this._themeService.modifyColors((Ce=>Ce[ge]=$.channels.toColor(...B.color)))}break;case 2:this._themeService.restoreColor(B.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(te){te?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(te){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Z.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var te;return(te=this.textarea)==null?void 0:te.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Z.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 te=this.buffer.ybase+this.buffer.y,B=this.buffer.lines.get(te);if(!B)return;const ie=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,be=B.getWidth(ie),ge=this._renderService.dimensions.css.cell.width*be,Ce=this.buffer.y*this._renderService.dimensions.css.cell.height,Le=ie*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Le+"px",this.textarea.style.top=Ce+"px",this.textarea.style.width=ge+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(B=>{this.hasSelection()&&(0,d.copyHandler)(B,this._selectionService)})));const te=B=>(0,d.handlePasteEvent)(B,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",te)),this.register((0,m.addDisposableDomListener)(this.element,"paste",te)),X.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(B=>{B.button===2&&(0,d.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(B=>{(0,d.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),X.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(B=>{B.button===1&&(0,d.moveTextAreaUnderMouseCursor)(B,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(te=>this._keyUp(te)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(te=>this._keyDown(te)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(te=>this._keyPress(te)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(te=>this._compositionHelper.compositionupdate(te)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(te=>this._inputEvent(te)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(te){var ie;if(!te)throw new Error("Terminal requires a parent element.");if(te.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ie=this.element)==null?void 0:ie.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=te.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"),te.appendChild(this.element);const B=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),B.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,m.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),B.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),X.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(N.CoreBrowserService,this.textarea,te.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(D.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,m.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(D.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(I.ThemeService),this._instantiationService.setService(D.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(D.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(j.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(D.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(_.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(E.MouseService),this._instantiationService.setService(D.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(B);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(k.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.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(D.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),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(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(x.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(x.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(w.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const te=this,B=this.element;function ie(ge){const Ce=te._mouseService.getMouseReportCoords(ge,te.screenElement);if(!Ce)return!1;let Le,Ue;switch(ge.overrideType||ge.type){case"mousemove":Ue=32,ge.buttons===void 0?(Le=3,ge.button!==void 0&&(Le=ge.button<3?ge.button:3)):Le=1&ge.buttons?0:4&ge.buttons?1:2&ge.buttons?2:3;break;case"mouseup":Ue=0,Le=ge.button<3?ge.button:3;break;case"mousedown":Ue=1,Le=ge.button<3?ge.button:3;break;case"wheel":if(te._customWheelEventHandler&&te._customWheelEventHandler(ge)===!1||te.viewport.getLinesScrolled(ge)===0)return!1;Ue=ge.deltaY<0?0:1,Le=4;break;default:return!1}return!(Ue===void 0||Le===void 0||Le>4)&&te.coreMouseService.triggerMouseEvent({col:Ce.col,row:Ce.row,x:Ce.x,y:Ce.y,button:Le,action:Ue,ctrl:ge.ctrlKey,alt:ge.altKey,shift:ge.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},be={mouseup:ge=>(ie(ge),ge.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(ge)),wheel:ge=>(ie(ge),this.cancel(ge,!0)),mousedrag:ge=>{ge.buttons&&ie(ge)},mousemove:ge=>{ge.buttons||ie(ge)}};this.register(this.coreMouseService.onProtocolChange((ge=>{ge?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ge)),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&ge?oe.mousemove||(B.addEventListener("mousemove",be.mousemove),oe.mousemove=be.mousemove):(B.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&ge?oe.wheel||(B.addEventListener("wheel",be.wheel,{passive:!1}),oe.wheel=be.wheel):(B.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&ge?oe.mouseup||(oe.mouseup=be.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&ge?oe.mousedrag||(oe.mousedrag=be.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(B,"mousedown",(ge=>{if(ge.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ge))return ie(ge),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(ge)}))),this.register((0,m.addDisposableDomListener)(B,"wheel",(ge=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ge)===!1)return!1;if(!this.buffer.hasScrollback){const Ce=this.viewport.getLinesScrolled(ge);if(Ce===0)return;const Le=Z.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ge.deltaY<0?"A":"B");let Ue="";for(let We=0;We{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ge),this.cancel(ge)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(B,"touchmove",(ge=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ge)?void 0:this.cancel(ge)}),{passive:!1}))}refresh(te,B){var ie;(ie=this._renderService)==null||ie.refreshRows(te,B)}updateCursorStyle(te){var B;(B=this._selectionService)!=null&&B.shouldColumnSelect(te)?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(te,B,ie=0){var oe;ie===1?(super.scrollLines(te,B,ie),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(te)}paste(te){(0,d.paste)(te,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(te){this._customKeyEventHandler=te}attachCustomWheelEventHandler(te){this._customWheelEventHandler=te}registerLinkProvider(te){return this._linkProviderService.registerLinkProvider(te)}registerCharacterJoiner(te){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const B=this._characterJoinerService.register(te);return this.refresh(0,this.rows-1),B}deregisterCharacterJoiner(te){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(te)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(te){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+te)}registerDecoration(te){return this._decorationService.registerDecoration(te)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(te,B,ie){this._selectionService.setSelection(te,B,ie)}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 te;(te=this._selectionService)==null||te.clearSelection()}selectAll(){var te;(te=this._selectionService)==null||te.selectAll()}selectLines(te,B){var ie;(ie=this._selectionService)==null||ie.selectLines(te,B)}_keyDown(te){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1)return!1;const B=this.browser.isMac&&this.options.macOptionIsMeta&&te.altKey;if(!B&&!this._compositionHelper.keydown(te))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;B||te.key!=="Dead"&&te.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ie=(0,Q.evaluateKeyboardEvent)(te,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(te),ie.type===3||ie.type===2){const oe=this.rows-1;return this.scrollLines(ie.type===2?-oe:oe),this.cancel(te,!0)}return ie.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,te)||(ie.cancel&&this.cancel(te,!0),!ie.key||!!(te.key&&!te.ctrlKey&&!te.altKey&&!te.metaKey&&te.key.length===1&&te.key.charCodeAt(0)>=65&&te.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ie.key!==Z.C0.ETX&&ie.key!==Z.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ie.key,domEvent:te}),this._showCursor(),this.coreService.triggerDataEvent(ie.key,!0),!this.optionsService.rawOptions.screenReaderMode||te.altKey||te.ctrlKey?this.cancel(te,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(te,B){const ie=te.isMac&&!this.options.macOptionIsMeta&&B.altKey&&!B.ctrlKey&&!B.metaKey||te.isWindows&&B.altKey&&B.ctrlKey&&!B.metaKey||te.isWindows&&B.getModifierState("AltGraph");return B.type==="keypress"?ie:ie&&(!B.keyCode||B.keyCode>47)}_keyUp(te){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1||((function(B){return B.keyCode===16||B.keyCode===17||B.keyCode===18})(te)||this.focus(),this.updateCursorStyle(te),this._keyPressHandled=!1)}_keyPress(te){let B;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1)return!1;if(this.cancel(te),te.charCode)B=te.charCode;else if(te.which===null||te.which===void 0)B=te.keyCode;else{if(te.which===0||te.charCode===0)return!1;B=te.which}return!(!B||(te.altKey||te.ctrlKey||te.metaKey)&&!this._isThirdLevelShift(this.browser,te)||(B=String.fromCharCode(B),this._onKey.fire({key:B,domEvent:te}),this._showCursor(),this.coreService.triggerDataEvent(B,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(te){if(te.data&&te.inputType==="insertText"&&(!te.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const B=te.data;return this.coreService.triggerDataEvent(B,!0),this.cancel(te),!0}return!1}resize(te,B){te!==this.cols||B!==this.rows?super.resize(te,B):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(te,B){var ie,oe;(ie=this._charSizeService)==null||ie.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var te;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 B=1;B{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,m){this._rowCount=m,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=f-this._lastRefreshMs,b=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(o,l,u){var d=this&&this.__decorate||function(_,w,y,C){var N,E=arguments.length,j=E<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(_,w,y,C);else for(var T=_.length-1;T>=0;T--)(N=_[T])&&(j=(E<3?N(j):E>3?N(w,y,j):N(w,y))||j);return E>3&&j&&Object.defineProperty(w,y,j),j},m=this&&this.__param||function(_,w){return function(y,C){w(y,C,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const f=u(3656),g=u(4725),b=u(8460),k=u(844),S=u(2585);let x=l.Viewport=class extends k.Disposable{constructor(_,w,y,C,N,E,j,T){super(),this._viewportElement=_,this._scrollArea=w,this._bufferService=y,this._optionsService=C,this._charSizeService=N,this._renderService=E,this._coreBrowserService=j,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 b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((D=>this._renderDimensions=D))),this._handleThemeChange(T.colors),this.register(T.onChangeColors((D=>this._handleThemeChange(D)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(_){this._viewportElement.style.backgroundColor=_.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(_){if(_)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 w=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==w&&(this._lastRecordedBufferHeight=w,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const _=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==_&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=_),this._refreshAnimationFrame=null}syncScrollArea(_=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(_);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(_)}_handleScroll(_){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 w=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:w,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const _=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(_*(this._smoothScrollState.target-this._smoothScrollState.origin)),_<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(_,w){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(w<0&&this._viewportElement.scrollTop!==0||w>0&&y0&&(y=F),C=""}}return{bufferElements:N,cursorElement:y}}getLinesScrolled(_){if(_.deltaY===0||_.shiftKey)return 0;let w=this._applyScrollModifier(_.deltaY,_);return _.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(w/=this._currentRowHeight+0,this._wheelPartialScroll+=w,w=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):_.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(w*=this._bufferService.rows),w}_applyScrollModifier(_,w){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&w.altKey||y==="ctrl"&&w.ctrlKey||y==="shift"&&w.shiftKey?_*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:_*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(_){this._lastTouchY=_.touches[0].pageY}handleTouchMove(_){const w=this._lastTouchY-_.touches[0].pageY;return this._lastTouchY=_.touches[0].pageY,w!==0&&(this._viewportElement.scrollTop+=w,this._bubbleScroll(_,w))}};l.Viewport=x=d([m(2,S.IBufferService),m(3,S.IOptionsService),m(4,g.ICharSizeService),m(5,g.IRenderService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],x)},3107:function(o,l,u){var d=this&&this.__decorate||function(S,x,_,w){var y,C=arguments.length,N=C<3?x:w===null?w=Object.getOwnPropertyDescriptor(x,_):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,x,_,w);else for(var E=S.length-1;E>=0;E--)(y=S[E])&&(N=(C<3?y(N):C>3?y(x,_,N):y(x,_))||N);return C>3&&N&&Object.defineProperty(x,_,N),N},m=this&&this.__param||function(S,x){return function(_,w){x(_,w,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const f=u(4725),g=u(844),b=u(2585);let k=l.BufferDecorationRenderer=class extends g.Disposable{constructor(S,x,_,w,y){super(),this._screenElement=S,this._bufferService=x,this._coreBrowserService=_,this._decorationService=w,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((C=>this._removeDecoration(C)))),this.register((0,g.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 S of this._decorationService.decorations)this._renderDecoration(S);this._dimensionsChanged=!1}_renderDecoration(S){this._refreshStyle(S),this._dimensionsChanged&&this._refreshXPosition(S)}_createElement(S){var w;const x=this._coreBrowserService.mainDocument.createElement("div");x.classList.add("xterm-decoration"),x.classList.toggle("xterm-decoration-top-layer",((w=S==null?void 0:S.options)==null?void 0:w.layer)==="top"),x.style.width=`${Math.round((S.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,x.style.height=(S.options.height||1)*this._renderService.dimensions.css.cell.height+"px",x.style.top=(S.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",x.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const _=S.options.x??0;return _&&_>this._bufferService.cols&&(x.style.display="none"),this._refreshXPosition(S,x),x}_refreshStyle(S){const x=S.marker.line-this._bufferService.buffers.active.ydisp;if(x<0||x>=this._bufferService.rows)S.element&&(S.element.style.display="none",S.onRenderEmitter.fire(S.element));else{let _=this._decorationElements.get(S);_||(_=this._createElement(S),S.element=_,this._decorationElements.set(S,_),this._container.appendChild(_),S.onDispose((()=>{this._decorationElements.delete(S),_.remove()}))),_.style.top=x*this._renderService.dimensions.css.cell.height+"px",_.style.display=this._altBufferIsActive?"none":"block",S.onRenderEmitter.fire(_)}}_refreshXPosition(S,x=S.element){if(!x)return;const _=S.options.x??0;(S.options.anchor||"left")==="right"?x.style.right=_?_*this._renderService.dimensions.css.cell.width+"px":"":x.style.left=_?_*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(S){var x;(x=this._decorationElements.get(S))==null||x.remove(),this._decorationElements.delete(S),S.dispose()}};l.BufferDecorationRenderer=k=d([m(1,b.IBufferService),m(2,f.ICoreBrowserService),m(3,b.IDecorationService),m(4,f.IRenderService)],k)},5871:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.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(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,m){return d>=u.startBufferLine-this._linePadding[m||"full"]&&d<=u.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(o,l,u){var d=this&&this.__decorate||function(y,C,N,E){var j,T=arguments.length,D=T<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,N):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,C,N,E);else for(var I=y.length-1;I>=0;I--)(j=y[I])&&(D=(T<3?j(D):T>3?j(C,N,D):j(C,N))||D);return T>3&&D&&Object.defineProperty(C,N,D),D},m=this&&this.__param||function(y,C){return function(N,E){C(N,E,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const f=u(5871),g=u(4725),b=u(844),k=u(2585),S={full:0,left:0,center:0,right:0},x={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0};let w=l.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,C,N,E,j,T,D){var $;super(),this._viewportElement=y,this._screenElement=C,this._bufferService=N,this._decorationService=E,this._renderService=j,this._optionsService=T,this._coreBrowserService=D,this._colorZoneStore=new f.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(),($=this._viewportElement.parentElement)==null||$.insertBefore(this._canvas,this._viewportElement);const I=this._canvas.getContext("2d");if(!I)throw new Error("Ctx cannot be null");this._ctx=I,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{var F;(F=this._canvas)==null||F.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),C=Math.ceil(this._canvas.width/3);x.full=this._canvas.width,x.left=y,x.center=C,x.right=y,this._refreshDrawHeightConstants(),_.full=0,_.left=0,_.center=x.left,_.right=x.left+x.center}_refreshDrawHeightConstants(){S.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,C=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);S.left=C,S.center=C,S.right=C}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.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 C of this._decorationService.decorations)this._colorZoneStore.addDecoration(C);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const C of y)C.position!=="full"&&this._renderColorZone(C);for(const C of y)C.position==="full"&&this._renderColorZone(C);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(_[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-S[y.position||"full"]/2),x[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+S[y.position||"full"]))}_queueRefresh(y,C){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=C||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=w=d([m(2,k.IBufferService),m(3,k.IDecorationService),m(4,g.IRenderService),m(5,k.IOptionsService),m(6,g.ICoreBrowserService)],w)},2950:function(o,l,u){var d=this&&this.__decorate||function(S,x,_,w){var y,C=arguments.length,N=C<3?x:w===null?w=Object.getOwnPropertyDescriptor(x,_):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,x,_,w);else for(var E=S.length-1;E>=0;E--)(y=S[E])&&(N=(C<3?y(N):C>3?y(x,_,N):y(x,_))||N);return C>3&&N&&Object.defineProperty(x,_,N),N},m=this&&this.__param||function(S,x){return function(_,w){x(_,w,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const f=u(4725),g=u(2585),b=u(2584);let k=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,x,_,w,y,C){this._textarea=S,this._compositionView=x,this._bufferService=_,this._optionsService=w,this._coreService=y,this._renderService=C,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(S){this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(S){if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){const x={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let _;this._isSendingComposition=!1,x.start+=this._dataAlreadySent.length,_=this._isComposing?this._textarea.value.substring(x.start,x.end):this._textarea.value.substring(x.start),_.length>0&&this._coreService.triggerDataEvent(_,!0)}}),0)}else{this._isSendingComposition=!1;const x=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(x,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const x=this._textarea.value,_=x.replace(S,"");this._dataAlreadySent=_,x.length>S.length?this._coreService.triggerDataEvent(_,!0):x.lengththis.updateCompositionElements(!0)),0)}}};l.CompositionHelper=k=d([m(2,g.IBufferService),m(3,g.IOptionsService),m(4,g.ICoreService),m(5,f.IRenderService)],k)},9806:(o,l)=>{function u(d,m,f){const g=f.getBoundingClientRect(),b=d.getComputedStyle(f),k=parseInt(b.getPropertyValue("padding-left")),S=parseInt(b.getPropertyValue("padding-top"));return[m.clientX-g.left-k,m.clientY-g.top-S]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=u,l.getCoords=function(d,m,f,g,b,k,S,x,_){if(!k)return;const w=u(d,m,f);return w?(w[0]=Math.ceil((w[0]+(_?S/2:0))/S),w[1]=Math.ceil(w[1]/x),w[0]=Math.min(Math.max(w[0],1),g+(_?1:0)),w[1]=Math.min(Math.max(w[1],1),b),w):void 0}},9504:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const d=u(2584);function m(x,_,w,y){const C=x-f(x,w),N=_-f(_,w),E=Math.abs(C-N)-(function(j,T,D){let I=0;const $=j-f(j,D),F=T-f(T,D);for(let U=0;U=0&&x<_.rows;)w++,y=_.buffer.lines.get(--x),C=y==null?void 0:y.isWrapped;return w}function g(x,_){return x>_?"A":"B"}function b(x,_,w,y,C,N){let E=x,j=_,T="";for(;E!==w||j!==y;)E+=C?1:-1,C&&E>N.cols-1?(T+=N.buffer.translateBufferLineToString(j,!1,x,E),E=0,x=0,j++):!C&&E<0&&(T+=N.buffer.translateBufferLineToString(j,!1,0,x+1),E=N.cols-1,x=E,j--);return T+N.buffer.translateBufferLineToString(j,!1,x,E)}function k(x,_){const w=_?"O":"[";return d.C0.ESC+w+x}function S(x,_){x=Math.floor(x);let w="";for(let y=0;y0?$-f($,F):D;const X=$,Y=(function(Z,Q,z,O,H,V){let W;return W=m(z,O,H,V).length>0?O-f(O,H):Q,Z=z&&Wx?"D":"C",S(Math.abs(C-x),k(E,y));E=N>_?"D":"C";const j=Math.abs(N-_);return S((function(T,D){return D.cols-T})(N>_?x:C,w)+(j-1)*w.cols+1+((N>_?C:x)-1),k(E,y))}},1296:function(o,l,u){var d=this&&this.__decorate||function(U,G,X,Y){var Z,Q=arguments.length,z=Q<3?G:Y===null?Y=Object.getOwnPropertyDescriptor(G,X):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(U,G,X,Y);else for(var O=U.length-1;O>=0;O--)(Z=U[O])&&(z=(Q<3?Z(z):Q>3?Z(G,X,z):Z(G,X))||z);return Q>3&&z&&Object.defineProperty(G,X,z),z},m=this&&this.__param||function(U,G){return function(X,Y){G(X,Y,U)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const f=u(3787),g=u(2550),b=u(2223),k=u(6171),S=u(6052),x=u(4725),_=u(8055),w=u(8460),y=u(844),C=u(2585),N="xterm-dom-renderer-owner-",E="xterm-rows",j="xterm-fg-",T="xterm-bg-",D="xterm-focus",I="xterm-selection";let $=1,F=l.DomRenderer=class extends y.Disposable{constructor(U,G,X,Y,Z,Q,z,O,H,V,W,re,le){super(),this._terminal=U,this._document=G,this._element=X,this._screenElement=Y,this._viewportElement=Z,this._helperContainer=Q,this._linkifier2=z,this._charSizeService=H,this._optionsService=V,this._bufferService=W,this._coreBrowserService=re,this._themeService=le,this._terminalClass=$++,this._rowElements=[],this._selectionRenderModel=(0,S.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new w.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(E),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(I),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((pe=>this._injectCss(pe)))),this._injectCss(this._themeService.colors),this._rowFactory=O.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(N+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((pe=>this._handleLinkHover(pe)))),this.register(this._linkifier2.onHideLinkUnderline((pe=>this._handleLinkLeave(pe)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(N+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new g.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 X of this._rowElements)X.style.width=`${this.dimensions.css.canvas.width}px`,X.style.height=`${this.dimensions.css.cell.height}px`,X.style.lineHeight=`${this.dimensions.css.cell.height}px`,X.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const G=`${this._terminalSelector} .${E} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=G,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 G=`${this._terminalSelector} .${E} { color: ${U.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;G+=`${this._terminalSelector} .${E} .xterm-dim { color: ${_.color.multiplyOpacity(U.foreground,.5).css};}`,G+=`${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 X=`blink_underline_${this._terminalClass}`,Y=`blink_bar_${this._terminalClass}`,Z=`blink_block_${this._terminalClass}`;G+=`@keyframes ${X} { 50% { border-bottom-style: hidden; }}`,G+=`@keyframes ${Y} { 50% { box-shadow: none; }}`,G+=`@keyframes ${Z} { 0% { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css}; } 50% { background-color: inherit; color: ${U.cursor.css}; }}`,G+=`${this._terminalSelector} .${E}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${E}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${E}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Z} 1s step-end infinite;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css};}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${U.cursor.css} !important; color: ${U.cursorAccent.css} !important;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${U.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${U.cursor.css} inset;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${U.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,G+=`${this._terminalSelector} .${I} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${I} div { position: absolute; background-color: ${U.selectionBackgroundOpaque.css};}${this._terminalSelector} .${I} div { position: absolute; background-color: ${U.selectionInactiveBackgroundOpaque.css};}`;for(const[Q,z]of U.ansi.entries())G+=`${this._terminalSelector} .${j}${Q} { color: ${z.css}; }${this._terminalSelector} .${j}${Q}.xterm-dim { color: ${_.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${T}${Q} { background-color: ${z.css}; }`;G+=`${this._terminalSelector} .${j}${b.INVERTED_DEFAULT_COLOR} { color: ${_.color.opaque(U.background).css}; }${this._terminalSelector} .${j}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${_.color.multiplyOpacity(_.color.opaque(U.background),.5).css}; }${this._terminalSelector} .${T}${b.INVERTED_DEFAULT_COLOR} { background-color: ${U.foreground.css}; }`,this._themeStyleElement.textContent=G}_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,G){for(let X=this._rowElements.length;X<=G;X++){const Y=this._document.createElement("div");this._rowContainer.appendChild(Y),this._rowElements.push(Y)}for(;this._rowElements.length>G;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(U,G){this._refreshRowElements(U,G),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(D),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(D),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(U,G,X){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(U,G,X),this.renderRows(0,this._bufferService.rows-1),!U||!G)return;this._selectionRenderModel.update(this._terminal,U,G,X);const Y=this._selectionRenderModel.viewportStartRow,Z=this._selectionRenderModel.viewportEndRow,Q=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(Q>=this._bufferService.rows||z<0)return;const O=this._document.createDocumentFragment();if(X){const H=U[0]>G[0];O.appendChild(this._createSelectionElement(Q,H?G[0]:U[0],H?U[0]:G[0],z-Q+1))}else{const H=Y===Q?U[0]:0,V=Q===Z?G[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(Q,H,V));const W=z-Q-1;if(O.appendChild(this._createSelectionElement(Q+1,0,this._bufferService.cols,W)),Q!==z){const re=Z===z?G[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(z,0,re))}}this._selectionContainer.appendChild(O)}_createSelectionElement(U,G,X,Y=1){const Z=this._document.createElement("div"),Q=G*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(X-G);return Q+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-Q),Z.style.height=Y*this.dimensions.css.cell.height+"px",Z.style.top=U*this.dimensions.css.cell.height+"px",Z.style.left=`${Q}px`,Z.style.width=`${z}px`,Z}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,G){const X=this._bufferService.buffer,Y=X.ybase+X.y,Z=Math.min(X.x,this._bufferService.cols-1),Q=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let H=U;H<=G;H++){const V=H+X.ydisp,W=this._rowElements[H],re=X.lines.get(V);if(!W||!re)break;W.replaceChildren(...this._rowFactory.createRow(re,V,V===Y,z,O,Z,Q,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${N}${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,G,X,Y,Z,Q){X<0&&(U=0),Y<0&&(G=0);const z=this._bufferService.rows-1;X=Math.max(Math.min(X,z),0),Y=Math.max(Math.min(Y,z),0),Z=Math.min(Z,this._bufferService.cols);const O=this._bufferService.buffer,H=O.ybase+O.y,V=Math.min(O.x,Z-1),W=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,le=this._optionsService.rawOptions.cursorInactiveStyle;for(let pe=X;pe<=Y;++pe){const te=pe+O.ydisp,B=this._rowElements[pe],ie=O.lines.get(te);if(!B||!ie)break;B.replaceChildren(...this._rowFactory.createRow(ie,te,te===H,re,le,V,W,this.dimensions.css.cell.width,this._widthCache,Q?pe===X?U:0:-1,Q?(pe===Y?G:Z)-1:-1))}}};l.DomRenderer=F=d([m(7,C.IInstantiationService),m(8,x.ICharSizeService),m(9,C.IOptionsService),m(10,C.IBufferService),m(11,x.ICoreBrowserService),m(12,x.IThemeService)],F)},3787:function(o,l,u){var d=this&&this.__decorate||function(E,j,T,D){var I,$=arguments.length,F=$<3?j:D===null?D=Object.getOwnPropertyDescriptor(j,T):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(E,j,T,D);else for(var U=E.length-1;U>=0;U--)(I=E[U])&&(F=($<3?I(F):$>3?I(j,T,F):I(j,T))||F);return $>3&&F&&Object.defineProperty(j,T,F),F},m=this&&this.__param||function(E,j){return function(T,D){j(T,D,E)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const f=u(2223),g=u(643),b=u(511),k=u(2585),S=u(8055),x=u(4725),_=u(4269),w=u(6171),y=u(3734);let C=l.DomRendererRowFactory=class{constructor(E,j,T,D,I,$,F){this._document=E,this._characterJoinerService=j,this._optionsService=T,this._coreBrowserService=D,this._coreService=I,this._decorationService=$,this._themeService=F,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(E,j,T){this._selectionStart=E,this._selectionEnd=j,this._columnSelectMode=T}createRow(E,j,T,D,I,$,F,U,G,X,Y){const Z=[],Q=this._characterJoinerService.getJoinedCharacters(j),z=this._themeService.colors;let O,H=E.getNoBgTrimmedLength();T&&H<$+1&&(H=$+1);let V=0,W="",re=0,le=0,pe=0,te=!1,B=0,ie=!1,oe=0;const be=[],ge=X!==-1&&Y!==-1;for(let Ce=0;Ce0&&Ce===Q[0][0]){Ue=!0;const it=Q.shift();Fe=new _.JoinedCellData(this._workCell,E.translateToString(!0,it[0],it[1]),it[1]-it[0]),We=it[1]-1,Le=Fe.getWidth()}const mt=this._isCellInSelection(Ce,j),De=T&&Ce===$,ot=ge&&Ce>=X&&Ce<=Y;let Bt=!1;this._decorationService.forEachDecorationAtCell(Ce,j,void 0,(it=>{Bt=!0}));let on=Fe.getChars()||g.WHITESPACE_CELL_CHAR;if(on===" "&&(Fe.isUnderline()||Fe.isOverline())&&(on=" "),oe=Le*U-G.get(on,Fe.isBold(),Fe.isItalic()),O){if(V&&(mt&&ie||!mt&&!ie&&Fe.bg===re)&&(mt&&ie&&z.selectionForeground||Fe.fg===le)&&Fe.extended.ext===pe&&ot===te&&oe===B&&!De&&!Ue&&!Bt){Fe.isInvisible()?W+=g.WHITESPACE_CELL_CHAR:W+=on,V++;continue}V&&(O.textContent=W),O=this._document.createElement("span"),V=0,W=""}else O=this._document.createElement("span");if(re=Fe.bg,le=Fe.fg,pe=Fe.extended.ext,te=ot,B=oe,ie=mt,Ue&&$>=Ce&&$<=We&&($=Ce),!this._coreService.isCursorHidden&&De&&this._coreService.isCursorInitialized){if(be.push("xterm-cursor"),this._coreBrowserService.isFocused)F&&be.push("xterm-cursor-blink"),be.push(D==="bar"?"xterm-cursor-bar":D==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(I)switch(I){case"outline":be.push("xterm-cursor-outline");break;case"block":be.push("xterm-cursor-block");break;case"bar":be.push("xterm-cursor-bar");break;case"underline":be.push("xterm-cursor-underline")}}if(Fe.isBold()&&be.push("xterm-bold"),Fe.isItalic()&&be.push("xterm-italic"),Fe.isDim()&&be.push("xterm-dim"),W=Fe.isInvisible()?g.WHITESPACE_CELL_CHAR:Fe.getChars()||g.WHITESPACE_CELL_CHAR,Fe.isUnderline()&&(be.push(`xterm-underline-${Fe.extended.underlineStyle}`),W===" "&&(W=" "),!Fe.isUnderlineColorDefault()))if(Fe.isUnderlineColorRGB())O.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Fe.getUnderlineColor()).join(",")})`;else{let it=Fe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Fe.isBold()&&it<8&&(it+=8),O.style.textDecorationColor=z.ansi[it].css}Fe.isOverline()&&(be.push("xterm-overline"),W===" "&&(W=" ")),Fe.isStrikethrough()&&be.push("xterm-strikethrough"),ot&&(O.style.textDecoration="underline");let Ze=Fe.getFgColor(),ct=Fe.getFgColorMode(),st=Fe.getBgColor(),xe=Fe.getBgColorMode();const Me=!!Fe.isInverse();if(Me){const it=Ze;Ze=st,st=it;const jt=ct;ct=xe,xe=jt}let Ge,Qe,Oe,tt=!1;switch(this._decorationService.forEachDecorationAtCell(Ce,j,void 0,(it=>{it.options.layer!=="top"&&tt||(it.backgroundColorRGB&&(xe=50331648,st=it.backgroundColorRGB.rgba>>8&16777215,Ge=it.backgroundColorRGB),it.foregroundColorRGB&&(ct=50331648,Ze=it.foregroundColorRGB.rgba>>8&16777215,Qe=it.foregroundColorRGB),tt=it.options.layer==="top")})),!tt&&mt&&(Ge=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,st=Ge.rgba>>8&16777215,xe=50331648,tt=!0,z.selectionForeground&&(ct=50331648,Ze=z.selectionForeground.rgba>>8&16777215,Qe=z.selectionForeground)),tt&&be.push("xterm-decoration-top"),xe){case 16777216:case 33554432:Oe=z.ansi[st],be.push(`xterm-bg-${st}`);break;case 50331648:Oe=S.channels.toColor(st>>16,st>>8&255,255&st),this._addStyle(O,`background-color:#${N((st>>>0).toString(16),"0",6)}`);break;default:Me?(Oe=z.foreground,be.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):Oe=z.background}switch(Ge||Fe.isDim()&&(Ge=S.color.multiplyOpacity(Oe,.5)),ct){case 16777216:case 33554432:Fe.isBold()&&Ze<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ze+=8),this._applyMinimumContrast(O,Oe,z.ansi[Ze],Fe,Ge,void 0)||be.push(`xterm-fg-${Ze}`);break;case 50331648:const it=S.channels.toColor(Ze>>16&255,Ze>>8&255,255&Ze);this._applyMinimumContrast(O,Oe,it,Fe,Ge,Qe)||this._addStyle(O,`color:#${N(Ze.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(O,Oe,z.foreground,Fe,Ge,Qe)||Me&&be.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}be.length&&(O.className=be.join(" "),be.length=0),De||Ue||Bt?O.textContent=W:V++,oe!==this.defaultSpacing&&(O.style.letterSpacing=`${oe}px`),Z.push(O),Ce=We}return O&&V&&(O.textContent=W),Z}_applyMinimumContrast(E,j,T,D,I,$){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,w.treatGlyphAsBackgroundColor)(D.getCode()))return!1;const F=this._getContrastCache(D);let U;if(I||$||(U=F.getColor(j.rgba,T.rgba)),U===void 0){const G=this._optionsService.rawOptions.minimumContrastRatio/(D.isDim()?2:1);U=S.color.ensureContrastRatio(I||j,$||T,G),F.setColor((I||j).rgba,($||T).rgba,U??null)}return!!U&&(this._addStyle(E,`color:${U.css}`),!0)}_getContrastCache(E){return E.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(E,j){E.setAttribute("style",`${E.getAttribute("style")||""}${j};`)}_isCellInSelection(E,j){const T=this._selectionStart,D=this._selectionEnd;return!(!T||!D)&&(this._columnSelectMode?T[0]<=D[0]?E>=T[0]&&j>=T[1]&&E=T[1]&&E>=D[0]&&j<=D[1]:j>T[1]&&j=T[0]&&E=T[0])}};function N(E,j,T){for(;E.length{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(u,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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 m=u.createElement("span");m.classList.add("xterm-char-measure-element");const f=u.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const g=u.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const b=u.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[m,f,g,b],this._container.appendChild(m),this._container.appendChild(f),this._container.appendChild(g),this._container.appendChild(b),d.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(u,d,m,f){u===this._font&&d===this._fontSize&&m===this._weight&&f===this._weightBold||(this._font=u,this._fontSize=d,this._weight=m,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(u,d,m){let f=0;if(!d&&!m&&u.length===1&&(f=u.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const k=this._measure(u,0);return k>0&&(this._flat[f]=k),k}let g=u;d&&(g+="B"),m&&(g+="I");let b=this._holey.get(g);if(b===void 0){let k=0;d&&(k|=1),m&&(k|=2),b=this._measure(u,k),b>0&&this._holey.set(g,b)}return b}_measure(u,d){const m=this._measureElements[d];return m.textContent=u.repeat(32),m.offsetWidth/32}}},2223:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(o,l)=>{function u(m){return 57508<=m&&m<=57558}function d(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},l.isPowerlineGlyph=u,l.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},l.isEmoji=d,l.allowRescaling=function(m,f,g,b){return f===1&&g>Math.ceil(1.5*b)&&m!==void 0&&m>255&&!d(m)&&!u(m)&&!(function(k){return 57344<=k&&k<=63743})(m)},l.treatGlyphAsBackgroundColor=function(m){return u(m)||(function(f){return 9472<=f&&f<=9631})(m)},l.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}}}},l.computeNextVariantOffset=function(m,f,g=0){return(m-(2*Math.round(f)-g))%(2*Math.round(f))}},6052:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createSelectionRenderModel=void 0;class u{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(m,f,g,b=!1){if(this.selectionStart=f,this.selectionEnd=g,!f||!g||f[0]===g[0]&&f[1]===g[1])return void this.clear();const k=m.buffers.active.ydisp,S=f[1]-k,x=g[1]-k,_=Math.max(S,0),w=Math.min(x,m.rows-1);_>=m.rows||w<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=S,this.viewportEndRow=x,this.viewportCappedStartRow=_,this.viewportCappedEndRow=w,this.startCol=f[0],this.endCol=g[0])}isCellSelected(m,f,g){return!!this.hasSelection&&(g-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&g>=this.viewportCappedStartRow&&f=this.viewportCappedStartRow&&f>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g=this.startCol&&f=this.startCol)}}l.createSelectionRenderModel=function(){return new u}},456:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(u){this._bufferService=u,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 u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(o,l,u){var d=this&&this.__decorate||function(w,y,C,N){var E,j=arguments.length,T=j<3?y:N===null?N=Object.getOwnPropertyDescriptor(y,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,C,N);else for(var D=w.length-1;D>=0;D--)(E=w[D])&&(T=(j<3?E(T):j>3?E(y,C,T):E(y,C))||T);return j>3&&T&&Object.defineProperty(y,C,T),T},m=this&&this.__param||function(w,y){return function(C,N){y(C,N,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const f=u(2585),g=u(8460),b=u(844);let k=l.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(w,y,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new _(this._optionsService))}catch{this._measureStrategy=this.register(new x(w,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const w=this._measureStrategy.measure();w.width===this.width&&w.height===this.height||(this.width=w.width,this.height=w.height,this._onCharSizeChange.fire())}};l.CharSizeService=k=d([m(2,f.IOptionsService)],k);class S extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,C){y!==void 0&&y>0&&C!==void 0&&C>0&&(this._result.width=y,this._result.height=C)}}class x extends S{constructor(y,C,N){super(),this._document=y,this._parentElement=C,this._optionsService=N,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 _ extends S{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const C=this._ctx.measureText("W");if(!("width"in C&&"fontBoundingBoxAscent"in C&&"fontBoundingBoxDescent"in C))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(o,l,u){var d=this&&this.__decorate||function(_,w,y,C){var N,E=arguments.length,j=E<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(_,w,y,C);else for(var T=_.length-1;T>=0;T--)(N=_[T])&&(j=(E<3?N(j):E>3?N(w,y,j):N(w,y))||j);return E>3&&j&&Object.defineProperty(w,y,j),j},m=this&&this.__param||function(_,w){return function(y,C){w(y,C,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const f=u(3734),g=u(643),b=u(511),k=u(2585);class S extends f.AttributeData{constructor(w,y,C){super(),this.content=0,this.combinedData="",this.fg=w.fg,this.bg=w.bg,this.combinedData=y,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(w){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=S;let x=l.CharacterJoinerService=class AE{constructor(w){this._bufferService=w,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(w){const y={id:this._nextCharacterJoinerId++,handler:w};return this._characterJoiners.push(y),y.id}deregister(w){for(let y=0;y1){const F=this._getJoinedRanges(N,T,j,y,E);for(let U=0;U1){const $=this._getJoinedRanges(N,T,j,y,E);for(let F=0;F<$.length;F++)C.push($[F])}return C}_getJoinedRanges(w,y,C,N,E){const j=w.substring(y,C);let T=[];try{T=this._characterJoiners[0].handler(j)}catch(D){console.error(D)}for(let D=1;D{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const d=u(844),m=u(8460),f=u(3656);class g extends d.Disposable{constructor(S,x,_){super(),this._textarea=S,this._window=x,this.mainDocument=_,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((w=>this._screenDprMonitor.setWindow(w)))),this.register((0,m.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(S){this._window!==S&&(this._window=S,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}}l.CoreBrowserService=g;class b extends d.Disposable{constructor(S){super(),this._parentWindow=S,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(S){this._parentWindow=S,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var S;this._outerListener&&((S=this._resolutionMediaMatchList)==null||S.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:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const d=u(844);class m extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const b=this.linkProviders.indexOf(g);b!==-1&&this.linkProviders.splice(b,1)}}}}l.LinkProviderService=m},8934:function(o,l,u){var d=this&&this.__decorate||function(k,S,x,_){var w,y=arguments.length,C=y<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,x):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(k,S,x,_);else for(var N=k.length-1;N>=0;N--)(w=k[N])&&(C=(y<3?w(C):y>3?w(S,x,C):w(S,x))||C);return y>3&&C&&Object.defineProperty(S,x,C),C},m=this&&this.__param||function(k,S){return function(x,_){S(x,_,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const f=u(4725),g=u(9806);let b=l.MouseService=class{constructor(k,S){this._renderService=k,this._charSizeService=S}getCoords(k,S,x,_,w){return(0,g.getCoords)(window,k,S,x,_,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,w)}getMouseReportCoords(k,S){const x=(0,g.getCoordsRelativeToElement)(window,k,S);if(this._charSizeService.hasValidSize)return x[0]=Math.min(Math.max(x[0],0),this._renderService.dimensions.css.canvas.width-1),x[1]=Math.min(Math.max(x[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(x[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(x[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(x[0]),y:Math.floor(x[1])}}};l.MouseService=b=d([m(0,f.IRenderService),m(1,f.ICharSizeService)],b)},3230:function(o,l,u){var d=this&&this.__decorate||function(w,y,C,N){var E,j=arguments.length,T=j<3?y:N===null?N=Object.getOwnPropertyDescriptor(y,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,C,N);else for(var D=w.length-1;D>=0;D--)(E=w[D])&&(T=(j<3?E(T):j>3?E(y,C,T):E(y,C))||T);return j>3&&T&&Object.defineProperty(y,C,T),T},m=this&&this.__param||function(w,y){return function(C,N){y(C,N,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const f=u(6193),g=u(4725),b=u(8460),k=u(844),S=u(7226),x=u(2585);let _=l.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(w,y,C,N,E,j,T,D){super(),this._rowCount=w,this._charSizeService=N,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new S.DebouncedIdleTask,this._observerDisposable=this.register(new k.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 b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((I,$)=>this._renderRows(I,$)),T),this.register(this._renderDebouncer),this.register(T.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(j.onResize((()=>this._fullRefresh()))),this.register(j.buffers.onBufferActivate((()=>{var I;return(I=this._renderer.value)==null?void 0:I.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(E.onDecorationRegistered((()=>this._fullRefresh()))),this.register(E.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(j.cols,j.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(j.buffer.y,j.buffer.y,!0)))),this.register(D.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(T.window,y),this.register(T.onWindowChange((I=>this._registerIntersectionObserver(I,y))))}_registerIntersectionObserver(w,y){if("IntersectionObserver"in w){const C=new w.IntersectionObserver((N=>this._handleIntersectionChange(N[N.length-1])),{threshold:0});C.observe(y),this._observerDisposable.value=(0,k.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(w){this._isPaused=w.isIntersecting===void 0?w.intersectionRatio===0:!w.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(w,y,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(w,y,this._rowCount))}_renderRows(w,y){this._renderer.value&&(w=Math.min(w,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(w,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:w,end:y}),this._onRender.fire({start:w,end:y}),this._isNextRenderRedrawOnly=!0)}resize(w,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(w){this._renderer.value=w,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(w){return this._renderDebouncer.addRefreshCallback(w)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var w,y;this._renderer.value&&((y=(w=this._renderer.value).clearTextureAtlas)==null||y.call(w),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(w,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(w,y)})):this._renderer.value.handleResize(w,y),this._fullRefresh())}handleCharSizeChanged(){var w;(w=this._renderer.value)==null||w.handleCharSizeChanged()}handleBlur(){var w;(w=this._renderer.value)==null||w.handleBlur()}handleFocus(){var w;(w=this._renderer.value)==null||w.handleFocus()}handleSelectionChanged(w,y,C){var N;this._selectionState.start=w,this._selectionState.end=y,this._selectionState.columnSelectMode=C,(N=this._renderer.value)==null||N.handleSelectionChanged(w,y,C)}handleCursorMove(){var w;(w=this._renderer.value)==null||w.handleCursorMove()}clear(){var w;(w=this._renderer.value)==null||w.clear()}};l.RenderService=_=d([m(2,x.IOptionsService),m(3,g.ICharSizeService),m(4,x.IDecorationService),m(5,x.IBufferService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],_)},9312:function(o,l,u){var d=this&&this.__decorate||function(T,D,I,$){var F,U=arguments.length,G=U<3?D:$===null?$=Object.getOwnPropertyDescriptor(D,I):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(T,D,I,$);else for(var X=T.length-1;X>=0;X--)(F=T[X])&&(G=(U<3?F(G):U>3?F(D,I,G):F(D,I))||G);return U>3&&G&&Object.defineProperty(D,I,G),G},m=this&&this.__param||function(T,D){return function(I,$){D(I,$,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const f=u(9806),g=u(9504),b=u(456),k=u(4725),S=u(8460),x=u(844),_=u(6114),w=u(4841),y=u(511),C=u(2585),N=" ",E=new RegExp(N,"g");let j=l.SelectionService=class extends x.Disposable{constructor(T,D,I,$,F,U,G,X,Y){super(),this._element=T,this._screenElement=D,this._linkifier=I,this._bufferService=$,this._coreService=F,this._mouseService=U,this._optionsService=G,this._renderService=X,this._coreBrowserService=Y,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 S.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new S.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new S.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Z=>this._handleMouseMove(Z),this._mouseUpListener=Z=>this._handleMouseUp(Z),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Z=>this._handleTrim(Z))),this.register(this._bufferService.buffers.onBufferActivate((Z=>this._handleBufferActivate(Z)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,x.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,D=this._model.finalSelectionEnd;return!(!T||!D||T[0]===D[0]&&T[1]===D[1])}get selectionText(){const T=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;if(!T||!D)return"";const I=this._bufferService.buffer,$=[];if(this._activeSelectionMode===3){if(T[0]===D[0])return"";const F=T[0]F.replace(E," "))).join(_.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()))),_.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 D=this._getMouseBufferCoords(T),I=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!!(I&&$&&D)&&this._areCoordsInSelection(D,I,$)}isCellInSelection(T,D){const I=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!(!I||!$)&&this._areCoordsInSelection([T,D],I,$)}_areCoordsInSelection(T,D,I){return T[1]>D[1]&&T[1]=D[0]&&T[0]=D[0]}_selectWordAtCursor(T,D){var F,U;const I=(U=(F=this._linkifier.currentLink)==null?void 0:F.link)==null?void 0:U.range;if(I)return this._model.selectionStart=[I.start.x-1,I.start.y-1],this._model.selectionStartLength=(0,w.getRangeLength)(I,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const $=this._getMouseBufferCoords(T);return!!$&&(this._selectWordAt($,D),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,D){this._model.clearSelection(),T=Math.max(T,0),D=Math.min(D,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,D],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const D=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(D)return D[0]--,D[1]--,D[1]+=this._bufferService.buffer.ydisp,D}_getMouseEventScrollAmount(T){let D=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const I=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=I?0:(D>I&&(D-=I),D=Math.min(Math.max(D,-50),50),D/=50,D/Math.abs(D)+Math.round(14*D))}shouldForceSelection(T){return _.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 D=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);D&&D.length!==this._model.selectionStart[0]&&D.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const D=this._getMouseBufferCoords(T);D&&(this._activeSelectionMode=2,this._selectLineAt(D[1]))}shouldColumnSelect(T){return T.altKey&&!(_.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.stopImmediatePropagation(),!this._model.selectionStart)return;const D=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]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const I=this._bufferService.buffer;if(this._model.selectionEnd[1]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 D=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&D<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const I=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(I&&I[0]!==void 0&&I[1]!==void 0){const $=(0,g.moveToCellSequence)(I[0]-1,I[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent($,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,D=this._model.finalSelectionEnd,I=!(!T||!D||T[0]===D[0]&&T[1]===D[1]);I?T&&D&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&D[0]===this._oldSelectionEnd[0]&&D[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,D,I)):this._oldHasSelection&&this._fireOnSelectionChange(T,D,I)}_fireOnSelectionChange(T,D,I){this._oldSelectionStart=T,this._oldSelectionEnd=D,this._oldHasSelection=I,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((D=>this._handleTrim(D)))}_convertViewportColToCharacterIndex(T,D){let I=D;for(let $=0;D>=$;$++){const F=T.loadCell($,this._workCell).getChars().length;this._workCell.getWidth()===0?I--:F>1&&D!==$&&(I+=F-1)}return I}setSelection(T,D,I){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,D],this._model.selectionStartLength=I,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,D,I=!0,$=!0){if(T[0]>=this._bufferService.cols)return;const F=this._bufferService.buffer,U=F.lines.get(T[1]);if(!U)return;const G=F.translateBufferLineToString(T[1],!1);let X=this._convertViewportColToCharacterIndex(U,T[0]),Y=X;const Z=T[0]-X;let Q=0,z=0,O=0,H=0;if(G.charAt(X)===" "){for(;X>0&&G.charAt(X-1)===" ";)X--;for(;Y1&&(H+=pe-1,Y+=pe-1);re>0&&X>0&&!this._isCharWordSeparator(U.loadCell(re-1,this._workCell));){U.loadCell(re-1,this._workCell);const te=this._workCell.getChars().length;this._workCell.getWidth()===0?(Q++,re--):te>1&&(O+=te-1,X-=te-1),X--,re--}for(;le1&&(H+=te-1,Y+=te-1),Y++,le++}}Y++;let V=X+Z-Q+O,W=Math.min(this._bufferService.cols,Y-X+Q+z-O-H);if(D||G.slice(X,Y).trim()!==""){if(I&&V===0&&U.getCodePoint(0)!==32){const re=F.lines.get(T[1]-1);if(re&&U.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const le=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(le){const pe=this._bufferService.cols-le.start;V-=pe,W+=pe}}}if($&&V+W===this._bufferService.cols&&U.getCodePoint(this._bufferService.cols-1)!==32){const re=F.lines.get(T[1]+1);if(re!=null&&re.isWrapped&&re.getCodePoint(0)!==32){const le=this._getWordAt([0,T[1]+1],!1,!1,!0);le&&(W+=le.length)}}return{start:V,length:W}}}_selectWordAt(T,D){const I=this._getWordAt(T,D);if(I){for(;I.start<0;)I.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[I.start,T[1]],this._model.selectionStartLength=I.length}}_selectToWordAt(T){const D=this._getWordAt(T,!0);if(D){let I=T[1];for(;D.start<0;)D.start+=this._bufferService.cols,I--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,I++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,I]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const D=this._bufferService.buffer.getWrappedRangeForLine(T),I={start:{x:0,y:D.first},end:{x:this._bufferService.cols-1,y:D.last}};this._model.selectionStart=[0,D.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,w.getRangeLength)(I,this._bufferService.cols)}};l.SelectionService=j=d([m(3,C.IBufferService),m(4,C.ICoreService),m(5,k.IMouseService),m(6,C.IOptionsService),m(7,k.IRenderService),m(8,k.ICoreBrowserService)],j)},4725:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const d=u(8343);l.ICharSizeService=(0,d.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),l.IMouseService=(0,d.createDecorator)("MouseService"),l.IRenderService=(0,d.createDecorator)("RenderService"),l.ISelectionService=(0,d.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,d.createDecorator)("ThemeService"),l.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(o,l,u){var d=this&&this.__decorate||function(j,T,D,I){var $,F=arguments.length,U=F<3?T:I===null?I=Object.getOwnPropertyDescriptor(T,D):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(j,T,D,I);else for(var G=j.length-1;G>=0;G--)($=j[G])&&(U=(F<3?$(U):F>3?$(T,D,U):$(T,D))||U);return F>3&&U&&Object.defineProperty(T,D,U),U},m=this&&this.__param||function(j,T){return function(D,I){T(D,I,j)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const f=u(7239),g=u(8055),b=u(8460),k=u(844),S=u(2585),x=g.css.toColor("#ffffff"),_=g.css.toColor("#000000"),w=g.css.toColor("#ffffff"),y=g.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const j=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],T=[0,95,135,175,215,255];for(let D=0;D<216;D++){const I=T[D/36%6|0],$=T[D/6%6|0],F=T[D%6];j.push({css:g.channels.toCss(I,$,F),rgba:g.channels.toRgba(I,$,F)})}for(let D=0;D<24;D++){const I=8+10*D;j.push({css:g.channels.toCss(I,I,I),rgba:g.channels.toRgba(I,I,I)})}return j})());let N=l.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(j){super(),this._optionsService=j,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:x,background:_,cursor:w,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:g.color.blend(_,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:g.color.blend(_,C),ansi:l.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(j={}){const T=this._colors;if(T.foreground=E(j.foreground,x),T.background=E(j.background,_),T.cursor=E(j.cursor,w),T.cursorAccent=E(j.cursorAccent,y),T.selectionBackgroundTransparent=E(j.selectionBackground,C),T.selectionBackgroundOpaque=g.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=E(j.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=g.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=j.selectionForeground?E(j.selectionForeground,g.NULL_COLOR):void 0,T.selectionForeground===g.NULL_COLOR&&(T.selectionForeground=void 0),g.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=g.color.opacity(T.selectionBackgroundTransparent,.3)),g.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=g.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=l.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=E(j.black,l.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=E(j.red,l.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=E(j.green,l.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=E(j.yellow,l.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=E(j.blue,l.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=E(j.magenta,l.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=E(j.cyan,l.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=E(j.white,l.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=E(j.brightBlack,l.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=E(j.brightRed,l.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=E(j.brightGreen,l.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=E(j.brightYellow,l.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=E(j.brightBlue,l.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=E(j.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=E(j.brightCyan,l.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=E(j.brightWhite,l.DEFAULT_ANSI_COLORS[15]),j.extendedAnsi){const D=Math.min(T.ansi.length-16,j.extendedAnsi.length);for(let I=0;I{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const d=u(8460),m=u(844);class f extends m.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.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(b){if(this._maxLength===b)return;const k=new Array(b);for(let S=0;Sthis._length)for(let k=this._length;k=b;x--)this._array[this._getCyclicIndex(x+S.length)]=this._array[this._getCyclicIndex(x)];for(let x=0;xthis._maxLength){const x=this._length+S.length-this._maxLength;this._startIndex+=x,this._length=this._maxLength,this.onTrimEmitter.fire(x)}else this._length+=S.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,k,S){if(!(k<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let _=k-1;_>=0;_--)this.set(b+_+S,this.get(b+_));const x=b+k+S-this._length;if(x>0)for(this._length+=x;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let x=0;x{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function u(d,m=5){if(typeof d!="object")return d;const f=Array.isArray(d)?[]:{};for(const g in d)f[g]=m<=1?d[g]:d[g]&&u(d[g],m-1);return f}},8055:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let u=0,d=0,m=0,f=0;var g,b,k,S,x;function _(y){const C=y.toString(16);return C.length<2?"0"+C:C}function w(y,C){return y>>0},y.toColor=function(C,N,E,j){return{css:y.toCss(C,N,E,j),rgba:y.toRgba(C,N,E,j)}}})(g||(l.channels=g={})),(function(y){function C(N,E){return f=Math.round(255*E),[u,d,m]=x.toChannels(N.rgba),{css:g.toCss(u,d,m,f),rgba:g.toRgba(u,d,m,f)}}y.blend=function(N,E){if(f=(255&E.rgba)/255,f===1)return{css:E.css,rgba:E.rgba};const j=E.rgba>>24&255,T=E.rgba>>16&255,D=E.rgba>>8&255,I=N.rgba>>24&255,$=N.rgba>>16&255,F=N.rgba>>8&255;return u=I+Math.round((j-I)*f),d=$+Math.round((T-$)*f),m=F+Math.round((D-F)*f),{css:g.toCss(u,d,m),rgba:g.toRgba(u,d,m)}},y.isOpaque=function(N){return(255&N.rgba)==255},y.ensureContrastRatio=function(N,E,j){const T=x.ensureContrastRatio(N.rgba,E.rgba,j);if(T)return g.toColor(T>>24&255,T>>16&255,T>>8&255)},y.opaque=function(N){const E=(255|N.rgba)>>>0;return[u,d,m]=x.toChannels(E),{css:g.toCss(u,d,m),rgba:E}},y.opacity=C,y.multiplyOpacity=function(N,E){return f=255&N.rgba,C(N,f*E/255)},y.toColorRGB=function(N){return[N.rgba>>24&255,N.rgba>>16&255,N.rgba>>8&255]}})(b||(l.color=b={})),(function(y){let C,N;try{const E=document.createElement("canvas");E.width=1,E.height=1;const j=E.getContext("2d",{willReadFrequently:!0});j&&(C=j,C.globalCompositeOperation="copy",N=C.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(E){if(E.match(/#[\da-f]{3,8}/i))switch(E.length){case 4:return u=parseInt(E.slice(1,2).repeat(2),16),d=parseInt(E.slice(2,3).repeat(2),16),m=parseInt(E.slice(3,4).repeat(2),16),g.toColor(u,d,m);case 5:return u=parseInt(E.slice(1,2).repeat(2),16),d=parseInt(E.slice(2,3).repeat(2),16),m=parseInt(E.slice(3,4).repeat(2),16),f=parseInt(E.slice(4,5).repeat(2),16),g.toColor(u,d,m,f);case 7:return{css:E,rgba:(parseInt(E.slice(1),16)<<8|255)>>>0};case 9:return{css:E,rgba:parseInt(E.slice(1),16)>>>0}}const j=E.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(j)return u=parseInt(j[1]),d=parseInt(j[2]),m=parseInt(j[3]),f=Math.round(255*(j[5]===void 0?1:parseFloat(j[5]))),g.toColor(u,d,m,f);if(!C||!N)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=N,C.fillStyle=E,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[u,d,m,f]=C.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(u,d,m,f),css:E}}})(k||(l.css=k={})),(function(y){function C(N,E,j){const T=N/255,D=E/255,I=j/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.0722*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))}y.relativeLuminance=function(N){return C(N>>16&255,N>>8&255,255&N)},y.relativeLuminance2=C})(S||(l.rgb=S={})),(function(y){function C(E,j,T){const D=E>>24&255,I=E>>16&255,$=E>>8&255;let F=j>>24&255,U=j>>16&255,G=j>>8&255,X=w(S.relativeLuminance2(F,U,G),S.relativeLuminance2(D,I,$));for(;X0||U>0||G>0);)F-=Math.max(0,Math.ceil(.1*F)),U-=Math.max(0,Math.ceil(.1*U)),G-=Math.max(0,Math.ceil(.1*G)),X=w(S.relativeLuminance2(F,U,G),S.relativeLuminance2(D,I,$));return(F<<24|U<<16|G<<8|255)>>>0}function N(E,j,T){const D=E>>24&255,I=E>>16&255,$=E>>8&255;let F=j>>24&255,U=j>>16&255,G=j>>8&255,X=w(S.relativeLuminance2(F,U,G),S.relativeLuminance2(D,I,$));for(;X>>0}y.blend=function(E,j){if(f=(255&j)/255,f===1)return j;const T=j>>24&255,D=j>>16&255,I=j>>8&255,$=E>>24&255,F=E>>16&255,U=E>>8&255;return u=$+Math.round((T-$)*f),d=F+Math.round((D-F)*f),m=U+Math.round((I-U)*f),g.toRgba(u,d,m)},y.ensureContrastRatio=function(E,j,T){const D=S.relativeLuminance(E>>8),I=S.relativeLuminance(j>>8);if(w(D,I)>8));if(Gw(D,S.relativeLuminance(X>>8))?U:X}return U}const $=N(E,j,T),F=w(D,S.relativeLuminance($>>8));if(Fw(D,S.relativeLuminance(U>>8))?$:U}return $}},y.reduceLuminance=C,y.increaseLuminance=N,y.toChannels=function(E){return[E>>24&255,E>>16&255,E>>8&255,255&E]}})(x||(l.rgba=x={})),l.toPaddedHex=_,l.contrastRatio=w},8969:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const d=u(844),m=u(2585),f=u(4348),g=u(7866),b=u(744),k=u(7302),S=u(6975),x=u(8460),_=u(1753),w=u(1480),y=u(7994),C=u(9282),N=u(5435),E=u(5981),j=u(2660);let T=!1;class D extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new x.EventEmitter),this._onScroll.event(($=>{var F;(F=this._onScrollApi)==null||F.fire($.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($){for(const F in $)this.optionsService.options[F]=$[F]}constructor($){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new x.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new x.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new x.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new x.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new x.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new x.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new k.OptionsService($)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(_.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(w.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(j.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new N.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,x.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,x.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,x.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,x.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((F=>{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((F=>{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 E.WriteBuffer(((F,U)=>this._inputHandler.parse(F,U)))),this.register((0,x.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write($,F){this._writeBuffer.write($,F)}writeSync($,F){this._logService.logLevel<=m.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync($,F)}input($,F=!0){this.coreService.triggerDataEvent($,F)}resize($,F){isNaN($)||isNaN(F)||($=Math.max($,b.MINIMUM_COLS),F=Math.max(F,b.MINIMUM_ROWS),this._bufferService.resize($,F))}scroll($,F=!1){this._bufferService.scroll($,F)}scrollLines($,F,U){this._bufferService.scrollLines($,F,U)}scrollPages($){this.scrollLines($*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine($){const F=$-this._bufferService.buffer.ydisp;F!==0&&this.scrollLines(F)}registerEscHandler($,F){return this._inputHandler.registerEscHandler($,F)}registerDcsHandler($,F){return this._inputHandler.registerDcsHandler($,F)}registerCsiHandler($,F){return this._inputHandler.registerCsiHandler($,F)}registerOscHandler($,F){return this._inputHandler.registerOscHandler($,F)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let $=!1;const F=this.optionsService.rawOptions.windowsPty;F&&F.buildNumber!==void 0&&F.buildNumber!==void 0?$=F.backend==="conpty"&&F.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&($=!0),$?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const $=[];$.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),$.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const F of $)F.dispose()}))}}}l.CoreTerminal=D},8460:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;dd.fire(m)))},l.runAndSubscribe=function(u,d){return d(void 0),u((m=>d(m)))}},5435:function(o,l,u){var d=this&&this.__decorate||function(Q,z,O,H){var V,W=arguments.length,re=W<3?z:H===null?H=Object.getOwnPropertyDescriptor(z,O):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(Q,z,O,H);else for(var le=Q.length-1;le>=0;le--)(V=Q[le])&&(re=(W<3?V(re):W>3?V(z,O,re):V(z,O))||re);return W>3&&re&&Object.defineProperty(z,O,re),re},m=this&&this.__param||function(Q,z){return function(O,H){z(O,H,Q)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const f=u(2584),g=u(7116),b=u(2015),k=u(844),S=u(482),x=u(8437),_=u(8460),w=u(643),y=u(511),C=u(3734),N=u(2585),E=u(1480),j=u(6242),T=u(6351),D=u(5941),I={"(":0,")":1,"*":2,"+":3,"-":1,".":2},$=131072;function F(Q,z){if(Q>24)return z.setWinLines||!1;switch(Q){case 1:return!!z.restoreWin;case 2:return!!z.minimizeWin;case 3:return!!z.setWinPosition;case 4:return!!z.setWinSizePixels;case 5:return!!z.raiseWin;case 6:return!!z.lowerWin;case 7:return!!z.refreshWin;case 8:return!!z.setWinSizeChars;case 9:return!!z.maximizeWin;case 10:return!!z.fullscreenWin;case 11:return!!z.getWinState;case 13:return!!z.getWinPosition;case 14:return!!z.getWinSizePixels;case 15:return!!z.getScreenSizePixels;case 16:return!!z.getCellSizePixels;case 18:return!!z.getWinSizeChars;case 19:return!!z.getScreenSizeChars;case 20:return!!z.getIconTitle;case 21:return!!z.getWinTitle;case 22:return!!z.pushTitle;case 23:return!!z.popTitle;case 24:return!!z.setWinLines}return!1}var U;(function(Q){Q[Q.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Q[Q.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(U||(l.WindowsOptionsReportType=U={}));let G=0;class X extends k.Disposable{getAttrData(){return this._curAttrData}constructor(z,O,H,V,W,re,le,pe,te=new b.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=O,this._coreService=H,this._logService=V,this._optionsService=W,this._oscLinkService=re,this._coreMouseService=le,this._unicodeService=pe,this._parser=te,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=x.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=x.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new _.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new _.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new _.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new _.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new _.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new _.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new _.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new _.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new _.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new _.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new _.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new _.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 Y(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._parser.setCsiHandlerFallback(((B,ie)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(B),params:ie.toArray()})})),this._parser.setEscHandlerFallback((B=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(B)})})),this._parser.setExecuteHandlerFallback((B=>{this._logService.debug("Unknown EXECUTE code: ",{code:B})})),this._parser.setOscHandlerFallback(((B,ie,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:B,action:ie,data:oe})})),this._parser.setDcsHandlerFallback(((B,ie,oe)=>{ie==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(B),action:ie,payload:oe})})),this._parser.setPrintHandler(((B,ie,oe)=>this.print(B,ie,oe))),this._parser.registerCsiHandler({final:"@"},(B=>this.insertChars(B))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(B=>this.scrollLeft(B))),this._parser.registerCsiHandler({final:"A"},(B=>this.cursorUp(B))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(B=>this.scrollRight(B))),this._parser.registerCsiHandler({final:"B"},(B=>this.cursorDown(B))),this._parser.registerCsiHandler({final:"C"},(B=>this.cursorForward(B))),this._parser.registerCsiHandler({final:"D"},(B=>this.cursorBackward(B))),this._parser.registerCsiHandler({final:"E"},(B=>this.cursorNextLine(B))),this._parser.registerCsiHandler({final:"F"},(B=>this.cursorPrecedingLine(B))),this._parser.registerCsiHandler({final:"G"},(B=>this.cursorCharAbsolute(B))),this._parser.registerCsiHandler({final:"H"},(B=>this.cursorPosition(B))),this._parser.registerCsiHandler({final:"I"},(B=>this.cursorForwardTab(B))),this._parser.registerCsiHandler({final:"J"},(B=>this.eraseInDisplay(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(B=>this.eraseInDisplay(B,!0))),this._parser.registerCsiHandler({final:"K"},(B=>this.eraseInLine(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(B=>this.eraseInLine(B,!0))),this._parser.registerCsiHandler({final:"L"},(B=>this.insertLines(B))),this._parser.registerCsiHandler({final:"M"},(B=>this.deleteLines(B))),this._parser.registerCsiHandler({final:"P"},(B=>this.deleteChars(B))),this._parser.registerCsiHandler({final:"S"},(B=>this.scrollUp(B))),this._parser.registerCsiHandler({final:"T"},(B=>this.scrollDown(B))),this._parser.registerCsiHandler({final:"X"},(B=>this.eraseChars(B))),this._parser.registerCsiHandler({final:"Z"},(B=>this.cursorBackwardTab(B))),this._parser.registerCsiHandler({final:"`"},(B=>this.charPosAbsolute(B))),this._parser.registerCsiHandler({final:"a"},(B=>this.hPositionRelative(B))),this._parser.registerCsiHandler({final:"b"},(B=>this.repeatPrecedingCharacter(B))),this._parser.registerCsiHandler({final:"c"},(B=>this.sendDeviceAttributesPrimary(B))),this._parser.registerCsiHandler({prefix:">",final:"c"},(B=>this.sendDeviceAttributesSecondary(B))),this._parser.registerCsiHandler({final:"d"},(B=>this.linePosAbsolute(B))),this._parser.registerCsiHandler({final:"e"},(B=>this.vPositionRelative(B))),this._parser.registerCsiHandler({final:"f"},(B=>this.hVPosition(B))),this._parser.registerCsiHandler({final:"g"},(B=>this.tabClear(B))),this._parser.registerCsiHandler({final:"h"},(B=>this.setMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(B=>this.setModePrivate(B))),this._parser.registerCsiHandler({final:"l"},(B=>this.resetMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(B=>this.resetModePrivate(B))),this._parser.registerCsiHandler({final:"m"},(B=>this.charAttributes(B))),this._parser.registerCsiHandler({final:"n"},(B=>this.deviceStatus(B))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(B=>this.deviceStatusPrivate(B))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(B=>this.softReset(B))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(B=>this.setCursorStyle(B))),this._parser.registerCsiHandler({final:"r"},(B=>this.setScrollRegion(B))),this._parser.registerCsiHandler({final:"s"},(B=>this.saveCursor(B))),this._parser.registerCsiHandler({final:"t"},(B=>this.windowOptions(B))),this._parser.registerCsiHandler({final:"u"},(B=>this.restoreCursor(B))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(B=>this.insertColumns(B))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(B=>this.deleteColumns(B))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(B=>this.selectProtected(B))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(B=>this.requestMode(B,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(B=>this.requestMode(B,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new j.OscHandler((B=>(this.setTitle(B),this.setIconName(B),!0)))),this._parser.registerOscHandler(1,new j.OscHandler((B=>this.setIconName(B)))),this._parser.registerOscHandler(2,new j.OscHandler((B=>this.setTitle(B)))),this._parser.registerOscHandler(4,new j.OscHandler((B=>this.setOrReportIndexedColor(B)))),this._parser.registerOscHandler(8,new j.OscHandler((B=>this.setHyperlink(B)))),this._parser.registerOscHandler(10,new j.OscHandler((B=>this.setOrReportFgColor(B)))),this._parser.registerOscHandler(11,new j.OscHandler((B=>this.setOrReportBgColor(B)))),this._parser.registerOscHandler(12,new j.OscHandler((B=>this.setOrReportCursorColor(B)))),this._parser.registerOscHandler(104,new j.OscHandler((B=>this.restoreIndexedColor(B)))),this._parser.registerOscHandler(110,new j.OscHandler((B=>this.restoreFgColor(B)))),this._parser.registerOscHandler(111,new j.OscHandler((B=>this.restoreBgColor(B)))),this._parser.registerOscHandler(112,new j.OscHandler((B=>this.restoreCursorColor(B)))),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 B in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:B},(()=>this.selectCharset("("+B))),this._parser.registerEscHandler({intermediates:")",final:B},(()=>this.selectCharset(")"+B))),this._parser.registerEscHandler({intermediates:"*",final:B},(()=>this.selectCharset("*"+B))),this._parser.registerEscHandler({intermediates:"+",final:B},(()=>this.selectCharset("+"+B))),this._parser.registerEscHandler({intermediates:"-",final:B},(()=>this.selectCharset("-"+B))),this._parser.registerEscHandler({intermediates:".",final:B},(()=>this.selectCharset("."+B))),this._parser.registerEscHandler({intermediates:"/",final:B},(()=>this.selectCharset("/"+B)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((B=>(this._logService.error("Parsing error: ",B),B))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler(((B,ie)=>this.requestStatusString(B,ie))))}_preserveStack(z,O,H,V){this._parseStack.paused=!0,this._parseStack.cursorStartX=z,this._parseStack.cursorStartY=O,this._parseStack.decodedLength=H,this._parseStack.position=V}_logSlowResolvingAsync(z){this._logService.logLevel<=N.LogLevelEnum.WARN&&Promise.race([z,new Promise(((O,H)=>setTimeout((()=>H("#SLOW_TIMEOUT")),5e3)))]).catch((O=>{if(O!=="#SLOW_TIMEOUT")throw O;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(z,O){let H,V=this._activeBuffer.x,W=this._activeBuffer.y,re=0;const le=this._parseStack.paused;if(le){if(H=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,O))return this._logSlowResolvingAsync(H),H;V=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,z.length>$&&(re=this._parseStack.position+$)}if(this._logService.logLevel<=N.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof z=="string"?` "${z}"`:` "${Array.prototype.map.call(z,(B=>String.fromCharCode(B))).join("")}"`),typeof z=="string"?z.split("").map((B=>B.charCodeAt(0))):z),this._parseBuffer.length$)for(let B=re;B0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ie);let be=this._parser.precedingJoinState;for(let ge=O;gepe){if(te){const We=oe;let Fe=this._activeBuffer.x-Ue;for(this._activeBuffer.x=Ue,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),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ue>0&&oe instanceof x.BufferLine&&oe.copyCellsFrom(We,Fe,0,Ue,!1);Fe=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}else if(B&&(oe.insertCells(this._activeBuffer.x,W-Ue,this._activeBuffer.getNullCell(ie)),oe.getWidth(pe-1)===2&&oe.setCellFromCodepoint(pe-1,w.NULL_CELL_CODE,w.NULL_CELL_WIDTH,ie)),oe.setCellFromCodepoint(this._activeBuffer.x++,V,W,ie),W>0)for(;--W;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}this._parser.precedingJoinState=be,this._activeBuffer.x0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,ie),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(z,O){return z.final!=="t"||z.prefix||z.intermediates?this._parser.registerCsiHandler(z,O):this._parser.registerCsiHandler(z,(H=>!F(H.params[0],this._optionsService.rawOptions.windowOptions)||O(H)))}registerDcsHandler(z,O){return this._parser.registerDcsHandler(z,new T.DcsHandler(O))}registerEscHandler(z,O){return this._parser.registerEscHandler(z,O)}registerOscHandler(z,O){return this._parser.registerOscHandler(z,new j.OscHandler(O))}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 z;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&&((z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&z.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);O.hasWidth(this._activeBuffer.x)&&!O.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const z=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-z),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(z=this._bufferService.cols-1){this._activeBuffer.x=Math.min(z,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(z,O){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=z,this._activeBuffer.y=this._activeBuffer.scrollTop+O):(this._activeBuffer.x=z,this._activeBuffer.y=O),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(z,O){this._restrictCursor(),this._setCursor(this._activeBuffer.x+z,this._activeBuffer.y+O)}cursorUp(z){const O=this._activeBuffer.y-this._activeBuffer.scrollTop;return O>=0?this._moveCursor(0,-Math.min(O,z.params[0]||1)):this._moveCursor(0,-(z.params[0]||1)),!0}cursorDown(z){const O=this._activeBuffer.scrollBottom-this._activeBuffer.y;return O>=0?this._moveCursor(0,Math.min(O,z.params[0]||1)):this._moveCursor(0,z.params[0]||1),!0}cursorForward(z){return this._moveCursor(z.params[0]||1,0),!0}cursorBackward(z){return this._moveCursor(-(z.params[0]||1),0),!0}cursorNextLine(z){return this.cursorDown(z),this._activeBuffer.x=0,!0}cursorPrecedingLine(z){return this.cursorUp(z),this._activeBuffer.x=0,!0}cursorCharAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(z){return this._setCursor(z.length>=2?(z.params[1]||1)-1:0,(z.params[0]||1)-1),!0}charPosAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(z){return this._moveCursor(z.params[0]||1,0),!0}linePosAbsolute(z){return this._setCursor(this._activeBuffer.x,(z.params[0]||1)-1),!0}vPositionRelative(z){return this._moveCursor(0,z.params[0]||1),!0}hVPosition(z){return this.cursorPosition(z),!0}tabClear(z){const O=z.params[0];return O===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:O===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=z.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=z.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(z){const O=z.params[0];return O===1&&(this._curAttrData.bg|=536870912),O!==2&&O!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(z,O,H,V=!1,W=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);re.replaceCells(O,H,this._activeBuffer.getNullCell(this._eraseAttrData()),W),V&&(re.isWrapped=!1)}_resetBufferLine(z,O=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);H&&(H.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),O),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+z),H.isWrapped=!1)}eraseInDisplay(z,O=!1){let H;switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:for(H=this._activeBuffer.y,this._dirtyRowTracker.markDirty(H),this._eraseInBufferLine(H++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);H=this._bufferService.cols&&(this._activeBuffer.lines.get(H+1).isWrapped=!1);H--;)this._resetBufferLine(H,O);this._dirtyRowTracker.markDirty(0);break;case 2:for(H=this._bufferService.rows,this._dirtyRowTracker.markDirty(H-1);H--;)this._resetBufferLine(H,O);this._dirtyRowTracker.markDirty(0);break;case 3:const V=this._activeBuffer.lines.length-this._bufferService.rows;V>0&&(this._activeBuffer.lines.trimStart(V),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-V,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-V,0),this._onScroll.fire(0))}return!0}eraseInLine(z,O=!1){switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,O);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,O)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(z){this._restrictCursor();let O=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let te=pe;for(let B=1;B0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(z){return z.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(z.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(z){return(this._optionsService.rawOptions.termName+"").indexOf(z)===0}setMode(z){for(let O=0;OLe?1:2,be=z.params[0];return ge=be,Ce=O?be===2?4:be===4?oe(re.modes.insertMode):be===12?3:be===20?oe(ie.convertEol):0:be===1?oe(H.applicationCursorKeys):be===3?ie.windowOptions.setWinLines?pe===80?2:pe===132?1:0:0:be===6?oe(H.origin):be===7?oe(H.wraparound):be===8?3:be===9?oe(V==="X10"):be===12?oe(ie.cursorBlink):be===25?oe(!re.isCursorHidden):be===45?oe(H.reverseWraparound):be===66?oe(H.applicationKeypad):be===67?4:be===1e3?oe(V==="VT200"):be===1002?oe(V==="DRAG"):be===1003?oe(V==="ANY"):be===1004?oe(H.sendFocus):be===1005?4:be===1006?oe(W==="SGR"):be===1015?4:be===1016?oe(W==="SGR_PIXELS"):be===1048?1:be===47||be===1047||be===1049?oe(te===B):be===2004?oe(H.bracketedPasteMode):0,re.triggerDataEvent(`${f.C0.ESC}[${O?"":"?"}${ge};${Ce}$y`),!0;var ge,Ce}_updateAttrColor(z,O,H,V,W){return O===2?(z|=50331648,z&=-16777216,z|=C.AttributeData.fromColorRGB([H,V,W])):O===5&&(z&=-50331904,z|=33554432|255&H),z}_extractColor(z,O,H){const V=[0,0,-1,0,0,0];let W=0,re=0;do{if(V[re+W]=z.params[O+re],z.hasSubParams(O+re)){const le=z.getSubParams(O+re);let pe=0;do V[1]===5&&(W=1),V[re+pe+1+W]=le[pe];while(++pe=2||V[1]===2&&re+W>=5)break;V[1]&&(W=1)}while(++re+O5)&&(z=1),O.extended.underlineStyle=z,O.fg|=268435456,z===0&&(O.fg&=-268435457),O.updateExtended()}_processSGR0(z){z.fg=x.DEFAULT_ATTR_DATA.fg,z.bg=x.DEFAULT_ATTR_DATA.bg,z.extended=z.extended.clone(),z.extended.underlineStyle=0,z.extended.underlineColor&=-67108864,z.updateExtended()}charAttributes(z){if(z.length===1&&z.params[0]===0)return this._processSGR0(this._curAttrData),!0;const O=z.length;let H;const V=this._curAttrData;for(let W=0;W=30&&H<=37?(V.fg&=-50331904,V.fg|=16777216|H-30):H>=40&&H<=47?(V.bg&=-50331904,V.bg|=16777216|H-40):H>=90&&H<=97?(V.fg&=-50331904,V.fg|=16777224|H-90):H>=100&&H<=107?(V.bg&=-50331904,V.bg|=16777224|H-100):H===0?this._processSGR0(V):H===1?V.fg|=134217728:H===3?V.bg|=67108864:H===4?(V.fg|=268435456,this._processUnderline(z.hasSubParams(W)?z.getSubParams(W)[0]:1,V)):H===5?V.fg|=536870912:H===7?V.fg|=67108864:H===8?V.fg|=1073741824:H===9?V.fg|=2147483648:H===2?V.bg|=134217728:H===21?this._processUnderline(2,V):H===22?(V.fg&=-134217729,V.bg&=-134217729):H===23?V.bg&=-67108865:H===24?(V.fg&=-268435457,this._processUnderline(0,V)):H===25?V.fg&=-536870913:H===27?V.fg&=-67108865:H===28?V.fg&=-1073741825:H===29?V.fg&=2147483647:H===39?(V.fg&=-67108864,V.fg|=16777215&x.DEFAULT_ATTR_DATA.fg):H===49?(V.bg&=-67108864,V.bg|=16777215&x.DEFAULT_ATTR_DATA.bg):H===38||H===48||H===58?W+=this._extractColor(z,W,V):H===53?V.bg|=1073741824:H===55?V.bg&=-1073741825:H===59?(V.extended=V.extended.clone(),V.extended.underlineColor=-1,V.updateExtended()):H===100?(V.fg&=-67108864,V.fg|=16777215&x.DEFAULT_ATTR_DATA.fg,V.bg&=-67108864,V.bg|=16777215&x.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",H);return!0}deviceStatus(z){switch(z.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const O=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${O};${H}R`)}return!0}deviceStatusPrivate(z){if(z.params[0]===6){const O=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${O};${H}R`)}return!0}softReset(z){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=x.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(z){const O=z.params[0]||1;switch(O){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 H=O%2==1;return this._optionsService.options.cursorBlink=H,!0}setScrollRegion(z){const O=z.params[0]||1;let H;return(z.length<2||(H=z.params[1])>this._bufferService.rows||H===0)&&(H=this._bufferService.rows),H>O&&(this._activeBuffer.scrollTop=O-1,this._activeBuffer.scrollBottom=H-1,this._setCursor(0,0)),!0}windowOptions(z){if(!F(z.params[0],this._optionsService.rawOptions.windowOptions))return!0;const O=z.length>1?z.params[1]:0;switch(z.params[0]){case 14:O!==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(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:O!==0&&O!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),O!==0&&O!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:O!==0&&O!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),O!==0&&O!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(z){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(z){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(z){return this._windowTitle=z,this._onTitleChange.fire(z),!0}setIconName(z){return this._iconName=z,!0}setOrReportIndexedColor(z){const O=[],H=z.split(";");for(;H.length>1;){const V=H.shift(),W=H.shift();if(/^\d+$/.exec(V)){const re=parseInt(V);if(Z(re))if(W==="?")O.push({type:0,index:re});else{const le=(0,D.parseColor)(W);le&&O.push({type:1,index:re,color:le})}}}return O.length&&this._onColor.fire(O),!0}setHyperlink(z){const O=z.split(";");return!(O.length<2)&&(O[1]?this._createHyperlink(O[0],O[1]):!O[0]&&this._finishHyperlink())}_createHyperlink(z,O){this._getCurrentLinkId()&&this._finishHyperlink();const H=z.split(":");let V;const W=H.findIndex((re=>re.startsWith("id=")));return W!==-1&&(V=H[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:V,uri:O}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(z,O){const H=z.split(";");for(let V=0;V=this._specialColors.length);++V,++O)if(H[V]==="?")this._onColor.fire([{type:0,index:this._specialColors[O]}]);else{const W=(0,D.parseColor)(H[V]);W&&this._onColor.fire([{type:1,index:this._specialColors[O],color:W}])}return!0}setOrReportFgColor(z){return this._setOrReportSpecialColor(z,0)}setOrReportBgColor(z){return this._setOrReportSpecialColor(z,1)}setOrReportCursorColor(z){return this._setOrReportSpecialColor(z,2)}restoreIndexedColor(z){if(!z)return this._onColor.fire([{type:2}]),!0;const O=[],H=z.split(";");for(let V=0;V=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 z=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,z,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=x.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=x.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(z){return this._charsetService.setgLevel(z),!0}screenAlignmentPattern(){const z=new y.CellData;z.content=4194373,z.fg=this._curAttrData.fg,z.bg=this._curAttrData.bg,this._setCursor(0,0);for(let O=0;O(this._coreService.triggerDataEvent(`${f.C0.ESC}${W}${f.C0.ESC}\\`),!0))(z==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:z==='"p'?'P1$r61;1"p':z==="r"?`P1$r${H.scrollTop+1};${H.scrollBottom+1}r`:z==="m"?"P1$r0m":z===" q"?`P1$r${{block:2,underline:4,bar:6}[V.cursorStyle]-(V.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(z,O){this._dirtyRowTracker.markRangeDirty(z,O)}}l.InputHandler=X;let Y=class{constructor(Q){this._bufferService=Q,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Q){Qthis.end&&(this.end=Q)}markRangeDirty(Q,z){Q>z&&(G=Q,Q=z,z=G),Qthis.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Z(Q){return 0<=Q&&Q<256}Y=d([m(0,N.IBufferService)],Y)},844:(o,l)=>{function u(d){for(const m of d)m.dispose();d.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const m=this._disposables.indexOf(d);m!==-1&&this._disposables.splice(m,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var m;this._isDisposed||d===this._value||((m=this._value)==null||m.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},l.toDisposable=function(d){return{dispose:d}},l.disposeArray=u,l.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(m,f,g){this._data[m]||(this._data[m]={}),this._data[m][f]=g}get(m,f){return this._data[m]?this._data[m][f]:void 0}clear(){this._data={}}}l.TwoKeyMap=u,l.FourKeyMap=class{constructor(){this._data=new u}set(d,m,f,g,b){this._data.get(d,m)||this._data.set(d,m,new u),this._data.get(d,m).set(f,g,b)}get(d,m,f,g){var b;return(b=this._data.get(d,m))==null?void 0:b.get(f,g)}clear(){this._data.clear()}}},6114:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const u=l.isNode?"node":navigator.userAgent,d=l.isNode?"node":navigator.platform;l.isFirefox=u.includes("Firefox"),l.isLegacyEdge=u.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(u),l.getSafariVersion=function(){if(!l.isSafari)return 0;const m=u.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),l.isIpad=d==="iPad",l.isIphone=d==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),l.isLinux=d.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(u)},6106:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let u=0;l.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const m=this._getKey(d);if(m===void 0||(u=this._search(m),u===-1)||this._getKey(this._array[u])!==m)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u=this._array.length)&&this._getKey(this._array[u])===d))do m(this._array[u]);while(++u=m;){let g=m+f>>1;const b=this._getKey(this._array[g]);if(b>d)f=g-1;else{if(!(b0&&this._getKey(this._array[g-1])===d;)g--;return g}m=g+1}}return m}}},7226:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const d=u(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),this._start()}flush(){for(;this._i_)return x-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(x-k))}ms`),void this._start();x=_}this.clear()}}class f extends m{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const k=Date.now()+b;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}l.PriorityTaskQueue=f,l.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:f,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const d=u(643);l.updateWindowsModeWrappedState=function(m){const f=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),g=f==null?void 0:f.get(m.cols-1),b=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);b&&g&&(b.isWrapped=g[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&g[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new u;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}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}}l.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,g=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=g}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=d},9092:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const d=u(6349),m=u(7226),f=u(3734),g=u(8437),b=u(4634),k=u(511),S=u(643),x=u(4863),_=u(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(w,y,C){this._hasScrollback=w,this._optionsService=y,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=_.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(w){return w?(this._nullCell.fg=w.fg,this._nullCell.bg=w.bg,this._nullCell.extended=w.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(w){return w?(this._whitespaceCell.fg=w.fg,this._whitespaceCell.bg=w.bg,this._whitespaceCell.extended=w.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(w,y){return new g.BufferLine(this._bufferService.cols,this.getNullCell(w),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const w=this.ybase+this.y-this.ydisp;return w>=0&&wl.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:y}fillViewportRows(w){if(this.lines.length===0){w===void 0&&(w=g.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(w))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(w,y){const C=this.getNullCell(g.DEFAULT_ATTR_DATA);let N=0;const E=this._getCorrectBufferLength(y);if(E>this.lines.maxLength&&(this.lines.maxLength=E),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+j+1?(this.ybase--,j++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(w,C)));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(E0&&(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=E}this.x=Math.min(this.x,w-1),this.y=Math.min(this.y,y-1),j&&(this.y+=j),this.savedX=Math.min(this.savedX,w-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(w,y),this._cols>w))for(let j=0;j.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let w=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,w=!1);let y=0;for(;this._memoryCleanupPosition100)return!0;return w}get _isReflowEnabled(){const w=this._optionsService.rawOptions.windowsPty;return w&&w.buildNumber?this._hasScrollback&&w.backend==="conpty"&&w.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(w,y){this._cols!==w&&(w>this._cols?this._reflowLarger(w,y):this._reflowSmaller(w,y))}_reflowLarger(w,y){const C=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,w,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(C.length>0){const N=(0,b.reflowLargerCreateNewLayout)(this.lines,C);(0,b.reflowLargerApplyNewLayout)(this.lines,N.layout),this._reflowLargerAdjustViewport(w,y,N.countRemoved)}}_reflowLargerAdjustViewport(w,y,C){const N=this.getNullCell(g.DEFAULT_ATTR_DATA);let E=C;for(;E-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;j--){let T=this.lines.get(j);if(!T||!T.isWrapped&&T.getTrimmedLength()<=w)continue;const D=[T];for(;T.isWrapped&&j>0;)T=this.lines.get(--j),D.unshift(T);const I=this.ybase+this.y;if(I>=j&&I0&&(N.push({start:j+D.length+E,newLines:X}),E+=X.length),D.push(...X);let Y=F.length-1,Z=F[Y];Z===0&&(Y--,Z=F[Y]);let Q=D.length-U-1,z=$;for(;Q>=0;){const H=Math.min(z,Z);if(D[Y]===void 0)break;if(D[Y].copyCellsFrom(D[Q],z-H,Z-H,H,!0),Z-=H,Z===0&&(Y--,Z=F[Y]),z-=H,z===0){Q--;const V=Math.max(Q,0);z=(0,b.getWrappedLineTrimmedLength)(D,V,this._cols)}}for(let H=0;H0;)this.ybase===0?this.y0){const j=[],T=[];for(let Y=0;Y=0;Y--)if(F&&F.start>I+U){for(let Z=F.newLines.length-1;Z>=0;Z--)this.lines.set(Y--,F.newLines[Z]);Y++,j.push({index:I+1,amount:F.newLines.length}),U+=F.newLines.length,F=N[++$]}else this.lines.set(Y,T[I--]);let G=0;for(let Y=j.length-1;Y>=0;Y--)j[Y].index+=G,this.lines.onInsertEmitter.fire(j[Y]),G+=j[Y].amount;const X=Math.max(0,D+E-this.lines.maxLength);X>0&&this.lines.onTrimEmitter.fire(X)}}translateBufferLineToString(w,y,C=0,N){const E=this.lines.get(w);return E?E.translateToString(y,C,N):""}getWrappedRangeForLine(w){let y=w,C=w;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;C+10;);return w>=this._cols?this._cols-1:w<0?0:w}nextStop(w){for(w==null&&(w=this.x);!this.tabs[++w]&&w=this._cols?this._cols-1:w<0?0:w}clearMarkers(w){this._isClearing=!0;for(let y=0;y{y.line-=C,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((C=>{y.line>=C.index&&(y.line+=C.amount)}))),y.register(this.lines.onDelete((C=>{y.line>=C.index&&y.lineC.index&&(y.line-=C.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(w){this._isClearing||this.markers.splice(this.markers.indexOf(w),1)}}},8437:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const d=u(3734),m=u(511),f=u(643),g=u(482);l.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let b=0;class k{constructor(x,_,w=!1){this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*x);const y=_||m.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let C=0;C>22,2097152&_?this._combined[x].charCodeAt(this._combined[x].length-1):w]}set(x,_){this._data[3*x+1]=_[f.CHAR_DATA_ATTR_INDEX],_[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[x]=_[1],this._data[3*x+0]=2097152|x|_[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*x+0]=_[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(x){return this._data[3*x+0]>>22}hasWidth(x){return 12582912&this._data[3*x+0]}getFg(x){return this._data[3*x+1]}getBg(x){return this._data[3*x+2]}hasContent(x){return 4194303&this._data[3*x+0]}getCodePoint(x){const _=this._data[3*x+0];return 2097152&_?this._combined[x].charCodeAt(this._combined[x].length-1):2097151&_}isCombined(x){return 2097152&this._data[3*x+0]}getString(x){const _=this._data[3*x+0];return 2097152&_?this._combined[x]:2097151&_?(0,g.stringFromCodePoint)(2097151&_):""}isProtected(x){return 536870912&this._data[3*x+2]}loadCell(x,_){return b=3*x,_.content=this._data[b+0],_.fg=this._data[b+1],_.bg=this._data[b+2],2097152&_.content&&(_.combinedData=this._combined[x]),268435456&_.bg&&(_.extended=this._extendedAttrs[x]),_}setCell(x,_){2097152&_.content&&(this._combined[x]=_.combinedData),268435456&_.bg&&(this._extendedAttrs[x]=_.extended),this._data[3*x+0]=_.content,this._data[3*x+1]=_.fg,this._data[3*x+2]=_.bg}setCellFromCodepoint(x,_,w,y){268435456&y.bg&&(this._extendedAttrs[x]=y.extended),this._data[3*x+0]=_|w<<22,this._data[3*x+1]=y.fg,this._data[3*x+2]=y.bg}addCodepointToCell(x,_,w){let y=this._data[3*x+0];2097152&y?this._combined[x]+=(0,g.stringFromCodePoint)(_):2097151&y?(this._combined[x]=(0,g.stringFromCodePoint)(2097151&y)+(0,g.stringFromCodePoint)(_),y&=-2097152,y|=2097152):y=_|4194304,w&&(y&=-12582913,y|=w<<22),this._data[3*x+0]=y}insertCells(x,_,w){if((x%=this.length)&&this.getWidth(x-1)===2&&this.setCellFromCodepoint(x-1,0,1,w),_=0;--C)this.setCell(x+_+C,this.loadCell(x+C,y));for(let C=0;C<_;++C)this.setCell(x+C,w)}else for(let y=x;ythis.length){if(this._data.buffer.byteLength>=4*w)this._data=new Uint32Array(this._data.buffer,0,w);else{const y=new Uint32Array(w);y.set(this._data),this._data=y}for(let y=this.length;y=x&&delete this._combined[E]}const C=Object.keys(this._extendedAttrs);for(let N=0;N=x&&delete this._extendedAttrs[E]}}return this.length=x,4*w*2=0;--x)if(4194303&this._data[3*x+0])return x+(this._data[3*x+0]>>22);return 0}getNoBgTrimmedLength(){for(let x=this.length-1;x>=0;--x)if(4194303&this._data[3*x+0]||50331648&this._data[3*x+2])return x+(this._data[3*x+0]>>22);return 0}copyCellsFrom(x,_,w,y,C){const N=x._data;if(C)for(let j=y-1;j>=0;j--){for(let T=0;T<3;T++)this._data[3*(w+j)+T]=N[3*(_+j)+T];268435456&N[3*(_+j)+2]&&(this._extendedAttrs[w+j]=x._extendedAttrs[_+j])}else for(let j=0;j=_&&(this._combined[T-_+w]=x._combined[T])}}translateToString(x,_,w,y){_=_??0,w=w??this.length,x&&(w=Math.min(w,this.getTrimmedLength())),y&&(y.length=0);let C="";for(;_>22||1}return y&&y.push(_),C}}l.BufferLine=k},4841:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(o,l)=>{function u(d,m,f){if(m===d.length-1)return d[m].getTrimmedLength();const g=!d[m].hasContent(f-1)&&d[m].getWidth(f-1)===1,b=d[m+1].getWidth(0)===2;return g&&b?f-1:f}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(d,m,f,g,b){const k=[];for(let S=0;S=S&&g0&&(T>y||w[T].getTrimmedLength()===0);T--)j++;j>0&&(k.push(S+w.length-j),k.push(j)),S+=w.length-1}return k},l.reflowLargerCreateNewLayout=function(d,m){const f=[];let g=0,b=m[g],k=0;for(let S=0;Su(d,w,m))).reduce(((_,w)=>_+w));let k=0,S=0,x=0;for(;x_&&(k-=_,S++);const w=d[S].getWidth(k-1)===2;w&&k--;const y=w?f-1:f;g.push(y),x+=y}return g},l.getWrappedLineTrimmedLength=u},5295:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const d=u(8460),m=u(844),f=u(9092);class g extends m.Disposable{constructor(k,S){super(),this._optionsService=k,this._bufferService=S,this._onBufferActivate=this.register(new d.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 f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.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(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,S){this._normal.resize(k,S),this._alt.resize(k,S),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}l.BufferSet=g},511:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const d=u(482),m=u(643),f=u(3734);class g extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const S=new g;return S.setFromCharData(k),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(k[m.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(k[m.CHAR_DATA_CHAR_INDEX].length===2){const x=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=x&&x<=56319){const _=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=_&&_<=57343?this.content=1024*(x-55296)+_-56320+65536|k[m.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[m.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=k[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=g},643:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const d=u(8460),m=u(844);class f{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}l.Marker=f,f._nextId=1},7116:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.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:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(o,l)=>{var u,d,m;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=` -`,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(u||(l.C0=u={})),(function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"})(d||(l.C1=d={})),(function(f){f.ST=`${u.ESC}\\`})(m||(l.C1_ESCAPED=m={}))},7399:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const d=u(2584),m={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:["'",'"']};l.evaluateKeyboardEvent=function(f,g,b,k){const S={type:0,cancel:!1,key:void 0},x=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?S.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?S.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?S.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(S.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:S.key=f.ctrlKey?"\b":d.C0.DEL,f.altKey&&(S.key=d.C0.ESC+S.key);break;case 9:if(f.shiftKey){S.key=d.C0.ESC+"[Z";break}S.key=d.C0.HT,S.cancel=!0;break;case 13:S.key=f.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,S.cancel=!0;break;case 27:S.key=d.C0.ESC,f.altKey&&(S.key=d.C0.ESC+d.C0.ESC),S.cancel=!0;break;case 37:if(f.metaKey)break;x?(S.key=d.C0.ESC+"[1;"+(x+1)+"D",S.key===d.C0.ESC+"[1;3D"&&(S.key=d.C0.ESC+(b?"b":"[1;5D"))):S.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(f.metaKey)break;x?(S.key=d.C0.ESC+"[1;"+(x+1)+"C",S.key===d.C0.ESC+"[1;3C"&&(S.key=d.C0.ESC+(b?"f":"[1;5C"))):S.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(f.metaKey)break;x?(S.key=d.C0.ESC+"[1;"+(x+1)+"A",b||S.key!==d.C0.ESC+"[1;3A"||(S.key=d.C0.ESC+"[1;5A")):S.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(f.metaKey)break;x?(S.key=d.C0.ESC+"[1;"+(x+1)+"B",b||S.key!==d.C0.ESC+"[1;3B"||(S.key=d.C0.ESC+"[1;5B")):S.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(S.key=d.C0.ESC+"[2~");break;case 46:S.key=x?d.C0.ESC+"[3;"+(x+1)+"~":d.C0.ESC+"[3~";break;case 36:S.key=x?d.C0.ESC+"[1;"+(x+1)+"H":g?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:S.key=x?d.C0.ESC+"[1;"+(x+1)+"F":g?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:f.shiftKey?S.type=2:f.ctrlKey?S.key=d.C0.ESC+"[5;"+(x+1)+"~":S.key=d.C0.ESC+"[5~";break;case 34:f.shiftKey?S.type=3:f.ctrlKey?S.key=d.C0.ESC+"[6;"+(x+1)+"~":S.key=d.C0.ESC+"[6~";break;case 112:S.key=x?d.C0.ESC+"[1;"+(x+1)+"P":d.C0.ESC+"OP";break;case 113:S.key=x?d.C0.ESC+"[1;"+(x+1)+"Q":d.C0.ESC+"OQ";break;case 114:S.key=x?d.C0.ESC+"[1;"+(x+1)+"R":d.C0.ESC+"OR";break;case 115:S.key=x?d.C0.ESC+"[1;"+(x+1)+"S":d.C0.ESC+"OS";break;case 116:S.key=x?d.C0.ESC+"[15;"+(x+1)+"~":d.C0.ESC+"[15~";break;case 117:S.key=x?d.C0.ESC+"[17;"+(x+1)+"~":d.C0.ESC+"[17~";break;case 118:S.key=x?d.C0.ESC+"[18;"+(x+1)+"~":d.C0.ESC+"[18~";break;case 119:S.key=x?d.C0.ESC+"[19;"+(x+1)+"~":d.C0.ESC+"[19~";break;case 120:S.key=x?d.C0.ESC+"[20;"+(x+1)+"~":d.C0.ESC+"[20~";break;case 121:S.key=x?d.C0.ESC+"[21;"+(x+1)+"~":d.C0.ESC+"[21~";break;case 122:S.key=x?d.C0.ESC+"[23;"+(x+1)+"~":d.C0.ESC+"[23~";break;case 123:S.key=x?d.C0.ESC+"[24;"+(x+1)+"~":d.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(b&&!k||!f.altKey||f.metaKey)!b||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?S.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(S.key=d.C0.US),f.key==="@"&&(S.key=d.C0.NUL)):f.keyCode===65&&(S.type=1);else{const _=m[f.keyCode],w=_==null?void 0:_[f.shiftKey?1:0];if(w)S.key=d.C0.ESC+w;else if(f.keyCode>=65&&f.keyCode<=90){const y=f.ctrlKey?f.keyCode-64:f.keyCode+32;let C=String.fromCharCode(y);f.shiftKey&&(C=C.toUpperCase()),S.key=d.C0.ESC+C}else if(f.keyCode===32)S.key=d.C0.ESC+(f.ctrlKey?d.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let y=f.code.slice(3,4);f.shiftKey||(y=y.toLowerCase()),S.key=d.C0.ESC+y,S.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?S.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?S.key=d.C0.NUL:f.keyCode>=51&&f.keyCode<=55?S.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?S.key=d.C0.DEL:f.keyCode===219?S.key=d.C0.ESC:f.keyCode===220?S.key=d.C0.FS:f.keyCode===221&&(S.key=d.C0.GS)}return S}},482:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},l.utf32ToString=function(u,d=0,m=u.length){let f="";for(let g=d;g65535?(b-=65536,f+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):f+=String.fromCharCode(b)}return f},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const m=u.length;if(!m)return 0;let f=0,g=0;if(this._interim){const b=u.charCodeAt(g++);56320<=b&&b<=57343?d[f++]=1024*(this._interim-55296)+b-56320+65536:(d[f++]=this._interim,d[f++]=b),this._interim=0}for(let b=g;b=m)return this._interim=k,f;const S=u.charCodeAt(b);56320<=S&&S<=57343?d[f++]=1024*(k-55296)+S-56320+65536:(d[f++]=k,d[f++]=S)}else k!==65279&&(d[f++]=k)}return f}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const m=u.length;if(!m)return 0;let f,g,b,k,S=0,x=0,_=0;if(this.interim[0]){let C=!1,N=this.interim[0];N&=(224&N)==192?31:(240&N)==224?15:7;let E,j=0;for(;(E=63&this.interim[++j])&&j<4;)N<<=6,N|=E;const T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,D=T-j;for(;_=m)return 0;if(E=u[_++],(192&E)!=128){_--,C=!0;break}this.interim[j++]=E,N<<=6,N|=63&E}C||(T===2?N<128?_--:d[S++]=N:T===3?N<2048||N>=55296&&N<=57343||N===65279||(d[S++]=N):N<65536||N>1114111||(d[S++]=N)),this.interim.fill(0)}const w=m-4;let y=_;for(;y=m)return this.interim[0]=f,S;if(g=u[y++],(192&g)!=128){y--;continue}if(x=(31&f)<<6|63&g,x<128){y--;continue}d[S++]=x}else if((240&f)==224){if(y>=m)return this.interim[0]=f,S;if(g=u[y++],(192&g)!=128){y--;continue}if(y>=m)return this.interim[0]=f,this.interim[1]=g,S;if(b=u[y++],(192&b)!=128){y--;continue}if(x=(15&f)<<12|(63&g)<<6|63&b,x<2048||x>=55296&&x<=57343||x===65279)continue;d[S++]=x}else if((248&f)==240){if(y>=m)return this.interim[0]=f,S;if(g=u[y++],(192&g)!=128){y--;continue}if(y>=m)return this.interim[0]=f,this.interim[1]=g,S;if(b=u[y++],(192&b)!=128){y--;continue}if(y>=m)return this.interim[0]=f,this.interim[1]=g,this.interim[2]=b,S;if(k=u[y++],(192&k)!=128){y--;continue}if(x=(7&f)<<18|(63&g)<<12|(63&b)<<6|63&k,x<65536||x>1114111)continue;d[S++]=x}}return S}}},225:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const d=u(1480),m=[[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]],f=[[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 g;l.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let b=0;bS[w][1])return!1;for(;w>=_;)if(x=_+w>>1,k>S[x][1])_=x+1;else{if(!(k=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,k){let S=this.wcwidth(b),x=S===0&&k!==0;if(x){const _=d.UnicodeService.extractWidth(k);_===0?x=!1:_>S&&(S=_)}return d.UnicodeService.createPropertyValue(0,S,x)}}},5981:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const d=u(8460),m=u(844);class f extends m.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const x=this._callbacks.shift();x&&x()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,k){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+=b.length,this._writeBuffer.push(b),this._callbacks.push(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(k)}_innerWrite(b=0,k=!0){const S=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const x=this._writeBuffer[this._bufferOffset],_=this._action(x,k);if(_){const y=C=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(S,C);return void _.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(y)}const w=this._callbacks[this._bufferOffset];if(w&&w(),this._bufferOffset++,this._pendingData-=x.length,Date.now()-S>=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()}}l.WriteBuffer=f},5941:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const u=/^([\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})$/,d=/^[\da-f]+$/;function m(f,g){const b=f.toString(16),k=b.length<2?"0"+b:b;switch(g){case 4:return b[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}l.parseColor=function(f){if(!f)return;let g=f.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const b=u.exec(g);if(b){const k=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/k*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/k*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/k*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),d.exec(g)&&[3,6,9,12].includes(g.length))){const b=g.length/3,k=[0,0,0];for(let S=0;S<3;++S){const x=parseInt(g.slice(b*S,b*S+b),16);k[S]=b===1?x<<4:b===2?x:b===3?x>>4:x>>8}return k}},l.toRgbString=function(f,g=16){const[b,k,S]=f;return`rgb:${m(b,g)}/${m(k,g)}/${m(S,g)}`}},5770:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const d=u(482),m=u(8742),f=u(5770),g=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(k,S){this._handlers[k]===void 0&&(this._handlers[k]=[]);const x=this._handlers[k];return x.push(S),{dispose:()=>{const _=x.indexOf(S);_!==-1&&x.splice(_,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(k,S){if(this.reset(),this._ident=k,this._active=this._handlers[k]||g,this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(k,S,x){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(k,S,x);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(k,S,x))}unhook(k,S=!0){if(this._active.length){let x=!1,_=this._active.length-1,w=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,x=S,w=this._stack.fallThrough,this._stack.paused=!1),!w&&x===!1){for(;_>=0&&(x=this._active[_].unhook(k),x!==!0);_--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,x;_--}for(;_>=0;_--)if(x=this._active[_].unhook(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,x}else this._handlerFb(this._ident,"UNHOOK",k);this._active=g,this._ident=0}};const b=new m.Params;b.addParam(0),l.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=b,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():b,this._data="",this._hitLimit=!1}put(k,S,x){this._hitLimit||(this._data+=(0,d.utf32ToString)(k,S,x),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let S=!1;if(this._hitLimit)S=!1;else if(k&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((x=>(this._params=b,this._data="",this._hitLimit=!1,x)));return this._params=b,this._data="",this._hitLimit=!1,S}}},2015:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const d=u(844),m=u(8742),f=u(6242),g=u(6351);class b{constructor(_){this.table=new Uint8Array(_)}setDefault(_,w){this.table.fill(_<<4|w)}add(_,w,y,C){this.table[w<<8|_]=y<<4|C}addMany(_,w,y,C){for(let N=0;N<_.length;N++)this.table[w<<8|_[N]]=y<<4|C}}l.TransitionTable=b;const k=160;l.VT500_TRANSITION_TABLE=(function(){const x=new b(4095),_=Array.apply(null,Array(256)).map(((j,T)=>T)),w=(j,T)=>_.slice(j,T),y=w(32,127),C=w(0,24);C.push(25),C.push.apply(C,w(28,32));const N=w(0,14);let E;for(E in x.setDefault(1,0),x.addMany(y,0,2,0),N)x.addMany([24,26,153,154],E,3,0),x.addMany(w(128,144),E,3,0),x.addMany(w(144,152),E,3,0),x.add(156,E,0,0),x.add(27,E,11,1),x.add(157,E,4,8),x.addMany([152,158,159],E,0,7),x.add(155,E,11,3),x.add(144,E,11,9);return x.addMany(C,0,3,0),x.addMany(C,1,3,1),x.add(127,1,0,1),x.addMany(C,8,0,8),x.addMany(C,3,3,3),x.add(127,3,0,3),x.addMany(C,4,3,4),x.add(127,4,0,4),x.addMany(C,6,3,6),x.addMany(C,5,3,5),x.add(127,5,0,5),x.addMany(C,2,3,2),x.add(127,2,0,2),x.add(93,1,4,8),x.addMany(y,8,5,8),x.add(127,8,5,8),x.addMany([156,27,24,26,7],8,6,0),x.addMany(w(28,32),8,0,8),x.addMany([88,94,95],1,0,7),x.addMany(y,7,0,7),x.addMany(C,7,0,7),x.add(156,7,0,0),x.add(127,7,0,7),x.add(91,1,11,3),x.addMany(w(64,127),3,7,0),x.addMany(w(48,60),3,8,4),x.addMany([60,61,62,63],3,9,4),x.addMany(w(48,60),4,8,4),x.addMany(w(64,127),4,7,0),x.addMany([60,61,62,63],4,0,6),x.addMany(w(32,64),6,0,6),x.add(127,6,0,6),x.addMany(w(64,127),6,0,0),x.addMany(w(32,48),3,9,5),x.addMany(w(32,48),5,9,5),x.addMany(w(48,64),5,0,6),x.addMany(w(64,127),5,7,0),x.addMany(w(32,48),4,9,5),x.addMany(w(32,48),1,9,2),x.addMany(w(32,48),2,9,2),x.addMany(w(48,127),2,10,0),x.addMany(w(48,80),1,10,0),x.addMany(w(81,88),1,10,0),x.addMany([89,90,92],1,10,0),x.addMany(w(96,127),1,10,0),x.add(80,1,11,9),x.addMany(C,9,0,9),x.add(127,9,0,9),x.addMany(w(28,32),9,0,9),x.addMany(w(32,48),9,9,12),x.addMany(w(48,60),9,8,10),x.addMany([60,61,62,63],9,9,10),x.addMany(C,11,0,11),x.addMany(w(32,128),11,0,11),x.addMany(w(28,32),11,0,11),x.addMany(C,10,0,10),x.add(127,10,0,10),x.addMany(w(28,32),10,0,10),x.addMany(w(48,60),10,8,10),x.addMany([60,61,62,63],10,0,11),x.addMany(w(32,48),10,9,12),x.addMany(C,12,0,12),x.add(127,12,0,12),x.addMany(w(28,32),12,0,12),x.addMany(w(32,48),12,9,12),x.addMany(w(48,64),12,0,11),x.addMany(w(64,127),12,12,13),x.addMany(w(64,127),10,12,13),x.addMany(w(64,127),9,12,13),x.addMany(C,13,13,13),x.addMany(y,13,13,13),x.add(127,13,0,13),x.addMany([27,156,24,26],13,14,0),x.add(k,0,2,0),x.add(k,8,5,8),x.add(k,6,0,6),x.add(k,11,0,11),x.add(k,13,13,13),x})();class S extends d.Disposable{constructor(_=l.VT500_TRANSITION_TABLE){super(),this._transitions=_,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(w,y,C)=>{},this._executeHandlerFb=w=>{},this._csiHandlerFb=(w,y)=>{},this._escHandlerFb=w=>{},this._errorHandlerFb=w=>w,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(_,w=[64,126]){let y=0;if(_.prefix){if(_.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=_.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(_.intermediates){if(_.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let N=0;N<_.intermediates.length;++N){const E=_.intermediates.charCodeAt(N);if(32>E||E>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=E}}if(_.final.length!==1)throw new Error("final must be a single byte");const C=_.final.charCodeAt(0);if(w[0]>C||C>w[1])throw new Error(`final must be in range ${w[0]} .. ${w[1]}`);return y<<=8,y|=C,y}identToString(_){const w=[];for(;_;)w.push(String.fromCharCode(255&_)),_>>=8;return w.reverse().join("")}setPrintHandler(_){this._printHandler=_}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(_,w){const y=this._identifier(_,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const C=this._escHandlers[y];return C.push(w),{dispose:()=>{const N=C.indexOf(w);N!==-1&&C.splice(N,1)}}}clearEscHandler(_){this._escHandlers[this._identifier(_,[48,126])]&&delete this._escHandlers[this._identifier(_,[48,126])]}setEscHandlerFallback(_){this._escHandlerFb=_}setExecuteHandler(_,w){this._executeHandlers[_.charCodeAt(0)]=w}clearExecuteHandler(_){this._executeHandlers[_.charCodeAt(0)]&&delete this._executeHandlers[_.charCodeAt(0)]}setExecuteHandlerFallback(_){this._executeHandlerFb=_}registerCsiHandler(_,w){const y=this._identifier(_);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const C=this._csiHandlers[y];return C.push(w),{dispose:()=>{const N=C.indexOf(w);N!==-1&&C.splice(N,1)}}}clearCsiHandler(_){this._csiHandlers[this._identifier(_)]&&delete this._csiHandlers[this._identifier(_)]}setCsiHandlerFallback(_){this._csiHandlerFb=_}registerDcsHandler(_,w){return this._dcsParser.registerHandler(this._identifier(_),w)}clearDcsHandler(_){this._dcsParser.clearHandler(this._identifier(_))}setDcsHandlerFallback(_){this._dcsParser.setHandlerFallback(_)}registerOscHandler(_,w){return this._oscParser.registerHandler(_,w)}clearOscHandler(_){this._oscParser.clearHandler(_)}setOscHandlerFallback(_){this._oscParser.setHandlerFallback(_)}setErrorHandler(_){this._errorHandler=_}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(_,w,y,C,N){this._parseStack.state=_,this._parseStack.handlers=w,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=N}parse(_,w,y){let C,N=0,E=0,j=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,j=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 D=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&D>-1){for(;D>=0&&(C=T[D](this._params),C!==!0);D--)if(C instanceof Promise)return this._parseStack.handlerPos=D,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&D>-1){for(;D>=0&&(C=T[D](),C!==!0);D--)if(C instanceof Promise)return this._parseStack.handlerPos=D,C}this._parseStack.handlers=[];break;case 6:if(N=_[this._parseStack.chunkPos],C=this._dcsParser.unhook(N!==24&&N!==26,y),C)return C;N===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(N=_[this._parseStack.chunkPos],C=this._oscParser.end(N!==24&&N!==26,y),C)return C;N===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,j=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let T=j;T>4){case 2:for(let U=T+1;;++U){if(U>=w||(N=_[U])<32||N>126&&N=w||(N=_[U])<32||N>126&&N=w||(N=_[U])<32||N>126&&N=w||(N=_[U])<32||N>126&&N=0&&(C=D[I](this._params),C!==!0);I--)if(C instanceof Promise)return this._preserveStack(3,D,I,E,T),C;I<0&&this._csiHandlerFb(this._collect<<8|N,this._params),this.precedingJoinState=0;break;case 8:do switch(N){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(N-48)}while(++T47&&N<60);T--;break;case 9:this._collect<<=8,this._collect|=N;break;case 10:const $=this._escHandlers[this._collect<<8|N];let F=$?$.length-1:-1;for(;F>=0&&(C=$[F](),C!==!0);F--)if(C instanceof Promise)return this._preserveStack(4,$,F,E,T),C;F<0&&this._escHandlerFb(this._collect<<8|N),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|N,this._params);break;case 13:for(let U=T+1;;++U)if(U>=w||(N=_[U])===24||N===26||N===27||N>127&&N=w||(N=_[U])<32||N>127&&N{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const d=u(5770),m=u(482),f=[];l.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,b){this._handlers[g]===void 0&&(this._handlers[g]=[]);const k=this._handlers[g];return k.push(b),{dispose:()=>{const S=k.indexOf(b);S!==-1&&k.splice(S,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,b,k){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(g,b,k);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(g,b,k))}start(){this.reset(),this._state=1}put(g,b,k){if(this._state!==3){if(this._state===1)for(;b0&&this._put(g,b,k)}}end(g,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,S=this._active.length-1,x=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,k=b,x=this._stack.fallThrough,this._stack.paused=!1),!x&&k===!1){for(;S>=0&&(k=this._active[S].end(g),k!==!0);S--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,k;S--}for(;S>=0;S--)if(k=this._active[S].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",g);this._active=f,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,b,k){this._hitLimit||(this._data+=(0,m.utf32ToString)(g,b,k),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let b=!1;if(this._hitLimit)b=!1;else if(g&&(b=this._handler(this._data),b instanceof Promise))return b.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,b}}},8742:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const u=2147483647;class d{static fromArray(f){const g=new d;if(!f.length)return g;for(let b=Array.isArray(f[0])?1:0;b256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new d(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let g=0;g>8,k=255&this._subParamsIdx[g];k-b>0&&f.push(Array.prototype.slice.call(this._subParams,b,k))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>u?u:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>u?u:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const g=this._subParamsIdx[f]>>8,b=255&this._subParamsIdx[f];return b-g>0?this._subParams.subarray(g,b):null}getSubParamsAll(){const f={};for(let g=0;g>8,k=255&this._subParamsIdx[g];k-b>0&&(f[g]=this._subParams.slice(b,k))}return f}addDigit(f){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,k=b[g-1];b[g-1]=~k?Math.min(10*k+f,u):f}}l.Params=d},5741:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const m={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(m),d.dispose=()=>this._wrappedAddonDispose(m),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let m=0;m{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const d=u(3785),m=u(511);l.BufferApiView=class{constructor(f,g){this._buffer=f,this.type=g}init(f){return this._buffer=f,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(f){const g=this._buffer.lines.get(f);if(g)return new d.BufferLineApiView(g)}getNullCell(){return new m.CellData}}},3785:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const d=u(511);l.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,f){if(!(m<0||m>=this._line.length))return f?(this._line.loadCell(m,f),f):this._line.loadCell(m,new d.CellData)}translateToString(m,f,g){return this._line.translateToString(m,f,g)}}},8285:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const d=u(8771),m=u(8460),f=u(844);class g extends f.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.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)}}l.BufferNamespaceApi=g},7975:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,(m=>d(m.toArray())))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,((m,f)=>d(m,f.toArray())))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(o,l,u){var d=this&&this.__decorate||function(x,_,w,y){var C,N=arguments.length,E=N<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(x,_,w,y);else for(var j=x.length-1;j>=0;j--)(C=x[j])&&(E=(N<3?C(E):N>3?C(_,w,E):C(_,w))||E);return N>3&&E&&Object.defineProperty(_,w,E),E},m=this&&this.__param||function(x,_){return function(w,y){_(w,y,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const f=u(8460),g=u(844),b=u(5295),k=u(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let S=l.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(x){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(x.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(x.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(x,this))}resize(x,_){this.cols=x,this.rows=_,this.buffers.resize(x,_),this._onResize.fire({cols:x,rows:_})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(x,_=!1){const w=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===x.fg&&y.getBg(0)===x.bg||(y=w.getBlankLine(x,_),this._cachedBlankLine=y),y.isWrapped=_;const C=w.ybase+w.scrollTop,N=w.ybase+w.scrollBottom;if(w.scrollTop===0){const E=w.lines.isFull;N===w.lines.length-1?E?w.lines.recycle().copyFrom(y):w.lines.push(y.clone()):w.lines.splice(N+1,0,y.clone()),E?this.isUserScrolling&&(w.ydisp=Math.max(w.ydisp-1,0)):(w.ybase++,this.isUserScrolling||w.ydisp++)}else{const E=N-C+1;w.lines.shiftElements(C+1,E-1,-1),w.lines.set(N,y.clone())}this.isUserScrolling||(w.ydisp=w.ybase),this._onScroll.fire(w.ydisp)}scrollLines(x,_,w){const y=this.buffer;if(x<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else x+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const C=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+x,y.ybase),0),C!==y.ydisp&&(_||this._onScroll.fire(y.ydisp))}};l.BufferService=S=d([m(0,k.IOptionsService)],S)},7994:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(o,l,u){var d=this&&this.__decorate||function(y,C,N,E){var j,T=arguments.length,D=T<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,N):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,C,N,E);else for(var I=y.length-1;I>=0;I--)(j=y[I])&&(D=(T<3?j(D):T>3?j(C,N,D):j(C,N))||D);return T>3&&D&&Object.defineProperty(C,N,D),D},m=this&&this.__param||function(y,C){return function(N,E){C(N,E,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const f=u(2585),g=u(8460),b=u(844),k={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 S(y,C){let N=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(N|=64,N|=y.action):(N|=3&y.button,4&y.button&&(N|=64),8&y.button&&(N|=128),y.action===32?N|=32:y.action!==0||C||(N|=3)),N}const x=String.fromCharCode,_={DEFAULT:y=>{const C=[S(y,!1)+32,y.col+32,y.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${x(C[0])}${x(C[1])}${x(C[2])}`},SGR:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.col};${y.row}${C}`},SGR_PIXELS:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.x};${y.y}${C}`}};let w=l.CoreMouseService=class extends b.Disposable{constructor(y,C){super(),this._bufferService=y,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const N of Object.keys(k))this.addProtocol(N,k[N]);for(const N of Object.keys(_))this.addEncoding(N,_[N]);this.reset()}addProtocol(y,C){this._protocols[y]=C}addEncoding(y,C){this._encodings[y]=C}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 C=this._encodings[this._activeEncoding](y);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!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,C,N){if(N){if(y.x!==C.x||y.y!==C.y)return!1}else if(y.col!==C.col||y.row!==C.row)return!1;return y.button===C.button&&y.action===C.action&&y.ctrl===C.ctrl&&y.alt===C.alt&&y.shift===C.shift}};l.CoreMouseService=w=d([m(0,f.IBufferService),m(1,f.ICoreService)],w)},6975:function(o,l,u){var d=this&&this.__decorate||function(w,y,C,N){var E,j=arguments.length,T=j<3?y:N===null?N=Object.getOwnPropertyDescriptor(y,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,C,N);else for(var D=w.length-1;D>=0;D--)(E=w[D])&&(T=(j<3?E(T):j>3?E(y,C,T):E(y,C))||T);return j>3&&T&&Object.defineProperty(y,C,T),T},m=this&&this.__param||function(w,y){return function(C,N){y(C,N,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const f=u(1439),g=u(8460),b=u(844),k=u(2585),S=Object.freeze({insertMode:!1}),x=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let _=l.CoreService=class extends b.Disposable{constructor(w,y,C){super(),this._bufferService=w,this._logService=y,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(S),this.decPrivateModes=(0,f.clone)(x)}reset(){this.modes=(0,f.clone)(S),this.decPrivateModes=(0,f.clone)(x)}triggerDataEvent(w,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${w}"`,(()=>w.split("").map((N=>N.charCodeAt(0))))),this._onData.fire(w)}triggerBinaryEvent(w){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${w}"`,(()=>w.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(w))}};l.CoreService=_=d([m(0,k.IBufferService),m(1,k.ILogService),m(2,k.IOptionsService)],_)},9074:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const d=u(8055),m=u(8460),f=u(844),g=u(6106);let b=0,k=0;class S extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((w=>w==null?void 0:w.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(w){if(w.marker.isDisposed)return;const y=new x(w);if(y){const C=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),C.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const w of this._decorations.values())w.dispose();this._decorations.clear()}*getDecorationsAtCell(w,y,C){let N=0,E=0;for(const j of this._decorations.getKeyIterator(y))N=j.options.x??0,E=N+(j.options.width??1),w>=N&&w{b=E.options.x??0,k=b+(E.options.width??1),w>=b&&w{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const d=u(2585),m=u(8343);class f{constructor(...b){this._entries=new Map;for(const[k,S]of b)this.set(k,S)}set(b,k){const S=this._entries.get(b);return this._entries.set(b,k),S}forEach(b){for(const[k,S]of this._entries.entries())b(k,S)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}l.ServiceCollection=f,l.InstantiationService=class{constructor(){this._services=new f,this._services.set(d.IInstantiationService,this)}setService(g,b){this._services.set(g,b)}getService(g){return this._services.get(g)}createInstance(g,...b){const k=(0,m.getServiceDependencies)(g).sort(((_,w)=>_.index-w.index)),S=[];for(const _ of k){const w=this._services.get(_.id);if(!w)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${_.id}.`);S.push(w)}const x=k.length>0?k[0].index:b.length;if(b.length!==x)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${x+1} conflicts with ${b.length} static arguments`);return new g(...b,...S)}}},7866:function(o,l,u){var d=this&&this.__decorate||function(x,_,w,y){var C,N=arguments.length,E=N<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(x,_,w,y);else for(var j=x.length-1;j>=0;j--)(C=x[j])&&(E=(N<3?C(E):N>3?C(_,w,E):C(_,w))||E);return N>3&&E&&Object.defineProperty(_,w,E),E},m=this&&this.__param||function(x,_){return function(w,y){_(w,y,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const f=u(844),g=u(2585),b={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let k,S=l.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(x){super(),this._optionsService=x,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(x){for(let _=0;_JSON.stringify(E))).join(", ")})`);const N=y.apply(this,C);return k.trace(`GlyphRenderer#${y.name} return`,N),N}}},7302:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const d=u(8460),m=u(844),f=u(6114);l.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:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends m.Disposable{constructor(S){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const x={...l.DEFAULT_OPTIONS};for(const _ in S)if(_ in x)try{const w=S[_];x[_]=this._sanitizeAndValidateOption(_,w)}catch(w){console.error(w)}this.rawOptions=x,this.options={...x},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(S,x){return this.onOptionChange((_=>{_===S&&x(this.rawOptions[S])}))}onMultipleOptionChange(S,x){return this.onOptionChange((_=>{S.indexOf(_)!==-1&&x()}))}_setupOptions(){const S=_=>{if(!(_ in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);return this.rawOptions[_]},x=(_,w)=>{if(!(_ in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);w=this._sanitizeAndValidateOption(_,w),this.rawOptions[_]!==w&&(this.rawOptions[_]=w,this._onOptionChange.fire(_))};for(const _ in this.rawOptions){const w={get:S.bind(this,_),set:x.bind(this,_)};Object.defineProperty(this.options,_,w)}}_sanitizeAndValidateOption(S,x){switch(S){case"cursorStyle":if(x||(x=l.DEFAULT_OPTIONS[S]),!(function(_){return _==="block"||_==="underline"||_==="bar"})(x))throw new Error(`"${x}" is not a valid value for ${S}`);break;case"wordSeparator":x||(x=l.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof x=="number"&&1<=x&&x<=1e3)break;x=g.includes(x)?x:l.DEFAULT_OPTIONS[S];break;case"cursorWidth":x=Math.floor(x);case"lineHeight":case"tabStopWidth":if(x<1)throw new Error(`${S} cannot be less than 1, value: ${x}`);break;case"minimumContrastRatio":x=Math.max(1,Math.min(21,Math.round(10*x)/10));break;case"scrollback":if((x=Math.min(x,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${x}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(x<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${x}`);break;case"rows":case"cols":if(!x&&x!==0)throw new Error(`${S} must be numeric, value: ${x}`);break;case"windowsPty":x=x??{}}return x}}l.OptionsService=b},2660:function(o,l,u){var d=this&&this.__decorate||function(b,k,S,x){var _,w=arguments.length,y=w<3?k:x===null?x=Object.getOwnPropertyDescriptor(k,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(b,k,S,x);else for(var C=b.length-1;C>=0;C--)(_=b[C])&&(y=(w<3?_(y):w>3?_(k,S,y):_(k,S))||y);return w>3&&y&&Object.defineProperty(k,S,y),y},m=this&&this.__param||function(b,k){return function(S,x){k(S,x,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const f=u(2585);let g=l.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const k=this._bufferService.buffer;if(b.id===void 0){const C=k.addMarker(k.ybase+k.y),N={data:b,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(N,C))),this._dataByLinkId.set(N.id,N),N.id}const S=b,x=this._getEntryIdKey(S),_=this._entriesWithId.get(x);if(_)return this.addLineToLink(_.id,k.ybase+k.y),_.id;const w=k.addMarker(k.ybase+k.y),y={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(y,w))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(b,k){const S=this._dataByLinkId.get(b);if(S&&S.lines.every((x=>x.line!==k))){const x=this._bufferService.buffer.addMarker(k);S.lines.push(x),x.onDispose((()=>this._removeMarkerFromLink(S,x)))}}getLinkData(b){var k;return(k=this._dataByLinkId.get(b))==null?void 0:k.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,k){const S=b.lines.indexOf(k);S!==-1&&(b.lines.splice(S,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};l.OscLinkService=g=d([m(0,f.IBufferService)],g)},8343:(o,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const u="di$target",d="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(m){return m[d]||[]},l.createDecorator=function(m){if(l.serviceRegistry.has(m))return l.serviceRegistry.get(m);const f=function(g,b,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,x,_){x[u]===x?x[d].push({id:S,index:_}):(x[d]=[{id:S,index:_}],x[u]=x)})(f,g,k)};return f.toString=()=>m,l.serviceRegistry.set(m,f),f}},2585:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const d=u(8343);var m;l.IBufferService=(0,d.createDecorator)("BufferService"),l.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),l.ICoreService=(0,d.createDecorator)("CoreService"),l.ICharsetService=(0,d.createDecorator)("CharsetService"),l.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(m||(l.LogLevelEnum=m={})),l.ILogService=(0,d.createDecorator)("LogService"),l.IOptionsService=(0,d.createDecorator)("OptionsService"),l.IOscLinkService=(0,d.createDecorator)("OscLinkService"),l.IUnicodeService=(0,d.createDecorator)("UnicodeService"),l.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(o,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const d=u(8460),m=u(225);class f{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,k,S=!1){return(16777215&b)<<3|(3&k)<<1|(S?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const b=new m.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let k=0,S=0;const x=b.length;for(let _=0;_=x)return k+this.wcwidth(w);const N=b.charCodeAt(_);56320<=N&&N<=57343?w=1024*(w-55296)+N-56320+65536:k+=this.wcwidth(N)}const y=this.charProperties(w,S);let C=f.extractWidth(y);f.extractShouldJoin(y)&&(C-=f.extractWidth(S)),k+=C,S=y}return k}charProperties(b,k){return this._activeProvider.charProperties(b,k)}}l.UnicodeService=f}},r={};function i(o){var l=r[o];if(l!==void 0)return l.exports;var u=r[o]={exports:{}};return n[o].call(u.exports,u,u.exports,i),u.exports}var a={};return(()=>{var o=a;Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const l=i(9042),u=i(3236),d=i(844),m=i(5741),f=i(8285),g=i(7975),b=i(7090),k=["cols","rows"];class S extends d.Disposable{constructor(_){super(),this._core=this.register(new u.Terminal(_)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const w=C=>this._core.options[C],y=(C,N)=>{this._checkReadonlyOptions(C),this._core.options[C]=N};for(const C in this._core.options){const N={get:w.bind(this,C),set:y.bind(this,C)};Object.defineProperty(this._publicOptions,C,N)}}_checkReadonlyOptions(_){if(k.includes(_))throw new Error(`Option "${_}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.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 f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const _=this._core.coreService.decPrivateModes;let w="none";switch(this._core.coreMouseService.activeProtocol){case"X10":w="x10";break;case"VT200":w="vt200";break;case"DRAG":w="drag";break;case"ANY":w="any"}return{applicationCursorKeysMode:_.applicationCursorKeys,applicationKeypadMode:_.applicationKeypad,bracketedPasteMode:_.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:w,originMode:_.origin,reverseWraparoundMode:_.reverseWraparound,sendFocusMode:_.sendFocus,wraparoundMode:_.wraparound}}get options(){return this._publicOptions}set options(_){for(const w in _)this._publicOptions[w]=_[w]}blur(){this._core.blur()}focus(){this._core.focus()}input(_,w=!0){this._core.input(_,w)}resize(_,w){this._verifyIntegers(_,w),this._core.resize(_,w)}open(_){this._core.open(_)}attachCustomKeyEventHandler(_){this._core.attachCustomKeyEventHandler(_)}attachCustomWheelEventHandler(_){this._core.attachCustomWheelEventHandler(_)}registerLinkProvider(_){return this._core.registerLinkProvider(_)}registerCharacterJoiner(_){return this._checkProposedApi(),this._core.registerCharacterJoiner(_)}deregisterCharacterJoiner(_){this._checkProposedApi(),this._core.deregisterCharacterJoiner(_)}registerMarker(_=0){return this._verifyIntegers(_),this._core.registerMarker(_)}registerDecoration(_){return this._checkProposedApi(),this._verifyPositiveIntegers(_.x??0,_.width??0,_.height??0),this._core.registerDecoration(_)}hasSelection(){return this._core.hasSelection()}select(_,w,y){this._verifyIntegers(_,w,y),this._core.select(_,w,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(_,w){this._verifyIntegers(_,w),this._core.selectLines(_,w)}dispose(){super.dispose()}scrollLines(_){this._verifyIntegers(_),this._core.scrollLines(_)}scrollPages(_){this._verifyIntegers(_),this._core.scrollPages(_)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(_){this._verifyIntegers(_),this._core.scrollToLine(_)}clear(){this._core.clear()}write(_,w){this._core.write(_,w)}writeln(_,w){this._core.write(_),this._core.write(`\r -`,w)}paste(_){this._core.paste(_)}refresh(_,w){this._verifyIntegers(_,w),this._core.refresh(_,w)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(_){this._addonManager.loadAddon(this,_)}static get strings(){return l}_verifyIntegers(..._){for(const w of _)if(w===1/0||isNaN(w)||w%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(..._){for(const w of _)if(w&&(w===1/0||isNaN(w)||w%1!=0||w<0))throw new Error("This API only accepts positive integers")}}o.Terminal=S})(),a})()))})(sb)),sb.exports}var XK=YK();function w7(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r{const n=t.current;if(!n)return;const r=new XK.Terminal({convertEol:!0,disableStdin:!0,fontSize:12,fontFamily:getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:"#1a1a1a",foreground:"#e6e1e0",cursor:"#1a1a1a",selectionBackground:"#2c3441"}}),i=new WK.FitAddon;r.loadAddon(i),r.open(n);try{i.fit()}catch{}const a=new ResizeObserver(()=>{try{i.fit()}catch{}});a.observe(n);let o=!1,l=0,u=!1,d=!1;async function m(){if(u){d=!0;return}u=!0;try{for(;;){const g=await NR(e,l);if(o)return;if(g.dataBase64&&r.write(w7(g.dataBase64)),l=g.nextOffset,g.eof)break}}catch{}finally{u=!1,d&&!o&&(d=!1,m())}}const f=GD(e,g=>{if(o)return;const b=w7(g.dataBase64);!u&&g.offset===l?(r.write(b),l+=b.length):g.offset+b.length>l&&m()});return m(),()=>{o=!0,f(),a.disconnect(),r.dispose()}},[e]),h.jsx("div",{ref:t,style:{width:"100%",height:"100%"}})}function ZK({experiment:e,project:t,view:n,runs:r,selectedRunId:i,onSelectRun:a,parentExperiment:o,onOpenView:l,onOpenCode:u}){const d=r.filter(m=>m.experimentId===e.id).sort((m,f)=>f.createdAt-m.createdAt);return n==="overview"?h.jsx(GK,{experiment:e,parentExperiment:o,project:t,runs:d,onOpenLogs:m=>l("terminal",m),onOpenCode:()=>u("files")}):h.jsx(QK,{experiment:e,expRuns:d,selectedRunId:i,onSelectRun:a})}function QK({experiment:e,expRuns:t,selectedRunId:n,onSelectRun:r}){const[i,a]=R.useState(null),[o,l]=R.useState(null),[u,d]=R.useState(!1),m=R.useRef(null),f=n&&t.find(_=>_.id===n)||t[0]||null,g=(f==null?void 0:f.status)==="running"||(f==null?void 0:f.status)==="starting",b=!!(f&&g&&(f.cancelRequested||o===f.id)),k=_=>{const w=t.findIndex(y=>y.id===_);return w===-1?t.length:t.length-w},S=R.useRef(null);R.useEffect(()=>{if(S.current===null){S.current=new Set(t.map(w=>w.id));return}const _=t.find(w=>!S.current.has(w.id));for(const w of t)S.current.add(w.id);_&&r(_.id)},[t,r]),R.useEffect(()=>{if(!u)return;const _=w=>{var y;(y=m.current)!=null&&y.contains(w.target)||d(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[u]);async function x(){if(f){a(null),l(f.id);try{await hS(f.id)}catch(_){l(null),a(_ instanceof Error?_.message:String(_))}}}return h.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[h.jsxs("div",{className:"term-bar flex items-center gap-2 h-10 py-0 px-2.5 border-b border-b-border shrink-0 [&_.error]:text-sm [&_.error]:text-accent-red [&_.btn]:inline-flex [&_.btn]:items-center [&_.btn]:gap-[5px]",children:[h.jsx("div",{className:"term-title min-w-0 text-md font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),h.jsx("span",{style:{flex:1}}),i&&h.jsx("span",{className:"error",role:"alert",children:i}),g&&h.jsxs("button",{className:`${Kn} ghost`,disabled:b,onClick:()=>void x(),children:[h.jsx(Y8,{size:13}),b?"Cancelling…":"Stop"]}),t.length>0&&f&&h.jsxs("div",{className:"run-history relative shrink-0",ref:m,children:[h.jsxs("button",{className:"run-picker inline-flex items-center gap-2 pt-1 pr-1.5 pb-1 pl-2.5 border border-border rounded-md bg-background text-text [&:hover]:bg-surface [&_.run-label]:text-sm [&_.run-label]:font-semibold",title:"Switch run",onClick:()=>d(_=>!_),children:[h.jsxs("span",{className:"run-label",children:["Run ",k(f.id)]}),h.jsx(Ma,{status:b?"cancelling":ss(f)}),h.jsx(Rl,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),u&&h.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] right-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] p-[5px] z-50",children:t.map(_=>h.jsxs("button",{className:`history-item flex items-center gap-2 w-full text-left py-1.5 px-2 text-sm rounded-sm [&:hover]:bg-surface [&.active]:bg-surface [&_.run-label]:font-semibold [&_.when]:ml-auto [&_.when]:text-xs [&_.when]:text-muted ${_.id===(f==null?void 0:f.id)?"active":""}`,onClick:()=>{r(_.id),d(!1)},children:[h.jsxs("span",{className:"run-label",children:["Run ",k(_.id)]}),h.jsx(Ma,{status:ss(_)}),h.jsx("span",{className:"when",children:Gs(_.createdAt)})]},_.id))})]})]}),h.jsx("div",{className:"term-fill flex-1 min-h-0 bg-[var(--term-bg)] pt-1 pr-0 pb-1 pl-1.5",children:f?h.jsx(KK,{runId:f.id},f.id):h.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-md text-muted",children:"No runs yet — ask the agent to launch one."})})]})}function JK({value:e,onChange:t,onSave:n,onBlur:r,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:l}){const u=R.useMemo(()=>A2(e,Q_(i)),[e,i]),d=e?e.split(` -`).length:1,m=R.useRef(null),f=R.useRef(null),g=R.useRef(null),b=()=>{const S=m.current;S&&(f.current&&(f.current.scrollTop=S.scrollTop,f.current.scrollLeft=S.scrollLeft),g.current&&(g.current.scrollTop=S.scrollTop))};R.useLayoutEffect(b,[e]),R.useLayoutEffect(()=>{const S=m.current;if(!S||!a)return;const x=getComputedStyle(S),_=Number.parseFloat(x.paddingTop)||0,w=Number.parseFloat(x.lineHeight)||0,y=Math.min(Math.max(Math.trunc(a),1),d),C=e.split(` -`);let N=0;for(let E=0;E{if((S.metaKey||S.ctrlKey)&&S.key.toLowerCase()==="s"){S.preventDefault(),n();return}if(S.key==="Tab"){S.preventDefault();const x=S.currentTarget,{selectionStart:_,selectionEnd:w}=x,y=e.slice(0,_)+" "+e.slice(w);t(y),requestAnimationFrame(()=>{x.selectionStart=x.selectionEnd=_+1})}};return h.jsxs("div",{className:"file-view-editwrap flex items-stretch h-full min-h-0 relative",children:[h.jsx("pre",{ref:g,className:"file-view-gutter m-0 pt-3.5 pb-3.5 font-mono text-sm leading-[1.55] pl-3.5 pr-2.5 text-right text-muted select-none bg-background border-r border-r-border-variant shrink-0 overflow-hidden","aria-hidden":"true",children:Array.from({length:d},(S,x)=>x+1).join(` -`)}),h.jsxs("div",{className:"relative flex-1 min-w-0",children:[h.jsx("pre",{ref:f,className:"file-view-code absolute inset-0 m-0 pt-3.5 pb-3.5 font-mono text-sm leading-[1.55] pl-4 pr-4 [tab-size:4] whitespace-pre overflow-hidden pointer-events-none","aria-hidden":"true",children:h.jsx("code",{children:u})}),h.jsx("textarea",{ref:m,className:"file-view-editarea absolute inset-0 m-0 pt-3.5 pb-3.5 font-mono text-sm leading-[1.55] pl-4 pr-4 [tab-size:4] whitespace-pre overflow-auto resize-none border-0 bg-transparent text-transparent caret-[var(--text)] outline-none",value:e,onChange:S=>t(S.target.value),onScroll:b,onKeyDown:k,onBlur:r,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",wrap:"off"})]})]})}function eZ({projectId:e,path:t,source:n="repo",sessionId:r,gitRef:i,line:a,branchLabel:o,onOpenFile:l,scrollPosition:u,onScrollPositionChange:d,lineScrollRequest:m,onLineScrollRequestHandled:f}){const[g,b]=R.useState(null),[k,S]=R.useState(null),[x,_]=R.useState(!0),[w,y]=R.useState(0),C=n==="artifacts",N=n==="abs",E=Y2(t),j=t.split("/").slice(0,-1).join("/"),[T,D]=R.useState(!1),[I,$]=R.useState(""),[F,U]=R.useState(!1),[G,X]=R.useState(null),Y=R.useRef(null),Z=R.useRef(u),Q=(g==null?void 0:g.file)??null,z=(g==null?void 0:g.source)==="checkout"?g.file.path:t,O=pE(Q==null?void 0:Q.presentation),H=(g==null?void 0:g.source)==="artifact"&&!C,V=C&&(g==null?void 0:g.source)==="checkout",W=(g==null?void 0:g.source)==="artifact",re=!i&&(g==null?void 0:g.source)==="checkout"&&Q!=null&&!Q.notFound,le=re&&Q!=null&&!Q.binary&&!Q.truncated&&!O&&!(r!=null&&(g==null?void 0:g.source)==="checkout"&&g.file.root==="clone"),pe=le&&!(E&&!T),te=R.useMemo(()=>((Q==null?void 0:Q.content)??"").replace(/\r\n/g,` -`),[Q==null?void 0:Q.content]),B=le&&I!==te,ie=R.useRef(null);R.useEffect(()=>{const De=(Q==null?void 0:Q.content)??"";if(ie.current!==null&&De===ie.current){ie.current=null;return}$(De.replace(/\r\n/g,` -`)),X(null)},[Q==null?void 0:Q.content,t]);const oe=async()=>{if(!le||Q==null||!B||F)return;const De=Q.content.includes(`\r -`)?I.replace(/\n/g,`\r -`):I;U(!0),X(null);try{await OR(e,z,De,{sessionId:r}),ie.current=De,b(ot=>ot&&ot.source==="checkout"?{source:"checkout",file:{...ot.file,content:De}}:ot)}catch(ot){X(ot instanceof Error?ot.message:String(ot))}finally{U(!1)}},[be,ge]=R.useState(!1),[Ce,Le]=R.useState(null),Ue=async()=>{ge(!0),Le(null);try{await IR(e,z,{sessionId:r})}catch(De){Le(De instanceof Error?De.message:String(De))}finally{ge(!1)}},Fe=`${N?LR(t):W?sh(e,t):RR(e,z,{sessionId:r,ref:i})}&v=${w}`;R.useEffect(()=>{let De=!1;_(!0);const ot=async()=>{const Ze=await fD(e,t),ct=(Ze==null?void 0:Ze.presentation)==="text"||(Ze==null?void 0:Ze.presentation)==="unknown",st=Ze&&ct?await bS(e,t):null,xe=Ze===null||ct&&st===null;return{path:t,content:(st==null?void 0:st.content)??"",truncated:(st==null?void 0:st.truncated)??!1,binary:(st==null?void 0:st.binary)??(Ze==null?void 0:Ze.presentation)==="download",notFound:xe,presentation:st?st.binary?"download":"text":(Ze==null?void 0:Ze.presentation)??"download"}},Bt=async()=>{for(const Ze of[`artifacts/${t}`,t]){const ct=await i3(e,Ze,{sessionId:r}).catch(()=>null);if(ct&&!ct.notFound)return ct}return null};return(N?DR(t).then(Ze=>({source:"absolute",file:Ze})):C?ot().then(async Ze=>{if(!Ze.notFound)return{source:"artifact",file:Ze};const ct=await Bt();return ct?{source:"checkout",file:ct}:{source:"artifact",file:Ze}}):i3(e,t,{sessionId:r,ref:i}).then(Ze=>Ze.notFound&&!i?ot().then(ct=>ct.notFound?{source:"checkout",file:Ze}:{source:"artifact",file:ct,checkoutRoot:Ze.root}):{source:"checkout",file:Ze})).then(Ze=>{De||(b(Ze),S(null))}).catch(Ze=>{De||S(Ze.message)}).finally(()=>{De||_(!1)}),()=>{De=!0}},[e,t,n,r,i,w]),R.useLayoutEffect(()=>{const De=Y.current,ot=Z.current;!De||!Q||!ot||(De.scrollTop=ot.top,De.scrollLeft=ot.left)},[Q]);const mt=De=>De.source==="absolute"?"File not found on disk.":C?`File not found in the project's artifacts or the ${r?"session's worktree":"project clone"}.`:i?`File not found on branch ${i}.`:r&&De.source==="checkout"&&De.file.root==="clone"?"This session's worktree isn't available, and the file isn't in the project clone or its artifacts.":`File not found in the ${(De.source==="checkout"?De.file.root:De.checkoutRoot)==="worktree"?"session's worktree":"project clone"} or the project's artifacts.`;return h.jsxs("div",{className:"file-view flex flex-col h-full min-h-0",children:[h.jsxs("div",{className:"file-view-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant text-text shrink-0",children:[h.jsx(th,{size:13,style:{flexShrink:0}}),h.jsx("code",{className:"file-view-path font-mono text-sm text-text flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",title:z,children:z}),o&&h.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 font-mono text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:`Branch: ${o}`,children:[h.jsx(nh,{size:11}),o]}),pe&&(F||B||G)&&h.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-xs shrink-0 ${G?"text-accent-red":"text-muted"}`,title:G??(F?"Saving…":"Unsaved — ⌘S or click away to save"),children:F?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:qt})," Saving…"]}):G?"Save failed":"Unsaved"}),E&&h.jsx("button",{className:`${Xn} ${T?"active":""}`,"data-tip":T?"Rendered view":"View source","data-tip-align":"end","aria-label":T?"Rendered view":"View source",onClick:()=>D(De=>!De),children:h.jsx(K8,{size:13})}),re&&h.jsx("button",{className:Xn,"data-tip":Ce??"Open in default editor","data-tip-align":"end","aria-label":"Open in default editor",disabled:be,onClick:()=>void Ue(),children:be?h.jsx("span",{className:qt}):h.jsx(xd,{size:13})}),h.jsx("button",{className:Xn,"data-tip":"Reload file","data-tip-align":"end","aria-label":"Reload file",onClick:()=>y(De=>De+1),children:x?h.jsx("span",{className:qt}):h.jsx(rS,{size:13})})]}),!k&&V&&(g==null?void 0:g.source)==="checkout"&&h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:["Not in the project's artifacts — showing the copy from the"," ",g.file.root==="worktree"?"session's worktree":"project clone","."]}),h.jsxs("div",{ref:Y,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:De=>{const ot={top:De.currentTarget.scrollTop,left:De.currentTarget.scrollLeft};Z.current=ot,d==null||d(ot)},children:[!pe&&!k&&!C&&(g==null?void 0:g.source)==="checkout"&&!g.file.notFound&&!i&&r&&g.file.root==="clone"&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:"This session's worktree isn't available — showing the project clone's copy."}),!pe&&!k&&(g==null?void 0:g.source)==="artifact"&&!g.file.notFound&&H&&h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["Not in the ",g.checkoutRoot==="worktree"?"session's worktree":"project clone"," — showing the copy from the project's artifacts."]}),k?h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["Failed to load file: ",k]}):Q===null?h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:"Loading…"}):Q.notFound?h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:g?mt(g):"File not found."}):O?h.jsx(mE,{kind:O,url:Fe,name:t.split("/").pop()??t}):Q.binary?h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:["Binary file — no inline preview. ",h.jsx("a",{href:Fe,download:t.split("/").pop()??t,children:"Download"})]}):E&&!T?h.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-[1.5em] [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-[1.25em] [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-[1.1em]",children:W?h.jsx(xE,{projectId:e,folder:j,markdown:Q.content}):h.jsx(La,{text:Q.content,onOpenFile:l&&(De=>l(N&&!De.startsWith("/")?`${j}/${De}`:De,r,i))})}):pe?h.jsx(JK,{value:I,onChange:De=>{$(De),G&&X(null)},onSave:()=>void oe(),onBlur:()=>void oe(),path:t,highlightLine:a,scrollRequest:m,onScrollRequestHandled:f}):h.jsxs(h.Fragment,{children:[h.jsx(fE,{text:Q.content,path:t,highlightLine:a,scrollRequest:m,onScrollRequestHandled:f}),Q.truncated&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:"File truncated — showing the first 512 KB."})]})]})]})}const ab=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function tZ({projectName:e,onHome:t,onNewProject:n,onRepository:r,onCollapse:i}){const{open:a,setOpen:o,ref:l}=Bo(),u=R.useRef(null);return R.useEffect(()=>{if(!a)return;const d=m=>{var f;m.key==="Escape"&&((f=u.current)==null||f.focus())};return document.addEventListener("keydown",d,!0),()=>document.removeEventListener("keydown",d,!0)},[a]),h.jsxs("div",{className:"rail-brand flex items-center gap-1 h-16 p-2 border-b border-b-border shrink-0 [&_.project-switcher]:relative [&_.project-switcher]:flex-1 [&_.project-switcher]:self-stretch [&_.project-switcher]:min-w-0 [&_.project-back]:shrink-0 [&_.brand]:flex [&_.brand]:items-center [&_.brand]:justify-between [&_.brand]:gap-2 [&_.brand]:w-full [&_.brand]:h-full [&_.brand]:min-w-0 [&_.brand]:font-semibold [&_.brand]:text-base [&_.brand]:text-text [&_.brand]:py-1 [&_.brand]:px-1.5 [&_.brand]:border [&_.brand]:border-transparent [&_.brand]:rounded-sm [&_.brand:hover]:bg-surface [&_.brand:hover]:border-border [&_.brand.open]:bg-surface [&_.brand.open]:border-border [&_.brand_svg]:shrink-0 [&_.brand-project-copy]:flex [&_.brand-project-copy]:flex-col [&_.brand-project-copy]:gap-[3px] [&_.brand-project-copy]:min-w-0 [&_.brand-project-copy]:leading-[1.15] [&_.brand-project-copy]:text-left [&_.brand-project-label]:text-muted [&_.brand-project-label]:text-2xs [&_.brand-project-label]:font-medium [&_.brand-project-label]:tracking-[0.04em] [&_.brand-project-label]:uppercase [&_.brand_.brand-project]:min-w-0 [&_.brand_.brand-project]:overflow-hidden [&_.brand_.brand-project]:text-ellipsis [&_.brand_.brand-project]:whitespace-nowrap [&_.brand_.brand-project]:text-2xl [&_.project-chevron]:text-muted [&_.project-chevron]:opacity-0 [&_.project-chevron]:transition-transform [&_.project-chevron]:duration-120 [&_.project-chevron]:ease-standard [&_.brand:hover_.project-chevron]:opacity-100 [&_.brand.open_.project-chevron]:opacity-100 [&_.brand.open_.project-chevron]:rotate-180 [&_.project-menu]:left-0 [&_.project-menu]:w-52.5 [&_.project-menu]:z-70",children:[h.jsx("button",{className:`${Xn} project-back !text-text`,"aria-label":"All projects",onClick:t,children:h.jsx(Cf,{size:18})}),h.jsxs("div",{className:"project-switcher",ref:l,children:[h.jsxs("button",{ref:u,className:`brand${a?" open":""}`,onClick:()=>o(d=>!d),"aria-expanded":a,children:[h.jsxs("span",{className:"brand-project-copy",children:[h.jsx("span",{className:"brand-project-label",children:"Project"}),h.jsx("span",{className:"brand-project",children:e})]}),h.jsx(Rl,{className:"project-chevron",size:14})]}),a&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu",children:[h.jsx("button",{className:hi,onClick:()=>{o(!1),r()},children:h.jsxs("span",{className:ab,children:[h.jsx(eS,{size:14}),"Configure Repository"]})}),h.jsx("button",{className:hi,onClick:()=>{o(!1),t()},children:h.jsxs("span",{className:ab,children:[h.jsx(yM,{size:14}),"All projects"]})}),h.jsx("button",{className:hi,onClick:()=>{var d;(d=u.current)==null||d.focus(),o(!1),n()},children:h.jsxs("span",{className:ab,children:[h.jsx(dM,{size:14}),"Create a new project"]})})]})]}),i&&h.jsx("button",{className:Xn,"data-tip":"Hide sidebar","data-tip-align":"end","aria-label":"Hide sidebar",onClick:i,children:h.jsx(nS,{size:15})})]})}const S7=["onb-gate-hint text-base font-semibold leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),Bd=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),k7=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-semibold leading-normal","text-text onb-git-hint mt-2"].join(" "),TE=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),C7=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-semibold leading-normal","text-text"].join(" "),E7="Couldn't reach orx. Check it's still running, then re-check.",nZ=["AI/ML","Biology","Physics","Other"];function rZ({onDone:e,preferredAgent:t}){const[n,r]=R.useState(0),[i,a]=R.useState(null),[o,l]=R.useState(),[u,d]=R.useState(!1),[m,f]=R.useState(null),[g,b]=R.useState(null),[k,S]=R.useState(!1),[x,_]=R.useState([]),[w,y]=R.useState(""),[C,N]=R.useState(""),[E,j]=R.useState([]),[T,D]=R.useState(""),[I,$]=R.useState([]),[F,U]=R.useState(!1),G=R.useRef(0),[X,Y]=R.useState(!1),[Z,Q]=R.useState(!1),z=(i==null?void 0:i.some(B=>B.agentReady))??!1,O=o!=null,H=R.useRef(0),V=(B,ie=!1)=>{const oe=++H.current;S(!0),Y(!1),Q(!1),l(void 0);const be=()=>oe===H.current;Promise.allSettled([Tf(B,ie).then(ge=>be()&&a(ge)),cS().then(ge=>be()&&l(ge.gitVersion))]).then(([ge,Ce])=>{be()&&(ge.status==="rejected"&&(Y(!0),a(null)),Ce.status==="rejected"&&(Q(!0),l(void 0)))}).finally(()=>be()&&S(!1))};R.useEffect(()=>V(!1),[]),R.useEffect(()=>{if(i===null)return;const B=i.filter(ie=>ie.agentReady);b(ie=>{var be;if(ie&&B.some(ge=>ge.id===ie))return ie;const oe=t&&B.find(ge=>ge.id===t.harness);return(oe==null?void 0:oe.id)??((be=B[0])==null?void 0:be.id)??null})},[i,t]),R.useEffect(()=>c_(()=>{Tf(!0).then(B=>{a(B),Y(!1)}).catch(()=>Y(!0))}),[]),R.useEffect(()=>{mD().then(B=>{_(B.researchAreas),y(B.otherArea??""),N(B.background??""),j(B.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const B=T.trim();if(B.length<3){$([]),U(!1);return}const ie=++G.current;U(!0);const oe=setTimeout(()=>{uS(B).then(be=>ie===G.current&&$(be)).catch(()=>ie===G.current&&$([])).finally(()=>ie===G.current&&U(!1))},350);return()=>clearTimeout(oe)},[T]);const W=B=>{const ie=E.some(oe=>oe.paperId===B.paperId);j(oe=>oe.some(be=>be.paperId===B.paperId)?oe:[...oe,{paperId:B.paperId,title:A7(B.title)}]),D(""),$([]),ie||Eb(B.paperId).then(oe=>{var ge;const be=(ge=oe.title)==null?void 0:ge.trim();be&&j(Ce=>Ce.map(Le=>Le.paperId===B.paperId?{...Le,title:be}:Le))}).catch(()=>{})},re=B=>j(ie=>ie.filter(oe=>oe.paperId!==B)),le=B=>{_(ie=>ie.includes(B)?ie.filter(oe=>oe!==B):[...ie,B])},pe=x.length>0&&(!x.includes("Other")||w.trim().length>0),te=async()=>{const B=i==null?void 0:i.find(oe=>oe.id===g&&oe.agentReady);if(!B||u)return;const ie=sZ(B);d(!0),f(null);try{const oe=await _R(ie,{researchAreas:x,otherArea:x.includes("Other")?w:null,background:C||null,papers:E});e(oe.project,oe.selection)}catch(oe){f(oe instanceof Error?oe.message:String(oe))}finally{d(!1)}};return h.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${n===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:h.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${n===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:n===0?h.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[h.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[h.jsx("div",{className:"onb-intro-brand text-[4rem] leading-none font-semibold tracking-[-0.035em] mb-10",children:h.jsx(cf,{})}),h.jsx("h2",{className:"onb-title mt-0 mx-0 text-[2.5rem] leading-[1.08] tracking-[-0.035em]",children:"A workspace for your research agents"})]}),h.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[h.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),h.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:"Consolidate your research"}),h.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:"Track experiments, artifacts, compute, skills, and code all in one place."})]})}),h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:"Ground your agents"}),h.jsxs("span",{className:"block text-lg leading-[1.55] text-text",children:["Connected to ",h.jsx(ob,{source:"alphaxiv"}),","," ",h.jsx(ob,{source:"biorxiv"}),", and"," ",h.jsx(ob,{source:"openalex"})," ","to ground your agents in the latest research."]})]})}),h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-[0_14px_36px_color-mix(in_oklab,_var(--text)_6%,_transparent)]",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-2xl tracking-[-0.015em]",children:"Everything stays local"}),h.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:"Your code, data, and experiment history stay on your machine."})]})})]})]}),h.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:h.jsxs("button",{className:`${Wr} !py-3.5 !px-7 !text-xl !rounded-lg`,onClick:()=>r(1),children:["Continue ",h.jsx(sg,{size:20})]})})]}):n===1?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"onb-eyebrow text-xl font-semibold text-muted mb-4.5",children:[h.jsx(cf,{})," · Step 1 of 2"]}),h.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:"Choose a coding agent"}),h.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:"OpenResearch uses a coding agent already installed on this machine."}),i!==null&&!z&&h.jsx("p",{className:S7,children:"Sign in to at least one agent to continue."}),i!==null&&z&&g===null&&h.jsx("p",{className:S7,children:"Choose a coding agent to continue."}),h.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:i!==null?i.map(B=>h.jsx(oZ,{h:B,selected:g===B.id,onSelect:()=>b(B.id)},B.id)):X?h.jsx("div",{className:Bd,children:E7}):h.jsxs("div",{className:"onb-loading flex items-center gap-2 text-subtext text-md py-2 px-0",children:[h.jsx("span",{className:qt})," Detecting Claude Code, Codex, OpenCode…"]})}),(o===null||Z)&&h.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[h.jsx(lZ,{gitVersion:o,error:Z}),Z?h.jsx("p",{className:k7,children:E7}):h.jsx("p",{className:k7,children:"Git is required for local experiments. Install Git, then re-check."})]}),h.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[h.jsxs("button",{className:cg,onClick:()=>r(0),children:[h.jsx(Cf,{size:12})," Back"]}),(X||Z||o===null||i!==null&&!z)&&h.jsxs("button",{className:cg,onClick:()=>V(!0,!0),disabled:k,children:[h.jsx(rh,{size:12,className:k?"spin animate-[settings-spin_0.9s_linear_infinite]":""})," Re-check"]}),h.jsx("div",{style:{flex:1}}),h.jsxs("button",{className:Wr,onClick:()=>r(2),disabled:k||!z||g===null||!O,title:k?"Waiting for the local tool checks":z?g===null?"Choose your preferred coding agent":Z?"Re-check Git before continuing":o===void 0?"Waiting for the Git check":o===null?"Install Git to continue":void 0:"Sign in to at least one coding agent to continue",children:["Continue ",h.jsx(sg,{size:13})]})]})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"onb-eyebrow text-xl font-semibold text-muted mb-4.5",children:[h.jsx(cf,{})," · Step 2 of 2"]}),h.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:"Tell us about your research"}),h.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:h.jsxs("div",{className:TE,children:[h.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-semibold [&_legend]:mb-1.5",children:[h.jsx("legend",{children:"What areas are you interested in?"}),h.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:"Choose one or more."}),h.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:nZ.map(B=>h.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[h.jsx("input",{type:"checkbox",checked:x.includes(B),onChange:()=>le(B),disabled:u}),h.jsx("span",{children:B})]},B))}),x.includes("Other")&&h.jsx("input",{className:"onb-other-area w-full mt-2",value:w,onChange:B=>y(B.target.value),disabled:u,placeholder:"Tell us your other research area","aria-label":"Other research area"})]}),h.jsx("label",{className:"onb-field-label text-base font-semibold mb-1.5",htmlFor:"onb-background",children:"Research background"}),h.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:C,onChange:B=>N(B.target.value),disabled:u,rows:4,placeholder:"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods."}),h.jsx("label",{className:"onb-field-label text-base font-semibold mb-1.5",htmlFor:"onb-paper-search",children:"Representative papers"}),h.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:"Add papers that represent your research interests, including papers by other authors."}),h.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[h.jsx("input",{id:"onb-paper-search",value:T,onChange:B=>D(B.target.value),disabled:u,placeholder:"Search alphaXiv by title to link a paper…"}),F?h.jsx("div",{className:Bd,children:"Searching alphaXiv…"}):I.length>0?h.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-left [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-md [&_.title]:font-medium [&_.id]:font-mono [&_.id]:text-xs [&_.id]:text-muted",children:I.map(B=>h.jsxs("button",{type:"button",onClick:()=>W(B),disabled:u,children:[h.jsx("span",{className:Sd,children:A7(B.title)}),h.jsx("span",{className:"id",children:B.paperId})]},B.paperId))}):null]}),E.length>0&&h.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:E.map(B=>h.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pr-1 pb-1 pl-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:font-mono [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[h.jsx("span",{className:Sd,children:B.title||B.paperId}),h.jsx("span",{className:"id",children:B.paperId}),h.jsx("button",{type:"button","aria-label":`Remove ${B.paperId}`,onClick:()=>re(B.paperId),disabled:u,children:h.jsx(qr,{size:12})})]},B.paperId))})]})}),!pe&&h.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:x.length===0?"Choose at least one research area to continue.":"Describe your research area to continue."}),h.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[h.jsxs("button",{className:cg,onClick:()=>r(1),disabled:u,children:[h.jsx(Cf,{size:12})," Back"]}),h.jsx("div",{style:{flex:1}}),h.jsx("button",{className:Wr,onClick:()=>void te(),disabled:u||g===null||!pe,children:u?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:qt})," Setting things up…"]}):h.jsxs(h.Fragment,{children:["Get started ",h.jsx(sg,{size:13})]})})]}),g===null&&h.jsx("p",{className:C7,children:"Your selected agent is no longer ready. Go back to Step 1 and choose another."}),m&&h.jsx("p",{className:C7,children:m})]})})})}function ob({source:e}){return h.jsxs("span",{className:"whitespace-nowrap",children:[h.jsx(d_,{source:e,size:18,decorative:!0,className:"mr-1 inline-flex align-[-0.15em] !rounded-none !bg-transparent !p-0 !shadow-none"}),u_[e]]})}function A7(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function iZ(e){return e.agentReady?{cls:"st-done",label:"Signed in"}:e.installed?e.authState==="unknown"?{cls:"st-starting",label:"Unable to verify"}:e.authState==="unsupported"?{cls:"st-starting",label:"Update required"}:e.installed?{cls:"st-starting",label:"Not signed in"}:{cls:"st-idle",label:"Not detected"}:{cls:"st-idle",label:"Not detected"}}function sZ(e){var n,r;const t=((n=e.models[0])==null?void 0:n.id)??null;return{harness:e.id,model:t,permissionMode:((r=e.options)==null?void 0:r.defaultPermissionMode)??null,reasoningLevel:op(e,t).defaultId}}function aZ({harness:e}){return h.jsx(bv,{harness:e,size:18})}function oZ({h:e,selected:t,onSelect:n}){var l;const r=iZ(e),i=t?{cls:"st-done",label:"Selected"}:r,a=(l=e.version)==null?void 0:l.replace(/\s*\(.*\)$/,""),o=h.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[h.jsxs("span",{className:"onb-card-identity flex items-center gap-2.5 min-w-0",children:[h.jsx(aZ,{harness:e.id}),h.jsx("span",{className:"onb-card-name font-semibold text-base",children:e.name})]}),h.jsxs("span",{className:`${f_} ${i.cls}`,children:[e.agentReady?h.jsx(Di,{size:12,strokeWidth:3}):h.jsx("span",{className:"dot"}),i.label]})]});return e.agentReady?h.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-[5px] bg-background border border-border rounded-lg py-4.5 px-5 onb-agent-choice w-full text-inherit [font:inherit] text-left transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-[0_0_0_1px_var(--accent)]${t?" selected":""}`,"aria-pressed":t,onClick:n,children:[o,h.jsxs("div",{className:`onb-card-detail ${tn}`,children:[e.account??"API key",e.plan?` · ${e.plan}`:""]}),h.jsx("div",{className:Bd,children:[a,e.models.length>0&&`${e.models.length} model${e.models.length===1?"":"s"} — ${e.models.slice(0,3).map(u=>Af(u)).join(", ")}${e.models.length>3?", …":""}`].filter(Boolean).join(" · ")})]}):h.jsxs("div",{className:"onb-card flex flex-col gap-[5px] bg-background border border-border rounded-lg py-4.5 px-5 onb-agent-choice w-full text-inherit [font:inherit] text-left transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-[0_0_0_1px_var(--accent)]",children:[o,h.jsx("div",{className:Bd,children:j2(e.agentNote)})]})}function lZ({gitVersion:e,error:t}){return h.jsxs("div",{className:TE,children:[h.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[h.jsx("span",{className:"onb-card-name font-semibold text-base",children:"Local Git"}),h.jsxs("span",{className:`${f_} ${e?"st-done":t||e===null?"st-failed":"st-starting"}`,children:[e?h.jsx(Di,{size:12,strokeWidth:3}):h.jsx("span",{className:"dot"}),e?"Ready":t?"Check failed":e===null?"Not found":"Checking"]})]}),(e||!t&&e===void 0)&&h.jsx("div",{className:Bd,children:e??"Checking Git…"})]})}function T7(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"research-project"}function cZ(e){const n=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(n)?n:null}function uZ(e){const t=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return t?{owner:t[1],repo:t[2].replace(/\.git$/,"")}:null}function dZ(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function hZ({onCreated:e,onCancel:t}){const[n,r]=R.useState("folder"),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,d]=R.useState(""),[m,f]=R.useState(!1),[g,b]=R.useState(null),[k,S]=R.useState(null),[x,_]=R.useState(!1),[w,y]=R.useState(!1),[C,N]=R.useState(!1),[E,j]=R.useState(null),[T,D]=R.useState(!1),[I,$]=R.useState(void 0),[F,U]=R.useState("research-project"),[G,X]=R.useState(null),[Y,Z]=R.useState(!1),[Q,z]=R.useState(!1),[O,H]=R.useState(""),[V,W]=R.useState(null),[re,le]=R.useState([]),[pe,te]=R.useState(!1),B=R.useRef(0),ie=R.useRef(0),oe=R.useRef(0),be=R.useRef({folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),Ce=(n==="paper"?uZ(V==null?void 0:V.repoUrl):null)??(g!=null&&g.githubOwner&&g.githubRepo?{owner:g.githubOwner,repo:g.githubRepo}:null);R.useEffect(()=>{wR().then(({login:Oe})=>$(Oe)).catch(()=>$(null)),a_().then(Oe=>D(Oe.githubForNewProjects)).catch(()=>{})},[]),R.useEffect(()=>{let Oe=!0;Z(!0);const tt=setTimeout(()=>{SR(i.trim()).then(({repo:it})=>Oe&&U(it)).catch(()=>Oe&&U(T7(i))).finally(()=>Oe&&Z(!1))},150);return()=>{Oe=!1,clearTimeout(tt)}},[i]),R.useEffect(()=>{let Oe=!0;if(X(null),z(!!Ce),!!Ce)return kR(Ce.owner,Ce.repo).then(({canPush:tt})=>{Oe&&tt&&X(`github.com/${Ce.owner}/${Ce.repo}`)}).catch(()=>{}).finally(()=>Oe&&z(!1)),()=>{Oe=!1}},[Ce==null?void 0:Ce.owner,Ce==null?void 0:Ce.repo]),R.useEffect(()=>{if(n!=="paper"||!V||m)return;const Oe=`~/OpenResearch/${T7(i||V.title||V.paperId)}`;Oe!==u&&(b(null),_(!0),d(Oe))},[n,i,V,u,m]),R.useEffect(()=>{const Oe=++ie.current;_(!0),S(null);const tt=setTimeout(()=>{cS(u.trim()).then(it=>{Oe===ie.current&&b(it)}).catch(it=>{Oe===ie.current&&(b(null),S(it instanceof Error?it.message:String(it)))}).finally(()=>{Oe===ie.current&&_(!1)})},u.trim()?200:0);return()=>clearTimeout(tt)},[n,u]),R.useEffect(()=>{const Oe=++B.current;if(n!=="paper"||V){te(!1);return}const tt=O.trim(),it=cZ(tt);if(!it&&tt.length<3){le([]),te(!1);return}te(!0);const jt=setTimeout(()=>{if(it){Eb(it).then(_t=>{var Tt;Oe===B.current&&(W(_t),o||a(((Tt=_t.title)==null?void 0:Tt.trim().slice(0,60))||_t.paperId))}).catch(_t=>Oe===B.current&&j(_t instanceof Error?_t.message:String(_t))).finally(()=>Oe===B.current&&te(!1));return}uS(tt).then(_t=>Oe===B.current&&le(_t)).catch(_t=>Oe===B.current&&j(_t instanceof Error?_t.message:String(_t))).finally(()=>Oe===B.current&&te(!1))},350);return()=>clearTimeout(jt)},[n,V,O,o]);async function Le(Oe){var it;const tt=++B.current;te(!0),j(null);try{const jt=await Eb(Oe);if(tt!==B.current)return;W(jt),le([]),o||a(((it=jt.title)==null?void 0:it.trim().slice(0,60))||jt.paperId)}catch(jt){tt===B.current&&j(jt instanceof Error?jt.message:String(jt))}finally{tt===B.current&&te(!1)}}function Ue(){B.current+=1,oe.current+=1,W(null),H(""),le([]),te(!1),y(!1),d(""),f(!1),o||a("")}function We(Oe){if(Oe===n)return;B.current+=1,oe.current+=1,be.current[n]={name:i,nameTouched:o,path:u,pathTouched:m};const tt=be.current[Oe];r(Oe),j(null),S(null),b(null),te(!1),y(!1),a(tt.name),l(tt.nameTouched),d(tt.path),f(tt.pathTouched)}async function Fe(){if(w)return;const Oe=++oe.current;y(!0),j(null);try{const tt=await xR();if(Oe!==oe.current||!tt)return;if(f(!0),tt!==u&&(b(null),_(!0),d(tt)),n==="folder"&&!o){const it=tt.replace(/[\\/]+$/,"").split(/[\\/]/).pop();it&&a(it)}}catch(tt){Oe===oe.current&&j(tt instanceof Error?tt.message:String(tt))}finally{Oe===oe.current&&y(!1)}}async function mt(Oe){if(Oe.preventDefault(),!!xe){N(!0),j(null);try{const tt=await yR({name:i.trim(),path:u.trim(),createFolder:n==="paper",initializeGit:!0,githubSyncEnabled:T,...n==="paper"&&V?{paperId:V.paperId,cloneUrl:V.repoUrl??void 0}:{}});e(tt.project,tt.githubPublicationError)}catch(tt){j(tt instanceof Error?tt.message:String(tt))}finally{N(!1)}}}const De=(g==null?void 0:g.gitVersion)===null,ot=n==="folder"&&!!u.trim()&&g!==null&&g.exists===!1,Bt=!!u.trim()&&(g==null?void 0:g.exists)===!0&&g.directory===!1,on=n==="paper"&&!!(V!=null&&V.repoUrl)&&(g==null?void 0:g.empty)===!1,Ze=n==="folder"&&((g==null?void 0:g.gitState)==="detached"||(g==null?void 0:g.gitState)==="invalid"),ct=Bt||on,st=Bt?"Choose a different destination. This path is a file, not a folder.":on?"Choose a different destination. The paper repository needs a new or empty folder.":V!=null&&V.repoUrl?(g==null?void 0:g.exists)===!1?"OpenResearch will create this folder and clone the paper's repository into it.":"OpenResearch will clone the paper's repository here and use it as your local workspace.":(g==null?void 0:g.exists)===!1?"OpenResearch will create this folder and initialize it as the local project workspace.":"OpenResearch will use this folder as the local workspace and initialize Git if needed.",xe=!!(i.trim()&&u.trim())&&!C&&!w&&!x&&g!==null&&!k&&!De&&!ot&&!Bt&&!on&&!Ze&&(n!=="paper"||!!(V!=null&&V.repoUrl))&&(!T||typeof I=="string"&&!Y&&!Q),Me=G??`github.com/${I??"you"}/${F}`,Qe=I===void 0||Y||Q?"Checking":G?"Pushes to":"Creates";return h.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-mono [&_.repo-hint]:font-normal [&_.repo-hint]:text-xs [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-left [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-[0_2px_8px_rgb(0_0_0_/_5%)] [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-semibold [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-semibold [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pr-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:pl-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-[color-mix(in_srgb,_var(--accent-red)_35%,_var(--border-variant))] [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-left [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-md [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:font-mono [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:font-mono [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-md [&_.paper-pick_.title]:font-semibold flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-xs [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.new-project-actions_.primary]:ml-auto [&_.error]:text-accent-red [&_.error]:text-md [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:mt,children:[h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-md [&_button]:font-semibold [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[h.jsx("button",{type:"button",className:n==="folder"?"active":"","aria-pressed":n==="folder",onClick:()=>We("folder"),children:"From folder"}),h.jsx("button",{type:"button",className:n==="paper"?"active":"","aria-pressed":n==="paper",onClick:()=>We("paper"),children:"From a paper"})]}),n==="paper"&&!V&&h.jsxs("label",{children:["Paper",h.jsx("input",{value:O,onChange:Oe=>H(Oe.target.value),placeholder:"arXiv id, URL, or title",autoFocus:!0}),h.jsx("span",{className:"repo-hint",children:pe?"Searching alphaXiv…":"The public code repository is cloned without credentials."}),re.length>0&&h.jsx("div",{className:"paper-results",children:re.map(Oe=>h.jsxs("button",{type:"button",onClick:()=>void Le(Oe.paperId),children:[h.jsx("span",{className:Sd,children:Oe.title}),h.jsx("span",{className:"id",children:Oe.paperId})]},Oe.paperId))})]}),V&&n==="paper"&&h.jsxs("div",{className:"paper-pick",children:[h.jsxs("div",{className:"meta",children:[h.jsx("div",{className:Sd,children:V.title||V.paperId}),V.repoUrl?h.jsx("div",{className:"id",children:dZ(V.repoUrl)}):h.jsxs("div",{className:"mt-[9px] inline-flex w-fit items-center gap-[5px] rounded-full border border-border-variant bg-background px-[9px] py-1 text-sm font-medium text-subtext",children:[h.jsx(Hj,{size:14})," No public repository"]})]}),h.jsx("button",{type:"button",className:Kn,"aria-label":"Change selected paper",onClick:Ue,children:"Change"})]}),(n!=="paper"||(V==null?void 0:V.repoUrl))&&h.jsxs(h.Fragment,{children:[n==="paper"?h.jsxs("div",{className:"project-location-field",children:[h.jsx("div",{className:"project-location-label",children:V!=null&&V.repoUrl?"Clone destination":"Project location"}),h.jsxs("div",{className:"paper-destination",children:[h.jsx("code",{title:u,children:u}),h.jsx("button",{type:"button",className:Kn,"aria-label":`${V!=null&&V.repoUrl?"Change clone destination":"Change project location"}; current location: ${u}`,"aria-describedby":"paper-destination-description",disabled:w,onClick:()=>void Fe(),children:w?"Choosing…":"Change…"})]}),h.jsx("span",{id:"paper-destination-description",className:`folder-picker-hint${ct?" error":""}`,children:st})]}):h.jsxs("button",{type:"button",className:"folder-picker-control","aria-label":u?`Change project folder; current folder: ${u}`:"Choose or create a project folder",disabled:w,title:u||void 0,onClick:()=>void Fe(),children:[h.jsx(yd,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),h.jsx("span",{className:u?tn:"placeholder",children:w?"Choosing…":u||"Choose or create a folder"}),h.jsx(Xs,{className:"folder-picker-chevron",size:15})]}),u&&h.jsxs("label",{children:[h.jsx("span",{className:"project-field-label",children:"Project name"}),h.jsx("input",{value:i,onChange:Oe=>{l(!0),a(Oe.target.value)},placeholder:"my-research",autoFocus:!0})]}),De&&h.jsx("div",{className:"project-path-notice error",children:"Git is required for experiments but is not installed. Install Git, then restart OpenResearch."}),!De&&u.trim()&&x&&h.jsx("span",{className:`repo-hint ${tn}`,children:"Checking folder…"}),!De&&n==="folder"&&u.trim()&&!x&&(g==null?void 0:g.exists)===!1&&h.jsx("div",{className:"project-path-notice error",children:"That folder no longer exists. Choose it again."}),!De&&n==="folder"&&u.trim()&&!x&&Bt&&h.jsx("div",{className:"project-path-notice error",children:"The selected path is not a folder."}),!De&&n==="folder"&&!x&&(g==null?void 0:g.gitState)==="detached"&&h.jsx("div",{className:"project-path-notice error",children:"Check out a Git branch before importing this folder."}),!De&&n==="folder"&&!x&&(g==null?void 0:g.gitState)==="invalid"&&h.jsx("div",{className:"project-path-notice error",children:"The selected folder contains an invalid Git repository."}),!De&&n==="folder"&&!x&&(g==null?void 0:g.directory)&&g.initialized===!1&&h.jsx("div",{className:"project-path-notice",children:"This folder is not a Git repository. OpenResearch will initialize Git here."}),k&&h.jsx("div",{className:"project-path-notice error",children:k})]}),E&&h.jsx("div",{className:"error",children:E}),(n!=="paper"||(V==null?void 0:V.repoUrl))&&u&&h.jsxs("label",{className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[h.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[h.jsx("input",{className:"m-0",type:"checkbox",checked:T,onChange:Oe=>D(Oe.target.checked),disabled:C}),h.jsx("strong",{className:"text-base font-semibold leading-[1.3] text-text",children:"Sync experiments to GitHub"})]}),h.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext [&_code]:text-sm [&_code]:text-inherit",children:[h.jsxs("span",{children:[Qe," ",h.jsx("code",{children:Me}),"."]}),h.jsx("span",{children:"Experiment branches will be pushed to the remote GitHub repository."}),I===null&&h.jsx("span",{children:"Connect GitHub before creating the project."})]})]}),h.jsxs("div",{className:"actions new-project-actions",children:[t&&h.jsx("button",{type:"button",className:fi,onClick:t,children:"Cancel"}),h.jsx("button",{className:Wr,disabled:!xe,children:C?"Creating…":n==="paper"?V!=null&&V.repoUrl?"Clone paper project":"Create paper project":"Create local project"})]})]})}function NE({onClose:e,onCreated:t}){const n=R.useRef(null),r=R.useRef(e);return r.current=e,R.useEffect(()=>{const i=n.current;if(!i)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(o()[0]??i).focus();const l=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),r.current();return}if(u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!u.altKey&&u.shiftKey){u.preventDefault(),u.stopPropagation();return}if(u.key!=="Tab")return;const d=o();if(d.length===0){u.preventDefault(),i.focus();return}const m=d[0],f=d[d.length-1];u.shiftKey&&document.activeElement===m?(u.preventDefault(),f.focus()):!u.shiftKey&&document.activeElement===f&&(u.preventDefault(),m.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),h.jsx("div",{className:"modal-backdrop fixed inset-0 bg-[rgba(29,_27,_26,_0.42)] flex items-center justify-center p-5 overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:h.jsxs("div",{ref:n,className:"modal w-120 max-w-full max-h-[calc(100vh_-_40px)] overflow-y-auto bg-background border border-border rounded-xl shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)] p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[h.jsx("h2",{id:"new-project-dialog-title",children:"New project"}),h.jsx(hZ,{onCancel:e,onCreated:t})]})})}function N7({projects:e,onOpen:t,onCreated:n,onDeleted:r}){const[i,a]=R.useState(!1),[o,l]=R.useState(null);async function u(d){const m=!!(d.githubUrl||d.githubOwner&&d.githubRepo);if(window.confirm(`Delete project "${d.name}"? - -Its experiments, runs and chats are removed from orx. The local folder (${d.path})${m?" and its GitHub repository":""} are kept.`)){l(d.id);try{await ER(d.id),r(d.id)}catch(g){window.alert(g instanceof Error?g.message:String(g))}finally{l(null)}}}return h.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[h.jsxs("div",{className:"home-inner max-w-155 my-0 mx-auto pt-12 px-6 pb-16",children:[h.jsx("div",{className:"home-brand font-display text-4xl tracking-[-0.02em] mb-9",children:h.jsx(cf,{})}),h.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-2xl [&_h2]:tracking-[-0.01em]",children:[h.jsx("h2",{children:"Projects"}),h.jsxs("button",{className:fi,onClick:()=>a(!0),children:[h.jsx(r_,{size:15})," New project"]})]}),h.jsx("div",{className:"home-list flex flex-col gap-2.5",children:e.length===0?h.jsx("div",{className:"changes-note text-sm text-muted",children:"No projects yet — create one to get started."}):[...e].sort((d,m)=>m.updatedAt-d.updatedAt).map(d=>{const m=!!(d.githubUrl||d.githubOwner&&d.githubRepo),f=d.githubUrl??(d.githubOwner&&d.githubRepo?`https://github.com/${d.githubOwner}/${d.githubRepo}`:null),g=d.githubEnabled?"GitHub syncing on":m?"GitHub syncing off":"local only";return h.jsxs("div",{className:"project-card relative flex flex-col gap-1 text-left py-3.5 px-4 bg-background border border-border rounded-lg cursor-pointer transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-[0_3px_12px_color-mix(in_srgb,_var(--text)_8%,_transparent)] [&_>_:not(.project-card-open,_.project-delete)]:relative [&_>_:not(.project-card-open,_.project-delete)]:z-1 [&_>_:not(.project-card-open,_.project-delete)]:pointer-events-none [&_.project-delete]:absolute [&_.project-delete]:top-2.5 [&_.project-delete]:right-2.5 [&_.project-delete]:z-2 [&_.project-delete]:hidden [&_.project-delete]:p-[5px] [&_.project-delete]:rounded-sm [&_.project-delete]:text-muted [&_.project-delete]:leading-[0] [&:is(:hover,_:focus-within)_.project-delete]:block [&_.name]:font-semibold [&_.name]:text-base [&_.paper]:text-xs [&_.paper]:text-muted [&_.time]:text-xs [&_.time]:text-muted",children:[h.jsx("button",{className:"project-card-open absolute inset-0 rounded-[inherit] [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2","aria-label":`Open ${d.name}`,onClick:()=>t(d.id)}),h.jsx("span",{className:"name",children:d.name}),h.jsxs("span",{className:`project-card-sync [&_a]:pointer-events-auto inline-flex items-center self-start gap-[7px] text-text [&_a]:inline-flex [&_a]:text-subtext [&_a:hover]:text-text ${tn}`,children:[g,d.githubEnabled&&f&&h.jsx("a",{href:f,target:"_blank",rel:"noreferrer","data-tip":"Open repository on GitHub","aria-label":`Open ${d.name} on GitHub`,onClick:b=>b.stopPropagation(),children:h.jsx(jp,{size:14})})]}),d.paperId&&h.jsxs("span",{className:`paper ${tn}`,children:["arXiv ",d.paperId]}),h.jsxs("span",{className:"time",children:["created ",Gs(d.createdAt)]}),h.jsx("button",{className:"project-delete [&:hover]:text-[var(--danger,_#d33)] [&:hover]:bg-[var(--overlay,_rgba(0,_0,_0,_0.05))]","data-tip":`Delete ${d.name}`,"data-tip-align":"end","aria-label":`Delete ${d.name}`,disabled:o===d.id,onClick:b=>{b.stopPropagation(),u(d)},children:h.jsx(ih,{size:14})})]},d.id)})})]}),i&&h.jsx(NE,{onClose:()=>a(!1),onCreated:(d,m)=>{a(!1),n(d,m)}})]})}const j7=["experiment-table-action inline-flex items-center gap-1.5 py-1.5 px-2.5","border border-border rounded-md bg-background text-text","text-sm font-medium leading-none","[&:hover:not(:disabled)]:bg-surface","[&:hover:not(:disabled)]:border-border-strong [&:disabled]:text-muted","[&:disabled]:cursor-default [&:disabled]:opacity-50","[&.danger]:border-[color-mix(in_oklab,_var(--accent-red)_42%,_var(--border))]","[&.danger]:bg-[color-mix(in_oklab,_var(--accent-red)_6%,_var(--base))]","[&.danger]:text-accent-red [&.danger:hover:not(:disabled)]:border-accent-red","[&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_10%,_var(--base))]","[@container((max-width:_560px))]:[&.danger]:ml-auto"].join(" ");function fZ({runs:e,experiments:t,emptyHint:n,onOpen:r,onOpenLogs:i,onOpenCode:a,onCancel:o}){const[l,u]=R.useState(new Set),[d,m]=R.useState(null),f=new Map;for(const k of e){const S=f.get(k.experimentId);S?S.push(k):f.set(k.experimentId,[k])}for(const k of f.values())k.sort((S,x)=>x.createdAt-S.createdAt);const g=[...t].sort((k,S)=>{var w,y,C,N;const x=((y=(w=f.get(k.id))==null?void 0:w[0])==null?void 0:y.createdAt)??k.createdAt;return(((N=(C=f.get(S.id))==null?void 0:C[0])==null?void 0:N.createdAt)??S.createdAt)-x});if(g.length===0)return h.jsx("div",{className:"empty-state absolute inset-0 flex flex-col items-center justify-center gap-2.5 p-6 text-center text-subtext [&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:leading-normal [&_p]:text-balance [&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext experiments-empty-state [&_p]:text-2xl",children:h.jsx("p",{children:n??"No experiments yet."})});async function b(k){m(null),u(S=>new Set(S).add(k));try{await o(k)}catch(S){u(x=>{const _=new Set(x);return _.delete(k),_}),m(S instanceof Error?S.message:String(S))}}return h.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[d&&h.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:["Stop failed: ",d]}),h.jsx("div",{className:"experiments-table w-full text-md bg-background",role:"list","aria-label":"Experiments",children:g.map(k=>{const S=f.get(k.id)??[],x=S[0]??null,_=S.find(N=>N.status==="running"||N.status==="starting"),w=_??x,y=!!(_&&(_.cancelRequested||l.has(_.id))),C=_?y?"cancelling":ss(_):x?ss(x):"idle";return h.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-[color-mix(in_oklab,_var(--text)_7%,_transparent)] bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(k),children:[h.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[h.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-left text-ellipsis whitespace-nowrap",onClick:N=>{N.stopPropagation(),r(k)},children:k.title||k.slug}),h.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:k.branchName,children:[h.jsx(nh,{size:14,"aria-hidden":"true"}),h.jsx("code",{children:k.branchName})]})]}),h.jsxs("div",{className:"experiment-table-meta [grid-area:meta] self-start flex items-center justify-end gap-4.5 whitespace-nowrap [@container((max-width:_560px))]:flex-col [@container((max-width:_560px))]:items-end [@container((max-width:_560px))]:gap-1.5 [@container((max-width:_400px))]:!flex-row [@container((max-width:_400px))]:!items-center [@container((max-width:_400px))]:flex-wrap [@container((max-width:_400px))]:justify-start [@container((max-width:_400px))]:gap-3",children:[h.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:h.jsx(Ma,{status:C})}),h.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-xs font-medium",children:h.jsxs("span",{children:[S.length," ",S.length===1?"run":"runs"]})}),h.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-xs font-medium whitespace-nowrap",children:h.jsx("span",{children:x?Gs(x.createdAt):"Not run yet"})})]}),h.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":`Actions for ${k.title||k.slug}`,onClick:N=>N.stopPropagation(),children:[h.jsxs("button",{className:j7,disabled:!w,title:w?"Open logs":"No runs yet",onClick:()=>w&&i(k.id,w.id),children:[h.jsx(Uc,{size:15}),"Logs"]}),h.jsxs("button",{className:j7,title:`Browse code on ${k.branchName}`,onClick:()=>a(k.id),children:[h.jsx(rp,{size:15}),"Code"]}),_&&h.jsxs("button",{className:"experiment-table-action inline-flex items-center gap-1.5 py-1.5 px-2.5 border border-border rounded-md bg-background text-text text-sm font-medium leading-none [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:border-border-strong [&:disabled]:text-muted [&:disabled]:cursor-default [&:disabled]:opacity-50 [&.danger]:border-[color-mix(in_oklab,_var(--accent-red)_42%,_var(--border))] [&.danger]:bg-[color-mix(in_oklab,_var(--accent-red)_6%,_var(--base))] [&.danger]:text-accent-red [&.danger:hover:not(:disabled)]:border-accent-red [&.danger:hover:not(:disabled)]:bg-[color-mix(in_oklab,_var(--accent-red)_10%,_var(--base))] [@container((max-width:_560px))]:[&.danger]:ml-auto danger",disabled:y,title:y?"Stop requested":"Stop run",onClick:()=>void b(_.id),children:[h.jsx(Y8,{size:15}),y?"Stopping…":"Stop"]})]})]},k.id)})})]})}var jE=U8();function pZ({onClose:e,onCreateProject:t}){const[n,r]=R.useState(!1),[i,a]=R.useState(null),o=R.useRef(null),l=R.useCallback(u=>{n||(r(!0),a(null),u().catch(()=>a("Couldn't save your progress. Try again.")).finally(()=>r(!1)))},[n]);return R.useEffect(()=>{const u=d=>{d.key==="Escape"&&(d.preventDefault(),d.stopPropagation(),l(e))};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[e,l]),R.useEffect(()=>{const u=o.current;if(!u)return;const d=document.activeElement instanceof HTMLElement?document.activeElement:null,m=()=>[...u.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(m()[0]??u).focus();const f=g=>{if(g.key!=="Tab")return;const b=m();if(b.length===0){g.preventDefault(),u.focus();return}const k=b[0],S=b[b.length-1];g.shiftKey&&document.activeElement===k?(g.preventDefault(),S.focus()):!g.shiftKey&&document.activeElement===S&&(g.preventDefault(),k.focus())};return document.addEventListener("keydown",f,!0),()=>{document.removeEventListener("keydown",f,!0),d==null||d.focus()}},[]),jE.createPortal(h.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-[rgba(29,_27,_26,_0.42)] p-5",children:h.jsxs("div",{ref:o,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-[0_24px_60px_rgba(0,_0,_0,_0.22)]",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[h.jsx("button",{className:`${Xn} !absolute top-3.5 right-3.5`,"aria-label":"Close",onClick:()=>l(e),disabled:n,children:h.jsx(qr,{size:16})}),h.jsxs("div",{className:"mb-5 flex items-center gap-3 pr-8",children:[h.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:h.jsx(l_,{})}),h.jsxs("div",{children:[h.jsx("div",{className:"mb-0.5 text-xs font-semibold tracking-[0.08em] text-primary uppercase",children:"Demo project"}),h.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-3xl leading-tight tracking-[-0.02em]",children:"Welcome to OpenResearch"})]})]}),h.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[h.jsxs("p",{children:["This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's"," ",h.jsx("a",{href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-semibold text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:"nanochat"}),", a repo for training a mini-GPT from scratch."]}),h.jsx("p",{children:"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together."})]}),i&&h.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:i}),h.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[h.jsx("button",{className:fi,onClick:()=>l(t),disabled:n,children:"Create a new project"}),h.jsx("button",{className:Wr,onClick:()=>l(e),disabled:n,children:n?"Saving…":"Explore the demo"})]})]})}),document.body)}function Qn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function Gp(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}bf.prototype=Gp.prototype={constructor:bf,on:function(e,t){var n=this._,r=gZ(e+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a0)for(var n=new Array(i),r=0,i,a;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),R7.hasOwnProperty(t)?{space:R7[t],local:e}:e}function vZ(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Bv&&t.documentElement.namespaceURI===Bv?t.createElement(e):t.createElementNS(n,e)}}function _Z(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ME(e){var t=Vp(e);return(t.local?_Z:vZ)(t)}function xZ(){}function K2(e){return e==null?xZ:function(){return this.querySelector(e)}}function yZ(e){typeof e!="function"&&(e=K2(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=y&&(y=w+1);!(N=x[y])&&++y=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function VZ(e){e||(e=WZ);function t(f,g){return f&&g?e(f.__data__,g.__data__):!f-!g}for(var n=this._groups,r=n.length,i=new Array(r),a=0;at?1:e>=t?0:NaN}function YZ(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function XZ(){return Array.from(this)}function KZ(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?oQ:typeof t=="function"?cQ:lQ)(e,t,n??"")):Kc(this.node(),e)}function Kc(e,t){return e.style.getPropertyValue(t)||IE(e).getComputedStyle(e,null).getPropertyValue(t)}function dQ(e){return function(){delete this[e]}}function hQ(e,t){return function(){this[e]=t}}function fQ(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function pQ(e,t){return arguments.length>1?this.each((t==null?dQ:typeof t=="function"?fQ:hQ)(e,t)):this.node()[e]}function zE(e){return e.trim().split(/^|\s+/)}function Z2(e){return e.classList||new BE(e)}function BE(e){this._node=e,this._names=zE(e.getAttribute("class")||"")}BE.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 HE(e,t){for(var n=Z2(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function PQ(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n()=>e;function Hv(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:l,dx:u,dy:d,dispatch:m}){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:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:m}})}Hv.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function QQ(e){return!e.ctrlKey&&!e.button}function JQ(){return this.parentNode}function eJ(e,t){return t??{x:e.x,y:e.y}}function tJ(){return navigator.maxTouchPoints||"ontouchstart"in this}function GE(){var e=QQ,t=JQ,n=eJ,r=tJ,i={},a=Gp("start","drag","end"),o=0,l,u,d,m,f=0;function g(C){C.on("mousedown.drag",b).filter(r).on("touchstart.drag",x).on("touchmove.drag",_,ZQ).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(C,N){if(!(m||!e.call(this,C,N))){var E=y(this,t.call(this,C,N),C,N,"mouse");E&&(Mi(C.view).on("mousemove.drag",k,Hd).on("mouseup.drag",S,Hd),UE(C.view),lb(C),d=!1,l=C.clientX,u=C.clientY,E("start",C))}}function k(C){if(Bc(C),!d){var N=C.clientX-l,E=C.clientY-u;d=N*N+E*E>f}i.mouse("drag",C)}function S(C){Mi(C.view).on("mousemove.drag mouseup.drag",null),qE(C.view,d),Bc(C),i.mouse("end",C)}function x(C,N){if(e.call(this,C,N)){var E=C.changedTouches,j=t.call(this,C,N),T=E.length,D,I;for(D=0;D>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?K0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?K0(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=rJ.exec(e))?new pi(t[1],t[2],t[3],1):(t=iJ.exec(e))?new pi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=sJ.exec(e))?K0(t[1],t[2],t[3],t[4]):(t=aJ.exec(e))?K0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=oJ.exec(e))?H7(t[1],t[2]/100,t[3]/100,1):(t=lJ.exec(e))?H7(t[1],t[2]/100,t[3]/100,t[4]):D7.hasOwnProperty(e)?I7(D7[e]):e==="transparent"?new pi(NaN,NaN,NaN,0):null}function I7(e){return new pi(e>>16&255,e>>8&255,e&255,1)}function K0(e,t,n,r){return r<=0&&(e=t=n=NaN),new pi(e,t,n,r)}function dJ(e){return e instanceof vh||(e=Al(e)),e?(e=e.rgb(),new pi(e.r,e.g,e.b,e.opacity)):new pi}function $v(e,t,n,r){return arguments.length===1?dJ(e):new pi(e,t,n,r??1)}function pi(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Q2(pi,$v,VE(vh,{brighter(e){return e=e==null?Vf:Math.pow(Vf,e),new pi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$d:Math.pow($d,e),new pi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new pi(Sl(this.r),Sl(this.g),Sl(this.b),Wf(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:z7,formatHex:z7,formatHex8:hJ,formatRgb:B7,toString:B7}));function z7(){return`#${bl(this.r)}${bl(this.g)}${bl(this.b)}`}function hJ(){return`#${bl(this.r)}${bl(this.g)}${bl(this.b)}${bl((isNaN(this.opacity)?1:this.opacity)*255)}`}function B7(){const e=Wf(this.opacity);return`${e===1?"rgb(":"rgba("}${Sl(this.r)}, ${Sl(this.g)}, ${Sl(this.b)}${e===1?")":`, ${e})`}`}function Wf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Sl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function bl(e){return e=Sl(e),(e<16?"0":"")+e.toString(16)}function H7(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new _s(e,t,n,r)}function WE(e){if(e instanceof _s)return new _s(e.h,e.s,e.l,e.opacity);if(e instanceof vh||(e=Al(e)),!e)return new _s;if(e instanceof _s)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-i,u=(a+i)/2;return l?(t===a?o=(n-r)/l+(n0&&u<1?0:o,new _s(o,l,u,e.opacity)}function fJ(e,t,n,r){return arguments.length===1?WE(e):new _s(e,t,n,r??1)}function _s(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Q2(_s,fJ,VE(vh,{brighter(e){return e=e==null?Vf:Math.pow(Vf,e),new _s(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$d:Math.pow($d,e),new _s(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new pi(cb(e>=240?e-240:e+120,i,r),cb(e,i,r),cb(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new _s($7(this.h),Z0(this.s),Z0(this.l),Wf(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=Wf(this.opacity);return`${e===1?"hsl(":"hsla("}${$7(this.h)}, ${Z0(this.s)*100}%, ${Z0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function $7(e){return e=(e||0)%360,e<0?e+360:e}function Z0(e){return Math.max(0,Math.min(1,e||0))}function cb(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 J2=e=>()=>e;function pJ(e,t){return function(n){return e+n*t}}function mJ(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 gJ(e){return(e=+e)==1?YE:function(t,n){return n-t?mJ(t,n,e):J2(isNaN(t)?n:t)}}function YE(e,t){var n=t-e;return n?pJ(e,n):J2(isNaN(e)?t:e)}const Yf=(function e(t){var n=gJ(t);function r(i,a){var o=n((i=$v(i)).r,(a=$v(a)).r),l=n(i.g,a.g),u=n(i.b,a.b),d=YE(i.opacity,a.opacity);return function(m){return i.r=o(m),i.g=l(m),i.b=u(m),i.opacity=d(m),i+""}}return r.gamma=e,r})(1);function bJ(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;in&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,u.push({i:o,x:Ps(r,i)})),n=ub.lastIndex;return n180?m+=360:m-d>180&&(d+=360),g.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Ps(d,m)})):m&&f.push(i(f)+"rotate("+m+r)}function l(d,m,f,g){d!==m?g.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Ps(d,m)}):m&&f.push(i(f)+"skewX("+m+r)}function u(d,m,f,g,b,k){if(d!==f||m!==g){var S=b.push(i(b)+"scale(",null,",",null,")");k.push({i:S-4,x:Ps(d,f)},{i:S-2,x:Ps(m,g)})}else(f!==1||g!==1)&&b.push(i(b)+"scale("+f+","+g+")")}return function(d,m){var f=[],g=[];return d=e(d),m=e(m),a(d.translateX,d.translateY,m.translateX,m.translateY,f,g),o(d.rotate,m.rotate,f,g),l(d.skewX,m.skewX,f,g),u(d.scaleX,d.scaleY,m.scaleX,m.scaleY,f,g),d=m=null,function(b){for(var k=-1,S=g.length,x;++k=0&&e._call.call(void 0,t),e=e._next;--Zc}function U7(){Tl=(Kf=Pd.now())+Wp,Zc=od=0;try{RJ()}finally{Zc=0,LJ(),Tl=0}}function DJ(){var e=Pd.now(),t=e-Kf;t>QE&&(Wp-=t,Kf=e)}function LJ(){for(var e,t=Xf,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:Xf=n);ld=e,Uv(r)}function Uv(e){if(!Zc){od&&(od=clearTimeout(od));var t=e-Tl;t>24?(e<1/0&&(od=setTimeout(U7,e-Pd.now()-Wp)),nd&&(nd=clearInterval(nd))):(nd||(Kf=Pd.now(),nd=setInterval(DJ,QE)),Zc=1,JE(U7))}}function q7(e,t,n){var r=new Zf;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var OJ=Gp("start","end","cancel","interrupt"),IJ=[],tA=0,G7=1,qv=2,_f=3,V7=4,Gv=5,xf=6;function Yp(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;zJ(e,n,{name:t,index:r,group:i,on:OJ,tween:IJ,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:tA})}function tx(e,t){var n=As(e,t);if(n.state>tA)throw new Error("too late; already scheduled");return n}function ta(e,t){var n=As(e,t);if(n.state>_f)throw new Error("too late; already running");return n}function As(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function zJ(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=eA(a,0,n.time);function a(d){n.state=G7,n.timer.restart(o,n.delay,n.time),n.delay<=d&&o(d-n.delay)}function o(d){var m,f,g,b;if(n.state!==G7)return u();for(m in r)if(b=r[m],b.name===n.name){if(b.state===_f)return q7(o);b.state===V7?(b.state=xf,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete r[m]):+mqv&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function fee(e,t,n){var r,i,a=hee(t)?tx:ta;return function(){var o=a(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}function pee(e,t){var n=this._id;return arguments.length<2?As(this.node(),n).on.on(e):this.each(fee(n,e,t))}function mee(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function gee(){return this.on("end.remove",mee(this._id))}function bee(e){var t=this._name,n=this._id;typeof e!="function"&&(e=K2(e));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o()=>e;function Pee(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){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:i}})}function Na(e,t,n){this.k=e,this.x=t,this.y=n}Na.prototype={constructor:Na,scale:function(e){return e===1?this:new Na(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Na(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 Xp=new Na(1,0,0);sA.prototype=Na.prototype;function sA(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Xp;return e.__zoom}function db(e){e.stopImmediatePropagation()}function rd(e){e.preventDefault(),e.stopImmediatePropagation()}function Uee(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function qee(){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 W7(){return this.__zoom||Xp}function Gee(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Vee(){return navigator.maxTouchPoints||"ontouchstart"in this}function Wee(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function aA(){var e=Uee,t=qee,n=Wee,r=Gee,i=Vee,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,u=vf,d=Gp("start","zoom","end"),m,f,g,b=500,k=150,S=0,x=10;function _(G){G.property("__zoom",W7).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",I).filter(i).on("touchstart.zoom",$).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(G,X,Y,Z){var Q=G.selection?G.selection():G;Q.property("__zoom",W7),G!==Q?N(G,X,Y,Z):Q.interrupt().each(function(){E(this,arguments).event(Z).start().zoom(null,typeof X=="function"?X.apply(this,arguments):X).end()})},_.scaleBy=function(G,X,Y,Z){_.scaleTo(G,function(){var Q=this.__zoom.k,z=typeof X=="function"?X.apply(this,arguments):X;return Q*z},Y,Z)},_.scaleTo=function(G,X,Y,Z){_.transform(G,function(){var Q=t.apply(this,arguments),z=this.__zoom,O=Y==null?C(Q):typeof Y=="function"?Y.apply(this,arguments):Y,H=z.invert(O),V=typeof X=="function"?X.apply(this,arguments):X;return n(y(w(z,V),O,H),Q,o)},Y,Z)},_.translateBy=function(G,X,Y,Z){_.transform(G,function(){return n(this.__zoom.translate(typeof X=="function"?X.apply(this,arguments):X,typeof Y=="function"?Y.apply(this,arguments):Y),t.apply(this,arguments),o)},null,Z)},_.translateTo=function(G,X,Y,Z,Q){_.transform(G,function(){var z=t.apply(this,arguments),O=this.__zoom,H=Z==null?C(z):typeof Z=="function"?Z.apply(this,arguments):Z;return n(Xp.translate(H[0],H[1]).scale(O.k).translate(typeof X=="function"?-X.apply(this,arguments):-X,typeof Y=="function"?-Y.apply(this,arguments):-Y),z,o)},Z,Q)};function w(G,X){return X=Math.max(a[0],Math.min(a[1],X)),X===G.k?G:new Na(X,G.x,G.y)}function y(G,X,Y){var Z=X[0]-Y[0]*G.k,Q=X[1]-Y[1]*G.k;return Z===G.x&&Q===G.y?G:new Na(G.k,Z,Q)}function C(G){return[(+G[0][0]+ +G[1][0])/2,(+G[0][1]+ +G[1][1])/2]}function N(G,X,Y,Z){G.on("start.zoom",function(){E(this,arguments).event(Z).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(Z).end()}).tween("zoom",function(){var Q=this,z=arguments,O=E(Q,z).event(Z),H=t.apply(Q,z),V=Y==null?C(H):typeof Y=="function"?Y.apply(Q,z):Y,W=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),re=Q.__zoom,le=typeof X=="function"?X.apply(Q,z):X,pe=u(re.invert(V).concat(W/re.k),le.invert(V).concat(W/le.k));return function(te){if(te===1)te=le;else{var B=pe(te),ie=W/B[2];te=new Na(ie,V[0]-B[0]*ie,V[1]-B[1]*ie)}O.zoom(null,te)}})}function E(G,X,Y){return!Y&&G.__zooming||new j(G,X)}function j(G,X){this.that=G,this.args=X,this.active=0,this.sourceEvent=null,this.extent=t.apply(G,X),this.taps=0}j.prototype={event:function(G){return G&&(this.sourceEvent=G),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(G,X){return this.mouse&&G!=="mouse"&&(this.mouse[1]=X.invert(this.mouse[0])),this.touch0&&G!=="touch"&&(this.touch0[1]=X.invert(this.touch0[0])),this.touch1&&G!=="touch"&&(this.touch1[1]=X.invert(this.touch1[0])),this.that.__zoom=X,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(G){var X=Mi(this.that).datum();d.call(G,this.that,new Pee(G,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:d}),X)}};function T(G,...X){if(!e.apply(this,arguments))return;var Y=E(this,X).event(G),Z=this.__zoom,Q=Math.max(a[0],Math.min(a[1],Z.k*Math.pow(2,r.apply(this,arguments)))),z=bs(G);if(Y.wheel)(Y.mouse[0][0]!==z[0]||Y.mouse[0][1]!==z[1])&&(Y.mouse[1]=Z.invert(Y.mouse[0]=z)),clearTimeout(Y.wheel);else{if(Z.k===Q)return;Y.mouse=[z,Z.invert(z)],yf(this),Y.start()}rd(G),Y.wheel=setTimeout(O,k),Y.zoom("mouse",n(y(w(Z,Q),Y.mouse[0],Y.mouse[1]),Y.extent,o));function O(){Y.wheel=null,Y.end()}}function D(G,...X){if(g||!e.apply(this,arguments))return;var Y=G.currentTarget,Z=E(this,X,!0).event(G),Q=Mi(G.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",W,!0),z=bs(G,Y),O=G.clientX,H=G.clientY;UE(G.view),db(G),Z.mouse=[z,this.__zoom.invert(z)],yf(this),Z.start();function V(re){if(rd(re),!Z.moved){var le=re.clientX-O,pe=re.clientY-H;Z.moved=le*le+pe*pe>S}Z.event(re).zoom("mouse",n(y(Z.that.__zoom,Z.mouse[0]=bs(re,Y),Z.mouse[1]),Z.extent,o))}function W(re){Q.on("mousemove.zoom mouseup.zoom",null),qE(re.view,Z.moved),rd(re),Z.event(re).end()}}function I(G,...X){if(e.apply(this,arguments)){var Y=this.__zoom,Z=bs(G.changedTouches?G.changedTouches[0]:G,this),Q=Y.invert(Z),z=Y.k*(G.shiftKey?.5:2),O=n(y(w(Y,z),Z,Q),t.apply(this,X),o);rd(G),l>0?Mi(this).transition().duration(l).call(N,O,Z,G):Mi(this).call(_.transform,O,Z,G)}}function $(G,...X){if(e.apply(this,arguments)){var Y=G.touches,Z=Y.length,Q=E(this,X,G.changedTouches.length===Z).event(G),z,O,H,V;for(db(G),O=0;O`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.`},Ud=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],oA=["Enter"," ","Escape"],lA={"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 Qc;(function(e){e.Strict="strict",e.Loose="loose"})(Qc||(Qc={}));var kl;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(kl||(kl={}));var qd;(function(e){e.Partial="partial",e.Full="full"})(qd||(qd={}));const cA={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Co;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Co||(Co={}));var Qf;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Qf||(Qf={}));var lt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(lt||(lt={}));const Y7={[lt.Left]:lt.Right,[lt.Right]:lt.Left,[lt.Top]:lt.Bottom,[lt.Bottom]:lt.Top};function uA(e){return e===null?null:e?"valid":"invalid"}const dA=e=>"id"in e&&"source"in e&&"target"in e,Yee=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),rx=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),_h=(e,t=[0,0])=>{const{width:n,height:r}=qa(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},Xee=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const a=typeof i=="string";let o=!t.nodeLookup&&!a?i:void 0;t.nodeLookup&&(o=a?t.nodeLookup.get(i):rx(i)?i:t.nodeLookup.get(i.id));const l=o?Jf(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Kp(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Zp(n)},xh=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=Kp(n,Jf(i)),r=!0)}),r?Zp(n):{x:0,y:0,width:0,height:0}},ix=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{const l=(t.x-n)/i,u=(t.y-r)/i,d=t.width/i,m=t.height/i,f=[];for(const g of e.values()){const{measured:b,selectable:k=!0,hidden:S=!1}=g;if(o&&!k||S)continue;const x=b.width??g.width??g.initialWidth??0,_=b.height??g.height??g.initialHeight??0,{x:w,y}=g.internals.positionAbsolute,C=mA(l,u,d,m,w,y,x,_),N=x*_,E=a&&C>0;(!g.internals.handleBounds||E||C>=N||g.dragging)&&f.push(g)}return f},Kee=(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 Zee(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function Qee({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;const l=Zee(e,o),u=xh(l),d=ax(u,t,n,(o==null?void 0:o.minZoom)??i,(o==null?void 0:o.maxZoom)??a,(o==null?void 0:o.padding)??.1);return await r.setViewport(d,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function hA({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:u,y:d}=l?l.internals.positionAbsolute:{x:0,y:0},m=o.origin??r;let f=o.extent||i;if(o.extent==="parent"&&!o.expandParent)if(!l)a==null||a("005",Es.error005());else{const b=l.measured.width,k=l.measured.height;b&&k&&(f=[[u,d],[u+b,d+k]])}else l&&jl(o.extent)&&(f=[[o.extent[0][0]+u,o.extent[0][1]+d],[o.extent[1][0]+u,o.extent[1][1]+d]]);const g=jl(f)?Nl(t,f,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",Es.error015())),{position:{x:g.x-u+(o.measured.width??0)*m[0],y:g.y-d+(o.measured.height??0)*m[1]},positionAbsolute:g}}async function Jee({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const a=new Set(e.map(g=>g.id)),o=[];for(const g of n){if(g.deletable===!1)continue;const b=a.has(g.id),k=!b&&g.parentId&&o.find(S=>S.id===g.parentId);(b||k)&&o.push(g)}const l=new Set(t.map(g=>g.id)),u=r.filter(g=>g.deletable!==!1),m=Kee(o,u);for(const g of u)l.has(g.id)&&!m.find(k=>k.id===g.id)&&m.push(g);if(!i)return{edges:m,nodes:o};const f=await i({nodes:o,edges:m});return typeof f=="boolean"?f?{edges:m,nodes:o}:{edges:[],nodes:[]}:f}const Jc=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Nl=(e={x:0,y:0},t,n)=>({x:Jc(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Jc(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function fA(e,t,n){const{width:r,height:i}=qa(n),{x:a,y:o}=n.internals.positionAbsolute;return Nl(e,[[a,o],[a+r,o+i]],t)}const X7=(e,t,n)=>en?-Jc(Math.abs(e-n),1,t)/t:0,sx=(e,t,n=15,r=40)=>{const i=X7(e.x,r,t.width-r)*n,a=X7(e.y,r,t.height-r)*n;return[i,a]},Kp=(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)}),Vv=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Zp=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Gd=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=rx(e)?e.internals.positionAbsolute:_h(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},Jf=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=rx(e)?e.internals.positionAbsolute:_h(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},pA=(e,t)=>Zp(Kp(Vv(e),Vv(t))),mA=(e,t,n,r,i,a,o,l)=>{const u=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),d=Math.max(0,Math.min(t+r,a+l)-Math.max(t,a));return Math.ceil(u*d)},ep=(e,t)=>mA(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),K7=e=>xs(e.width)&&xs(e.height)&&xs(e.x)&&xs(e.y),xs=e=>!isNaN(e)&&isFinite(e),gA=(e,t)=>(n,r)=>{},yh=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),wh=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return a?yh(l,o):l},eu=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function wc(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 ete(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=wc(e,n),i=wc(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=wc(e.top??e.y??0,n),i=wc(e.bottom??e.y??0,n),a=wc(e.left??e.x??0,t),o=wc(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function tte(e,t,n,r,i,a){const{x:o,y:l}=eu(e,[t,n,r]),{x:u,y:d}=eu({x:e.x+e.width,y:e.y+e.height},[t,n,r]),m=i-u,f=a-d;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(m),bottom:Math.floor(f)}}const ax=(e,t,n,r,i,a)=>{const o=ete(a,t,n),l=(t-o.x)/e.width,u=(n-o.y)/e.height,d=Math.min(l,u),m=Jc(d,r,i),f=e.x+e.width/2,g=e.y+e.height/2,b=t/2-f*m,k=n/2-g*m,S=tte(e,b,k,m,t,n),x={left:Math.min(S.left-o.left,0),top:Math.min(S.top-o.top,0),right:Math.min(S.right-o.right,0),bottom:Math.min(S.bottom-o.bottom,0)};return{x:b-x.left+x.right,y:k-x.top+x.bottom,zoom:m}},Vd=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function jl(e){return e!=null&&e!=="parent"}function qa(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 bA(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 vA(e,t={width:0,height:0},n,r,i){const a={...e},o=r.get(n);if(o){const l=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return a}function Z7(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function nte(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function rte(e){return{...lA,...e||{}}}function _d(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:a,y:o}=ys(e),l=wh({x:a-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:u,y:d}=n?yh(l,t):l;return{xSnapped:u,ySnapped:d,...l}}const ox=e=>({width:e.offsetWidth,height:e.offsetHeight}),_A=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},ite=["INPUT","SELECT","TEXTAREA"];function xA(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:ite.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const yA=e=>"clientX"in e,ys=(e,t)=>{var a,o;const n=yA(e),r=n?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,i=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},Q7=(e,t,n,r,i)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:i,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...ox(o)}})};function wA({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:l}){const u=e*.125+i*.375+o*.375+n*.125,d=t*.125+a*.375+l*.375+r*.125,m=Math.abs(u-e),f=Math.abs(d-t);return[u,d,m,f]}function ef(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function J7({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case lt.Left:return[t-ef(t-r,a),n];case lt.Right:return[t+ef(r-t,a),n];case lt.Top:return[t,n-ef(n-i,a)];case lt.Bottom:return[t,n+ef(i-n,a)]}}function SA({sourceX:e,sourceY:t,sourcePosition:n=lt.Bottom,targetX:r,targetY:i,targetPosition:a=lt.Top,curvature:o=.25}){const[l,u]=J7({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[d,m]=J7({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[f,g,b,k]=wA({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:u,targetControlX:d,targetControlY:m});return[`M${e},${t} C${l},${u} ${d},${m} ${r},${i}`,f,g,b,k]}function kA({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,a=n0}const ote=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,lte=(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)),cte=(e,t,n={})=>{var a;if(!e.source||!e.target)return(a=n.onError)==null||a.call(n,"006",Es.error006()),t;const r=n.getEdgeId||ote;let i;return dA(e)?i={...e}:i={...e,id:r(e)},lte(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function CA({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,a,o,l]=kA({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,l]}const e8={[lt.Left]:{x:-1,y:0},[lt.Right]:{x:1,y:0},[lt.Top]:{x:0,y:-1},[lt.Bottom]:{x:0,y:1}},ute=({source:e,sourcePosition:t=lt.Bottom,target:n})=>t===lt.Left||t===lt.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function dte({source:e,sourcePosition:t=lt.Bottom,target:n,targetPosition:r=lt.Top,center:i,offset:a,stepPosition:o}){const l=e8[t],u=e8[r],d={x:e.x+l.x*a,y:e.y+l.y*a},m={x:n.x+u.x*a,y:n.y+u.y*a},f=ute({source:d,sourcePosition:t,target:m}),g=f.x!==0?"x":"y",b=f[g];let k=[],S,x;const _={x:0,y:0},w={x:0,y:0},[,,y,C]=kA({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[g]*u[g]===-1){g==="x"?(S=i.x??d.x+(m.x-d.x)*o,x=i.y??(d.y+m.y)/2):(S=i.x??(d.x+m.x)/2,x=i.y??d.y+(m.y-d.y)*o);const T=[{x:S,y:d.y},{x:S,y:m.y}],D=[{x:d.x,y:x},{x:m.x,y:x}];l[g]===b?k=g==="x"?T:D:k=g==="x"?D:T}else{const T=[{x:d.x,y:m.y}],D=[{x:m.x,y:d.y}];if(g==="x"?k=l.x===b?D:T:k=l.y===b?T:D,t===r){const G=Math.abs(e[g]-n[g]);if(G<=a){const X=Math.min(a-1,a-G);l[g]===b?_[g]=(d[g]>e[g]?-1:1)*X:w[g]=(m[g]>n[g]?-1:1)*X}}if(t!==r){const G=g==="x"?"y":"x",X=l[g]===u[G],Y=d[G]>m[G],Z=d[G]=U?(S=(I.x+$.x)/2,x=k[0].y):(S=k[0].x,x=(I.y+$.y)/2)}const N={x:d.x+_.x,y:d.y+_.y},E={x:m.x+w.x,y:m.y+w.y};return[[e,...N.x!==k[0].x||N.y!==k[0].y?[N]:[],...k,...E.x!==k[k.length-1].x||E.y!==k[k.length-1].y?[E]:[],n],S,x,y,C]}function hte(e,t,n,r){const i=Math.min(t8(e,t)/2,t8(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){const d=e.xn.id===t):e[0])||null}function Yv(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function pte(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const a=new Set;return e.reduce((o,l)=>([l.markerStart||r,l.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const d=Yv(u,t);a.has(d)||(o.push({id:d,color:u.color||n,...u}),a.add(d))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const EA=1e3,mte=10,lx={nodeOrigin:[0,0],nodeExtent:Ud,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},gte={...lx,checkEquality:!0};function cx(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function bte(e,t,n){const r=cx(lx,n);for(const i of e.values())if(i.parentId)dx(i,e,t,r);else{const a=_h(i,r.nodeOrigin),o=jl(i.extent)?i.extent:r.nodeExtent,l=Nl(a,o,qa(i));i.internals.positionAbsolute=l}}function vte(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const a={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(a):i.type==="target"&&r.push(a)}return{source:n,target:r}}function ux(e){return e==="manual"}function Xv(e,t,n,r={}){var m,f;const i=cx(gte,r),a={i:0},o=new Map(t),l=i!=null&&i.elevateNodesOnSelect&&!ux(i.zIndexMode)?EA:0;let u=e.length>0,d=!1;t.clear(),n.clear();for(const g of e){let b=o.get(g.id);if(i.checkEquality&&g===(b==null?void 0:b.internals.userNode))t.set(g.id,b);else{const k=_h(g,i.nodeOrigin),S=jl(g.extent)?g.extent:i.nodeExtent,x=Nl(k,S,qa(g));b={...i.defaults,...g,measured:{width:(m=g.measured)==null?void 0:m.width,height:(f=g.measured)==null?void 0:f.height},internals:{positionAbsolute:x,handleBounds:vte(g,b),z:AA(g,l,i.zIndexMode),userNode:g}},t.set(g.id,b)}(b.measured===void 0||b.measured.width===void 0||b.measured.height===void 0)&&!b.hidden&&(u=!1),g.parentId&&dx(b,t,n,r,a),d||(d=g.selected??!1)}return{nodesInitialized:u,hasSelectedNodes:d}}function _te(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 dx(e,t,n,r,i){const{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:l,zIndexMode:u}=cx(lx,r),d=e.parentId,m=t.get(d);if(!m){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}_te(e,n),i&&!m.parentId&&m.internals.rootParentIndex===void 0&&u==="auto"&&(m.internals.rootParentIndex=++i.i,m.internals.z=m.internals.z+i.i*mte),i&&m.internals.rootParentIndex!==void 0&&(i.i=m.internals.rootParentIndex);const f=a&&!ux(u)?EA:0,{x:g,y:b,z:k}=xte(e,m,o,l,f,u),{positionAbsolute:S}=e.internals,x=g!==S.x||b!==S.y;(x||k!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:g,y:b}:S,z:k}})}function AA(e,t,n){const r=xs(e.zIndex)?e.zIndex:0;return ux(n)?r:r+(e.selected?t:0)}function xte(e,t,n,r,i,a){const{x:o,y:l}=t.internals.positionAbsolute,u=qa(e),d=_h(e,n),m=jl(e.extent)?Nl(d,e.extent,u):d;let f=Nl({x:o+m.x,y:l+m.y},r,u);e.extent==="parent"&&(f=fA(f,u,t));const g=AA(e,i,a),b=t.internals.z??0;return{x:f.x,y:f.y,z:b>=g?b+1:g}}function hx(e,t,n,r=[0,0]){var o;const i=[],a=new Map;for(const l of e){const u=t.get(l.parentId);if(!u)continue;const d=((o=a.get(l.parentId))==null?void 0:o.expandedRect)??Gd(u),m=pA(d,l.rect);a.set(l.parentId,{expandedRect:m,parent:u})}return a.size>0&&a.forEach(({expandedRect:l,parent:u},d)=>{var y;const m=u.internals.positionAbsolute,f=qa(u),g=u.origin??r,b=l.x0||k>0||_||w)&&(i.push({id:d,type:"position",position:{x:u.position.x-b+_,y:u.position.y-k+w}}),(y=n.get(d))==null||y.forEach(C=>{e.some(N=>N.id===C.id)||i.push({id:C.id,type:"position",position:{x:C.position.x+b,y:C.position.y+k}})})),(f.width0){const b=hx(g,t,n,i);d.push(...b)}return{changes:d,updatedInternals:u}}async function wte({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function s8(e,t,n,r,i,a){let o=i;const l=r.get(o)||new Map;r.set(o,l.set(n,t)),o=`${i}-${e}`;const u=r.get(o)||new Map;if(r.set(o,u.set(n,t)),a){o=`${i}-${e}-${a}`;const d=r.get(o)||new Map;r.set(o,d.set(n,t))}}function TA(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:a,sourceHandle:o=null,targetHandle:l=null}=r,u={edgeId:r.id,source:i,target:a,sourceHandle:o,targetHandle:l},d=`${i}-${o}--${a}-${l}`,m=`${a}-${l}--${i}-${o}`;s8("source",u,m,e,i,o),s8("target",u,d,e,a,l),t.set(r.id,r)}}function NA(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:NA(n,t):!1}function a8(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Ste(e,t,n,r){const i=new Map;for(const[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!NA(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(a);l&&i.set(a,{id:a,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function hb({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,u;const i=[];for(const[d,m]of t){const f=(o=n.get(d))==null?void 0:o.internals.userNode;f&&i.push({...f,position:m.position,dragging:r})}if(!e)return[i[0],i];const a=(l=n.get(e))==null?void 0:l.internals.userNode;return[a?{...a,position:((u=t.get(e))==null?void 0:u.position)||a.position,dragging:r}:i[0],i]}function kte({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const a={x:n-i.distance.x,y:r-i.distance.y},o=yh(a,t);return{x:o.x-a.x,y:o.y-a.y}}function Cte({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,l=new Map,u=!1,d={x:0,y:0},m=null,f=!1,g=null,b=!1,k=!1,S=null;function x({noDragClassName:w,handleSelector:y,domNode:C,isSelectable:N,nodeId:E,nodeClickDistance:j=0}){g=Mi(C);function T({x:F,y:U}){const{nodeLookup:G,nodeExtent:X,snapGrid:Y,snapToGrid:Z,nodeOrigin:Q,onNodeDrag:z,onSelectionDrag:O,onError:H,updateNodePositions:V}=t();a={x:F,y:U};let W=!1;const re=l.size>1,le=re&&X?Vv(xh(l)):null,pe=re&&Z?kte({dragItems:l,snapGrid:Y,x:F,y:U}):null;for(const[te,B]of l){if(!G.has(te))continue;let ie={x:F-B.distance.x,y:U-B.distance.y};Z&&(ie=pe?{x:Math.round(ie.x+pe.x),y:Math.round(ie.y+pe.y)}:yh(ie,Y));let oe=null;if(re&&X&&!B.extent&&le){const{positionAbsolute:Ce}=B.internals,Le=Ce.x-le.x+X[0][0],Ue=Ce.x+B.measured.width-le.x2+X[1][0],We=Ce.y-le.y+X[0][1],Fe=Ce.y+B.measured.height-le.y2+X[1][1];oe=[[Le,We],[Ue,Fe]]}const{position:be,positionAbsolute:ge}=hA({nodeId:te,nextPosition:ie,nodeLookup:G,nodeExtent:oe||X,nodeOrigin:Q,onError:H});W=W||B.position.x!==be.x||B.position.y!==be.y,B.position=be,B.internals.positionAbsolute=ge}if(k=k||W,!!W&&(V(l,!0),S&&(r||z||!E&&O))){const[te,B]=hb({nodeId:E,dragItems:l,nodeLookup:G});r==null||r(S,l,te,B),z==null||z(S,te,B),E||O==null||O(S,B)}}async function D(){if(!m)return;const{transform:F,panBy:U,autoPanSpeed:G,autoPanOnNodeDrag:X}=t();if(!X){u=!1,cancelAnimationFrame(o);return}const[Y,Z]=sx(d,m,G);(Y!==0||Z!==0)&&(a.x=(a.x??0)-Y/F[2],a.y=(a.y??0)-Z/F[2],await U({x:Y,y:Z})&&T(a)),o=requestAnimationFrame(D)}function I(F){var re;const{nodeLookup:U,multiSelectionActive:G,nodesDraggable:X,transform:Y,snapGrid:Z,snapToGrid:Q,selectNodesOnDrag:z,onNodeDragStart:O,onSelectionDragStart:H,unselectNodesAndEdges:V}=t();f=!0,(!z||!N)&&!G&&E&&((re=U.get(E))!=null&&re.selected||V()),N&&z&&E&&(e==null||e(E));const W=_d(F.sourceEvent,{transform:Y,snapGrid:Z,snapToGrid:Q,containerBounds:m});if(a=W,l=Ste(U,X,W,E),l.size>0&&(n||O||!E&&H)){const[le,pe]=hb({nodeId:E,dragItems:l,nodeLookup:U});n==null||n(F.sourceEvent,l,le,pe),O==null||O(F.sourceEvent,le,pe),E||H==null||H(F.sourceEvent,pe)}}const $=GE().clickDistance(j).on("start",F=>{const{domNode:U,nodeDragThreshold:G,transform:X,snapGrid:Y,snapToGrid:Z}=t();m=(U==null?void 0:U.getBoundingClientRect())||null,b=!1,k=!1,S=F.sourceEvent,G===0&&I(F),a=_d(F.sourceEvent,{transform:X,snapGrid:Y,snapToGrid:Z,containerBounds:m}),d=ys(F.sourceEvent,m)}).on("drag",F=>{const{autoPanOnNodeDrag:U,transform:G,snapGrid:X,snapToGrid:Y,nodeDragThreshold:Z,nodeLookup:Q}=t(),z=_d(F.sourceEvent,{transform:G,snapGrid:X,snapToGrid:Y,containerBounds:m});if(S=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||E&&!Q.has(E))&&(b=!0),!b){if(!u&&U&&f&&(u=!0,D()),!f){const O=ys(F.sourceEvent,m),H=O.x-d.x,V=O.y-d.y;Math.sqrt(H*H+V*V)>Z&&I(F)}(a.x!==z.xSnapped||a.y!==z.ySnapped)&&l&&f&&(d=ys(F.sourceEvent,m),T(z))}}).on("end",F=>{if(!f||b){b&&l.size>0&&t().updateNodePositions(l,!1);return}if(u=!1,f=!1,cancelAnimationFrame(o),l.size>0){const{nodeLookup:U,updateNodePositions:G,onNodeDragStop:X,onSelectionDragStop:Y}=t();if(k&&(G(l,!1),k=!1),i||X||!E&&Y){const[Z,Q]=hb({nodeId:E,dragItems:l,nodeLookup:U,dragging:!1});i==null||i(F.sourceEvent,l,Z,Q),X==null||X(F.sourceEvent,Z,Q),E||Y==null||Y(F.sourceEvent,Q)}}}).filter(F=>{const U=F.target;return!F.button&&(!w||!a8(U,`.${w}`,C))&&(!y||a8(U,y,C))});g.call($)}function _(){g==null||g.on(".drag",null)}return{update:x,destroy:_}}function Ete(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())ep(i,Gd(a))>0&&r.push(a);return r}const Ate=250;function Tte(e,t,n,r){var l,u;let i=[],a=1/0;const o=Ete(e,n,t+Ate);for(const d of o){const m=[...((l=d.internals.handleBounds)==null?void 0:l.source)??[],...((u=d.internals.handleBounds)==null?void 0:u.target)??[]];for(const f of m){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:g,y:b}=Ml(d,f,f.position,!0),k=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(b-e.y,2));k>t||(k1){const d=r.type==="source"?"target":"source";return i.find(m=>m.type===d)??i[0]}return i[0]}function jA(e,t,n,r,i,a=!1){var d,m,f;const o=r.get(e);if(!o)return null;const l=i==="strict"?(d=o.internals.handleBounds)==null?void 0:d[t]:[...((m=o.internals.handleBounds)==null?void 0:m.source)??[],...((f=o.internals.handleBounds)==null?void 0:f.target)??[]],u=(n?l==null?void 0:l.find(g=>g.id===n):l==null?void 0:l[0])??null;return u&&a?{...u,...Ml(o,u,u.position,!0)}:u}function MA(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Nte(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const RA=()=>!0;function jte(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:l,nodeLookup:u,lib:d,autoPanOnConnect:m,flowId:f,panBy:g,cancelConnection:b,onConnectStart:k,onConnect:S,onConnectEnd:x,isValidConnection:_=RA,onReconnectEnd:w,updateConnection:y,getTransform:C,getFromHandle:N,autoPanSpeed:E,dragThreshold:j=1,handleDomNode:T}){const D=_A(e.target);let I=0,$;const{x:F,y:U}=ys(e),G=MA(a,T),X=l==null?void 0:l.getBoundingClientRect();let Y=!1;if(!X||!G)return;const Z=jA(i,G,r,u,t);if(!Z)return;let Q=ys(e,X),z=!1,O=null,H=!1,V=null;function W(){if(!m||!X)return;const[be,ge]=sx(Q,X,E);g({x:be,y:ge}),I=requestAnimationFrame(W)}const re={...Z,nodeId:i,type:G,position:Z.position},le=u.get(i);let te={inProgress:!0,isValid:null,from:Ml(le,re,lt.Left,!0),fromHandle:re,fromPosition:re.position,fromNode:le,to:Q,toHandle:null,toPosition:Y7[re.position],toNode:null,pointer:Q};function B(){Y=!0,y(te),k==null||k(e,{nodeId:i,handleId:r,handleType:G})}j===0&&B();function ie(be){if(!Y){const{x:Fe,y:mt}=ys(be),De=Fe-F,ot=mt-U;if(!(De*De+ot*ot>j*j))return;B()}if(!N()||!re){oe(be);return}const ge=C();Q=ys(be,X),$=Tte(wh(Q,ge,!1,[1,1]),n,u,re),z||(W(),z=!0);const Ce=DA(be,{handle:$,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:_,doc:D,lib:d,flowId:f,nodeLookup:u});V=Ce.handleDomNode,O=Ce.connection,H=Nte(!!$,Ce.isValid);const Le=u.get(i),Ue=Le?Ml(Le,re,lt.Left,!0):te.from,We={...te,from:Ue,isValid:H,to:Ce.toHandle&&H?eu({x:Ce.toHandle.x,y:Ce.toHandle.y},ge):Q,toHandle:Ce.toHandle,toPosition:H&&Ce.toHandle?Ce.toHandle.position:Y7[re.position],toNode:Ce.toHandle?u.get(Ce.toHandle.nodeId):null,pointer:Q};y(We),te=We}function oe(be){if(!("touches"in be&&be.touches.length>0)){if(Y){($||V)&&O&&H&&(S==null||S(O));const{inProgress:ge,...Ce}=te,Le={...Ce,toPosition:te.toHandle?te.toPosition:null};x==null||x(be,Le),a&&(w==null||w(be,Le))}b(),cancelAnimationFrame(I),z=!1,H=!1,O=null,V=null,D.removeEventListener("mousemove",ie),D.removeEventListener("mouseup",oe),D.removeEventListener("touchmove",ie),D.removeEventListener("touchend",oe)}}D.addEventListener("mousemove",ie),D.addEventListener("mouseup",oe),D.addEventListener("touchmove",ie),D.addEventListener("touchend",oe)}function DA(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:l,flowId:u,isValidConnection:d=RA,nodeLookup:m}){const f=a==="target",g=t?o.querySelector(`.${l}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:b,y:k}=ys(e),S=o.elementFromPoint(b,k),x=S!=null&&S.classList.contains(`${l}-flow__handle`)?S:g,_={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const w=MA(void 0,x),y=x.getAttribute("data-nodeid"),C=x.getAttribute("data-handleid"),N=x.classList.contains("connectable"),E=x.classList.contains("connectableend");if(!y||!w)return _;const j={source:f?y:r,sourceHandle:f?C:i,target:f?r:y,targetHandle:f?i:C};_.connection=j;const D=N&&E&&(n===Qc.Strict?f&&w==="source"||!f&&w==="target":y!==r||C!==i);_.isValid=D&&d(j),_.toHandle=jA(y,w,C,m,n,!0)}return _}const Kv={onPointerDown:jte,isValid:DA};function Mte({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=Mi(e);function a({translateExtent:l,width:u,height:d,zoomStep:m=1,pannable:f=!0,zoomable:g=!0,inversePan:b=!1}){const k=y=>{if(y.sourceEvent.type!=="wheel"||!t)return;const C=n(),N=y.sourceEvent.ctrlKey&&Vd()?10:1,E=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*m,j=C[2]*Math.pow(2,E*N);t.scaleTo(j)};let S=[0,0];const x=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(S=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},_=y=>{const C=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const N=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],E=[N[0]-S[0],N[1]-S[1]];S=N;const j=r()*Math.max(C[2],Math.log(C[2]))*(b?-1:1),T={x:C[0]-E[0]*j,y:C[1]-E[1]*j},D=[[0,0],[u,d]];t.setViewportConstrained({x:T.x,y:T.y,zoom:C[2]},D,l)},w=aA().on("start",x).on("zoom",f?_:null).on("zoom.wheel",g?k:null);i.call(w,{})}function o(){i.on("zoom",null)}return{update:a,destroy:o,pointer:bs}}const Qp=e=>({x:e.x,y:e.y,zoom:e.k}),fb=({x:e,y:t,zoom:n})=>Xp.translate(e,t).scale(n),Mc=(e,t)=>e.target.closest(`.${t}`),LA=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Rte=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,pb=(e,t=0,n=Rte,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},OA=e=>{const t=e.ctrlKey&&Vd()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Dte({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:d}){return m=>{if(Mc(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(m.ctrlKey&&o){const x=bs(m),_=OA(m),w=f*Math.pow(2,_);r.scaleTo(n,w,x,m);return}const g=m.deltaMode===1?20:1;let b=i===kl.Vertical?0:m.deltaX*g,k=i===kl.Horizontal?0:m.deltaY*g;!Vd()&&m.shiftKey&&i!==kl.Vertical&&(b=m.deltaY*g,k=0),r.translateBy(n,-(b/f)*a,-(k/f)*a,{internal:!0});const S=Qp(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(m,S),e.panScrollTimeout=setTimeout(()=>{d==null||d(m,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(m,S))}}function Lte({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const a=r.type==="wheel",o=!t&&a&&!r.ctrlKey,l=Mc(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,i)}}function Ote({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,o,l;if((a=r.sourceEvent)!=null&&a.internal)return;const i=Qp(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function Ite({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{var o,l;e.usedRightMouseButton=!!(n&&LA(t,e.mouseButton??0)),(o=a.sourceEvent)!=null&&o.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!((l=a.sourceEvent)!=null&&l.internal)&&(i==null||i(a.sourceEvent,Qp(a.transform)))}}function zte({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,a&&LA(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const u=Qp(o.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,u)},n?150:0)}}}function Bte({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:l,noPanClassName:u,lib:d,connectionInProgress:m}){return f=>{var x;const g=e||t,b=n&&f.ctrlKey,k=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Mc(f,`${d}-flow__node`)||Mc(f,`${d}-flow__edge`)))return!0;if(!r&&!g&&!i&&!a&&!n||o||m&&!k||Mc(f,l)&&k||Mc(f,u)&&(!k||i&&k&&!e)||!n&&f.ctrlKey&&k)return!1;if(!n&&f.type==="touchstart"&&((x=f.touches)==null?void 0:x.length)>1)return f.preventDefault(),!1;if(!g&&!i&&!b&&k||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const S=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||k)&&S}}function Hte({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:u}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),f=aA().scaleExtent([t,n]).translateExtent(r),g=Mi(e).call(f);w({x:i.x,y:i.y,zoom:Jc(i.zoom,t,n)},[[0,0],[m.width,m.height]],r);const b=g.on("wheel.zoom"),k=g.on("dblclick.zoom");f.wheelDelta(OA);async function S($,F){return g?new Promise(U=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?vd:vf).transform(pb(g,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>U(!0)),$)}):!1}function x({noWheelClassName:$,noPanClassName:F,onPaneContextMenu:U,userSelectionActive:G,panOnScroll:X,panOnDrag:Y,panOnScrollMode:Z,panOnScrollSpeed:Q,preventScrolling:z,zoomOnPinch:O,zoomOnScroll:H,zoomOnDoubleClick:V,zoomActivationKeyPressed:W,lib:re,onTransformChange:le,connectionInProgress:pe,paneClickDistance:te,selectionOnDrag:B}){G&&!d.isZoomingOrPanning&&_();const ie=X&&!W&&!G;f.clickDistance(B?1/0:!xs(te)||te<0?0:te);const oe=ie?Dte({zoomPanValues:d,noWheelClassName:$,d3Selection:g,d3Zoom:f,panOnScrollMode:Z,panOnScrollSpeed:Q,zoomOnPinch:O,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:l}):Lte({noWheelClassName:$,preventScrolling:z,d3ZoomHandler:b});g.on("wheel.zoom",oe,{passive:!1});const be=Ote({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:o});f.on("start",be);const ge=Ite({zoomPanValues:d,panOnDrag:Y,onPaneContextMenu:!!U,onPanZoom:a,onTransformChange:le});f.on("zoom",ge);const Ce=zte({zoomPanValues:d,panOnDrag:Y,panOnScroll:X,onPaneContextMenu:U,onPanZoomEnd:l,onDraggingChange:u});f.on("end",Ce);const Le=Bte({zoomActivationKeyPressed:W,panOnDrag:Y,zoomOnScroll:H,panOnScroll:X,zoomOnDoubleClick:V,zoomOnPinch:O,userSelectionActive:G,noPanClassName:F,noWheelClassName:$,lib:re,connectionInProgress:pe});f.filter(Le),V?g.on("dblclick.zoom",k):g.on("dblclick.zoom",null)}function _(){f.on("zoom",null)}async function w($,F,U){const G=fb($),X=f==null?void 0:f.constrain()(G,F,U);return X&&await S(X),X}async function y($,F){const U=fb($);return await S(U,F),U}function C($){if(g){const F=fb($),U=g.property("__zoom");(U.k!==$.zoom||U.x!==$.x||U.y!==$.y)&&(f==null||f.transform(g,F,null,{sync:!0}))}}function N(){const $=g?sA(g.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}async function E($,F){return g?new Promise(U=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?vd:vf).scaleTo(pb(g,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>U(!0)),$)}):!1}async function j($,F){return g?new Promise(U=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?vd:vf).scaleBy(pb(g,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>U(!0)),$)}):!1}function T($){f==null||f.scaleExtent($)}function D($){f==null||f.translateExtent($)}function I($){const F=!xs($)||$<0?0:$;f==null||f.clickDistance(F)}return{update:x,destroy:_,setViewport:y,setViewportConstrained:w,getViewport:N,scaleTo:E,scaleBy:j,setScaleExtent:T,setTranslateExtent:D,syncViewport:C,setClickDistance:I}}var tu;(function(e){e.Line="line",e.Handle="handle"})(tu||(tu={}));function $te({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){const o=e-t,l=n-r,u=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&i&&(u[0]=u[0]*-1),l&&a&&(u[1]=u[1]*-1),u}function o8(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function So(e,t){return Math.max(0,t-e)}function ko(e,t){return Math.max(0,e-t)}function tf(e,t,n){return Math.max(0,t-e,e-n)}function l8(e,t){return e?!t:t}function Fte(e,t,n,r,i,a,o,l){let{affectsX:u,affectsY:d}=t;const{isHorizontal:m,isVertical:f}=t,g=m&&f,{xSnapped:b,ySnapped:k}=n,{minWidth:S,maxWidth:x,minHeight:_,maxHeight:w}=r,{x:y,y:C,width:N,height:E,aspectRatio:j}=e;let T=Math.floor(m?b-e.pointerX:0),D=Math.floor(f?k-e.pointerY:0);const I=N+(u?-T:T),$=E+(d?-D:D),F=-a[0]*N,U=-a[1]*E;let G=tf(I,S,x),X=tf($,_,w);if(o){let Q=0,z=0;u&&T<0?Q=So(y+T+F,o[0][0]):!u&&T>0&&(Q=ko(y+I+F,o[1][0])),d&&D<0?z=So(C+D+U,o[0][1]):!d&&D>0&&(z=ko(C+$+U,o[1][1])),G=Math.max(G,Q),X=Math.max(X,z)}if(l){let Q=0,z=0;u&&T>0?Q=ko(y+T,l[0][0]):!u&&T<0&&(Q=So(y+I,l[1][0])),d&&D>0?z=ko(C+D,l[0][1]):!d&&D<0&&(z=So(C+$,l[1][1])),G=Math.max(G,Q),X=Math.max(X,z)}if(i){if(m){const Q=tf(I/j,_,w)*j;if(G=Math.max(G,Q),o){let z=0;!u&&!d||u&&!d&&g?z=ko(C+U+I/j,o[1][1])*j:z=So(C+U+(u?T:-T)/j,o[0][1])*j,G=Math.max(G,z)}if(l){let z=0;!u&&!d||u&&!d&&g?z=So(C+I/j,l[1][1])*j:z=ko(C+(u?T:-T)/j,l[0][1])*j,G=Math.max(G,z)}}if(f){const Q=tf($*j,S,x)/j;if(X=Math.max(X,Q),o){let z=0;!u&&!d||d&&!u&&g?z=ko(y+$*j+F,o[1][0])/j:z=So(y+(d?D:-D)*j+F,o[0][0])/j,X=Math.max(X,z)}if(l){let z=0;!u&&!d||d&&!u&&g?z=So(y+$*j,l[1][0])/j:z=ko(y+(d?D:-D)*j,l[0][0])/j,X=Math.max(X,z)}}}D=D+(D<0?X:-X),T=T+(T<0?G:-G),i&&(g?I>$*j?D=(l8(u,d)?-T:T)/j:T=(l8(u,d)?-D:D)*j:m?(D=T/j,d=u):(T=D*j,u=d));const Y=u?y+T:y,Z=d?C+D:C;return{width:N+(u?-T:T),height:E+(d?-D:D),x:a[0]*T*(u?-1:1)+Y,y:a[1]*D*(d?-1:1)+Z}}const IA={width:0,height:0,x:0,y:0},Pte={...IA,pointerX:0,pointerY:0,aspectRatio:1};function Ute(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,l=n[0]*a,u=n[1]*o;return[[r-l,i-u],[r+a-l,i+o-u]]}function qte({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const a=Mi(e);let o={controlDirection:o8("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:d,boundaries:m,keepAspectRatio:f,resizeDirection:g,onResizeStart:b,onResize:k,onResizeEnd:S,shouldResize:x}){let _={...IA},w={...Pte};o={boundaries:m,resizeDirection:g,keepAspectRatio:f,controlDirection:o8(d)};let y,C=null,N=[],E,j,T,D=!1;const I=GE().on("start",$=>{const{nodeLookup:F,transform:U,snapGrid:G,snapToGrid:X,nodeOrigin:Y,paneDomNode:Z}=n();if(y=F.get(t),!y)return;C=(Z==null?void 0:Z.getBoundingClientRect())??null;const{xSnapped:Q,ySnapped:z}=_d($.sourceEvent,{transform:U,snapGrid:G,snapToGrid:X,containerBounds:C});_={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={..._,pointerX:Q,pointerY:z,aspectRatio:_.width/_.height},E=void 0,j=jl(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(E=F.get(y.parentId)),E&&y.extent==="parent"&&(j=[[0,0],[E.measured.width,E.measured.height]]),N=[],T=void 0;for(const[O,H]of F)if(H.parentId===t&&(N.push({id:O,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const V=Ute(H,y,H.origin??Y);T?T=[[Math.min(V[0][0],T[0][0]),Math.min(V[0][1],T[0][1])],[Math.max(V[1][0],T[1][0]),Math.max(V[1][1],T[1][1])]]:T=V}b==null||b($,{..._})}).on("drag",$=>{const{transform:F,snapGrid:U,snapToGrid:G,nodeOrigin:X}=n(),Y=_d($.sourceEvent,{transform:F,snapGrid:U,snapToGrid:G,containerBounds:C}),Z=[];if(!y)return;const{x:Q,y:z,width:O,height:H}=_,V={},W=y.origin??X,{width:re,height:le,x:pe,y:te}=Fte(w,o.controlDirection,Y,o.boundaries,o.keepAspectRatio,W,j,T),B=re!==O,ie=le!==H,oe=pe!==Q&&B,be=te!==z&&ie;if(!oe&&!be&&!B&&!ie)return;if((oe||be||W[0]===1||W[1]===1)&&(V.x=oe?pe:_.x,V.y=be?te:_.y,_.x=V.x,_.y=V.y,N.length>0)){const Ue=pe-Q,We=te-z;for(const Fe of N)Fe.position={x:Fe.position.x-Ue+W[0]*(re-O),y:Fe.position.y-We+W[1]*(le-H)},Z.push(Fe)}if((B||ie)&&(V.width=B&&(!o.resizeDirection||o.resizeDirection==="horizontal")?re:_.width,V.height=ie&&(!o.resizeDirection||o.resizeDirection==="vertical")?le:_.height,_.width=V.width,_.height=V.height),E&&y.expandParent){const Ue=W[0]*(V.width??0);V.x&&V.x{D&&(S==null||S($,{..._}),i==null||i({..._}),D=!1)});a.call(I)}function u(){a.on(".drag",null)}return{update:l,destroy:u}}var mb={exports:{}},gb={},bb={exports:{}},vb={};/** - * @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 c8;function Gte(){if(c8)return vb;c8=1;var e=eh();function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function l(f,g){var b=g(),k=r({inst:{value:b,getSnapshot:g}}),S=k[0].inst,x=k[1];return a(function(){S.value=b,S.getSnapshot=g,u(S)&&x({inst:S})},[f,b,g]),i(function(){return u(S)&&x({inst:S}),f(function(){u(S)&&x({inst:S})})},[f]),o(b),b}function u(f){var g=f.getSnapshot;f=f.value;try{var b=g();return!n(f,b)}catch{return!0}}function d(f,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return vb.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,vb}var u8;function Vte(){return u8||(u8=1,bb.exports=Gte()),bb.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 d8;function Wte(){if(d8)return gb;d8=1;var e=eh(),t=Vte();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,l=e.useMemo,u=e.useDebugValue;return gb.useSyncExternalStoreWithSelector=function(d,m,f,g,b){var k=a(null);if(k.current===null){var S={hasValue:!1,value:null};k.current=S}else S=k.current;k=l(function(){function _(E){if(!w){if(w=!0,y=E,E=g(E),b!==void 0&&S.hasValue){var j=S.value;if(b(j,E))return C=j}return C=E}if(j=C,r(y,E))return j;var T=g(E);return b!==void 0&&b(j,T)?(y=E,j):(y=E,C=T)}var w=!1,y,C,N=f===void 0?null:f;return[function(){return _(m())},N===null?void 0:function(){return _(N())}]},[m,f,g,b]);var x=i(d,k[0],k[1]);return o(function(){S.hasValue=!0,S.value=x},[x]),u(x),x},gb}var h8;function Yte(){return h8||(h8=1,mb.exports=Wte()),mb.exports}var Xte=Yte();const Kte=np(Xte),Zte={},f8=e=>{let t;const n=new Set,r=(m,f)=>{const g=typeof m=="function"?m(t):m;if(!Object.is(g,t)){const b=t;t=f??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(k=>k(t,b))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>d,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(Zte?"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()}},d=t=e(r,i,u);return u},Qte=e=>e?f8(e):f8,{useDebugValue:Jte}=cj,{useSyncExternalStoreWithSelector:ene}=Kte,tne=e=>e;function zA(e,t=tne,n){const r=ene(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Jte(r),r}const p8=(e,t)=>{const n=Qte(e),r=(i,a=t)=>zA(n,i,a);return Object.assign(r,n),r},nne=(e,t)=>e?p8(e,t):p8;function An(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,i]of e)if(!Object.is(i,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}const Jp=R.createContext(null),rne=Jp.Provider,BA=Es.error001("react");function Ft(e,t){const n=R.useContext(Jp);if(n===null)throw new Error(BA);return zA(n,e,t)}function Nn(){const e=R.useContext(Jp);if(e===null)throw new Error(BA);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const m8={display:"none"},ine={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},HA="react-flow__node-desc",$A="react-flow__edge-desc",sne="react-flow__aria-live",ane=e=>e.ariaLiveMessage,one=e=>e.ariaLabelConfig;function lne({rfId:e}){const t=Ft(ane);return h.jsx("div",{id:`${sne}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:ine,children:t})}function cne({rfId:e,disableKeyboardA11y:t}){const n=Ft(one);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${HA}-${e}`,style:m8,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${$A}-${e}`,style:m8,children:n["edge.a11yDescription.default"]}),!t&&h.jsx(lne,{rfId:e})]})}const em=R.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},a)=>{const o=`${e}`.split("-");return h.jsx("div",{className:Qn(["react-flow__panel",n,...o]),style:r,ref:a,...i,children:t})});em.displayName="Panel";const g8="https://reactflow.dev?utm_source=attribution";function une({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:h.jsx(em,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${g8}`,children:h.jsx("a",{href:g8,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const dne=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}},nf=e=>e.id;function hne(e,t){return An(e.selectedNodes.map(nf),t.selectedNodes.map(nf))&&An(e.selectedEdges.map(nf),t.selectedEdges.map(nf))}function fne({onSelectionChange:e}){const t=Nn(),{selectedNodes:n,selectedEdges:r}=Ft(dne,hne);return R.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(a=>a(i))},[n,r,e]),null}const pne=e=>!!e.onSelectionChangeHandlers;function mne({onSelectionChange:e}){const t=Ft(pne);return e||t?h.jsx(fne,{onSelectionChange:e}):null}const FA=[0,0],gne={x:0,y:0,zoom:1},bne=["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"],b8=[...bne,"rfId"],vne=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}),v8={translateExtent:Ud,nodeOrigin:FA,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function _ne(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:u}=Ft(vne,An),d=Nn();R.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{m.current=v8,l()}),[]);const m=R.useRef(v8);return R.useEffect(()=>{for(const f of b8){const g=e[f],b=m.current[f];g!==b&&(typeof e[f]>"u"||(f==="nodes"?t(g):f==="edges"?n(g):f==="minZoom"?r(g):f==="maxZoom"?i(g):f==="translateExtent"?a(g):f==="nodeExtent"?o(g):f==="ariaLabelConfig"?d.setState({ariaLabelConfig:rte(g)}):f==="fitView"?d.setState({fitViewQueued:g}):f==="fitViewOptions"?d.setState({fitViewOptions:g}):d.setState({[f]:g})))}m.current=e},b8.map(f=>e[f])),null}function _8(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function xne(e){var r;const[t,n]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){n(e);return}const i=_8(),a=()=>n(i!=null&&i.matches?"dark":"light");return a(),i==null||i.addEventListener("change",a),()=>{i==null||i.removeEventListener("change",a)}},[e]),t!==null?t:(r=_8())!=null&&r.matches?"dark":"light"}const x8=typeof document<"u"?document:null;function Wd(e=null,t={target:x8,actInsideInputWithModifier:!0}){const[n,r]=R.useState(!1),i=R.useRef(!1),a=R.useRef(new Set([])),[o,l]=R.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` -`).replace(` - -`,` -+`).split(` -`)),m=d.reduce((f,g)=>f.concat(...g),[]);return[d,m]}return[[],[]]},[e]);return R.useEffect(()=>{const u=(t==null?void 0:t.target)??x8,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=b=>{var x,_;if(i.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!i.current||i.current&&!d)&&xA(b))return!1;const S=w8(b.code,l);if(a.current.add(b[S]),y8(o,a.current,!1)){const w=((_=(x=b.composedPath)==null?void 0:x.call(b))==null?void 0:_[0])||b.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(i.current||!y)&&b.preventDefault(),r(!0)}},f=b=>{const k=w8(b.code,l);y8(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(b[k]),b.key==="Meta"&&a.current.clear(),i.current=!1},g=()=>{a.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",m),u==null||u.addEventListener("keyup",f),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{u==null||u.removeEventListener("keydown",m),u==null||u.removeEventListener("keyup",f),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function y8(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function w8(e,t){return t.includes(e)?"code":"key"}const yne=()=>{const e=Nn();return R.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,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},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:i,minZoom:a,maxZoom:o,panZoom:l}=e.getState(),u=ax(t,r,i,a,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(u,{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:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;const{x:l,y:u}=o.getBoundingClientRect(),d={x:t.x-l,y:t.y-u},m=n.snapGrid??i,f=n.snapToGrid??a;return wh(d,r,f,m)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:a}=r.getBoundingClientRect(),o=eu(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function PA(e,t){const n=[],r=new Map,i=[];for(const a of e)if(a.type==="add"){i.push(a);continue}else if(a.type==="remove"||a.type==="replace")r.set(a.id,[a]);else{const o=r.get(a.id);o?o.push(a):r.set(a.id,[a])}for(const a of t){const o=r.get(a.id);if(!o){n.push(a);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...a};for(const u of o)wne(u,l);n.push(l)}return i.length&&i.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function wne(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 Sne(e,t){return PA(e,t)}function kne(e,t){return PA(e,t)}function fl(e,t){return{id:e,type:"select",selected:t}}function Rc(e,t=new Set,n=!1){const r=[];for(const[i,a]of e){const o=t.has(i);!(a.selected===void 0&&!o)&&a.selected!==o&&(n&&(a.selected=o),r.push(fl(a.id,o)))}return r}function S8({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,o]of e.entries()){const l=t.get(o.id),u=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;u!==void 0&&u!==o&&n.push({id:o.id,item:o,type:"replace"}),u===void 0&&n.push({item:o,type:"add",index:a})}for(const[a]of t)r.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function k8(e){return{id:e.id,type:"remove"}}const Cne=gA();function Ene(e,t,n={}){return cte(e,t,{...n,onError:n.onError??Cne})}const C8=e=>Yee(e),Ane=e=>dA(e);function UA(e){return R.forwardRef(e)}const Tne=typeof window<"u"?R.useLayoutEffect:R.useEffect;function E8(e){const[t,n]=R.useState(BigInt(0)),[r]=R.useState(()=>Nne(()=>n(i=>i+BigInt(1))));return Tne(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function Nne(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const qA=R.createContext(null);function jne({children:e}){const t=Nn(),n=R.useCallback(l=>{const{nodes:u=[],setNodes:d,hasDefaultNodes:m,onNodesChange:f,nodeLookup:g,fitViewQueued:b,onNodesChangeMiddlewareMap:k}=t.getState();let S=u;for(const _ of l)S=typeof _=="function"?_(S):_;let x=S8({items:S,lookup:g});for(const _ of k.values())x=_(x);m&&d(S),x.length>0?f==null||f(x):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:_,nodes:w,setNodes:y}=t.getState();_&&y(w)})},[]),r=E8(n),i=R.useCallback(l=>{const{edges:u=[],setEdges:d,hasDefaultEdges:m,onEdgesChange:f,edgeLookup:g}=t.getState();let b=u;for(const k of l)b=typeof k=="function"?k(b):k;m?d(b):f&&f(S8({items:b,lookup:g}))},[]),a=E8(i),o=R.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return h.jsx(qA.Provider,{value:o,children:e})}function Mne(){const e=R.useContext(qA);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Rne=e=>!!e.panZoom;function fx(){const e=yne(),t=Nn(),n=Mne(),r=Ft(Rne),i=R.useMemo(()=>{const a=f=>t.getState().nodeLookup.get(f),o=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},u=f=>{var _,w;const{nodeLookup:g,nodeOrigin:b}=t.getState(),k=C8(f)?f:g.get(f.id),S=k.parentId?vA(k.position,k.measured,k.parentId,g,b):k.position,x={...k,position:S,width:((_=k.measured)==null?void 0:_.width)??k.width,height:((w=k.measured)==null?void 0:w.height)??k.height};return Gd(x)},d=(f,g,b={replace:!1})=>{o(k=>k.map(S=>{if(S.id===f){const x=typeof g=="function"?g(S):g;return b.replace&&C8(x)?x:{...S,...x}}return S}))},m=(f,g,b={replace:!1})=>{l(k=>k.map(S=>{if(S.id===f){const x=typeof g=="function"?g(S):g;return b.replace&&Ane(x)?x:{...S,...x}}return S}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var g;return(g=a(f))==null?void 0:g.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(g=>({...g}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:o,setEdges:l,addNodes:f=>{const g=Array.isArray(f)?f:[f];n.nodeQueue.push(b=>[...b,...g])},addEdges:f=>{const g=Array.isArray(f)?f:[f];n.edgeQueue.push(b=>[...b,...g])},toObject:()=>{const{nodes:f=[],edges:g=[],transform:b}=t.getState(),[k,S,x]=b;return{nodes:f.map(_=>({..._})),edges:g.map(_=>({..._})),viewport:{x:k,y:S,zoom:x}}},deleteElements:async({nodes:f=[],edges:g=[]})=>{const{nodes:b,edges:k,onNodesDelete:S,onEdgesDelete:x,triggerNodeChanges:_,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:C}=t.getState(),{nodes:N,edges:E}=await Jee({nodesToRemove:f,edgesToRemove:g,nodes:b,edges:k,onBeforeDelete:C}),j=E.length>0,T=N.length>0;if(j){const D=E.map(k8);x==null||x(E),w(D)}if(T){const D=N.map(k8);S==null||S(N),_(D)}return(T||j)&&(y==null||y({nodes:N,edges:E})),{deletedNodes:N,deletedEdges:E}},getIntersectingNodes:(f,g=!0,b)=>{const k=K7(f),S=k?f:u(f),x=b!==void 0;return S?(b||t.getState().nodes).filter(_=>{const w=t.getState().nodeLookup.get(_.id);if(w&&!k&&(_.id===f.id||!w.internals.positionAbsolute))return!1;const y=Gd(x?_:w),C=ep(y,S);return g&&C>0||C>=y.width*y.height||C>=S.width*S.height}):[]},isNodeIntersecting:(f,g,b=!0)=>{const S=K7(f)?f:u(f);if(!S)return!1;const x=ep(S,g);return b&&x>0||x>=g.width*g.height||x>=S.width*S.height},updateNode:d,updateNodeData:(f,g,b={replace:!1})=>{d(f,k=>{const S=typeof g=="function"?g(k):g;return b.replace?{...k,data:S}:{...k,data:{...k.data,...S}}},b)},updateEdge:m,updateEdgeData:(f,g,b={replace:!1})=>{m(f,k=>{const S=typeof g=="function"?g(k):g;return b.replace?{...k,data:S}:{...k,data:{...k.data,...S}}},b)},getNodesBounds:f=>{const{nodeLookup:g,nodeOrigin:b}=t.getState();return Xee(f,{nodeLookup:g,nodeOrigin:b})},getHandleConnections:({type:f,id:g,nodeId:b})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${b}-${f}${g?`-${g}`:""}`))==null?void 0:k.values())??[])},getNodeConnections:({type:f,handleId:g,nodeId:b})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${b}${f?g?`-${f}-${g}`:`-${f}`:""}`))==null?void 0:k.values())??[])},fitView:async f=>{const g=t.getState().fitViewResolver??nte();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:g}),n.nodeQueue.push(b=>[...b]),g.promise}}},[]);return R.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const A8=e=>e.selected,Dne=typeof window<"u"?window:void 0;function Lne({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Nn(),{deleteElements:r}=fx(),i=Wd(e,{actInsideInputWithModifier:!1}),a=Wd(t,{target:Dne});R.useEffect(()=>{if(i){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(A8),edges:o.filter(A8)}),n.setState({nodesSelectionActive:!1})}},[i]),R.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function One(e){const t=Nn();R.useEffect(()=>{const n=()=>{var i,a,o,l;if(!e.current||!(((a=(i=e.current).checkVisibility)==null?void 0:a.call(i))??!0))return!1;const r=ox(e.current);(r.height===0||r.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",Es.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 tm={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ine=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function zne({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=kl.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:d,minZoom:m,maxZoom:f,zoomActivationKeyCode:g,preventScrolling:b=!0,children:k,noWheelClassName:S,noPanClassName:x,onViewportChange:_,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:C}){const N=Nn(),E=R.useRef(null),{userSelectionActive:j,lib:T,connectionInProgress:D}=Ft(Ine,An),I=Wd(g),$=R.useRef();One(E);const F=R.useCallback(U=>{_==null||_({x:U[0],y:U[1],zoom:U[2]}),w||N.setState({transform:U})},[_,w]);return R.useEffect(()=>{if(E.current){$.current=Hte({domNode:E.current,minZoom:m,maxZoom:f,translateExtent:d,viewport:u,onDraggingChange:Y=>N.setState(Z=>Z.paneDragging===Y?Z:{paneDragging:Y}),onPanZoomStart:(Y,Z)=>{const{onViewportChangeStart:Q,onMoveStart:z}=N.getState();z==null||z(Y,Z),Q==null||Q(Z)},onPanZoom:(Y,Z)=>{const{onViewportChange:Q,onMove:z}=N.getState();z==null||z(Y,Z),Q==null||Q(Z)},onPanZoomEnd:(Y,Z)=>{const{onViewportChangeEnd:Q,onMoveEnd:z}=N.getState();z==null||z(Y,Z),Q==null||Q(Z)}});const{x:U,y:G,zoom:X}=$.current.getViewport();return N.setState({panZoom:$.current,transform:[U,G,X],domNode:E.current.closest(".react-flow")}),()=>{var Y;(Y=$.current)==null||Y.destroy()}}},[]),R.useEffect(()=>{var U;(U=$.current)==null||U.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:I,preventScrolling:b,noPanClassName:x,userSelectionActive:j,noWheelClassName:S,lib:T,onTransformChange:F,connectionInProgress:D,selectionOnDrag:C,paneClickDistance:y})},[e,t,n,r,i,a,o,l,I,b,x,j,S,T,F,D,C,y]),h.jsx("div",{className:"react-flow__renderer",ref:E,style:tm,children:k})}const Bne=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Hne(){const{userSelectionActive:e,userSelectionRect:t}=Ft(Bne,An);return e&&t?h.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 _b=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},$ne=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Fne({isSelecting:e,selectionKeyPressed:t,selectionMode:n=qd.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:u,onPaneClick:d,onPaneContextMenu:m,onPaneScroll:f,onPaneMouseEnter:g,onPaneMouseMove:b,onPaneMouseLeave:k,children:S}){const x=R.useRef(0),_=Nn(),{userSelectionActive:w,elementsSelectable:y,dragging:C,panBy:N,autoPanSpeed:E}=Ft($ne,An),j=y&&(e||w),T=R.useRef(null),D=R.useRef(),I=R.useRef(new Set),$=R.useRef(new Set),F=R.useRef(!1),U=R.useRef(!1),G=R.useRef({x:0,y:0}),X=R.useRef(!1),Y=B=>{if(U.current||F.current||_.getState().connection.inProgress){U.current=!1,F.current=!1;return}d==null||d(B),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},Z=B=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){B.preventDefault();return}m==null||m(B)},Q=f?B=>f(B):void 0,z=B=>{U.current&&(B.stopPropagation(),U.current=!1)},O=B=>{var Fe,mt;const{domNode:ie,transform:oe}=_.getState();if(D.current=ie==null?void 0:ie.getBoundingClientRect(),!D.current)return;const be=B.target===T.current;if(!be&&!!B.target.closest(".nokey")||!e||!(o&&be||t)||B.button!==0||!B.isPrimary)return;(mt=(Fe=B.target)==null?void 0:Fe.setPointerCapture)==null||mt.call(Fe,B.pointerId),U.current=!1;const{x:Le,y:Ue}=ys(B.nativeEvent,D.current),We=wh({x:Le,y:Ue},oe);_.setState({userSelectionRect:{width:0,height:0,startX:We.x,startY:We.y,x:Le,y:Ue}}),be||(B.stopPropagation(),B.preventDefault())};function H(B,ie){const{userSelectionRect:oe}=_.getState();if(!oe)return;const{transform:be,nodeLookup:ge,edgeLookup:Ce,connectionLookup:Le,triggerNodeChanges:Ue,triggerEdgeChanges:We,defaultEdgeOptions:Fe}=_.getState(),mt={x:oe.startX,y:oe.startY},{x:De,y:ot}=eu(mt,be),Bt={startX:mt.x,startY:mt.y,x:Bst.id)),$.current=new Set;const ct=(Fe==null?void 0:Fe.selectable)??!0;for(const st of I.current){const xe=Le.get(st);if(xe)for(const{edgeId:Me}of xe.values()){const Ge=Ce.get(Me);Ge&&(Ge.selectable??ct)&&$.current.add(Me)}}if(!Z7(on,I.current)){const st=Rc(ge,I.current,!0);Ue(st)}if(!Z7(Ze,$.current)){const st=Rc(Ce,$.current);We(st)}_.setState({userSelectionRect:Bt,userSelectionActive:!0,nodesSelectionActive:!1})}function V(){if(!i||!D.current)return;const[B,ie]=sx(G.current,D.current,E);N({x:B,y:ie}).then(oe=>{if(!U.current||!oe){x.current=requestAnimationFrame(V);return}const{x:be,y:ge}=G.current;H(be,ge),x.current=requestAnimationFrame(V)})}const W=()=>{cancelAnimationFrame(x.current),x.current=0,X.current=!1};R.useEffect(()=>()=>W(),[]);const re=B=>{const{userSelectionRect:ie,transform:oe,resetSelectedElements:be}=_.getState();if(!D.current||!ie)return;const{x:ge,y:Ce}=ys(B.nativeEvent,D.current);G.current={x:ge,y:Ce};const Le=eu({x:ie.startX,y:ie.startY},oe);if(!U.current){const Ue=t?0:a;if(Math.hypot(ge-Le.x,Ce-Le.y)<=Ue)return;be(),l==null||l(B)}U.current=!0,X.current||(V(),X.current=!0),H(ge,Ce)},le=B=>{var ie,oe;if(!j){B.target===T.current&&_.getState().connection.inProgress&&(F.current=!0);return}B.button===0&&((oe=(ie=B.target)==null?void 0:ie.releasePointerCapture)==null||oe.call(ie,B.pointerId),!w&&B.target===T.current&&_.getState().userSelectionRect&&(Y==null||Y(B)),_.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(u==null||u(B),_.setState({nodesSelectionActive:I.current.size>0})),W())},pe=B=>{var ie,oe;(oe=(ie=B.target)==null?void 0:ie.releasePointerCapture)==null||oe.call(ie,B.pointerId),W()},te=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:Qn(["react-flow__pane",{draggable:te,dragging:C,selection:e}]),onClick:j?void 0:_b(Y,T),onContextMenu:_b(Z,T),onWheel:_b(Q,T),onPointerEnter:j?void 0:g,onPointerMove:j?re:b,onPointerUp:le,onPointerCancel:j?pe:void 0,onPointerDownCapture:j?O:void 0,onClickCapture:j?z:void 0,onPointerLeave:k,ref:T,style:tm,children:[S,h.jsx(Hne,{})]})}function Zv({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:l,onError:u}=t.getState(),d=l.get(e);if(!d){u==null||u("012",Es.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&o)&&(a({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var m;return(m=r==null?void 0:r.current)==null?void 0:m.blur()})):i([e])}function GA({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){const l=Nn(),[u,d]=R.useState(!1),m=R.useRef();return R.useEffect(()=>{m.current=Cte({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{Zv({id:f,store:l,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),R.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{var f;(f=m.current)==null||f.destroy()}},[n,r,t,a,e,i,o]),u}const Pne=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function VA(){const e=Nn();return R.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:a,nodesDraggable:o,onError:l,updateNodePositions:u,nodeLookup:d,nodeOrigin:m}=e.getState(),f=new Map,g=Pne(o),b=i?a[0]:5,k=i?a[1]:5,S=n.direction.x*b*n.factor,x=n.direction.y*k*n.factor;for(const[,_]of d){if(!g(_))continue;let w={x:_.internals.positionAbsolute.x+S,y:_.internals.positionAbsolute.y+x};i&&(w=yh(w,a));const{position:y,positionAbsolute:C}=hA({nodeId:_.id,nextPosition:w,nodeLookup:d,nodeExtent:r,nodeOrigin:m,onError:l});_.position=y,_.internals.positionAbsolute=C,f.set(_.id,_)}u(f)},[])}const px=R.createContext(null),Une=px.Provider;px.Consumer;const WA=()=>R.useContext(px),qne=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),YA=R.createContext(null);function Gne({children:e}){const t=Ft(qne,An);return h.jsx(YA.Provider,{value:t,children:e})}function Vne(){const e=R.useContext(YA);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const Wne={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},Yne=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:l,toHandle:u,isValid:d}=o;if(!l&&!i)return Wne;const m=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:m,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:a===Qc.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:m&&d}};function Xne({type:e="source",position:t=lt.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:l,children:u,className:d,onMouseDown:m,onTouchStart:f,...g},b){var X,Y;const k=o||null,S=e==="target",x=Nn(),_=WA(),{connectOnClick:w,noPanClassName:y,rfId:C}=Vne(),{connectingFrom:N,connectingTo:E,clickConnecting:j,isPossibleEndHandle:T,connectionInProcess:D,clickConnectionInProcess:I,valid:$}=Ft(Yne(_,k,e),An);_||(Y=(X=x.getState()).onError)==null||Y.call(X,"010",Es.error010());const F=Z=>{const{defaultEdgeOptions:Q,onConnect:z,hasDefaultEdges:O}=x.getState(),H={...Q,...Z};if(O){const{edges:V,setEdges:W,onError:re}=x.getState();W(Ene(H,V,{onError:re}))}z==null||z(H),l==null||l(H)},U=Z=>{if(!_)return;const Q=yA(Z.nativeEvent);if(i&&(Q&&Z.button===0||!Q)){const z=x.getState();Kv.onPointerDown(Z.nativeEvent,{handleDomNode:Z.currentTarget,autoPanOnConnect:z.autoPanOnConnect,connectionMode:z.connectionMode,connectionRadius:z.connectionRadius,domNode:z.domNode,nodeLookup:z.nodeLookup,lib:z.lib,isTarget:S,handleId:k,nodeId:_,flowId:z.rfId,panBy:z.panBy,cancelConnection:z.cancelConnection,onConnectStart:z.onConnectStart,onConnectEnd:(...O)=>{var H,V;return(V=(H=x.getState()).onConnectEnd)==null?void 0:V.call(H,...O)},updateConnection:z.updateConnection,onConnect:F,isValidConnection:n||((...O)=>{var H,V;return((V=(H=x.getState()).isValidConnection)==null?void 0:V.call(H,...O))??!0}),getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:z.autoPanSpeed,dragThreshold:z.connectionDragThreshold})}Q?m==null||m(Z):f==null||f(Z)},G=Z=>{const{onClickConnectStart:Q,onClickConnectEnd:z,connectionClickStartHandle:O,connectionMode:H,isValidConnection:V,lib:W,rfId:re,nodeLookup:le,connection:pe}=x.getState();if(!_||!O&&!i)return;if(!O){Q==null||Q(Z.nativeEvent,{nodeId:_,handleId:k,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:_,type:e,id:k}});return}const te=_A(Z.target),B=n||V,{connection:ie,isValid:oe}=Kv.isValid(Z.nativeEvent,{handle:{nodeId:_,id:k,type:e},connectionMode:H,fromNodeId:O.nodeId,fromHandleId:O.id||null,fromType:O.type,isValidConnection:B,flowId:re,doc:te,lib:W,nodeLookup:le});oe&&ie&&F(ie);const be=structuredClone(pe);delete be.inProgress,be.toPosition=be.toHandle?be.toHandle.position:null,z==null||z(Z,be),x.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":k,"data-nodeid":_,"data-handlepos":t,"data-id":`${C}-${_}-${k}-${e}`,className:Qn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,d,{source:!S,target:S,connectable:r,connectablestart:i,connectableend:a,clickconnecting:j,connectingfrom:N,connectingto:E,valid:$,connectionindicator:r&&(!D||T)&&(D||I?a:i)}]),onMouseDown:U,onTouchStart:U,onClick:w?G:void 0,ref:b,...g,children:u})}const Oo=R.memo(UA(Xne));function Kne({data:e,isConnectable:t,sourcePosition:n=lt.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(Oo,{type:"source",position:n,isConnectable:t})]})}function Zne({data:e,isConnectable:t,targetPosition:n=lt.Top,sourcePosition:r=lt.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(Oo,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(Oo,{type:"source",position:r,isConnectable:t})]})}function Qne(){return null}function Jne({data:e,isConnectable:t,targetPosition:n=lt.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(Oo,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const tp={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},T8={input:Kne,default:Zne,output:Jne,group:Qne};function ere(e){var t,n,r,i;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??((i=e.style)==null?void 0:i.height)}}const tre=e=>{const{width:t,height:n,x:r,y:i}=xh(e.nodeLookup,{filter:a=>!!a.selected});return{width:xs(t)?t:null,height:xs(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function nre({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Nn(),{width:i,height:a,transformString:o,userSelectionActive:l}=Ft(tre,An),u=VA(),d=R.useRef(null);R.useEffect(()=>{var b;n||(b=d.current)==null||b.focus({preventScroll:!0})},[n]);const m=!l&&i!==null&&a!==null;if(GA({nodeRef:d,disabled:!m}),!m)return null;const f=e?b=>{const k=r.getState().nodes.filter(S=>S.selected);e(b,k)}:void 0,g=b=>{Object.prototype.hasOwnProperty.call(tp,b.key)&&(b.preventDefault(),u({direction:tp[b.key],factor:b.shiftKey?4:1}))};return h.jsx("div",{className:Qn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:h.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:i,height:a}})})}const N8=typeof window<"u"?window:void 0,rre=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function XA({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:d,selectionOnDrag:m,selectionMode:f,onSelectionStart:g,onSelectionEnd:b,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:x,elementsSelectable:_,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:N,panOnScrollMode:E,zoomOnDoubleClick:j,panOnDrag:T,autoPanOnSelection:D,defaultViewport:I,translateExtent:$,minZoom:F,maxZoom:U,preventScrolling:G,onSelectionContextMenu:X,noWheelClassName:Y,noPanClassName:Z,disableKeyboardA11y:Q,onViewportChange:z,isControlledViewport:O}){const{nodesSelectionActive:H,userSelectionActive:V}=Ft(rre,An),W=Wd(d,{target:N8}),re=Wd(S,{target:N8}),le=re||T,pe=re||C,te=m&&le!==!0,B=W||V||te;return Lne({deleteKeyCode:u,multiSelectionKeyCode:k}),h.jsx(zne,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:pe,panOnScrollSpeed:N,panOnScrollMode:E,zoomOnDoubleClick:j,panOnDrag:!W&&le,defaultViewport:I,translateExtent:$,minZoom:F,maxZoom:U,zoomActivationKeyCode:x,preventScrolling:G,noWheelClassName:Y,noPanClassName:Z,onViewportChange:z,isControlledViewport:O,paneClickDistance:l,selectionOnDrag:te,children:h.jsxs(Fne,{onSelectionStart:g,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:le,autoPanOnSelection:D,isSelecting:!!B,selectionMode:f,selectionKeyPressed:W,paneClickDistance:l,selectionOnDrag:te,children:[e,H&&h.jsx(nre,{onSelectionContextMenu:X,noPanClassName:Z,disableKeyboardA11y:Q})]})})}XA.displayName="FlowRenderer";const ire=R.memo(XA),sre=e=>t=>e?ix(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 are(e){return Ft(R.useCallback(sre(e),[e]),An)}const ore=e=>e.updateNodeInternals;function lre(){const e=Ft(ore),[t]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const a=i.target.getAttribute("data-id");r.set(a,{id:a,nodeElement:i.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function cre({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=Nn(),a=R.useRef(null),o=R.useRef(null),l=R.useRef(e.sourcePosition),u=R.useRef(e.targetPosition),d=R.useRef(t),m=n&&!!e.internals.handleBounds;return R.useEffect(()=>{a.current&&!e.hidden&&(!m||o.current!==a.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(a.current),o.current=a.current)},[m,e.hidden]),R.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),R.useEffect(()=>{if(a.current){const f=d.current!==t,g=l.current!==e.sourcePosition,b=u.current!==e.targetPosition;(f||g||b)&&(d.current=t,l.current=e.sourcePosition,u.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function ure({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:l,elementsSelectable:u,nodesConnectable:d,nodesFocusable:m,resizeObserver:f,noDragClassName:g,noPanClassName:b,disableKeyboardA11y:k,rfId:S,nodeTypes:x,nodeClickDistance:_,onError:w}){const{node:y,internals:C,isParent:N}=Ft(B=>{const ie=B.nodeLookup.get(e),oe=B.parentLookup.has(e);return{node:ie,internals:ie.internals,isParent:oe}},An);let E=y.type||"default",j=(x==null?void 0:x[E])||T8[E];j===void 0&&(w==null||w("003",Es.error003(E)),E="default",j=(x==null?void 0:x.default)||T8.default);const T=!!(y.draggable||l&&typeof y.draggable>"u"),D=!!(y.selectable||u&&typeof y.selectable>"u"),I=!!(y.connectable||d&&typeof y.connectable>"u"),$=!!(y.focusable||m&&typeof y.focusable>"u"),F=Nn(),U=bA(y),G=cre({node:y,nodeType:E,hasDimensions:U,resizeObserver:f}),X=GA({nodeRef:G,disabled:y.hidden||!T,noDragClassName:g,handleSelector:y.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:_}),Y=VA();if(y.hidden)return null;const Z=qa(y),Q=ere(y),z=D||T||t||n||r||i,O=n?B=>n(B,{...C.userNode}):void 0,H=r?B=>r(B,{...C.userNode}):void 0,V=i?B=>i(B,{...C.userNode}):void 0,W=a?B=>a(B,{...C.userNode}):void 0,re=o?B=>o(B,{...C.userNode}):void 0,le=B=>{const{selectNodesOnDrag:ie,nodeDragThreshold:oe}=F.getState();D&&(!ie||!T||oe>0)&&Zv({id:e,store:F,nodeRef:G}),t&&t(B,{...C.userNode})},pe=B=>{if(!(xA(B.nativeEvent)||k)){if(oA.includes(B.key)&&D){const ie=B.key==="Escape";Zv({id:e,store:F,unselect:ie,nodeRef:G})}else if(T&&y.selected&&Object.prototype.hasOwnProperty.call(tp,B.key)){B.preventDefault();const{ariaLabelConfig:ie}=F.getState();F.setState({ariaLiveMessage:ie["node.a11yDescription.ariaLiveMessage"]({direction:B.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),Y({direction:tp[B.key],factor:B.shiftKey?4:1})}}},te=()=>{var Le;if(k||!((Le=G.current)!=null&&Le.matches(":focus-visible")))return;const{transform:B,width:ie,height:oe,autoPanOnNodeFocus:be,setCenter:ge}=F.getState();if(!be)return;ix(new Map([[e,y]]),{x:0,y:0,width:ie,height:oe},B,!0).length>0||ge(y.position.x+Z.width/2,y.position.y+Z.height/2,{zoom:B[2]})};return h.jsx("div",{className:Qn(["react-flow__node",`react-flow__node-${E}`,{[b]:T},y.className,{selected:y.selected,selectable:D,parent:N,draggable:T,dragging:X}]),ref:G,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:z?"all":"none",visibility:U?"visible":"hidden",...y.style,...Q},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:O,onMouseMove:H,onMouseLeave:V,onContextMenu:W,onClick:le,onDoubleClick:re,onKeyDown:$?pe:void 0,tabIndex:$?0:void 0,onFocus:$?te:void 0,role:y.ariaRole??($?"group":void 0),"aria-roledescription":"node","aria-describedby":k?void 0:`${HA}-${S}`,"aria-label":y.ariaLabel,...y.domAttributes,children:h.jsx(Une,{value:e,children:h.jsx(j,{id:e,data:y.data,type:E,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:D,draggable:T,deletable:y.deletable??!0,isConnectable:I,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:X,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...Z})})})}var dre=R.memo(ure);const hre=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function KA(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=Ft(hre,An),o=are(e.onlyRenderVisibleElements),l=lre();return h.jsx("div",{className:"react-flow__nodes",style:tm,children:o.map(u=>h.jsx(dre,{id:u,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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},u))})}KA.displayName="NodeRenderer";const fre=R.memo(KA);function pre(e){return Ft(R.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const a=n.nodeLookup.get(i.source),o=n.nodeLookup.get(i.target);a&&o&&ate({sourceNode:a,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),An)}const mre=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return h.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},gre=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return h.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},j8={[Qf.Arrow]:mre,[Qf.ArrowClosed]:gre};function bre(e){const t=Nn();return R.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(j8,e)?j8[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",Es.error009(e)),null)},[e])}const vre=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const u=bre(t);return u?h.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0",children:h.jsx(u,{color:n,strokeWidth:o})}):null},ZA=({defaultColor:e,rfId:t})=>{const n=Ft(a=>a.edges),r=Ft(a=>a.defaultEdgeOptions),i=R.useMemo(()=>pte(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:i.map(a=>h.jsx(vre,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};ZA.displayName="MarkerDefinitions";var _re=R.memo(ZA);function QA({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:u,className:d,...m}){const[f,g]=R.useState({x:1,y:0,width:0,height:0}),b=Qn(["react-flow__edge-textwrapper",d]),k=R.useRef(null);return R.useEffect(()=>{if(k.current){const S=k.current.getBBox();g({x:S.x,y:S.y,width:S.width,height:S.height})}},[n]),n?h.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:b,visibility:f.width?"visible":"hidden",...m,children:[i&&h.jsx("rect",{width:f.width+2*o[0],x:-o[0],y:-o[1],height:f.height+2*o[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),h.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:k,style:r,children:n}),u]}):null}QA.displayName="EdgeText";const xre=R.memo(QA);function nm({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:u,interactionWidth:d=20,...m}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{...m,d:e,fill:"none",className:Qn(["react-flow__edge-path",m.className])}),d?h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&xs(t)&&xs(n)?h.jsx(xre,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:u}):null]})}function M8({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===lt.Left||e===lt.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function JA({sourceX:e,sourceY:t,sourcePosition:n=lt.Bottom,targetX:r,targetY:i,targetPosition:a=lt.Top}){const[o,l]=M8({pos:n,x1:e,y1:t,x2:r,y2:i}),[u,d]=M8({pos:a,x1:r,y1:i,x2:e,y2:t}),[m,f,g,b]=wA({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${o},${l} ${u},${d} ${r},${i}`,m,f,g,b]}function eT(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:b,style:k,markerEnd:S,markerStart:x,interactionWidth:_})=>{const[w,y,C]=JA({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l}),N=e.isInternal?void 0:t;return h.jsx(nm,{id:N,path:w,labelX:y,labelY:C,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:b,style:k,markerEnd:S,markerStart:x,interactionWidth:_})})}const yre=eT({isInternal:!1}),tT=eT({isInternal:!0});yre.displayName="SimpleBezierEdge";tT.displayName="SimpleBezierEdgeInternal";function nT(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:g,sourcePosition:b=lt.Bottom,targetPosition:k=lt.Top,markerEnd:S,markerStart:x,pathOptions:_,interactionWidth:w})=>{const[y,C,N]=Wv({sourceX:n,sourceY:r,sourcePosition:b,targetX:i,targetY:a,targetPosition:k,borderRadius:_==null?void 0:_.borderRadius,offset:_==null?void 0:_.offset,stepPosition:_==null?void 0:_.stepPosition}),E=e.isInternal?void 0:t;return h.jsx(nm,{id:E,path:y,labelX:C,labelY:N,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:g,markerEnd:S,markerStart:x,interactionWidth:w})})}const rT=nT({isInternal:!1}),iT=nT({isInternal:!0});rT.displayName="SmoothStepEdge";iT.displayName="SmoothStepEdgeInternal";function sT(e){return R.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return h.jsx(rT,{...n,id:r,pathOptions:R.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const wre=sT({isInternal:!1}),aT=sT({isInternal:!0});wre.displayName="StepEdge";aT.displayName="StepEdgeInternal";function oT(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:g,markerEnd:b,markerStart:k,interactionWidth:S})=>{const[x,_,w]=CA({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return h.jsx(nm,{id:y,path:x,labelX:_,labelY:w,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:g,markerEnd:b,markerStart:k,interactionWidth:S})})}const Sre=oT({isInternal:!1}),lT=oT({isInternal:!0});Sre.displayName="StraightEdge";lT.displayName="StraightEdgeInternal";function cT(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=lt.Bottom,targetPosition:l=lt.Top,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:b,style:k,markerEnd:S,markerStart:x,pathOptions:_,interactionWidth:w})=>{const[y,C,N]=SA({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l,curvature:_==null?void 0:_.curvature}),E=e.isInternal?void 0:t;return h.jsx(nm,{id:E,path:y,labelX:C,labelY:N,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:b,style:k,markerEnd:S,markerStart:x,interactionWidth:w})})}const kre=cT({isInternal:!1}),uT=cT({isInternal:!0});kre.displayName="BezierEdge";uT.displayName="BezierEdgeInternal";const R8={default:uT,straight:lT,step:aT,smoothstep:iT,simplebezier:tT},D8={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},Cre=(e,t,n)=>n===lt.Left?e-t:n===lt.Right?e+t:e,Ere=(e,t,n)=>n===lt.Top?e-t:n===lt.Bottom?e+t:e,L8="react-flow__edgeupdater";function O8({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:l}){return h.jsx("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:Qn([L8,`${L8}-${l}`]),cx:Cre(t,r,e),cy:Ere(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Are({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:l,targetPosition:u,onReconnect:d,onReconnectStart:m,onReconnectEnd:f,setReconnecting:g,setUpdateHover:b}){const k=Nn(),S=(C,N)=>{if(C.button!==0)return;const{autoPanOnConnect:E,domNode:j,connectionMode:T,connectionRadius:D,lib:I,onConnectStart:$,cancelConnection:F,nodeLookup:U,rfId:G,panBy:X,updateConnection:Y}=k.getState(),Z=N.type==="target",Q=(H,V)=>{g(!1),f==null||f(H,n,N.type,V)},z=H=>d==null?void 0:d(n,H),O=(H,V)=>{g(!0),m==null||m(C,n,N.type),$==null||$(H,V)};Kv.onPointerDown(C.nativeEvent,{autoPanOnConnect:E,connectionMode:T,connectionRadius:D,domNode:j,handleId:N.id,nodeId:N.nodeId,nodeLookup:U,isTarget:Z,edgeUpdaterType:N.type,lib:I,flowId:G,cancelConnection:F,panBy:X,isValidConnection:(...H)=>{var V,W;return((W=(V=k.getState()).isValidConnection)==null?void 0:W.call(V,...H))??!0},onConnect:z,onConnectStart:O,onConnectEnd:(...H)=>{var V,W;return(W=(V=k.getState()).onConnectEnd)==null?void 0:W.call(V,...H)},onReconnectEnd:Q,updateConnection:Y,getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,dragThreshold:k.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},x=C=>S(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),_=C=>S(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>b(!0),y=()=>b(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(O8,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:x,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&h.jsx(O8,{position:u,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function Tre({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:l,onMouseMove:u,onMouseLeave:d,reconnectRadius:m,onReconnect:f,onReconnectStart:g,onReconnectEnd:b,rfId:k,edgeTypes:S,noPanClassName:x,onError:_,disableKeyboardA11y:w}){let y=Ft(ge=>ge.edgeLookup.get(e));const C=Ft(ge=>ge.defaultEdgeOptions);y=C?{...C,...y}:y;let N=y.type||"default",E=(S==null?void 0:S[N])||R8[N];E===void 0&&(_==null||_("011",Es.error011(N)),N="default",E=(S==null?void 0:S.default)||R8.default);const j=!!(y.focusable||t&&typeof y.focusable>"u"),T=typeof f<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),D=!!(y.selectable||r&&typeof y.selectable>"u"),I=R.useRef(null),[$,F]=R.useState(!1),[U,G]=R.useState(!1),X=Nn(),{zIndex:Y=y.zIndex,sourceX:Z,sourceY:Q,targetX:z,targetY:O,sourcePosition:H,targetPosition:V}=Ft(R.useCallback(ge=>{const Ce=ge.nodeLookup.get(y.source),Le=ge.nodeLookup.get(y.target);if(!Ce||!Le)return D8;const Ue=fte({id:e,sourceNode:Ce,targetNode:Le,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:ge.connectionMode,onError:_}),We=ste({selected:y.selected,zIndex:y.zIndex,sourceNode:Ce,targetNode:Le,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode});return{...Ue||D8,zIndex:We}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),An),W=R.useMemo(()=>y.markerStart?`url('#${Yv(y.markerStart,k)}')`:void 0,[y.markerStart,k]),re=R.useMemo(()=>y.markerEnd?`url('#${Yv(y.markerEnd,k)}')`:void 0,[y.markerEnd,k]);if(y.hidden||Z===null||Q===null||z===null||O===null)return null;const le=ge=>{var We;const{addSelectedEdges:Ce,unselectNodesAndEdges:Le,multiSelectionActive:Ue}=X.getState();D&&(X.setState({nodesSelectionActive:!1}),y.selected&&Ue?(Le({nodes:[],edges:[y]}),(We=I.current)==null||We.blur()):Ce([e])),i&&i(ge,y)},pe=a?ge=>{a(ge,{...y})}:void 0,te=o?ge=>{o(ge,{...y})}:void 0,B=l?ge=>{l(ge,{...y})}:void 0,ie=u?ge=>{u(ge,{...y})}:void 0,oe=d?ge=>{d(ge,{...y})}:void 0,be=ge=>{var Ce;if(!w&&oA.includes(ge.key)&&D){const{unselectNodesAndEdges:Le,addSelectedEdges:Ue}=X.getState();ge.key==="Escape"?((Ce=I.current)==null||Ce.blur(),Le({edges:[y]})):Ue([e])}};return h.jsx("svg",{style:{zIndex:Y},children:h.jsxs("g",{className:Qn(["react-flow__edge",`react-flow__edge-${N}`,y.className,x,{selected:y.selected,animated:y.animated,inactive:!D&&!i,updating:$,selectable:D}]),onClick:le,onDoubleClick:pe,onContextMenu:te,onMouseEnter:B,onMouseMove:ie,onMouseLeave:oe,onKeyDown:j?be:void 0,tabIndex:j?0:void 0,role:y.ariaRole??(j?"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":j?`${$A}-${k}`:void 0,ref:I,...y.domAttributes,children:[!U&&h.jsx(E,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:D,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:Z,sourceY:Q,targetX:z,targetY:O,sourcePosition:H,targetPosition:V,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:W,markerEnd:re,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),T&&h.jsx(Are,{edge:y,isReconnectable:T,reconnectRadius:m,onReconnect:f,onReconnectStart:g,onReconnectEnd:b,sourceX:Z,sourceY:Q,targetX:z,targetY:O,sourcePosition:H,targetPosition:V,setUpdateHover:F,setReconnecting:G})]})})}var Nre=R.memo(Tre);const jre=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function dT({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:m,reconnectRadius:f,onEdgeDoubleClick:g,onReconnectStart:b,onReconnectEnd:k,disableKeyboardA11y:S}){const{edgesFocusable:x,edgesReconnectable:_,elementsSelectable:w,onError:y}=Ft(jre,An),C=pre(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(_re,{defaultColor:e,rfId:n}),C.map(N=>h.jsx(Nre,{id:N,edgesFocusable:x,edgesReconnectable:_,elementsSelectable:w,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:l,onMouseMove:u,onMouseLeave:d,onClick:m,reconnectRadius:f,onDoubleClick:g,onReconnectStart:b,onReconnectEnd:k,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:S},N))]})}dT.displayName="EdgeRenderer";const Mre=R.memo(dT),Rre=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Dre({children:e}){const t=Ft(Rre);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Lre(e){const t=fx(),n=R.useRef(!1);R.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Ore=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Ire(e){const t=Ft(Ore),n=Nn();return R.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function zre(e){return e.connection.inProgress?{...e.connection,to:wh(e.connection.to,e.transform)}:{...e.connection}}function Bre(e){return zre}function Hre(e){const t=Bre();return Ft(t,An)}const $re=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Fre({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:a,height:o,isValid:l,inProgress:u}=Ft($re,An);return!(a&&i&&u)?null:h.jsx("svg",{style:e,width:a,height:o,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:Qn(["react-flow__connection",uA(l)]),children:h.jsx(hT,{style:t,type:n,CustomComponent:r,isValid:l})})})}const hT=({style:e,type:t=Co.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:a,fromNode:o,fromHandle:l,fromPosition:u,to:d,toNode:m,toHandle:f,toPosition:g,pointer:b}=Hre();if(!i)return;if(n)return h.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:a.x,fromY:a.y,toX:d.x,toY:d.y,fromPosition:u,toPosition:g,connectionStatus:uA(r),toNode:m,toHandle:f,pointer:b});let k="";const S={sourceX:a.x,sourceY:a.y,sourcePosition:u,targetX:d.x,targetY:d.y,targetPosition:g};switch(t){case Co.Bezier:[k]=SA(S);break;case Co.SimpleBezier:[k]=JA(S);break;case Co.Step:[k]=Wv({...S,borderRadius:0});break;case Co.SmoothStep:[k]=Wv(S);break;default:[k]=CA(S)}return h.jsx("path",{d:k,fill:"none",className:"react-flow__connection-path",style:e})};hT.displayName="ConnectionLine";const Pre={};function I8(e=Pre){R.useRef(e),Nn(),R.useEffect(()=>{},[e])}function Ure(){Nn(),R.useRef(!1),R.useEffect(()=>{},[])}function fT({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:m,onSelectionContextMenu:f,onSelectionStart:g,onSelectionEnd:b,connectionLineType:k,connectionLineStyle:S,connectionLineComponent:x,connectionLineContainerStyle:_,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:N,panActivationKeyCode:E,zoomActivationKeyCode:j,deleteKeyCode:T,onlyRenderVisibleElements:D,elementsSelectable:I,defaultViewport:$,translateExtent:F,minZoom:U,maxZoom:G,preventScrolling:X,defaultMarkerColor:Y,zoomOnScroll:Z,zoomOnPinch:Q,panOnScroll:z,panOnScrollSpeed:O,panOnScrollMode:H,zoomOnDoubleClick:V,panOnDrag:W,autoPanOnSelection:re,onPaneClick:le,onPaneMouseEnter:pe,onPaneMouseMove:te,onPaneMouseLeave:B,onPaneScroll:ie,onPaneContextMenu:oe,paneClickDistance:be,nodeClickDistance:ge,onEdgeContextMenu:Ce,onEdgeMouseEnter:Le,onEdgeMouseMove:Ue,onEdgeMouseLeave:We,reconnectRadius:Fe,onReconnect:mt,onReconnectStart:De,onReconnectEnd:ot,noDragClassName:Bt,noWheelClassName:on,noPanClassName:Ze,disableKeyboardA11y:ct,nodeExtent:st,rfId:xe,viewport:Me,onViewportChange:Ge}){return I8(e),I8(t),Ure(),Lre(n),Ire(Me),h.jsx(ire,{onPaneClick:le,onPaneMouseEnter:pe,onPaneMouseMove:te,onPaneMouseLeave:B,onPaneContextMenu:oe,onPaneScroll:ie,paneClickDistance:be,deleteKeyCode:T,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,onSelectionStart:g,onSelectionEnd:b,multiSelectionKeyCode:N,panActivationKeyCode:E,zoomActivationKeyCode:j,elementsSelectable:I,zoomOnScroll:Z,zoomOnPinch:Q,zoomOnDoubleClick:V,panOnScroll:z,panOnScrollSpeed:O,panOnScrollMode:H,panOnDrag:W,autoPanOnSelection:re,defaultViewport:$,translateExtent:F,minZoom:U,maxZoom:G,onSelectionContextMenu:f,preventScrolling:X,noDragClassName:Bt,noWheelClassName:on,noPanClassName:Ze,disableKeyboardA11y:ct,onViewportChange:Ge,isControlledViewport:!!Me,children:h.jsxs(Dre,{children:[h.jsx(Mre,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:mt,onReconnectStart:De,onReconnectEnd:ot,onlyRenderVisibleElements:D,onEdgeContextMenu:Ce,onEdgeMouseEnter:Le,onEdgeMouseMove:Ue,onEdgeMouseLeave:We,reconnectRadius:Fe,defaultMarkerColor:Y,noPanClassName:Ze,disableKeyboardA11y:ct,rfId:xe}),h.jsx(Fre,{style:S,type:k,component:x,containerStyle:_}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(fre,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:m,nodeClickDistance:ge,onlyRenderVisibleElements:D,noPanClassName:Ze,noDragClassName:Bt,disableKeyboardA11y:ct,nodeExtent:st,rfId:xe}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}fT.displayName="GraphView";const qre=R.memo(fT),Gre=gA(),z8=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u=.5,maxZoom:d=2,nodeOrigin:m,nodeExtent:f,zIndexMode:g="basic"}={})=>{const b=new Map,k=new Map,S=new Map,x=new Map,_=r??t??[],w=n??e??[],y=m??[0,0],C=f??Ud;TA(S,x,_);const{nodesInitialized:N}=Xv(w,b,k,{nodeOrigin:y,nodeExtent:C,zIndexMode:g});let E=[0,0,1];if(o&&i&&a){const j=xh(b,{filter:$=>!!(($.width||$.initialWidth)&&($.height||$.initialHeight))}),{x:T,y:D,zoom:I}=ax(j,i,a,u,d,(l==null?void 0:l.padding)??.1);E=[T,D,I]}return{rfId:"1",width:i??0,height:a??0,transform:E,nodes:w,nodesInitialized:N,nodeLookup:b,parentLookup:k,edges:_,edgeLookup:x,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:d,translateExtent:Ud,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Qc.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:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...cA},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Gre,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:lA,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Vre=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:m,nodeExtent:f,zIndexMode:g})=>nne((b,k)=>{async function S(){const{nodeLookup:x,panZoom:_,fitViewOptions:w,fitViewResolver:y,width:C,height:N,minZoom:E,maxZoom:j}=k();_&&(await Qee({nodes:x,width:C,height:N,panZoom:_,minZoom:E,maxZoom:j},w),y==null||y.resolve(!0),b({fitViewResolver:null}))}return{...z8({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:m,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:x=>{const{nodeLookup:_,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:N,zIndexMode:E,nodesSelectionActive:j}=k(),{nodesInitialized:T,hasSelectedNodes:D}=Xv(x,_,w,{nodeOrigin:y,nodeExtent:f,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:E}),I=j&&D;N&&T?(S(),b({nodes:x,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):b({nodes:x,nodesInitialized:T,nodesSelectionActive:I})},setEdges:x=>{const{connectionLookup:_,edgeLookup:w}=k();TA(_,w,x),b({edges:x})},setDefaultNodesAndEdges:(x,_)=>{if(x){const{setNodes:w}=k();w(x),b({hasDefaultNodes:!0})}if(_){const{setEdges:w}=k();w(_),b({hasDefaultEdges:!0})}},updateNodeInternals:x=>{const{triggerNodeChanges:_,nodeLookup:w,parentLookup:y,domNode:C,nodeOrigin:N,nodeExtent:E,debug:j,fitViewQueued:T,zIndexMode:D}=k(),{changes:I,updatedInternals:$}=yte(x,w,y,C,N,E,D);$&&(bte(w,y,{nodeOrigin:N,nodeExtent:E,zIndexMode:D}),T?(S(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),(I==null?void 0:I.length)>0&&(j&&console.log("React Flow: trigger node changes",I),_==null||_(I)))},updateNodePositions:(x,_=!1)=>{const w=[];let y=[];const{nodeLookup:C,triggerNodeChanges:N,connection:E,updateConnection:j,onNodesChangeMiddlewareMap:T}=k();for(const[D,I]of x){const $=C.get(D),F=!!($!=null&&$.expandParent&&($!=null&&$.parentId)&&(I!=null&&I.position)),U={id:D,type:"position",position:F?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:_};if($&&E.inProgress&&E.fromNode.id===$.id){const G=Ml($,E.fromHandle,lt.Left,!0);j({...E,from:G})}F&&$.parentId&&w.push({id:D,parentId:$.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),y.push(U)}if(w.length>0){const{parentLookup:D,nodeOrigin:I}=k(),$=hx(w,C,D,I);y.push(...$)}for(const D of T.values())y=D(y);N(y)},triggerNodeChanges:x=>{const{onNodesChange:_,setNodes:w,nodes:y,hasDefaultNodes:C,debug:N}=k();if(x!=null&&x.length){if(C){const E=Sne(x,y);w(E)}N&&console.log("React Flow: trigger node changes",x),_==null||_(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:_,setEdges:w,edges:y,hasDefaultEdges:C,debug:N}=k();if(x!=null&&x.length){if(C){const E=kne(x,y);w(E)}N&&console.log("React Flow: trigger edge changes",x),_==null||_(x)}},addSelectedNodes:x=>{const{multiSelectionActive:_,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:N}=k();if(_){const E=x.map(j=>fl(j,!0));C(E);return}C(Rc(y,new Set([...x]),!0)),N(Rc(w))},addSelectedEdges:x=>{const{multiSelectionActive:_,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:N}=k();if(_){const E=x.map(j=>fl(j,!0));N(E);return}N(Rc(w,new Set([...x]))),C(Rc(y,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:_}={})=>{const{edges:w,nodes:y,nodeLookup:C,triggerNodeChanges:N,triggerEdgeChanges:E}=k(),j=x||y,T=_||w,D=[];for(const $ of j){if(!$.selected)continue;const F=C.get($.id);F&&(F.selected=!1),D.push(fl($.id,!1))}const I=[];for(const $ of T)$.selected&&I.push(fl($.id,!1));N(D),E(I)},setMinZoom:x=>{const{panZoom:_,maxZoom:w}=k();_==null||_.setScaleExtent([x,w]),b({minZoom:x})},setMaxZoom:x=>{const{panZoom:_,minZoom:w}=k();_==null||_.setScaleExtent([w,x]),b({maxZoom:x})},setTranslateExtent:x=>{var _;(_=k().panZoom)==null||_.setTranslateExtent(x),b({translateExtent:x})},resetSelectedElements:()=>{const{edges:x,nodes:_,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:C}=k();if(!C)return;const N=_.reduce((j,T)=>T.selected?[...j,fl(T.id,!1)]:j,[]),E=x.reduce((j,T)=>T.selected?[...j,fl(T.id,!1)]:j,[]);w(N),y(E)},setNodeExtent:x=>{const{nodes:_,nodeLookup:w,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:N,nodeExtent:E,zIndexMode:j}=k();x[0][0]===E[0][0]&&x[0][1]===E[0][1]&&x[1][0]===E[1][0]&&x[1][1]===E[1][1]||(Xv(_,w,y,{nodeOrigin:C,nodeExtent:x,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:j}),b({nodeExtent:x}))},panBy:x=>{const{transform:_,width:w,height:y,panZoom:C,translateExtent:N}=k();return wte({delta:x,panZoom:C,transform:_,translateExtent:N,width:w,height:y})},setCenter:async(x,_,w)=>{const{width:y,height:C,maxZoom:N,panZoom:E}=k();if(!E)return!1;const j=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:N;return await E.setViewport({x:y/2-x*j,y:C/2-_*j,zoom:j},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{b({connection:{...cA}})},updateConnection:x=>{b({connection:x})},reset:()=>b({...z8()})}},Object.is);function Wre({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:u,fitView:d,nodeOrigin:m,nodeExtent:f,zIndexMode:g,children:b}){const[k]=R.useState(()=>Vre({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:d,minZoom:o,maxZoom:l,fitViewOptions:u,nodeOrigin:m,nodeExtent:f,zIndexMode:g}));return h.jsx(rne,{value:k,children:h.jsx(jne,{children:h.jsx(Gne,{children:b})})})}function Yre({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:l,fitViewOptions:u,minZoom:d,maxZoom:m,nodeOrigin:f,nodeExtent:g,zIndexMode:b}){return R.useContext(Jp)?h.jsx(h.Fragment,{children:e}):h.jsx(Wre,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:l,initialFitViewOptions:u,initialMinZoom:d,initialMaxZoom:m,nodeOrigin:f,nodeExtent:g,zIndexMode:b,children:e})}const Xre={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Kre({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:l,onEdgeClick:u,onInit:d,onMove:m,onMoveStart:f,onMoveEnd:g,onConnect:b,onConnectStart:k,onConnectEnd:S,onClickConnectStart:x,onClickConnectEnd:_,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:N,onNodeDoubleClick:E,onNodeDragStart:j,onNodeDrag:T,onNodeDragStop:D,onNodesDelete:I,onEdgesDelete:$,onDelete:F,onSelectionChange:U,onSelectionDragStart:G,onSelectionDrag:X,onSelectionDragStop:Y,onSelectionContextMenu:Z,onSelectionStart:Q,onSelectionEnd:z,onBeforeDelete:O,connectionMode:H,connectionLineType:V=Co.Bezier,connectionLineStyle:W,connectionLineComponent:re,connectionLineContainerStyle:le,deleteKeyCode:pe="Backspace",selectionKeyCode:te="Shift",selectionOnDrag:B=!1,selectionMode:ie=qd.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:be=Vd()?"Meta":"Control",zoomActivationKeyCode:ge=Vd()?"Meta":"Control",snapToGrid:Ce,snapGrid:Le,onlyRenderVisibleElements:Ue=!1,selectNodesOnDrag:We,nodesDraggable:Fe,autoPanOnNodeFocus:mt,nodesConnectable:De,nodesFocusable:ot,nodeOrigin:Bt=FA,edgesFocusable:on,edgesReconnectable:Ze,elementsSelectable:ct=!0,defaultViewport:st=gne,minZoom:xe=.5,maxZoom:Me=2,translateExtent:Ge=Ud,preventScrolling:Qe=!0,nodeExtent:Oe,defaultMarkerColor:tt="#b1b1b7",zoomOnScroll:it=!0,zoomOnPinch:jt=!0,panOnScroll:_t=!1,panOnScrollSpeed:Tt=.5,panOnScrollMode:ut=kl.Free,zoomOnDoubleClick:xn=!0,panOnDrag:dr=!0,onPaneClick:Or,onPaneMouseEnter:os,onPaneMouseMove:ls,onPaneMouseLeave:gi,onPaneScroll:pr,onPaneContextMenu:Ts,paneClickDistance:Jn=1,nodeClickDistance:Xr=0,children:Kr,onReconnect:yn,onReconnectStart:mn,onReconnectEnd:bi,onEdgeContextMenu:Ns,onEdgeDoubleClick:Ui,onEdgeMouseEnter:Sr,onEdgeMouseMove:mr,onEdgeMouseLeave:Pt,reconnectRadius:er=10,onNodesChange:Zr,onEdgesChange:Qr,noDragClassName:ft="nodrag",noWheelClassName:In="nowheel",noPanClassName:tr="nopan",fitView:Je,fitViewOptions:Nt,connectOnClick:na,attributionPosition:pn,proOptions:kr,defaultEdgeOptions:Cr,elevateNodesOnSelect:Jr=!0,elevateEdgesOnSelect:Er=!1,disableKeyboardA11y:Ut=!1,autoPanOnConnect:Ir,autoPanOnNodeDrag:Qt,autoPanOnSelection:gr=!0,autoPanSpeed:qi,connectionRadius:Hn,isValidConnection:zr,onError:ra,style:Gi,id:ia,nodeDragThreshold:js,connectionDragThreshold:ei,viewport:vi,onViewportChange:nr,width:rr,height:Rn,colorMode:ln="light",debug:sa,onScroll:cs,ariaLabelConfig:ti,zIndexMode:Ga="basic",...ir},aa){const cn=ia||"1",Ms=xne(ln),gn=R.useCallback(Ar=>{Ar.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),cs==null||cs(Ar)},[cs]);return h.jsx("div",{"data-testid":"rf__wrapper",...ir,onScroll:gn,style:{...Gi,...Xre},ref:aa,className:Qn(["react-flow",i,Ms]),id:ia,role:"application",children:h.jsxs(Yre,{nodes:e,edges:t,width:rr,height:Rn,fitView:Je,fitViewOptions:Nt,minZoom:xe,maxZoom:Me,nodeOrigin:Bt,nodeExtent:Oe,zIndexMode:Ga,children:[h.jsx(_ne,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:b,onConnectStart:k,onConnectEnd:S,onClickConnectStart:x,onClickConnectEnd:_,nodesDraggable:Fe,autoPanOnNodeFocus:mt,nodesConnectable:De,nodesFocusable:ot,edgesFocusable:on,edgesReconnectable:Ze,elementsSelectable:ct,elevateNodesOnSelect:Jr,elevateEdgesOnSelect:Er,minZoom:xe,maxZoom:Me,nodeExtent:Oe,onNodesChange:Zr,onEdgesChange:Qr,snapToGrid:Ce,snapGrid:Le,connectionMode:H,translateExtent:Ge,connectOnClick:na,defaultEdgeOptions:Cr,fitView:Je,fitViewOptions:Nt,onNodesDelete:I,onEdgesDelete:$,onDelete:F,onNodeDragStart:j,onNodeDrag:T,onNodeDragStop:D,onSelectionDrag:X,onSelectionDragStart:G,onSelectionDragStop:Y,onMove:m,onMoveStart:f,onMoveEnd:g,noPanClassName:tr,nodeOrigin:Bt,rfId:cn,autoPanOnConnect:Ir,autoPanOnNodeDrag:Qt,autoPanSpeed:qi,onError:ra,connectionRadius:Hn,isValidConnection:zr,selectNodesOnDrag:We,nodeDragThreshold:js,connectionDragThreshold:ei,onBeforeDelete:O,debug:sa,ariaLabelConfig:ti,zIndexMode:Ga}),h.jsx(qre,{onInit:d,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:N,onNodeDoubleClick:E,nodeTypes:a,edgeTypes:o,connectionLineType:V,connectionLineStyle:W,connectionLineComponent:re,connectionLineContainerStyle:le,selectionKeyCode:te,selectionOnDrag:B,selectionMode:ie,deleteKeyCode:pe,multiSelectionKeyCode:be,panActivationKeyCode:oe,zoomActivationKeyCode:ge,onlyRenderVisibleElements:Ue,defaultViewport:st,translateExtent:Ge,minZoom:xe,maxZoom:Me,preventScrolling:Qe,zoomOnScroll:it,zoomOnPinch:jt,zoomOnDoubleClick:xn,panOnScroll:_t,panOnScrollSpeed:Tt,panOnScrollMode:ut,panOnDrag:dr,autoPanOnSelection:gr,onPaneClick:Or,onPaneMouseEnter:os,onPaneMouseMove:ls,onPaneMouseLeave:gi,onPaneScroll:pr,onPaneContextMenu:Ts,paneClickDistance:Jn,nodeClickDistance:Xr,onSelectionContextMenu:Z,onSelectionStart:Q,onSelectionEnd:z,onReconnect:yn,onReconnectStart:mn,onReconnectEnd:bi,onEdgeContextMenu:Ns,onEdgeDoubleClick:Ui,onEdgeMouseEnter:Sr,onEdgeMouseMove:mr,onEdgeMouseLeave:Pt,reconnectRadius:er,defaultMarkerColor:tt,noDragClassName:ft,noWheelClassName:In,noPanClassName:tr,rfId:cn,disableKeyboardA11y:Ut,nodeExtent:Oe,viewport:vi,onViewportChange:nr}),h.jsx(mne,{onSelectionChange:U}),Kr,h.jsx(une,{proOptions:kr,position:pn}),h.jsx(cne,{rfId:cn,disableKeyboardA11y:Ut})]})})}var Zre=UA(Kre);function Qre({dimensions:e,lineWidth:t,variant:n,className:r}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Qn(["react-flow__background-pattern",n,r])})}function Jre({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:Qn(["react-flow__background-pattern","dots",t])})}var Ra;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ra||(Ra={}));const eie={[Ra.Dots]:1,[Ra.Lines]:1,[Ra.Cross]:6},tie=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function pT({id:e,variant:t=Ra.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:l,style:u,className:d,patternClassName:m}){const f=R.useRef(null),{transform:g,patternId:b}=Ft(tie,An),k=r||eie[t],S=t===Ra.Dots,x=t===Ra.Cross,_=Array.isArray(n)?n:[n,n],w=[_[0]*g[2]||1,_[1]*g[2]||1],y=k*g[2],C=Array.isArray(a)?a:[a,a],N=x?[y,y]:w,E=[C[0]*g[2]||1+N[0]/2,C[1]*g[2]||1+N[1]/2],j=`${b}${e||""}`;return h.jsxs("svg",{className:Qn(["react-flow__background",d]),style:{...u,...tm,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:f,"data-testid":"rf__background",children:[h.jsx("pattern",{id:j,x:g[0]%w[0],y:g[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:S?h.jsx(Jre,{radius:y/2,className:m}):h.jsx(Qre,{dimensions:N,lineWidth:i,variant:t,className:m})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${j})`})]})}pT.displayName="Background";const nie=R.memo(pT);function rie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function iie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function sie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.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 aie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 oie(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 rf({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:Qn(["react-flow__controls-button",t]),...n,children:e})}const lie=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function mT({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:l,onInteractiveChange:u,className:d,children:m,position:f="bottom-left",orientation:g="vertical","aria-label":b}){const k=Nn(),{isInteractive:S,minZoomReached:x,maxZoomReached:_,ariaLabelConfig:w}=Ft(lie,An),{zoomIn:y,zoomOut:C,fitView:N}=fx(),E=()=>{y(),a==null||a()},j=()=>{C(),o==null||o()},T=()=>{N(i),l==null||l()},D=()=>{k.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),u==null||u(!S)},I=g==="horizontal"?"horizontal":"vertical";return h.jsxs(em,{className:Qn(["react-flow__controls",I,d]),position:f,style:e,"data-testid":"rf__controls","aria-label":b??w["controls.ariaLabel"],children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(rf,{onClick:E,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:_,children:h.jsx(rie,{})}),h.jsx(rf,{onClick:j,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:x,children:h.jsx(iie,{})})]}),n&&h.jsx(rf,{className:"react-flow__controls-fitview",onClick:T,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:h.jsx(sie,{})}),r&&h.jsx(rf,{className:"react-flow__controls-interactive",onClick:D,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:S?h.jsx(oie,{}):h.jsx(aie,{})}),m]})}mT.displayName="Controls";R.memo(mT);function cie({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:l,strokeWidth:u,className:d,borderRadius:m,shapeRendering:f,selected:g,onClick:b}){const{background:k,backgroundColor:S}=a||{},x=o||k||S;return h.jsx("rect",{className:Qn(["react-flow__minimap-node",{selected:g},d]),x:t,y:n,rx:m,ry:m,width:r,height:i,style:{fill:x,stroke:l,strokeWidth:u},shapeRendering:f,onClick:b?_=>b(_,e):void 0})}const uie=R.memo(cie),die=e=>e.nodes.map(t=>t.id),xb=e=>e instanceof Function?e:()=>e;function hie({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=uie,onClick:o}){const l=Ft(die,An),u=xb(t),d=xb(e),m=xb(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:l.map(g=>h.jsx(pie,{id:g,nodeColorFunc:u,nodeStrokeColorFunc:d,nodeClassNameFunc:m,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:f},g))})}function fie({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:l,onClick:u}){const{node:d,x:m,y:f,width:g,height:b}=Ft(k=>{const S=k.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const x=S.internals.userNode,{x:_,y:w}=S.internals.positionAbsolute,{width:y,height:C}=qa(x);return{node:x,x:_,y:w,width:y,height:C}},An);return!d||d.hidden||!bA(d)?null:h.jsx(l,{x:m,y:f,width:g,height:b,style:d.style,selected:!!d.selected,className:r(d),color:t(d),borderRadius:i,strokeColor:n(d),strokeWidth:a,shapeRendering:o,onClick:u,id:d.id})}const pie=R.memo(fie);var mie=R.memo(hie);const gie=200,bie=150,vie=e=>!e.hidden,_ie=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?pA(xh(e.nodeLookup,{filter:vie}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},xie="react-flow__minimap-desc";function gT({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:u,maskColor:d,maskStrokeColor:m,maskStrokeWidth:f,position:g="bottom-right",onClick:b,onNodeClick:k,pannable:S=!1,zoomable:x=!1,ariaLabel:_,inversePan:w,zoomStep:y=1,offsetScale:C=5}){const N=Nn(),E=R.useRef(null),{boundingRect:j,viewBB:T,rfId:D,panZoom:I,translateExtent:$,flowWidth:F,flowHeight:U,ariaLabelConfig:G}=Ft(_ie,An),X=(e==null?void 0:e.width)??gie,Y=(e==null?void 0:e.height)??bie,Z=j.width/X,Q=j.height/Y,z=Math.max(Z,Q),O=z*X,H=z*Y,V=C*z,W=j.x-(O-j.width)/2-V,re=j.y-(H-j.height)/2-V,le=O+V*2,pe=H+V*2,te=`${xie}-${D}`,B=R.useRef(0),ie=R.useRef();B.current=z,R.useEffect(()=>{if(E.current&&I)return ie.current=Mte({domNode:E.current,panZoom:I,getTransform:()=>N.getState().transform,getViewScale:()=>B.current}),()=>{var Ce;(Ce=ie.current)==null||Ce.destroy()}},[I]),R.useEffect(()=>{var Ce;(Ce=ie.current)==null||Ce.update({translateExtent:$,width:F,height:U,inversePan:w,pannable:S,zoomStep:y,zoomable:x})},[S,x,w,y,$,F,U]);const oe=b?Ce=>{var We;const[Le,Ue]=((We=ie.current)==null?void 0:We.pointer(Ce))||[0,0];b(Ce,{x:Le,y:Ue})}:void 0,be=k?R.useCallback((Ce,Le)=>{const Ue=N.getState().nodeLookup.get(Le).internals.userNode;k(Ce,Ue)},[]):void 0,ge=_??G["minimap.ariaLabel"];return h.jsx(em,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*z: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 o=="number"?o:void 0},className:Qn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:X,height:Y,viewBox:`${W} ${re} ${le} ${pe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":te,ref:E,onClick:oe,children:[ge&&h.jsx("title",{id:te,children:ge}),h.jsx(mie,{onClick:be,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:l}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-V},${re-V}h${le+V*2}v${pe+V*2}h${-le-V*2}z - M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}gT.displayName="MiniMap";R.memo(gT);const yie=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,wie={[tu.Line]:"right",[tu.Handle]:"bottom-right"};function Sie({nodeId:e,position:t,variant:n=tu.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:l=10,minHeight:u=10,maxWidth:d=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:g,autoScale:b=!0,shouldResize:k,onResizeStart:S,onResize:x,onResizeEnd:_}){const w=WA(),y=typeof e=="string"?e:w,C=Nn(),N=R.useRef(null),E=n===tu.Handle,j=Ft(R.useCallback(yie(E&&b),[E,b]),An),T=R.useRef(null),D=t??wie[n];R.useEffect(()=>{if(!(!N.current||!y))return T.current||(T.current=qte({domNode:N.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:$,transform:F,snapGrid:U,snapToGrid:G,nodeOrigin:X,domNode:Y}=C.getState();return{nodeLookup:$,transform:F,snapGrid:U,snapToGrid:G,nodeOrigin:X,paneDomNode:Y}},onChange:($,F)=>{const{triggerNodeChanges:U,nodeLookup:G,parentLookup:X,nodeOrigin:Y}=C.getState(),Z=[],Q={x:$.x,y:$.y},z=G.get(y);if(z&&z.expandParent&&z.parentId){const O=z.origin??Y,H=$.width??z.measured.width??0,V=$.height??z.measured.height??0,W={id:z.id,parentId:z.parentId,rect:{width:H,height:V,...vA({x:$.x??z.position.x,y:$.y??z.position.y},{width:H,height:V},z.parentId,G,O)}},re=hx([W],G,X,Y);Z.push(...re),Q.x=$.x?Math.max(O[0]*H,$.x):void 0,Q.y=$.y?Math.max(O[1]*V,$.y):void 0}if(Q.x!==void 0&&Q.y!==void 0){const O={id:y,type:"position",position:{...Q}};Z.push(O)}if($.width!==void 0&&$.height!==void 0){const H={id:y,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:$.width,height:$.height}};Z.push(H)}for(const O of F){const H={...O,type:"position"};Z.push(H)}U(Z)},onEnd:({width:$,height:F})=>{const U={id:y,type:"dimensions",resizing:!1,dimensions:{width:$,height:F}};C.getState().triggerNodeChanges([U])}})),T.current.update({controlPosition:D,boundaries:{minWidth:l,minHeight:u,maxWidth:d,maxHeight:m},keepAspectRatio:f,resizeDirection:g,onResizeStart:S,onResize:x,onResizeEnd:_,shouldResize:k}),()=>{var $;($=T.current)==null||$.destroy()}},[D,l,u,d,m,f,S,x,_,k]);const I=D.split("-");return h.jsx("div",{className:Qn(["react-flow__resize-control","nodrag",...I,n,r]),ref:N,style:{...i,scale:j,...o&&{[E?"backgroundColor":"borderColor"]:o}},children:a})}R.memo(Sie);function kie(){const[e,t]=R.useState(0),[n,r]=R.useState(0);return{ref:R.useCallback(a=>{if(!a)return;function o(){t(a.offsetWidth),r(a.offsetHeight)}const l=new ResizeObserver(o),u=new MutationObserver(o);return l.observe(a),u.observe(a,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),o(),()=>{l.disconnect(),u.disconnect()}},[]),offsetWidth:e,offsetHeight:n}}const sf=8;function Cie(e,t){const{offsetWidth:n,offsetHeight:r}=t,[{viewHeight:i,viewWidth:a},o]=R.useState({viewWidth:0,viewHeight:0});R.useEffect(()=>{function m(){o({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",m),m(),()=>window.removeEventListener("resize",m)},[]);let l=0,u=0,d=0;if(e){const{distance:m}=e;switch(e.anchor){case"left":l=e.x-n-m,u=e.y+e.height/2-r/2;break;case"right":l=e.x+e.width+m,u=e.y+e.height/2-r/2;break;case"below":l=e.x+e.width/2-n/2,u=e.y+e.height+m;break;case"above":l=e.x+e.width/2-n/2,u=e.y-r-m;break}const f=l,g=u;l=Math.min(Math.max(l,sf),a-n-sf),u=Math.min(Math.max(u,sf),i-r-sf),d=e.anchor==="left"||e.anchor==="right"?g-u:f-l}return{x:l,y:u,arrowAdjustment:d}}const yb=380,wb=12,Eie=350,Aie=150,Qv=new EventTarget;function Tie(){Qv.dispatchEvent(new Event("move"))}function Nie(e,t){const[n,r]=R.useState(null),i=R.useRef(void 0),a=R.useRef(void 0);R.useEffect(()=>{const d=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current),r(null)};return Qv.addEventListener("move",d),()=>{Qv.removeEventListener("move",d),window.clearTimeout(i.current),window.clearTimeout(a.current)}},[]),R.useEffect(()=>{r(d=>{var f;if(!d)return d;const m=((f=e.current)==null?void 0:f.getBoundingClientRect())??null;return m&&d.x===m.x&&d.y===m.y&&d.width===m.width&&d.height===m.height?d:m})},[e,t]);const o=R.useCallback(()=>{window.clearTimeout(a.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>{var d;r(((d=e.current)==null?void 0:d.getBoundingClientRect())??null)},Eie)},[e]),l=R.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(a.current),a.current=window.setTimeout(()=>r(null),Aie)},[]),u=R.useCallback(()=>window.clearTimeout(a.current),[]);return{rect:n,onMouseEnter:o,onMouseLeave:l,keepOpen:u}}function jie(e){const t=new Date(e),n=t.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return t.toLocaleDateString(void 0,n)}function Mie({exp:e,runs:t,latestRun:n,parentSlug:r,anchor:i,onOpenLogs:a,onOpenCode:o,onMouseEnter:l,onMouseLeave:u}){const d=kie(),m=i.right+wb+yb<=window.innerWidth,f=i.x-wb-yb>=0,g=m?"right":f?"left":i.y>window.innerHeight/2?"above":"below",{x:b,y:k}=Cie({x:i.x,y:i.y,width:i.width,height:i.height,anchor:g,distance:wb},d),[S,x]=R.useState(null),_=e.parentExperimentId&&(n!=null&&n.commitSha)?n.id:null;R.useEffect(()=>{if(x(null),!_)return;let $=!1;return jR(_).then(F=>{let U=F.diff;if(F.truncated){const Z=U.lastIndexOf(` -diff --git `);U=Z!==-1?U.slice(0,Z+1):U.slice(0,U.lastIndexOf(` -`)+1)}let G=[];try{G=U.trim()?Ev(U):[]}catch{return}if(F.truncated&&G.every(Z=>Z.hunks.length===0))return;let X=0,Y=0;for(const Z of G){const Q=W2(Z);X+=Q.additions,Y+=Q.deletions}$||x({fileCount:G.length,additions:X,deletions:Y,truncated:F.truncated})}).catch(()=>{}),()=>{$=!0}},[_]);const w={done:0,failed:0,cancelled:0,live:0};for(const $ of t)$.status==="done"?w.done+=1:$.status==="failed"?w.failed+=1:$.status==="cancelled"?w.cancelled+=1:w.live+=1;const y=n?Nf((n.endedAt??Date.now())-n.createdAt):null,C=(n==null?void 0:n.status)==="failed"&&n.resultMarkdown?n.resultMarkdown:null,N=e.description||(C?null:n==null?void 0:n.resultMarkdown)||null,E=R.useRef(null),[j,T]=R.useState(!1),[D,I]=R.useState(!1);return R.useEffect(()=>{T(!1)},[N]),R.useEffect(()=>{const $=E.current;$&&I($.scrollHeight>$.clientHeight+1)},[N,j]),jE.createPortal(h.jsxs("div",{ref:d.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] py-3.5 px-4 text-sm text-text [&_.hc-mono]:font-mono [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:font-mono [&_.hc-slug]:text-md [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-[color-mix(in_oklab,_var(--border)_55%,_var(--text))] [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-xs [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:font-mono [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-2xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-mono]:min-w-0 [&_.hc-foot_.hc-mono]:overflow-hidden [&_.hc-foot_.hc-mono]:text-ellipsis [&_.hc-foot_.hc-mono]:whitespace-nowrap",style:{width:yb,left:b,top:k,visibility:d.offsetHeight===0?"hidden":void 0},onMouseEnter:l,onMouseLeave:u,children:[h.jsxs("div",{className:"hc-head",children:[h.jsx("span",{className:"hc-slug",children:e.slug}),h.jsx(Ma,{status:n?ss(n):"idle"})]}),e.title&&h.jsx("div",{className:"hc-title",children:e.title}),h.jsxs("div",{className:"hc-actions",children:[a&&h.jsxs("button",{type:"button",onClick:a,children:[h.jsx(Uc,{size:13}),"Logs"]}),h.jsxs("button",{type:"button",onClick:o,children:[h.jsx(rp,{size:13}),"Code"]})]}),N&&h.jsx("div",{className:`hc-body${j?" expanded":""}`,ref:E,children:N}),N&&(D||j)&&h.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>T($=>!$),children:j?"Show less":"Show more"}),C&&h.jsx("div",{className:"hc-failure",children:C}),h.jsxs("div",{className:"hc-stats",children:[h.jsxs("span",{children:[t.length===1?"1 run":`${t.length} runs`,w.done>0&&` · ${w.done} done`,w.failed>0&&` · ${w.failed} failed`,w.cancelled>0&&` · ${w.cancelled} cancelled`,w.live>0&&` · ${w.live} live`]}),n&&o_(n.backend)&&h.jsx(N2,{backend:n.backend}),y&&h.jsx("span",{children:y}),n&&h.jsx("span",{children:Gs(n.createdAt)})]}),h.jsxs("div",{className:"hc-git",children:[h.jsxs("div",{className:"hc-git-row",children:[h.jsxs("span",{className:"hc-branch",title:e.branchName,children:[h.jsx(nh,{size:12}),e.branchName]}),r&&h.jsxs("span",{children:["from ",h.jsx("span",{className:"hc-mono",children:r})]})]}),S&&S.fileCount>0&&h.jsx("div",{className:"hc-git-row",title:`Committed changes vs ${r??"parent"}${S.truncated?" (diff truncated — counts are lower bounds)":""}`,children:h.jsxs("span",{children:[S.truncated&&"≥ ",h.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",S.additions]})," ",h.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",S.deletions]})," · ",S.fileCount===1&&!S.truncated?"1 file":`${S.fileCount}${S.truncated?"+":""} files`]})})]}),h.jsxs("div",{className:"hc-foot",children:[h.jsxs("span",{className:"hc-mono",children:["$ ",e.runCommand]}),h.jsxs("span",{children:["created ",jie(e.createdAt)]})]})]}),document.body)}const B8=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-md [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),Rie=264,H8=132,wf=44,Die=72,Lie=148,Oie=44;function Iie(e){const t=new Map(e.map(a=>[a.id,{exp:a,children:[]}])),n=[];for(const a of e){const o=t.get(a.id),l=a.parentExperimentId?t.get(a.parentExperimentId):void 0;l?l.children.push(o):n.push(o)}const r=(a,o)=>a.exp.createdAt-o.exp.createdAt,i=a=>{a.children.sort(r),a.children.forEach(i)};return n.sort(r),n.forEach(i),n}function zie(e,t){const n=new Map,r=l=>{const u=n.get(l)??1+l.children.reduce((d,m)=>d+r(m),0);return n.set(l,u),u},i=new Map,a=l=>{const u=i.get(l)??(t(l)||l.children.some(a));return i.set(l,u),u};function o(l){if(t(l)){const m=[];let f=0;for(const g of l.children)a(g)?m.push(...o(g)):f+=r(g);return f>0&&m.push({kind:"elided",id:`el-${l.exp.id}`,count:f,children:[]}),[{kind:"exp",exp:l.exp,children:m}]}if(!a(l))return[];let u=0;const d=[];return(function m(f){u+=1;for(const g of f.children)t(g)?d.push(...o(g)):a(g)?m(g):u+=r(g)})(l),[{kind:"elided",id:`el-${l.exp.id}`,count:u,children:d}]}return e.flatMap(o)}function Jv(e){return e.kind==="exp"?Rie:Lie}function af(e){return e.kind==="exp"?e.exp.id:e.id}function Sf(e){if(e.children.length===0)return Jv(e);const t=e.children.reduce((n,r)=>n+Sf(r),0)+wf*(e.children.length-1);return Math.max(Jv(e),t)}function Bie(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const Hie=R.memo(function({data:t}){const{exp:n,latestRun:r,runs:i,isBaseline:a,parentSlug:o,githubOwner:l,githubRepo:u,onOpenView:d,onOpenCode:m}=t,f=r?ss(r):void 0,g=f==="running"||f==="starting"||f==="cancelling",b=a?"Baseline":g?"Running":"Experiment",k=i.slice(-8),S=R.useRef(null),x=Nie(S,t);return h.jsxs("div",{ref:S,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-[0_1px_2px_rgba(0,_0,_0,_0.04)] text-md transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-[0_2px_8px_rgba(0,_0,_0,_0.08)] [&.live]:border-accent-teal [&.live]:shadow-[0_2px_12px_rgba(32,_154,_132,_0.2)] [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-left [&_.node-overview-link]:cursor-pointer [&_.node-overview-link:hover_.node-slug]:underline [&_.node-overview-link:hover_.node-slug]:underline-offset-[3px] [&_.node-overview-link:focus-visible]:outline-2 [&_.node-overview-link:focus-visible]:outline-solid [&_.node-overview-link:focus-visible]:outline-accent [&_.node-overview-link:focus-visible]:outline-offset-4 [&_.node-overview-link:focus-visible]:rounded-xs [&_.node-eyebrow]:flex [&_.node-eyebrow]:items-center [&_.node-eyebrow]:justify-between [&_.node-eyebrow]:gap-2 [&_.node-eyebrow]:mb-1.5 [&_.node-eyebrow]:text-2xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:font-mono [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-2xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-xs [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ml-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${g?"live":""}`,onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,children:[h.jsx(Oo,{type:"target",position:lt.Top}),h.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",onClick:()=>d(n.id,"overview"),onKeyDown:_=>{_.key!=="Enter"&&_.key!==" "||(_.preventDefault(),d(n.id,"overview"))},children:[h.jsxs("div",{className:"node-eyebrow",children:[h.jsx("span",{children:b}),h.jsx(Ma,{status:f??"idle"})]}),h.jsx("div",{className:"node-head",children:h.jsx("span",{className:"node-slug",children:n.slug})}),(n.title||n.description)&&h.jsx("div",{className:"node-title",children:n.title||n.description}),h.jsxs("div",{className:"node-meta",children:[h.jsx("span",{children:"Runs"}),k.length>0?h.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:k.map(_=>h.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-[color-mix(in_oklab,_var(--accent-red)_55%,_transparent)] [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${Bie(ss(_))}`,title:ss(_)},_.id))}):h.jsx("span",{children:"no runs"}),h.jsx("span",{style:{flex:1}}),r&&h.jsx("span",{children:Gs(r.createdAt)})]})]}),h.jsxs("div",{className:"node-actions",onClick:_=>_.stopPropagation(),children:[i.length>0&&h.jsxs("button",{className:"node-action",title:"Open logs",onClick:()=>d(n.id,"terminal"),children:[h.jsx(Uc,{size:13}),"Logs"]}),h.jsxs("button",{className:"node-action",title:`Browse code on ${n.branchName}`,onClick:()=>m(n.id,n.branchName,"files"),children:[h.jsx(rp,{size:13}),"Code"]}),l&&u&&h.jsx("a",{className:"node-action node-action-ext",title:`Open ${n.branchName} on GitHub`,"aria-label":`Open ${n.branchName} on GitHub`,href:ap(l,u,n.branchName),target:"_blank",rel:"noopener noreferrer",onClick:_=>_.stopPropagation(),children:h.jsx(jp,{size:13})})]}),h.jsx(Oo,{type:"source",position:lt.Bottom}),x.rect&&h.jsx(Mie,{exp:n,runs:i,latestRun:r,parentSlug:o,anchor:x.rect,onOpenLogs:i.length>0?()=>d(n.id,"terminal"):void 0,onOpenCode:()=>m(n.id,n.branchName,"files"),onMouseEnter:x.keepOpen,onMouseLeave:x.onMouseLeave})]})}),$ie=R.memo(function({data:t}){const{count:n,onShowProjectScope:r}=t;return h.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-[color-mix(in_oklab,_var(--text)_3%,_transparent)] text-muted text-2xs font-medium text-left transition-[border-color,color] duration-120 ease-standard [&:hover]:border-text [&:hover]:text-text [&_.elided-node-label]:flex [&_.elided-node-label]:flex-col [&_.elided-node-label]:leading-[1.3] [&_.elided-node-sub]:text-muted",role:"button",tabIndex:0,title:"Switch to Entire project to see all experiments",onClick:r,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),r())},children:[h.jsx(Oo,{type:"target",position:lt.Top}),h.jsx(Q8,{size:14}),h.jsxs("span",{className:"elided-node-label",children:[n," ",n===1?"experiment":"experiments",h.jsx("span",{className:"elided-node-sub",children:"other tasks"})]}),h.jsx(Oo,{type:"source",position:lt.Bottom})]})}),Fie={exp:Hie,elided:$ie},bT={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},Pie={...bT.style,strokeDasharray:"4 4"};function Uie({experiments:e,runs:t,project:n,onOpenView:r,onOpenCode:i,agentSessionId:a,onShowProjectScope:o}){const{nodes:l,edges:u}=R.useMemo(()=>{const d=new Map;for(const _ of t){const w=d.get(_.experimentId);w?w.push(_):d.set(_.experimentId,[_])}for(const _ of d.values())_.sort((w,y)=>w.createdAt-y.createdAt);const m=[],f=[],g=_=>!a||_.exp.chatSessionId===a,b=zie(Iie(e),g),k=new Map(e.map(_=>[_.id,_.slug]));function S(_,w,y){const C=w-Jv(_)/2;if(_.kind==="exp"){const j=d.get(_.exp.id)??[];m.push({id:_.exp.id,type:"exp",position:{x:C,y},data:{exp:_.exp,latestRun:j[j.length-1]??null,runs:j,isBaseline:!_.exp.parentExperimentId,parentSlug:_.exp.parentExperimentId?k.get(_.exp.parentExperimentId)??null:null,githubOwner:n.githubEnabled?n.githubOwner:"",githubRepo:n.githubEnabled?n.githubRepo:"",onOpenView:r,onOpenCode:i}})}else m.push({id:_.id,type:"elided",position:{x:C,y:y+(H8-Oie)/2},data:{count:_.count,onShowProjectScope:o}});if(_.children.length===0)return;const N=_.children.reduce((j,T)=>j+Sf(T),0)+wf*(_.children.length-1);let E=w-N/2;for(const j of _.children){const T=Sf(j),D=_.kind==="elided"||j.kind==="elided";f.push({id:`e-${af(_)}-${af(j)}`,source:af(_),target:af(j),...D?{style:Pie}:{}}),S(j,E+T/2,y+H8+Die),E+=T+wf}}let x=0;for(const _ of b){const w=Sf(_);S(_,x+w/2,0),x+=w+wf}return{nodes:m,edges:f}},[e,t,r,i,n.githubOwner,n.githubRepo,n.githubEnabled,a,o]);return e.length===0?h.jsxs("div",{className:B8,children:[h.jsx("p",{className:"empty-state-title",children:"No experiments yet"}),h.jsx("p",{className:"empty-state-hint",children:"Ask the agent in chat to create and run your first experiment."})]}):l.length===0&&a?h.jsxs("div",{className:B8,children:[h.jsx("p",{className:"empty-state-title",children:"No experiments from the current task yet"}),h.jsx("p",{className:"empty-state-hint",children:"Ask in this task to create one, or switch to Entire project to see all experiments."})]}):h.jsx(Zre,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:l,edges:u,nodeTypes:Fie,defaultEdgeOptions:bT,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:Tie,minZoom:.15,fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},children:h.jsx(nie,{variant:Ra.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},a??"project")}const $8=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-md [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" "),Sb=(e,t)=>e.id===t.id&&e.view===t.view,cl=(e,t)=>e.path===t.path&&(e.source??"repo")===(t.source??"repo")&&e.sessionId===t.sessionId&&e.ref===t.ref,mx=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,of=(e,t,n)=>`${e}:${t??""}:${mx(n)}`,vT=e=>({...e,lineScrollRequest:void 0});function kb(e){return typeof e=="object"&&"path"in e?vT(e):e}const Sc=(e,t)=>e.branch===t.branch;function Mr(e){return typeof e=="string"?`home:${e}`:"code"in e?`code:${e.branch}`:"kind"in e?e.kind==="plan"?`plan:${e.promptId}`:`subagent:${e.spawnPartId}`:"path"in e?`file:${mx(e)}`:`experiment:${e.id}:${e.view}`}function F8(e,t=!1){const n={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1};if(e===cd&&t){const r={path:Ef,source:"artifacts"};return{...n,rightTab:r,tabHistory:[r],fileTabs:[r],panelOpen:!0}}if(e===aS){const r=[{path:"nanochat-base-training-curves.svg",source:"artifacts"},{path:"nanochat-sft-training-curves.svg",source:"artifacts"},{path:"nanochat-training-throughput.svg",source:"artifacts"},{path:"nanochat-core-evaluation.svg",source:"artifacts"}];return{...n,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,panelOpen:!0}}if(e===oS){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...n,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,panelOpen:!0}}return n}function qie(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gie(e,t,n,r,i){let a=e,o;const l=t==null?void 0:t.replace(/\/+$/,""),u=r==null?void 0:r.replace(/\/+$/,"");if(a.startsWith("artifacts/"))return a=a.slice(10),a?{path:a,source:"artifacts"}:null;if(a==="~"||a.startsWith("~/"))return{path:a,source:"abs"};const d=g=>{const b=x=>x.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[k,S]=[b(a),b(g)];return k===S?"":k.startsWith(`${S}/`)?k.slice(S.length).replace(/^\/+/,""):null},m=a.startsWith("/")&&u?d(u):null,f=a.startsWith("/")&&l?d(l):null;if(!a.startsWith("/"))o=n;else{if(m!==null)return m?{path:m,source:"artifacts"}:null;if(f!==null)a=f;else{const g=i?qie(i):"[^/]+",b=a.match(new RegExp(`/files/${g}/(.+)$`)),k=b?null:a.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),S=b||k?null:a.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(b)return{path:b[1],source:"artifacts"};k?(o=k[1],a=k[2]):S&&(a=S[1])}}return a?a.startsWith("/")?{path:a,source:"abs"}:{path:a,sessionId:o}:null}function Vie(e,t){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??t}const e_="orx:panel-width",_T="orx:experiments-view";function Wie(){try{return localStorage.getItem(_T)==="tree"?"tree":"table"}catch{return"table"}}const Yd=360,Yie=10,Xie=272,Kie=380,Zie=Xie+56,Qie=80,Jie=48;function kf(){return Math.max(Yd,window.innerWidth-Zie-Kie)}function ese(){const e=kf();try{const t=Number(localStorage.getItem(e_));if(Number.isFinite(t)&&t>=Yd)return Math.min(t,e)}catch{}return Math.max(Yd,Math.min(760,e,Math.round(window.innerWidth*.42)))}function id(e,t){const n=e.findIndex(i=>i.id===t.id);if(n<0)return[...e,t];const r=e.slice();return r[n]=t,r}function P8(e){const t=R.useRef(e);return t.current.size===e.size&&[...e].every(([r,i])=>t.current.get(r)===i)||(t.current=e),t.current}function tse(){var Wa,ds;const[e,t]=R.useState(null),[n,r]=R.useState(null),i=R.useRef(void 0);i.current=n==null?void 0:n.tourCompleted;const a=R.useRef(!1),[o,l]=R.useState(null),u=R.useRef(null),[d,m]=R.useState(null),[f,g]=R.useState([]),[b,k]=R.useState([]),S=R.useRef(b);S.current=b;const x=R.useRef(new Map),_=R.useRef(new Set),w=R.useRef(null),y=R.useRef(!1),C=R.useRef(new Map),N=R.useRef(new Map),E=R.useRef(0),j=R.useRef(f);j.current=f;const[T,D]=R.useState(null),[I,$]=R.useState(Wie),[F,U]=R.useState("project"),G=R.useRef(null),{open:X,setOpen:Y,ref:Z}=Bo(G),[Q,z]=R.useState(null),[O,H]=R.useState(!1),V=f.every(se=>se.chatSessionId),W=Q&&V?F:"project",re=R.useMemo(()=>W!=="agent"?f:f.filter(se=>se.chatSessionId===Q),[f,W,Q]),le=R.useMemo(()=>{if(W!=="agent")return b;const se=new Set(re.map(we=>we.id));return b.filter(we=>se.has(we.experimentId))},[b,re,W]);R.useEffect(()=>{try{localStorage.setItem(_T,I)}catch{}},[I]);const[pe,te]=R.useState(null),[B,ie]=R.useState("experiments"),[oe,be]=R.useState([]),[ge,Ce]=R.useState(!1),[Le,Ue]=R.useState(!1),[We,Fe]=R.useState(!1),[mt,De]=R.useState([]),[ot,Bt]=R.useState([]),on=R.useRef(new Map),Ze=R.useRef(0),[ct,st]=R.useState([]),[xe,Me]=R.useState([]),[Ge,Qe]=R.useState([]),[Oe,tt]=R.useState("files"),[it,jt]=R.useState(new Set),[_t,Tt]=R.useState(!1),[ut,xn]=R.useState(!1),[dr,Or]=R.useState(ese),[os,ls]=R.useState(!0),[gi,pr]=R.useState(!1),[Ts,Jn]=R.useState(!1),[Xr,Kr]=R.useState("chat"),[yn,mn]=R.useState(null),bi=R.useRef(new Map),Ns=R.useRef(F8()),Ui=R.useRef(null),Sr=R.useRef(!1),mr=R.useRef(oe);mr.current=oe;const Pt=R.useCallback(se=>{Sr.current=!1;const we=Mr(se),Ee=[...mr.current.filter(Ve=>Mr(Ve)!==we),kb(se)];mr.current=Ee,be(Ee),ie(se)},[]),er=R.useCallback((se,we)=>{Sr.current=!1;const Ee=Mr(se),Ve=mr.current.filter(vt=>Mr(vt)!==Ee);if(mr.current=Ve,be(Ve),!we)return;const qe=Ve[Ve.length-1];qe?ie(qe):(Tt(!1),xn(!1))},[]),Zr=R.useCallback(se=>{se!=="chat"&&(Sr.current=!1),Kr(se)},[]);Ns.current={rightTab:kb(B),tabHistory:oe,experimentsTabOpen:ge,filesTabOpen:Le,artifactsTabOpen:We,expTabs:mt,fileTabs:ot,planTabs:ct,subagentTabs:xe,codeTabs:Ge,filesView:Oe,filesToggled:it,selectedRunId:pe,scope:F,panelOpen:_t,panelMax:ut};const Qr=R.useCallback(se=>{const we=Ui.current;if(we===se)return;we&&bi.current.set(we,Ns.current);let Ee=se?bi.current.get(se):void 0;if(!Ee){const Ve=se===cd&&i.current===!1&&!a.current;Ve&&(a.current=!0,H(!0)),Ee=F8(se??void 0,Ve)}if(se&&Sr.current){Sr.current=!1;const Ve="experiments";Ee={...Ee,rightTab:Ve,tabHistory:[...Ee.tabHistory.filter(qe=>Mr(qe)!==Mr(Ve)),Ve],experimentsTabOpen:!0,panelOpen:!0}}ie(Ee.rightTab),mr.current=Ee.tabHistory,be(Ee.tabHistory),Ce(Ee.experimentsTabOpen),Ue(Ee.filesTabOpen),Fe(Ee.artifactsTabOpen),De(Ee.expTabs),Bt(Ee.fileTabs),st(Ee.planTabs),Me(Ee.subagentTabs),Qe(Ee.codeTabs),tt(Ee.filesView),jt(Ee.filesToggled),te(Ee.selectedRunId),U(Ee.scope),Tt(Ee.panelOpen),xn(Ee.panelMax),Ui.current=se,z(se)},[]),ft=(n==null?void 0:n.onboardingCompleted)??!1,[In,tr]=R.useState(!1),Je=R.useCallback(()=>tr(!0),[]),Nt=R.useCallback(async()=>{const se=await r3({tourCompleted:!0});r(we=>we&&{...we,tourCompleted:se.tourCompleted}),tr(!1)},[]),na=R.useCallback(async()=>{await Nt(),Jn(!0)},[Nt]);R.useEffect(()=>{!d||!og(d)||gi||!ft||n!=null&&n.tourCompleted||Je()},[d,gi,ft,Je,n==null?void 0:n.tourCompleted]);const pn=R.useRef(d);pn.current=d;const kr=R.useCallback(()=>{Kr("chat"),Ce(!0),Pt("experiments"),Tt(!0),Ui.current||(Sr.current=!0)},[Pt]),Cr=R.useCallback(()=>{l(null),t(null),r(null),Promise.allSettled([bR(),vR()]).then(([se,we])=>{const Ee=[];se.status==="fulfilled"?(t(se.value),m(Ve=>{var qe;return Ve&&se.value.some(vt=>vt.id===Ve)?Ve:((qe=se.value[0])==null?void 0:qe.id)??null})):Ee.push("projects"),we.status==="fulfilled"?(u.current=we.value.preferredAgent,r(we.value)):Ee.push("settings"),Ee.length>0&&l(`Couldn't load OpenResearch ${Ee.join(" and ")}.`)})},[]);R.useEffect(()=>{Cr()},[Cr]);const Jr=R.useRef(Promise.resolve()),Er=R.useRef(0),Ut=R.useCallback(se=>{const we=++Er.current;r(Ve=>Ve&&{...Ve,preferredAgent:se});const Ee=Jr.current.then(()=>r3({preferredAgent:se})).then(Ve=>{u.current=Ve.preferredAgent,we===Er.current&&r(qe=>qe&&{...qe,preferredAgent:Ve.preferredAgent})}).catch(Ve=>{throw we===Er.current&&r(qe=>qe&&{...qe,preferredAgent:u.current}),Ve});return Jr.current=Ee.catch(()=>{}),Ee},[]);R.useEffect(()=>{const se=()=>Or(we=>Math.min(we,kf()));return window.addEventListener("resize",se),()=>window.removeEventListener("resize",se)},[]);const Ir=R.useCallback(se=>{y.current=!1,C.current.clear(),N.current.clear();const we=++E.current;TR(se).then(Ee=>{if(pn.current!==se||w.current!==se||E.current!==we)return;C.current=new Map(Ee.map(qe=>[qe.id,qe]));const Ve=[...N.current.values()].some(qe=>{const vt=C.current.get(qe.id);return!vt||vt.status!=="running"&&vt.updatedAt<=qe.updatedAt});N.current.clear();for(const qe of Ee){const vt=x.current.get(qe.id);(!vt||vt.updatedAt{const vt=new Map(Ee.map(ne=>[ne.id,ne]));for(const ne of qe){const fe=vt.get(ne.id);(!fe||fe.updatedAt<=ne.updatedAt)&&vt.set(ne.id,ne)}return[...vt.values()]}),y.current=!0,Ve&&kr()}).catch(()=>{E.current===we&&N.current.clear()})},[kr]);R.useEffect(()=>{if(!d)return;const se=Ui.current;se&&bi.current.set(se,Ns.current),Ui.current=null,Sr.current=!1,z(null),w.current=d,x.current.clear(),_.current.clear(),CR(d).catch(()=>{}),g([]),k([]),D(null),te(null),De([]),Bt([]),H(!1),st([]),Me([]),Qe([]),tt("files"),jt(new Set),mr.current=[],be([]),ie("experiments"),Ce(!1),Ue(!1),Fe(!1),Tt(!1),xn(!1),U("project"),AR(d).then(g).catch(()=>{}),Ir(d),s3(d).then(D).catch(()=>{})},[Ir,d]);const Qt=R.useCallback(()=>{const se=pn.current;se&&s3(se).then(D).catch(()=>{})},[]),gr=R.useCallback(()=>{Qt(),Kr("chat"),Fe(!0),Pt("artifacts"),Tt(!0)},[Qt,Pt]);KD({onReconnect:()=>{const se=pn.current;se&&(w.current=se,x.current.clear(),_.current.clear(),Ir(se))},onRun:se=>{if(se.projectId!==pn.current||se.projectId!==w.current)return;const we=x.current.get(se.id),Ee=_.current.has(se.id);if(we&&we.updatedAt>se.updatedAt||(x.current.set(se.id,se),_.current.add(se.id),k(vt=>id(vt,se)),se.status!=="running"||(we==null?void 0:we.status)==="running"))return;const Ve=C.current.get(se.id),qe=y.current&&(!Ve||Ve.status!=="running"&&Ve.updatedAt<=se.updatedAt);Ee&&we||qe?kr():y.current||N.current.set(se.id,se)},onExperiment:se=>{se.projectId===pn.current&&g(we=>id(we,se))},onProject:se=>{t(we=>we?id(we,se):[se])},onArtifacts:se=>{se===pn.current&&Qt()}});const qi=R.useCallback(()=>U("project"),[]),Hn=R.useCallback((se,we="overview")=>{const Ee={id:se,view:we};De(Ve=>Ve.some(qe=>Sb(qe,Ee))?Ve:[...Ve,Ee]),Pt(Ee),Tt(!0)},[Pt]),zr=R.useCallback(se=>{const we=S.current.filter(Ve=>Ve.id===se||Ve.id.startsWith(se)),Ee=we.length===1?we[0]:null;Ee&&(te(Ee.id),Hn(Ee.experimentId,"terminal"))},[Hn]),ra=R.useMemo(()=>new Map(f.map(se=>{var we;return[se.id,((we=se.title)==null?void 0:we.trim())||se.slug||"Experiment"]})),[f]),Gi=P8(ra),ia=R.useMemo(()=>{const se=new Map;for(const we of b)se.set(we.id,Gi.get(we.experimentId)??"Experiment");return se},[Gi,b]),js=P8(ia),ei=R.useCallback(se=>{const we=js.get(se);if(we)return we;const Ee=[...js].filter(([Ve])=>Ve.startsWith(se));return Ee.length===1?Ee[0][1]:""},[js]),vi=R.useCallback(se=>{const we=Gi.get(se);if(we)return we;const Ee=[...Gi].filter(([Ve])=>Ve.startsWith(se));return Ee.length===1?Ee[0][1]:""},[Gi]),nr=R.useCallback(se=>{const we=j.current.filter(Ee=>Ee.id===se||Ee.id.startsWith(se));we.length===1&&Hn(we[0].id,"overview")},[Hn]),rr=R.useCallback(se=>{const we=mt.findIndex(Ee=>Sb(Ee,se));we!==-1&&(De(Ee=>Ee.filter((Ve,qe)=>qe!==we)),er(se,Mr(B)===Mr(se)))},[mt,er,B]),Rn=R.useCallback(se=>{const we=vT(se);Bt(Ee=>{const Ve=Ee.findIndex(vt=>cl(vt,se));if(Ve===-1)return[...Ee,we];const qe=Ee.slice();return qe[Ve]=we,qe}),Pt(se),Tt(!0)},[Pt]),ln=R.useCallback((se,we,Ee,Ve,qe,vt)=>{const ne=e==null?void 0:e.find(nt=>nt.id===d),fe=Gie(se,ne==null?void 0:ne.repoPath,we,(ne==null?void 0:ne.artifactsDir)??(ne==null?void 0:ne.filesDir),ne==null?void 0:ne.slug);if(!fe)return;const Se=qe?j.current.find(nt=>nt.id===qe||qe.length>=6&&nt.id.startsWith(qe)):void 0,Te=Ee??(Se==null?void 0:Se.branchName),ze=fe.source==null||fe.source==="repo";Te&&ze&&(fe.ref=Te),vt&&!fe.ref&&ze&&(fe.branchLabel=vt),Ve!=null&&(fe.line=Ve,fe.lineScrollRequest=++Ze.current),Rn(fe)},[e,d,Rn]),sa=R.useCallback(se=>Rn({path:se,source:"artifacts"}),[Rn]),cs=R.useCallback((se,we,Ee,Ve,qe)=>ln(se,we,qe,Ee,Ve),[ln]),ti=R.useCallback(se=>{const we=ot.findIndex(Ee=>cl(Ee,se));we!==-1&&(Bt(Ee=>Ee.filter((Ve,qe)=>qe!==we)),d&&on.current.delete(of(d,Q,se)),Q===cd&&cl(se,{path:Ef,source:"artifacts"})&&H(!1),er(se,Mr(B)===Mr(se)))},[Q,ot,er,d,B]),Ga=R.useCallback(se=>{se.lineScrollRequest!==void 0&&ie(we=>typeof we!="object"||!("path"in we)||!cl(we,se)||we.lineScrollRequest!==se.lineScrollRequest?we:kb(we))},[]),ir=R.useCallback((se,we,Ee)=>{const Ve={kind:"plan",sessionId:we,promptId:Ee,plan:se};st(qe=>{const vt=qe.findIndex(fe=>fe.promptId===Ee);if(vt===-1)return[...qe,Ve];const ne=qe.slice();return ne[vt]=Ve,ne}),Pt(Ve),Tt(!0)},[Pt]),aa=R.useCallback(se=>{const we=ct.findIndex(Ee=>Ee.promptId===se.promptId);we!==-1&&(st(Ee=>Ee.filter((Ve,qe)=>qe!==we)),er(se,Mr(B)===Mr(se)))},[er,ct,B]),cn=R.useCallback((se,we,Ee)=>{const Ve={kind:"subagent",sessionId:se,spawnPartId:we,label:Ee};Me(qe=>qe.some(vt=>vt.spawnPartId===we)?qe:[...qe,Ve]),Pt(Ve),Tt(!0)},[Pt]),Ms=R.useCallback(se=>{const we=xe.findIndex(Ee=>Ee.spawnPartId===se.spawnPartId);we!==-1&&(Me(Ee=>Ee.filter((Ve,qe)=>qe!==we)),er(se,Mr(B)===Mr(se)))},[er,B,xe]),[gn,Ar]=R.useState({});R.useEffect(()=>{if(Ar(ne=>{const fe=new Set(xe.map(Se=>Se.spawnPartId));return Object.keys(ne).every(Se=>fe.has(Se))?ne:Object.fromEntries(Object.entries(ne).filter(([Se])=>fe.has(Se)))}),xe.length===0)return;let se=!0;const we=new Set,Ee=(ne,fe,Se)=>{Ar(Te=>{var nt;let ze=Te;for(const Zt of fe)if(!(Se&&we.has(Zt.spawnPartId)))for(const Nr of ne){const $n=O2(Nr.parts,Zt.spawnPartId);if(!$n)continue;Se||we.add(Zt.spawnPartId);const ri={label:HV($n),running:((nt=$n.state)==null?void 0:nt.status)==="running"},xi=ze[Zt.spawnPartId];(!xi||xi.label!==ri.label||xi.running!==ri.running)&&(ze===Te&&(ze={...Te}),ze[Zt.spawnPartId]=ri);break}return ze})};let Ve=0;const qe=()=>{const ne=++Ve;for(const fe of new Set(xe.map(Se=>Se.sessionId)))ud(fe).then(({messages:Se})=>{se&&ne===Ve&&Ee(Se,xe.filter(Te=>Te.sessionId===fe),!0)}).catch(()=>{})};qe();const vt=wd(ne=>{if(ne.type==="reconnected"){we.clear(),qe();return}if(ne.type!=="message")return;const fe=xe.filter(Se=>Se.sessionId===ne.sessionId);fe.length&&Ee([ne.message],fe,!1)});return()=>{se=!1,vt()}},[xe]);const Br=R.useCallback((se,we,Ee="files")=>{const Ve={code:!0,experimentId:se,branch:we,view:Ee,toggled:new Set};Qe(qe=>qe.some(vt=>Sc(vt,Ve))?qe.map(vt=>Sc(vt,Ve)?{...vt,experimentId:se,view:Ee}:vt):[...qe,Ve]),Pt(Ve),Tt(!0)},[Pt]),Vi=R.useCallback((se,we)=>{Qe(Ee=>Ee.map(Ve=>Sc(Ve,se)?{...Ve,...we}:Ve))},[]),Bl=R.useCallback(se=>{const we=Ge.findIndex(Ee=>Sc(Ee,se));we!==-1&&(Qe(Ee=>Ee.filter((Ve,qe)=>qe!==we)),er(se,Mr(B)===Mr(se)))},[Ge,er,B]),Hl=R.useCallback(()=>{Kr("chat"),Ue(!0),Pt("files"),Tt(!0)},[Pt]),oa=R.useCallback(se=>{se==="experiments"?Ce(!1):se==="files"?Ue(!1):Fe(!1),er(se,B===se)},[er,B]),Rs=se=>{se.preventDefault(),se.currentTarget.setPointerCapture(se.pointerId);const Ee=document.body.style.userSelect;document.body.style.userSelect="none";const Ve=ut,qe=se.clientX,vt=dr;let ne=!1;function fe(){window.removeEventListener("pointermove",Se),window.removeEventListener("pointerup",fe),window.removeEventListener("pointercancel",fe),document.body.style.userSelect=Ee}function Se(Te){if(Ve){const Nr=Te.clientX-qe;if(ne||Nrnt+Qie){xn(!0);return}xn(!1);const Zt=Math.min(Math.max(ze,Yd),nt);Or(Zt);try{localStorage.setItem(e_,String(Zt))}catch{}}window.addEventListener("pointermove",Se),window.addEventListener("pointerup",fe),window.addEventListener("pointercancel",fe)},$o=(se,we)=>{t(Ee=>Ee?id(Ee,se):[se]),m(se.id),pr(!1),we&&(mn({projectId:se.id,message:we}),Zr("git"))},$l=se=>{t(we=>we&&we.filter(Ee=>Ee.id!==se)),d===se&&m(null)},br=typeof B=="object"&&"id"in B?B:null,nn=typeof B=="object"&&"path"in B?B:null,us=Q===cd&&O?ot.find(se=>cl(se,{path:Ef,source:"artifacts"})):void 0,Fo=us?[us]:[],Ds=us?ot.filter(se=>!cl(se,us)):ot,ni=typeof B=="object"&&"kind"in B&&B.kind==="plan"?B:null,Hr=typeof B=="object"&&"kind"in B&&B.kind==="subagent"?B:null,Va=typeof B=="object"&&"code"in B?B:null,Tr=Va?Ge.find(se=>Sc(se,Va))??null:null,Ls=se=>h.jsx(wo,{active:nn!==null&&cl(nn,se),label:se.path.split("/").pop()||se.path,icon:h.jsx(J8,{size:12,style:{flexShrink:0}}),onSelect:()=>Pt(se),onClose:()=>ti(se)},`file:${mx(se)}`),St=(e==null?void 0:e.find(se=>se.id===d))??null,_i=br?f.find(se=>se.id===br.id)??null:null,Wi=Tr?f.find(se=>se.id===Tr.experimentId)??null:null;if(o)return h.jsx("div",{className:"app flex flex-col h-full",children:h.jsxs("div",{className:$8,children:[h.jsx("p",{children:o}),h.jsx("button",{className:Wr,onClick:Cr,children:"Retry"})]})});if(e===null||n===null)return h.jsx("div",{className:"app flex flex-col h-full",children:h.jsx("div",{className:$8,children:h.jsx("span",{className:qt})})});if(e.length===0)return h.jsx("div",{className:"app flex flex-col h-full",children:ft?h.jsx(N7,{projects:e,onOpen:m,onCreated:$o,onDeleted:$l}):h.jsx(rZ,{preferredAgent:n.preferredAgent,onDone:(se,we)=>{HG(),u.current=we,t([se]),m(se.id),r(Ee=>({...Ee??{tourCompleted:!1},onboardingCompleted:!0,preferredAgent:we}))}})});const Yi=h.jsx(tZ,{projectName:((Wa=e.find(se=>se.id===d))==null?void 0:Wa.name)??"",onHome:()=>pr(!0),onNewProject:()=>Jn(!0),onRepository:()=>Zr("git"),onCollapse:()=>ls(!1)});return h.jsxs("div",{className:"app flex flex-col h-full",children:[h.jsx(yq,{}),gi?h.jsx(N7,{projects:e,onOpen:se=>{m(se),pr(!1)},onCreated:$o,onDeleted:$l}):h.jsxs("div",{className:"app-body flex flex-1 min-h-0 py-0 px-3.5",children:[d&&h.jsx(ZV,{projectId:d,projectName:(St==null?void 0:St.name)??"",paperId:(ds=e.find(se=>se.id===d))==null?void 0:ds.paperId,railHeader:Yi,railOpen:os,onShowRail:()=>ls(!0),mainView:Xr,onSelectMainView:Zr,experimentsActive:Xr==="chat"&&_t&&B==="experiments",filesActive:Xr==="chat"&&_t&&B==="files",artifactsActive:Xr==="chat"&&_t&&B==="artifacts",onOpenExperiments:kr,onOpenArtifacts:gr,onOpenFile:cs,onOpenRun:zr,runExperimentName:ei,onOpenExperiment:nr,experimentName:vi,onOpenPlan:ir,onOpenSubagent:cn,onOpenWorktree:Hl,onOpenDemoWelcome:St&&og(St.id)?Je:void 0,onActiveSessionChange:Qr,preferredAgent:n.preferredAgent,onPreferredAgentChange:Ut,children:Xr==="skills"?h.jsx(UK,{project:St}):Xr!=="chat"?h.jsx(SG,{tab:Xr,project:St,githubPublicationError:yn&&yn.projectId===(St==null?void 0:St.id)?yn.message:null,onProjectUpdate:se=>{t(we=>we?id(we,se):[se]),se.githubEnabled&&mn(null)},onSelectTab:Zr}):null}),Xr==="chat"&&_t&&h.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-2.5 mr-0 mb-2.5 ml-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-[0_12px_40px_color-mix(in_oklab,_var(--text)_22%,_transparent)] floating-panel border border-border rounded-lg 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 ${ut?"max":""}`,style:ut?void 0:{width:dr},"data-onboarding":"experiments",children:[h.jsx("div",{className:`panel-resizer absolute left-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] [&:active]:bg-[color-mix(in_oklab,_var(--text)_12%,_transparent)] ${ut?"cursor-e-resize":"cursor-col-resize"}`,title:ut?"Drag right to restore panel":"Drag to resize panel",onPointerDown:Rs}),h.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pr-1.5 pb-0 pl-2 h-10 border-b border-b-border bg-background shrink-0",children:[h.jsxs("div",{className:"tab-strip flex items-end gap-0.5 flex-1 min-w-0 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[Fo.map(Ls),Le&&h.jsx(wo,{active:B==="files",label:"Files",icon:h.jsx(yd,{size:12,style:{flexShrink:0}}),onSelect:()=>Pt("files"),onClose:()=>oa("files")}),We&&h.jsx(wo,{active:B==="artifacts",label:"Artifacts",icon:h.jsx(n_,{size:12,style:{flexShrink:0}}),onSelect:()=>Pt("artifacts"),onClose:()=>oa("artifacts")}),ge&&h.jsx(wo,{active:B==="experiments",label:"Experiments",icon:h.jsx(Cb,{size:12,style:{flexShrink:0}}),onSelect:()=>Pt("experiments"),onClose:()=>oa("experiments")}),mt.map(se=>{const we=f.find(Ee=>Ee.id===se.id);return h.jsx(wo,{active:br!==null&&Sb(br,se),label:we?we.title||we.slug:"…",icon:se.view==="overview"?h.jsx(V8,{size:12,style:{flexShrink:0}}):h.jsx(Uc,{size:12,style:{flexShrink:0}}),onSelect:()=>Pt(se),onClose:()=>rr(se)},`${se.id}:${se.view}`)}),Ds.map(Ls),ct.map(se=>h.jsx(wo,{active:ni!==null&&ni.promptId===se.promptId,label:"Plan",icon:h.jsx(i_,{size:12,style:{flexShrink:0}}),onSelect:()=>Pt(se),onClose:()=>aa(se)},`plan:${se.promptId}`)),xe.map(se=>{var we,Ee;return h.jsx(wo,{active:Hr!==null&&Hr.spawnPartId===se.spawnPartId,label:((we=gn[se.spawnPartId])==null?void 0:we.label)??se.label??"Sub-agent",shimmer:((Ee=gn[se.spawnPartId])==null?void 0:Ee.running)??!1,icon:h.jsx(sS,{size:12,style:{flexShrink:0}}),onSelect:()=>Pt(se),onClose:()=>Ms(se)},`subagent:${se.spawnPartId}`)}),Ge.map(se=>{const we=f.find(Ee=>Ee.id===se.experimentId);return h.jsx(wo,{active:Tr!==null&&Sc(Tr,se),label:(we==null?void 0:we.slug)??se.branch,icon:h.jsx(yd,{size:12,style:{flexShrink:0}}),onSelect:()=>Pt(se),onClose:()=>Bl(se)},`code:${se.branch}`)})]}),h.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[h.jsx("button",{className:Xn,title:ut?"Restore panel":"Expand panel","aria-label":ut?"Restore panel":"Expand panel",onClick:()=>xn(se=>!se),children:ut?h.jsx(DM,{size:14}):h.jsx(jM,{size:14})}),h.jsx("button",{className:Xn,title:"Close panel","aria-label":"Close panel",onClick:()=>{Sr.current=!1,Tt(!1),xn(!1)},children:h.jsx(qr,{size:14})})]})]}),B==="artifacts"?h.jsx("div",{className:Aa,children:St&&h.jsx(zK,{project:St,artifacts:T,onChanged:Qt,onOpenFile:sa,onOpenStorage:()=>Zr("storage")},St.id)}):B==="experiments"?h.jsxs("div",{className:Aa,children:[h.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[h.jsx("span",{style:{flex:1}}),h.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[h.jsxs("div",{className:"option-picker relative inline-flex",ref:Z,children:[h.jsx("button",{ref:G,className:`${ah} experiment-scope-trigger w-6.5 h-6.5 rounded-sm${W==="agent"?" active":""}`,title:`Experiment filter: ${W==="agent"?"Current task":"Entire project"}`,"aria-label":"Filter experiments","aria-expanded":X,onClick:()=>Y(se=>!se),children:h.jsx(pM,{size:16,strokeWidth:2.5})}),X&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] left-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-[0_12px_32px_rgba(0,_0,_0,_0.18)] z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:left-auto [&.align-right]:right-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:left-auto [&.session-menu]:right-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right experiment-scope-menu [&_.model-item]:whitespace-nowrap [&_.model-item:disabled]:text-muted [&_.model-item:disabled]:cursor-default [&_.model-item:disabled:hover]:bg-transparent",children:[h.jsxs("button",{className:hi,"aria-pressed":W==="agent",disabled:!Q||!V,title:Q?V?void 0:"Current task filtering is unavailable for unattributed experiments":"Open a task to filter to its experiments",onClick:()=>{U("agent"),Y(!1)},children:[h.jsx("span",{children:"Current task"}),W==="agent"&&h.jsx(Di,{size:13})]}),h.jsxs("button",{className:hi,"aria-pressed":W==="project",onClick:()=>{U("project"),Y(!1)},children:[h.jsx("span",{children:"Entire project"}),W==="project"&&h.jsx(Di,{size:13})]})]})]}),h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-[color-mix(in_oklab,_var(--text)_10%,_transparent)] [&_button]:font-semibold [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-[0_1px_3px_color-mix(in_oklab,_var(--text)_25%,_transparent)] [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":"Experiment view",children:[h.jsx("button",{className:I==="table"?"active":"","aria-pressed":I==="table",onClick:()=>$("table"),children:"Table"}),h.jsx("button",{className:I==="tree"?"active":"","aria-pressed":I==="tree",onClick:()=>$("tree"),children:"Tree"})]})]})]}),h.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:I==="tree"?St&&h.jsx(Uie,{experiments:f,runs:le,project:St,onOpenView:Hn,onOpenCode:Br,agentSessionId:W==="agent"?Q:null,onShowProjectScope:qi}):h.jsx(fZ,{runs:le,emptyHint:W==="agent"&&f.length>0?"No experiments from the current task yet. Switch to Entire project to see all experiments.":void 0,experiments:re,onOpen:se=>{Hn(se.id,"overview")},onOpenLogs:(se,we)=>{te(we),Hn(se,"terminal")},onOpenCode:se=>{const we=f.find(Ee=>Ee.id===se);we&&Br(we.id,we.branchName,"files")},onCancel:hS})})]}):B==="files"?h.jsx("div",{className:Aa,children:St?h.jsx(EK,{sessionId:Q??void 0,project:St,view:Oe,toggled:it,onViewChange:tt,onToggledChange:jt,onOpenFile:ln},`files:${Q??`project:${St.id}`}`):h.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:h.jsx("div",{className:Dc,children:h.jsxs("div",{className:"wt-empty flex flex-col items-center gap-2.5 py-12 px-6 text-center text-muted [&_>_svg]:text-subtext [&_p]:m-0 [&_p]:max-w-80 [&_p]:text-sm",children:[h.jsx(eS,{size:22}),h.jsx("p",{children:"Select a project to browse its files."})]})})})}):nn?h.jsx("div",{className:Aa,children:d&&h.jsx(eZ,{projectId:d,path:nn.path,source:nn.source,sessionId:nn.source==="artifacts"?Q??void 0:nn.sessionId,gitRef:nn.ref,line:nn.line,branchLabel:Vie(nn,St==null?void 0:St.baselineBranch),onOpenFile:ln,scrollPosition:on.current.get(of(d,Q,nn)),onScrollPositionChange:se=>{on.current.set(of(d,Q,nn),se)},lineScrollRequest:nn.lineScrollRequest,onLineScrollRequestHandled:()=>Ga(nn)},of(d,Q,nn))}):ni?h.jsx("div",{className:Aa,children:h.jsx("div",{className:"pane-content flex-1 min-h-0 relative plan-tab-content overflow-y-auto bg-background py-4.5 px-6 [&_.md]:max-w-readable",children:h.jsx(La,{text:ni.plan,onOpenFile:se=>ln(se,ni.sessionId)})})}):Hr?h.jsx(QV,{sessionId:Hr.sessionId,spawnPartId:Hr.spawnPartId,onOpenFile:se=>ln(se,Hr.sessionId),onOpenRun:zr,runExperimentName:ei,onOpenExperiment:nr,experimentName:vi,onOpenSubagent:(se,we)=>cn(Hr.sessionId,se,we)},Hr.spawnPartId):Tr?h.jsx("div",{className:Aa,children:d&&St&&Tr&&Wi&&h.jsx(kK,{projectId:d,project:St,experiment:Wi,view:Tr.view,toggled:Tr.toggled,onViewChange:se=>Vi(Tr,{view:se}),onToggledChange:se=>Vi(Tr,{toggled:se}),onOpenFile:(se,we,Ee)=>ln(se,we,Ee,void 0,void 0,Wi.branchName)},`code:${Tr.branch}`)}):h.jsx("div",{className:Aa,children:br&&_i&&St&&h.jsx(ZK,{experiment:_i,project:St,view:br.view,runs:b,selectedRunId:pe,onSelectRun:te,parentExperiment:f.find(se=>se.id===_i.parentExperimentId)??null,onOpenView:(se,we)=>{we&&te(we),Hn(_i.id,se)},onOpenCode:se=>Br(_i.id,_i.branchName,se)},`${br.id}:${br.view}`)})]})]}),Ts&&h.jsx(NE,{onClose:()=>Jn(!1),onCreated:(se,we)=>{Jn(!1),$o(se,we)}}),In&&!gi&&St&&og(St.id)&&h.jsx(pZ,{onClose:Nt,onCreateProject:na})]})}mj.createRoot(document.getElementById("root")).render(h.jsx(R.StrictMode,{children:h.jsx(tse,{})})); diff --git a/ui/dist/assets/index-wpJeURKR.css b/ui/dist/assets/index-wpJeURKR.css deleted file mode 100644 index 6a9453c6..00000000 --- a/ui/dist/assets/index-wpJeURKR.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-outline-style:solid;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}@layer theme{:root,:host{--spacing:.25rem;--container-2xl:42rem;--tracking-wide:.025em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:6px;--radius-md:8px;--radius-lg:10px;--radius-2xl:1rem;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer base{*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--base);color:var(--text);font-family:var(--sans);font-size:var(--fs-base);line-height:1.45;overflow:hidden}::selection{background:var(--highlight)}.chat-thread-inner ::selection{background:var(--chat-annotation-highlight)}::highlight(chat-annotations){background:var(--chat-annotation-highlight)}button{font:inherit;color:inherit;cursor:pointer;background:0 0;border:none;padding:0}input,textarea,select{font:inherit;color:var(--text);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-md);outline:none;padding:6px 10px}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:var(--radius-sm);background-clip:padding-box;border:2px solid #0000}::-webkit-scrollbar-track{background:0 0}}@layer vendor{.react-flow{--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:#ffffff80;--xy-minimap-background-color-default:#fff;--xy-minimap-mask-background-color-default:#f0f0f099;--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:#f0f0f040;--xy-node-boxshadow-hover-default:0 1px 4px 1px #00000014;--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:#0059dc14;--xy-selection-border-default:1px dotted #0059dccc;--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 #00000014;--xy-edge-label-background-color-default:#fff;--xy-edge-label-color-default:inherit;--xy-resize-background-color-default:#3367d9;direction:ltr}.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:#96969640;--xy-minimap-background-color-default:#141414;--xy-minimap-mask-background-color-default:#3c3c3c99;--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:#f0f0f040;--xy-node-boxshadow-hover-default:0 1px 4px 1px #ffffff14;--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:#c8c8dc14;--xy-selection-border-default:1px dotted #c8c8dccc;--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 #00000014;--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{width:100%;height:100%;position:absolute;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{pointer-events:none;position:absolute;overflow:visible}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.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;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:.5s linear infinite dashdraw}svg.react-flow__connectionline{z-index:1001;position:absolute;overflow:visible}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.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:0 0;pointer-events:none}.react-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.react-flow__handle{pointer-events:none;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%;width:6px;min-width:5px;height:6px;min-height:5px;position:absolute}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;bottom:0;left:50%;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{z-index:5;margin:15px;position:absolute}.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{background:var(--xy-attribution-background-color,var(--xy-attribution-background-color-default));margin:0;padding:2px 3px;font-size:10px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.react-flow__edgelabel-renderer{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__viewport-portal{-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.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{box-shadow:var(--xy-controls-box-shadow,var(--xy-controls-box-shadow-default));flex-direction:column;display:flex}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{background:var(--xy-controls-button-background-color,var(--xy-controls-button-background-color-default));border:none;border-bottom:1px solid var(--xy-controls-button-border-color-props,var(--xy-controls-button-border-color,var(--xy-controls-button-border-color-default)));width:26px;height:26px;color:var(--xy-controls-button-color-props,var(--xy-controls-button-color,var(--xy-controls-button-color-default)));cursor:pointer;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;padding:4px;display:flex}.react-flow__controls-button svg{fill:currentColor;width:100%;max-width:12px;max-height:12px}.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{border-radius:var(--xy-node-border-radius,var(--xy-node-border-radius-default));width:150px;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));padding:10px;font-size:12px}.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{background-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border:1px solid #fff;border-radius:1px;width:5px;height:5px;translate:-50% -50%}.react-flow__resize-control.handle.left{top:50%;left:0}.react-flow__resize-control.handle.right{top:50%;left:100%}.react-flow__resize-control.handle.top{top:0;left:50%}.react-flow__resize-control.handle.bottom{top:100%;left:50%}.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-style:solid;border-width:0}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;height:100%;top:0;transform:translate(-50%)}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{width:100%;height:1px;left:0;transform:translateY(-50%)}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.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))}.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;top:0;right:0;bottom:0;left:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.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{z-index:10;color:#0000;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;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;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2)format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff)format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2)format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff)format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2)format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff)format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2)format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff)format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2)format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff)format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2)format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff)format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2)format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff)format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2)format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff)format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2)format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff)format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2)format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff)format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2)format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff)format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff)format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff)format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff)format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2)format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff)format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2)format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff)format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2)format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff)format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC)format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff)format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2)format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff)format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2)format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff)format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf)format("truetype")}.katex{text-indent:0;text-rendering:auto;font:1.21em/1.2 KaTeX_Main,Times New Roman,serif;position:relative}.katex *{border-color:currentColor;-ms-high-contrast-adjust:none!important}.katex .katex-version:after{content:"0.16.47"}.katex .katex-mathml{clip-path:inset(50%);border:0;width:1px;height:1px;padding:0;position:absolute;overflow:hidden}.katex .katex-html>.newline{display:block}.katex .base{white-space:nowrap;width:min-content;position:relative}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;table-layout:fixed;display:inline-table}.katex .vlist-r{display:table-row}.katex .vlist{vertical-align:bottom;display:table-cell;position:relative}.katex .vlist>span{height:0;display:block;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{width:0;overflow:hidden}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{vertical-align:bottom;width:2px;min-width:2px;font-size:1px;display:table-cell}.katex .vbox{flex-direction:column;align-items:baseline;display:inline-flex}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{flex-direction:row;display:inline-flex}.katex .thinbox{width:0;max-width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .smash{line-height:0;display:inline}.katex .clap,.katex .llap,.katex .rlap{width:0;position:relative}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .hdashline{border-bottom-style:dashed;width:100%;display:inline-block}.katex .sqrt>.root{margin-left:.277778em;margin-right:-.555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.833333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.714286em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.857143em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14286em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71429em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96286em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55429em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.416667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.583333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.833333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.347222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.416667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.486111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.694444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.833333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44028em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.289352em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.347222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.405093em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.520833em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.578704em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.694444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.833333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.289296em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.385728em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.433944em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.578592em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.694311em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.833173em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.200965em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.241158em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.281351em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.321543em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.361736em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.401929em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.482315em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.694534em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.833601em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{width:.12em;display:inline-block}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{min-width:1px;display:inline-block}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;height:inherit;width:100%;display:block;position:absolute}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;min-width:0;max-width:none;min-height:0;max-height:none}.katex .stretchy{width:100%;display:block;position:relative;overflow:hidden}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{width:100%;position:relative;overflow:hidden}.katex .halfarrow-left{width:50.2%;position:absolute;left:0;overflow:hidden}.katex .halfarrow-right{width:50.2%;position:absolute;right:0;overflow:hidden}.katex .brace-left{width:25.1%;position:absolute;left:0;overflow:hidden}.katex .brace-center{width:50%;position:absolute;left:25%;overflow:hidden}.katex .brace-right{width:25.1%;position:absolute;right:0;overflow:hidden}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{box-sizing:border-box;border:.04em solid}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{box-sizing:border-box;border-top:.049em solid;border-right:.049em solid;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{text-align:left;display:inline-block;position:absolute;right:calc(50% + .3em)}.katex .cd-label-right{text-align:right;display:inline-block;position:absolute;left:calc(50% + .3em)}.katex-display{text-align:center;margin:1em 0;display:block}.katex-display>.katex{text-align:center;white-space:nowrap;display:block}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{text-align:left;padding-left:2em}body{counter-reset:katexEqnNo mmlEqnNo}: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::selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-selection-text-color)}.diff td{vertical-align:top;padding-top:0;padding-bottom:0}.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;text-align:right;-webkit-user-select:none;user-select:none;padding:0 1ch}.diff-gutter-insert{background-color:#d6fedb;background-color:var(--diff-gutter-insert-background-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-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-gutter-selected-text-color)}.diff-code{word-wrap:break-word;white-space:pre-wrap;word-break:break-all;padding:0 0 0 .5em}.diff-code-edit{color:inherit}.diff-code-insert{background-color:#eaffee;background-color:var(--diff-code-insert-background-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-code-insert-edit-text-color)}.diff-code-delete{background-color:#fdeff0;background-color:var(--diff-code-delete-background-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-code-delete-edit-text-color)}.diff-code-selected{background-color:#fffce0;background-color:var(--diff-code-selected-background-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:" ";white-space:pre;width:2px;height:100%;margin-left:4.6ch;display:block;overflow:hidden}.diff-decoration{-webkit-user-select:none;user-select:none;line-height:1.5}.diff-decoration-content{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);padding:0}}@layer components;@layer utilities{.\@container{container-type:inline-size}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.\!absolute{position:absolute!important}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.-inset-14{inset:calc(var(--spacing) * -14)}.inset-0{top:0;right:0;bottom:0;left:0}.top-0{top:0}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-3\.5{top:calc(var(--spacing) * 3.5)}.top-\[9px\]{top:9px}.top-\[calc\(100\%_\+_6px\)\]{top:calc(100% + 6px)}.-right-\[3px\]{right:-3px}.right-0{right:0}.right-1\.5{right:calc(var(--spacing) * 1.5)}.right-3\.5{right:calc(var(--spacing) * 3.5)}.bottom-0{bottom:0}.bottom-\[calc\(100\%_\+_4px\)\]{bottom:calc(100% + 4px)}.bottom-\[calc\(100\%_\+_8px\)\]{bottom:calc(100% + 8px)}.left-0{left:0}.left-3{left:calc(var(--spacing) * 3)}.z-1{z-index:1}.z-4{z-index:4}.z-6{z-index:6}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.z-60{z-index:60}.z-100{z-index:100}.z-200{z-index:200}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-0{margin-inline:0}.mx-1{margin-inline:var(--spacing)}.mx-auto{margin-inline:auto}.my-0{margin-block:0}.my-2{margin-block:calc(var(--spacing) * 2)}.my-2\.5{margin-block:calc(var(--spacing) * 2.5)}.my-3{margin-block:calc(var(--spacing) * 3)}.my-3\.5{margin-block:calc(var(--spacing) * 3.5)}.my-\[5px\]{margin-block:5px}.mt-0{margin-top:0}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-3\.5{margin-top:calc(var(--spacing) * 3.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-4\.5{margin-top:calc(var(--spacing) * 4.5)}.mt-5\.5{margin-top:calc(var(--spacing) * 5.5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-7{margin-top:calc(var(--spacing) * 7)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-19{margin-top:calc(var(--spacing) * 19)}.mt-\[5px\]{margin-top:5px}.mt-\[9px\]{margin-top:9px}.mt-\[13px\]{margin-top:13px}.mr-0{margin-right:0}.mr-1{margin-right:var(--spacing)}.mr-3\.5{margin-right:calc(var(--spacing) * 3.5)}.mb-0{margin-bottom:0}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:var(--spacing)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-3\.5{margin-bottom:calc(var(--spacing) * 3.5)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-4\.5{margin-bottom:calc(var(--spacing) * 4.5)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-5\.5{margin-bottom:calc(var(--spacing) * 5.5)}.mb-6\.5{margin-bottom:calc(var(--spacing) * 6.5)}.mb-9{margin-bottom:calc(var(--spacing) * 9)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.ml-0{margin-left:0}.ml-1{margin-left:var(--spacing)}.ml-3\.5{margin-left:calc(var(--spacing) * 3.5)}.ml-6{margin-left:calc(var(--spacing) * 6)}.ml-auto{margin-left:auto}.box-border{box-sizing:border-box}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.field-sizing-content{field-sizing:content}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.h-2{height:calc(var(--spacing) * 2)}.h-4{height:calc(var(--spacing) * 4)}.h-4\.5{height:calc(var(--spacing) * 4.5)}.h-5\.5{height:calc(var(--spacing) * 5.5)}.h-6{height:calc(var(--spacing) * 6)}.h-6\.5{height:calc(var(--spacing) * 6.5)}.h-7{height:calc(var(--spacing) * 7)}.h-7\.5{height:calc(var(--spacing) * 7.5)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-10\.5{height:calc(var(--spacing) * 10.5)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-\[7px\]{height:7px}.h-\[9px\]{height:9px}.h-\[13px\]{height:13px}.h-\[15px\]{height:15px}.h-full{height:100%}.h-px{height:1px}.max-h-36{max-height:calc(var(--spacing) * 36)}.max-h-50{max-height:calc(var(--spacing) * 50)}.max-h-65{max-height:calc(var(--spacing) * 65)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-85{max-height:calc(var(--spacing) * 85)}.max-h-95{max-height:calc(var(--spacing) * 95)}.max-h-100{max-height:calc(var(--spacing) * 100)}.max-h-\[calc\(100vh_-_40px\)\]{max-height:calc(100vh - 40px)}.max-h-\[calc\(100vh_-_var\(--modal-top\)_-_48px\)\]{max-height:calc(100vh - var(--modal-top) - 48px)}.max-h-\[min\(70vh\,_720px\)\]{max-height:min(70vh,720px)}.max-h-full{max-height:100%}.min-h-0{min-height:0}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-16{min-height:calc(var(--spacing) * 16)}.min-h-19\.5{min-height:calc(var(--spacing) * 19.5)}.min-h-28{min-height:calc(var(--spacing) * 28)}.min-h-dvh{min-height:100dvh}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-4{width:calc(var(--spacing) * 4)}.w-4\.5{width:calc(var(--spacing) * 4.5)}.w-6{width:calc(var(--spacing) * 6)}.w-6\.5{width:calc(var(--spacing) * 6.5)}.w-7{width:calc(var(--spacing) * 7)}.w-7\.5{width:calc(var(--spacing) * 7.5)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-9\.5{width:calc(var(--spacing) * 9.5)}.w-10\.5{width:calc(var(--spacing) * 10.5)}.w-37{width:calc(var(--spacing) * 37)}.w-66{width:calc(var(--spacing) * 66)}.w-68{width:calc(var(--spacing) * 68)}.w-70{width:calc(var(--spacing) * 70)}.w-72{width:calc(var(--spacing) * 72)}.w-110{width:calc(var(--spacing) * 110)}.w-120{width:calc(var(--spacing) * 120)}.w-\[7px\]{width:7px}.w-\[9px\]{width:9px}.w-\[13px\]{width:13px}.w-\[15px\]{width:15px}.w-\[min\(100\%\,_620px\)\]{width:min(100%,620px)}.w-\[min\(440px\,_calc\(100vw_-_48px\)\)\]{width:min(440px,100vw - 48px)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-36{max-width:calc(var(--spacing) * 36)}.max-w-55{max-width:calc(var(--spacing) * 55)}.max-w-60{max-width:calc(var(--spacing) * 60)}.max-w-65{max-width:calc(var(--spacing) * 65)}.max-w-68{max-width:calc(var(--spacing) * 68)}.max-w-72{max-width:calc(var(--spacing) * 72)}.max-w-120{max-width:calc(var(--spacing) * 120)}.max-w-155{max-width:calc(var(--spacing) * 155)}.max-w-160{max-width:calc(var(--spacing) * 160)}.max-w-230{max-width:calc(var(--spacing) * 230)}.max-w-\[88\%\]{max-width:88%}.max-w-\[94vw\]{max-width:94vw}.max-w-full{max-width:100%}.max-w-readable{max-width:var(--readable-col)}.min-w-0{min-width:0}.min-w-24{min-width:calc(var(--spacing) * 24)}.min-w-47\.5{min-width:calc(var(--spacing) * 47.5)}.min-w-55{min-width:calc(var(--spacing) * 55)}.min-w-57\.5{min-width:calc(var(--spacing) * 57.5)}.min-w-80{min-width:calc(var(--spacing) * 80)}.min-w-85{min-width:calc(var(--spacing) * 85)}.min-w-max{min-width:max-content}.flex-1{flex:1}.flex-none{flex:none}.shrink-0{flex-shrink:0}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\[settings-spin_0\.9s_linear_infinite\]{animation:.9s linear infinite settings-spin}.animate-\[spin_0\.8s_linear_infinite\]{animation:.8s linear infinite spin}.animate-\[title-char-in_240ms_ease-out_both\]{animation:.24s ease-out both title-char-in}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-e-resize{cursor:e-resize}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.\[scrollbar-width\:none\]{scrollbar-width:none}.\[scrollbar-gutter\:stable_both-edges\]{scrollbar-gutter:stable both-edges}.list-none{list-style-type:none}.grid-cols-\[24px_minmax\(0\,_1fr\)\]{grid-template-columns:24px minmax(0,1fr)}.grid-cols-\[24px_minmax\(0\,_1fr\)_24px\]{grid-template-columns:24px minmax(0,1fr) 24px}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[minmax\(0\,_1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.grid-cols-\[minmax\(180px\,_260px\)_minmax\(0\,_1fr\)\]{grid-template-columns:minmax(180px,260px) minmax(0,1fr)}.grid-cols-\[repeat\(2\,_minmax\(0\,_1fr\)\)\]{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0{gap:0}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-4\.5{gap:calc(var(--spacing) * 4.5)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-\[0\.4em\]{gap:.4em}.gap-\[3px\]{gap:3px}.gap-\[5px\]{gap:5px}.gap-\[7px\]{gap:7px}.gap-\[9px\]{gap:9px}.gap-px{gap:1px}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-3\.5{column-gap:calc(var(--spacing) * 3.5)}.gap-x-4\.5{column-gap:calc(var(--spacing) * 4.5)}.gap-x-8{column-gap:calc(var(--spacing) * 8)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2\.5{row-gap:calc(var(--spacing) * 2.5)}.gap-y-\[3px\]{row-gap:3px}.gap-y-\[7px\]{row-gap:7px}.gap-y-\[9px\]{row-gap:9px}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.\!rounded-lg{border-radius:10px!important}.\!rounded-none{border-radius:0!important}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\[3px\]{border-radius:3px}.rounded-\[16px\]{border-radius:16px}.rounded-\[inherit\]{border-radius:inherit}.rounded-\[var\(--radius-md\)_var\(--radius-md\)_0_0\]{border-radius:var(--radius-md) var(--radius-md) 0 0}.rounded-full{border-radius:999px}.rounded-lg{border-radius:10px}.rounded-md{border-radius:8px}.rounded-sm{border-radius:6px}.rounded-xl{border-radius:12px}.rounded-xs{border-radius:4px}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\[1\.5px\]{border-style:var(--tw-border-style);border-width:1.5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-\[3px\]{border-left-style:var(--tw-border-style);border-left-width:3px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-solid{--tw-border-style:solid;border-style:solid}.border-accent-amber{border-color:var(--accent-amber)}.border-border{border-color:var(--border)}.border-border-variant{border-color:var(--border-variant)}.border-primary{border-color:var(--primary)}.border-text{border-color:var(--text)}.border-transparent{border-color:#0000}.border-t-border{border-top-color:var(--border)}.border-t-border-variant{border-top-color:var(--border-variant)}.border-t-primary{border-top-color:var(--primary)}.border-r-border-variant{border-right-color:var(--border-variant)}.border-b-\[color-mix\(in_oklab\,_var\(--text\)_7\%\,_transparent\)\]{border-bottom-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.border-b-\[color-mix\(in_oklab\,_var\(--text\)_7\%\,_transparent\)\]{border-bottom-color:color-mix(in oklab,var(--text) 7%,transparent)}}.border-b-border{border-bottom-color:var(--border)}.border-b-border-variant{border-bottom-color:var(--border-variant)}.border-l-accent-blue{border-left-color:var(--accent-blue)}.border-l-border{border-left-color:var(--border)}.border-l-border-variant{border-left-color:var(--border-variant)}.\!bg-transparent{background-color:#0000!important}.bg-\[color-mix\(in_oklab\,_var\(--text\)_3\%\,_transparent\)\]{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_oklab\,_var\(--text\)_3\%\,_transparent\)\]{background-color:color-mix(in oklab,var(--text) 3%,transparent)}}.bg-\[color-mix\(in_oklab\,_var\(--text\)_8\%\,_transparent\)\]{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_oklab\,_var\(--text\)_8\%\,_transparent\)\]{background-color:color-mix(in oklab,var(--text) 8%,transparent)}}.bg-\[color-mix\(in_oklab\,_var\(--text\)_10\%\,_transparent\)\]{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_oklab\,_var\(--text\)_10\%\,_transparent\)\]{background-color:color-mix(in oklab,var(--text) 10%,transparent)}}.bg-\[color-mix\(in_srgb\,_var\(--primary\)_16\%\,_transparent\)\]{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_srgb\,_var\(--primary\)_16\%\,_transparent\)\]{background-color:color-mix(in srgb,var(--primary) 16%,transparent)}}.bg-\[rgba\(29\,_27\,_26\,_0\.4\)\]{background-color:#1d1b1a66}.bg-\[rgba\(29\,_27\,_26\,_0\.42\)\]{background-color:#1d1b1a6b}.bg-\[var\(--term-bg\)\]{background-color:var(--term-bg)}.bg-accent{background-color:var(--accent)}.bg-accent-amber-subtle{background-color:var(--accent-amber-subtle)}.bg-background{background-color:var(--base)}.bg-border-variant{background-color:var(--border-variant)}.bg-canvas{background-color:var(--canvas)}.bg-muted{background-color:var(--muted)}.bg-primary{background-color:var(--primary)}.bg-primary-subtle{background-color:var(--primary-subtle)}.bg-surface{background-color:var(--surface)}.bg-text{background-color:var(--text)}.bg-transparent{background-color:#0000}.bg-white{background-color:#fff}.bg-none{background-image:none}.\!p-0{padding:0!important}.p-0{padding:0}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-\[1\.5px\]{padding:1.5px}.p-\[3px\]{padding:3px}.p-\[5px\]{padding:5px}.p-px{padding:1px}.\!px-7{padding-inline:calc(var(--spacing) * 7)!important}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-4\.5{padding-inline:calc(var(--spacing) * 4.5)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-7{padding-inline:calc(var(--spacing) * 7)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-\[7px\]{padding-inline:7px}.px-\[9px\]{padding-inline:9px}.px-\[11px\]{padding-inline:11px}.px-\[13px\]{padding-inline:13px}.px-\[15px\]{padding-inline:15px}.\!py-3\.5{padding-block:calc(var(--spacing) * 3.5)!important}.py-0{padding-block:0}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-4\.5{padding-block:calc(var(--spacing) * 4.5)}.py-6\.5{padding-block:calc(var(--spacing) * 6.5)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-\[3px\]{padding-block:3px}.py-\[5px\]{padding-block:5px}.py-\[7px\]{padding-block:7px}.py-\[9px\]{padding-block:9px}.py-\[11px\]{padding-block:11px}.py-px{padding-block:1px}.pt-0{padding-top:0}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-1\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-3\.5{padding-top:calc(var(--spacing) * 3.5)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-4\.5{padding-top:calc(var(--spacing) * 4.5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-6\.5{padding-top:calc(var(--spacing) * 6.5)}.pt-12{padding-top:calc(var(--spacing) * 12)}.pt-\[var\(--modal-top\)\]{padding-top:var(--modal-top)}.pr-0{padding-right:0}.pr-1{padding-right:var(--spacing)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-0{padding-bottom:0}.pb-1{padding-bottom:var(--spacing)}.pb-1\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-3\.5{padding-bottom:calc(var(--spacing) * 3.5)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-8{padding-bottom:calc(var(--spacing) * 8)}.pb-10{padding-bottom:calc(var(--spacing) * 10)}.pb-15{padding-bottom:calc(var(--spacing) * 15)}.pb-16{padding-bottom:calc(var(--spacing) * 16)}.pl-1\.5{padding-left:calc(var(--spacing) * 1.5)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-3\.5{padding-left:calc(var(--spacing) * 3.5)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-4\.5{padding-left:calc(var(--spacing) * 4.5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-\[-0\.15em\]{vertical-align:-.15em}.align-baseline{vertical-align:baseline}.font-\[inherit\]{font-family:inherit}.font-mono{font-family:var(--mono)}.font-sans{font-family:var(--sans)}.\!text-xl{font-size:var(--fs-xl)!important}.text-2xl{font-size:var(--fs-2xl)}.text-2xs{font-size:var(--fs-2xs)}.text-3xl{font-size:var(--fs-3xl)}.text-4xl{font-size:var(--fs-4xl)}.text-\[2\.5rem\]{font-size:2.5rem}.text-\[4rem\]{font-size:4rem}.text-\[length\:inherit\]{font-size:inherit}.text-base{font-size:var(--fs-base)}.text-lg{font-size:var(--fs-lg)}.text-md{font-size:var(--fs-md)}.text-sm{font-size:var(--fs-sm)}.text-xl{font-size:var(--fs-xl)}.text-xs{font-size:var(--fs-xs)}.leading-\[1\.3\]{--tw-leading:1.3;line-height:1.3}.leading-\[1\.4\]{--tw-leading:1.4;line-height:1.4}.leading-\[1\.6\]{--tw-leading:1.6;line-height:1.6}.leading-\[1\.08\]{--tw-leading:1.08;line-height:1.08}.leading-\[1\.35\]{--tw-leading:1.35;line-height:1.35}.leading-\[1\.45\]{--tw-leading:1.45;line-height:1.45}.leading-\[1\.55\]{--tw-leading:1.55;line-height:1.55}.leading-\[1\.62\]{--tw-leading:1.62;line-height:1.62}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-\[375\]{--tw-font-weight:375;font-weight:375}.font-display{--tw-font-weight:var(--fw-display);font-weight:var(--fw-display)}.font-medium{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.font-normal{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.font-semibold{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.tracking-\[-0\.01em\]{--tw-tracking:-.01em;letter-spacing:-.01em}.tracking-\[-0\.02em\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\[-0\.015em\]{--tw-tracking:-.015em;letter-spacing:-.015em}.tracking-\[-0\.035em\]{--tw-tracking:-.035em;letter-spacing:-.035em}.tracking-\[0\.08em\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.wrap-anywhere{overflow-wrap:anywhere}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.\[tab-size\:4\]{-moz-tab-size:4;tab-size:4}.\!text-text{color:var(--text)!important}.text-\[\#d97757\]{color:#d97757}.text-accent-amber{color:var(--accent-amber)}.text-accent-blue{color:var(--accent-blue)}.text-accent-green{color:var(--accent-green)}.text-accent-red{color:var(--accent-red)}.text-background{color:var(--base)}.text-inherit{color:inherit}.text-muted{color:var(--muted)}.text-primary{color:var(--primary)}.text-subtext{color:var(--subtext)}.text-text{color:var(--text)}.text-transparent{color:#0000}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.decoration-border-strong{-webkit-text-decoration-color:var(--border-strong);text-decoration-color:var(--border-strong)}.underline-offset-3{text-underline-offset:3px}.caret-\[var\(--text\)\]{caret-color:var(--text)}.opacity-0{opacity:0}.opacity-35{opacity:.35}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-100{opacity:1}.\!shadow-none{--tw-shadow:0 0 #0000!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.shadow-\[0_0_0_1px_rgba\(0\,_0\,_0\,_0\.08\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_1px_2px_rgb\(0_0_0_\/_4\%\)\],.shadow-\[0_1px_2px_rgba\(0\,_0\,_0\,_0\.04\)\]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\]{--tw-shadow:0 1px 3px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\]{--tw-shadow:0 1px 3px var(--tw-shadow-color,color-mix(in oklab, var(--text) 5%, transparent))}}.shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\]{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_8px_rgba\(0\,_0\,_0\,_0\.10\)\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_10px_rgb\(0_0_0_\/_6\%\)\]{--tw-shadow:0 2px 10px var(--tw-shadow-color,#0000000f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(0\,_0\,_0\,_0\.10\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_6px_20px_rgb\(0_0_0_\/_12\%\)\]{--tw-shadow:0 6px 20px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_6px_24px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\,_0_1px_4px_color-mix\(in_oklab\,_var\(--text\)_4\%\,_transparent\)\]{--tw-shadow:0 6px 24px var(--tw-shadow-color,var(--text)), 0 1px 4px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.shadow-\[0_6px_24px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\,_0_1px_4px_color-mix\(in_oklab\,_var\(--text\)_4\%\,_transparent\)\]{--tw-shadow:0 6px 24px var(--tw-shadow-color,color-mix(in oklab, var(--text) 5%, transparent)), 0 1px 4px var(--tw-shadow-color,color-mix(in oklab, var(--text) 4%, transparent))}}.shadow-\[0_6px_24px_color-mix\(in_oklab\,_var\(--text\)_5\%\,_transparent\)\,_0_1px_4px_color-mix\(in_oklab\,_var\(--text\)_4\%\,_transparent\)\]{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_10px_26px_rgba\(0\,_0\,_0\,_0\.16\)\]{--tw-shadow:0 10px 26px var(--tw-shadow-color,#00000029);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_12px_32px_rgba\(0\,_0\,_0\,_0\.18\)\]{--tw-shadow:0 12px 32px var(--tw-shadow-color,#0000002e);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_14px_36px_color-mix\(in_oklab\,_var\(--text\)_6\%\,_transparent\)\]{--tw-shadow:0 14px 36px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.shadow-\[0_14px_36px_color-mix\(in_oklab\,_var\(--text\)_6\%\,_transparent\)\]{--tw-shadow:0 14px 36px var(--tw-shadow-color,color-mix(in oklab, var(--text) 6%, transparent))}}.shadow-\[0_14px_36px_color-mix\(in_oklab\,_var\(--text\)_6\%\,_transparent\)\]{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_24px_60px_rgba\(0\,_0\,_0\,_0\.22\)\]{--tw-shadow:0 24px 60px var(--tw-shadow-color,#00000038);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_2px_0_0_var\(--primary\)\]{--tw-shadow:inset 2px 0 0 var(--tw-shadow-color,var(--primary));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\[background\,border-color\,color\]{transition-property:background,border-color,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background\,border-color\]{transition-property:background,border-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background\,color\]{transition-property:background,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background\,opacity\]{transition-property:background,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background\]{transition-property:background;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[border-color\,background\,translate\]{transition-property:border-color,background,translate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[border-color\,background\]{transition-property:border-color,background;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[border-color\,box-shadow\]{transition-property:border-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[border-color\,color\]{transition-property:border-color,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[box-shadow\]{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[opacity\,color\]{transition-property:opacity,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[transform\,color\]{transition-property:transform,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-80{--tw-duration:80ms;transition-duration:80ms}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-120{--tw-duration:.12s;transition-duration:.12s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-standard{--tw-ease:ease;transition-timing-function:ease}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\[font\:inherit\]{font:inherit}.\[grid-area\:actions\]{grid-area:actions}.\[grid-area\:meta\]{grid-area:meta}.\[grid-area\:name\]{grid-area:name}.\[grid-template-areas\:\'name_meta\'_\'actions_actions\'\]{grid-template-areas:"name meta""actions actions"}.group-focus-within\/turn\:opacity-100:is(:where(.group\/turn):focus-within *){opacity:1}@media(hover:hover){.group-hover\:opacity-0:is(:where(.group):hover *){opacity:0}.group-hover\:opacity-100:is(:where(.group):hover *),.group-hover\/turn\:opacity-100:is(:where(.group\/turn):hover *){opacity:1}}.group-focus-visible\:opacity-0:is(:where(.group):focus-visible *){opacity:0}.group-focus-visible\:opacity-100:is(:where(.group):focus-visible *){opacity:1}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:top-full:after{content:var(--tw-content);top:100%}.after\:right-0:after{content:var(--tw-content);right:0}.after\:left-0:after{content:var(--tw-content);left:0}.after\:h-2:after{content:var(--tw-content);height:calc(var(--spacing) * 2)}.after\:content-\[\'\'\]:after{--tw-content:"";content:var(--tw-content)}.first\:border-t-0:first-child{border-top-style:var(--tw-border-style);border-top-width:0}@media(hover:hover){.hover\:bg-highlight:hover{background-color:var(--highlight)}.hover\:bg-surface:hover{background-color:var(--surface)}.hover\:text-text:hover{color:var(--text)}.hover\:decoration-primary:hover{-webkit-text-decoration-color:var(--primary);text-decoration-color:var(--primary)}.hover\:opacity-85:hover{opacity:.85}}.focus-visible\:text-text:focus-visible{color:var(--text)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:1120px){.min-\[1120px\]\:col-start-1{grid-column-start:1}.min-\[1120px\]\:col-start-2{grid-column-start:2}.min-\[1120px\]\:row-start-1{grid-row-start:1}.min-\[1120px\]\:row-start-2{grid-row-start:2}.min-\[1120px\]\:mt-0{margin-top:0}.min-\[1120px\]\:grid{display:grid}.min-\[1120px\]\:grid-cols-\[minmax\(0\,_1\.1fr\)_minmax\(28rem\,_1fr\)\]{grid-template-columns:minmax(0,1.1fr) minmax(28rem,1fr)}.min-\[1120px\]\:grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.min-\[1120px\]\:content-center{align-content:center}.min-\[1120px\]\:gap-x-20{column-gap:calc(var(--spacing) * 20)}.min-\[1120px\]\:gap-y-10{row-gap:calc(var(--spacing) * 10)}.min-\[1120px\]\:self-end{align-self:flex-end}.min-\[1120px\]\:self-start{align-self:flex-start}}@media(min-width:40rem){.sm\:px-12{padding-inline:calc(var(--spacing) * 12)}}.\[\&_\+_\.settings-stack-section\]\:mt-6+.settings-stack-section{margin-top:calc(var(--spacing) * 6)}.\[\&_\.actions\]\:mt-1\.5 .actions{margin-top:calc(var(--spacing) * 1.5)}.\[\&_\.actions\]\:flex .actions{display:flex}.\[\&_\.actions\]\:justify-end .actions{justify-content:flex-end}.\[\&_\.actions\]\:gap-2\.5 .actions{gap:calc(var(--spacing) * 2.5)}.\[\&_\.artifact-img\]\:mx-0 .artifact-img{margin-inline:0}.\[\&_\.artifact-img\]\:my-3 .artifact-img{margin-block:calc(var(--spacing) * 3)}.\[\&_\.artifact-img\]\:block .artifact-img{display:block}.\[\&_\.artifact-img_img\]\:h-auto .artifact-img img{height:auto}.\[\&_\.artifact-img_img\]\:max-w-full .artifact-img img{max-width:100%}.\[\&_\.artifact-img_img\]\:rounded-sm .artifact-img img{border-radius:6px}.\[\&_\.artifact-img_img\]\:border .artifact-img img{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.artifact-img_img\]\:border-border .artifact-img img{border-color:var(--border)}.\[\&_\.artifact-img-caption\]\:mt-1 .artifact-img-caption{margin-top:var(--spacing)}.\[\&_\.artifact-img-caption\]\:block .artifact-img-caption{display:block}.\[\&_\.artifact-img-caption\]\:text-center .artifact-img-caption{text-align:center}.\[\&_\.artifact-img-caption\]\:text-sm .artifact-img-caption{font-size:var(--fs-sm)}.\[\&_\.artifact-img-caption\]\:text-subtext .artifact-img-caption{color:var(--subtext)}.\[\&_\.backend-badge\]\:text-text .backend-badge{color:var(--text)}.\[\&_\.backend-detail\]\:text-muted .backend-detail{color:var(--muted)}.\[\&_\.backend-name\]\:font-medium .backend-name{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.badge\]\:ml-2 .badge{margin-left:calc(var(--spacing) * 2)}.\[\&_\.badge\]\:flex-none .badge{flex:none}.\[\&_\.brand\]\:flex .brand{display:flex}.\[\&_\.brand\]\:h-full .brand{height:100%}.\[\&_\.brand\]\:w-full .brand{width:100%}.\[\&_\.brand\]\:min-w-0 .brand{min-width:0}.\[\&_\.brand\]\:items-center .brand{align-items:center}.\[\&_\.brand\]\:justify-between .brand{justify-content:space-between}.\[\&_\.brand\]\:gap-2 .brand{gap:calc(var(--spacing) * 2)}.\[\&_\.brand\]\:rounded-sm .brand{border-radius:6px}.\[\&_\.brand\]\:border .brand{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.brand\]\:border-transparent .brand{border-color:#0000}.\[\&_\.brand\]\:px-1\.5 .brand{padding-inline:calc(var(--spacing) * 1.5)}.\[\&_\.brand\]\:py-1 .brand{padding-block:var(--spacing)}.\[\&_\.brand\]\:text-base .brand{font-size:var(--fs-base)}.\[\&_\.brand\]\:font-semibold .brand{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.brand\]\:text-text .brand{color:var(--text)}.\[\&_\.brand_\.brand-project\]\:min-w-0 .brand .brand-project{min-width:0}.\[\&_\.brand_\.brand-project\]\:overflow-hidden .brand .brand-project{overflow:hidden}.\[\&_\.brand_\.brand-project\]\:text-2xl .brand .brand-project{font-size:var(--fs-2xl)}.\[\&_\.brand_\.brand-project\]\:text-ellipsis .brand .brand-project{text-overflow:ellipsis}.\[\&_\.brand_\.brand-project\]\:whitespace-nowrap .brand .brand-project{white-space:nowrap}.\[\&_\.brand_svg\]\:shrink-0 .brand svg{flex-shrink:0}.\[\&_\.brand-project-copy\]\:flex .brand-project-copy{display:flex}.\[\&_\.brand-project-copy\]\:min-w-0 .brand-project-copy{min-width:0}.\[\&_\.brand-project-copy\]\:flex-col .brand-project-copy{flex-direction:column}.\[\&_\.brand-project-copy\]\:gap-\[3px\] .brand-project-copy{gap:3px}.\[\&_\.brand-project-copy\]\:text-left .brand-project-copy{text-align:left}.\[\&_\.brand-project-copy\]\:leading-\[1\.15\] .brand-project-copy{--tw-leading:1.15;line-height:1.15}.\[\&_\.brand-project-label\]\:text-2xs .brand-project-label{font-size:var(--fs-2xs)}.\[\&_\.brand-project-label\]\:font-medium .brand-project-label{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.brand-project-label\]\:tracking-\[0\.04em\] .brand-project-label{--tw-tracking:.04em;letter-spacing:.04em}.\[\&_\.brand-project-label\]\:text-muted .brand-project-label{color:var(--muted)}.\[\&_\.brand-project-label\]\:uppercase .brand-project-label{text-transform:uppercase}.\[\&_\.brand\.open\]\:border-border .brand.open{border-color:var(--border)}.\[\&_\.brand\.open\]\:bg-surface .brand.open{background-color:var(--surface)}.\[\&_\.brand\.open_\.project-chevron\]\:rotate-180 .brand.open .project-chevron{rotate:180deg}.\[\&_\.brand\.open_\.project-chevron\]\:opacity-100 .brand.open .project-chevron{opacity:1}.\[\&_\.brand\:hover\]\:border-border .brand:hover{border-color:var(--border)}.\[\&_\.brand\:hover\]\:bg-surface .brand:hover{background-color:var(--surface)}.\[\&_\.brand\:hover_\.project-chevron\]\:opacity-100 .brand:hover .project-chevron{opacity:1}.\[\&_\.btn\]\:inline-flex .btn{display:inline-flex}.\[\&_\.btn\]\:items-center .btn{align-items:center}.\[\&_\.btn\]\:gap-\[5px\] .btn{gap:5px}.\[\&_\.btn-ghost\]\:inline-flex .btn-ghost{display:inline-flex}.\[\&_\.btn-ghost\]\:cursor-pointer .btn-ghost{cursor:pointer}.\[\&_\.btn-ghost\]\:items-center .btn-ghost{align-items:center}.\[\&_\.btn-ghost\]\:gap-1\.5 .btn-ghost{gap:calc(var(--spacing) * 1.5)}.\[\&_\.btn-ghost\]\:rounded-sm .btn-ghost{border-radius:6px}.\[\&_\.btn-ghost\]\:border .btn-ghost{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.btn-ghost\]\:border-border .btn-ghost{border-color:var(--border)}.\[\&_\.btn-ghost\]\:border-text .btn-ghost{border-color:var(--text)}.\[\&_\.btn-ghost\]\:border-transparent .btn-ghost{border-color:#0000}.\[\&_\.btn-ghost\]\:bg-transparent .btn-ghost{background-color:#0000}.\[\&_\.btn-ghost\]\:px-\[13px\] .btn-ghost{padding-inline:13px}.\[\&_\.btn-ghost\]\:py-1\.5 .btn-ghost{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\.btn-ghost\]\:font-\[inherit\] .btn-ghost{font-family:inherit}.\[\&_\.btn-ghost\]\:text-sm .btn-ghost{font-size:var(--fs-sm)}.\[\&_\.btn-ghost\]\:font-semibold .btn-ghost{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.btn-ghost\]\:text-subtext .btn-ghost{color:var(--subtext)}.\[\&_\.btn-ghost\]\:text-text .btn-ghost{color:var(--text)}.\[\&_\.btn-ghost\]\:transition-\[background\,border-color\] .btn-ghost{transition-property:background,border-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_\.btn-ghost\]\:duration-80 .btn-ghost{--tw-duration:80ms;transition-duration:80ms}.\[\&_\.btn-ghost\]\:ease-standard .btn-ghost{--tw-ease:ease;transition-timing-function:ease}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:border-border-strong .btn-ghost:hover:not(:disabled){border-color:var(--border-strong)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:border-text .btn-ghost:hover:not(:disabled){border-color:var(--text)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:bg-\[var\(--surface-2\,_rgb\(0_0_0_\/_5\%\)\)\] .btn-ghost:hover:not(:disabled){background-color:var(--surface-2,#0000000d)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:bg-surface .btn-ghost:hover:not(:disabled){background-color:var(--surface)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:text-text .btn-ghost:hover:not(:disabled){color:var(--text)}.\[\&_\.btn-ghost\:hover\:not\(\:disabled\)\]\:opacity-100 .btn-ghost:hover:not(:disabled){opacity:1}.\[\&_\.btn-primary\]\:inline-flex .btn-primary{display:inline-flex}.\[\&_\.btn-primary\]\:cursor-pointer .btn-primary{cursor:pointer}.\[\&_\.btn-primary\]\:items-center .btn-primary{align-items:center}.\[\&_\.btn-primary\]\:gap-1\.5 .btn-primary{gap:calc(var(--spacing) * 1.5)}.\[\&_\.btn-primary\]\:rounded-sm .btn-primary{border-radius:6px}.\[\&_\.btn-primary\]\:border .btn-primary{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.btn-primary\]\:border-text .btn-primary{border-color:var(--text)}.\[\&_\.btn-primary\]\:border-transparent .btn-primary{border-color:#0000}.\[\&_\.btn-primary\]\:bg-primary .btn-primary{background-color:var(--primary)}.\[\&_\.btn-primary\]\:bg-transparent .btn-primary{background-color:#0000}.\[\&_\.btn-primary\]\:px-\[13px\] .btn-primary{padding-inline:13px}.\[\&_\.btn-primary\]\:py-1\.5 .btn-primary{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\.btn-primary\]\:font-\[inherit\] .btn-primary{font-family:inherit}.\[\&_\.btn-primary\]\:text-sm .btn-primary{font-size:var(--fs-sm)}.\[\&_\.btn-primary\]\:font-semibold .btn-primary{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.btn-primary\]\:text-background .btn-primary{color:var(--base)}.\[\&_\.btn-primary\]\:text-text .btn-primary{color:var(--text)}.\[\&_\.btn-primary\]\:transition-\[background\,border-color\] .btn-primary{transition-property:background,border-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_\.btn-primary\]\:duration-80 .btn-primary{--tw-duration:80ms;transition-duration:80ms}.\[\&_\.btn-primary\]\:ease-standard .btn-primary{--tw-ease:ease;transition-timing-function:ease}.\[\&_\.btn-primary\:first-child\]\:rounded-tr-none .btn-primary:first-child{border-top-right-radius:0}.\[\&_\.btn-primary\:first-child\]\:rounded-br-none .btn-primary:first-child{border-bottom-right-radius:0}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:border-text .btn-primary:hover:not(:disabled){border-color:var(--text)}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:bg-\[var\(--surface-2\,_rgb\(0_0_0_\/_5\%\)\)\] .btn-primary:hover:not(:disabled){background-color:var(--surface-2,#0000000d)}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:text-text .btn-primary:hover:not(:disabled){color:var(--text)}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:opacity-90 .btn-primary:hover:not(:disabled){opacity:.9}.\[\&_\.btn-primary\:hover\:not\(\:disabled\)\]\:opacity-100 .btn-primary:hover:not(:disabled){opacity:1}.\[\&_\.busy-dot\]\:h-\[7px\] .busy-dot{height:7px}.\[\&_\.busy-dot\]\:w-\[7px\] .busy-dot{width:7px}.\[\&_\.busy-dot\]\:shrink-0 .busy-dot{flex-shrink:0}.\[\&_\.busy-dot\]\:animate-\[or-pulse_1\.2s_infinite\] .busy-dot{animation:1.2s infinite or-pulse}.\[\&_\.busy-dot\]\:rounded-full .busy-dot{border-radius:999px}.\[\&_\.busy-dot\]\:bg-primary .busy-dot{background-color:var(--primary)}.\[\&_\.busy-dot\.waiting\]\:animate-none .busy-dot.waiting{animation:none}.\[\&_\.chev\]\:w-3 .chev{width:calc(var(--spacing) * 3)}.\[\&_\.chev\]\:shrink-0 .chev{flex-shrink:0}.\[\&_\.chev\]\:text-2xs .chev{font-size:var(--fs-2xs)}.\[\&_\.chev\]\:text-muted .chev{color:var(--muted)}.\[\&_\.count-badge\]\:inline-flex .count-badge{display:inline-flex}.\[\&_\.count-badge\]\:h-4\.5 .count-badge{height:calc(var(--spacing) * 4.5)}.\[\&_\.count-badge\]\:min-w-4\.5 .count-badge{min-width:calc(var(--spacing) * 4.5)}.\[\&_\.count-badge\]\:items-center .count-badge{align-items:center}.\[\&_\.count-badge\]\:justify-center .count-badge{justify-content:center}.\[\&_\.count-badge\]\:rounded-md .count-badge{border-radius:8px}.\[\&_\.count-badge\]\:border .count-badge{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.count-badge\]\:border-border .count-badge{border-color:var(--border)}.\[\&_\.count-badge\]\:bg-canvas .count-badge{background-color:var(--canvas)}.\[\&_\.count-badge\]\:px-\[5px\] .count-badge{padding-inline:5px}.\[\&_\.count-badge\]\:py-0 .count-badge{padding-block:0}.\[\&_\.count-badge\]\:text-xs .count-badge{font-size:var(--fs-xs)}.\[\&_\.count-badge\]\:font-medium .count-badge{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.count-badge\]\:text-text .count-badge{color:var(--text)}.\[\&_\.dot\]\:h-\[7px\] .dot{height:7px}.\[\&_\.dot\]\:w-\[7px\] .dot{width:7px}.\[\&_\.dot\]\:shrink-0 .dot{flex-shrink:0}.\[\&_\.dot\]\:rounded-full .dot{border-radius:999px}.\[\&_\.dot\]\:bg-current .dot{background-color:currentColor}.\[\&_\.elided-node-label\]\:flex .elided-node-label{display:flex}.\[\&_\.elided-node-label\]\:flex-col .elided-node-label{flex-direction:column}.\[\&_\.elided-node-label\]\:leading-\[1\.3\] .elided-node-label{--tw-leading:1.3;line-height:1.3}.\[\&_\.elided-node-sub\]\:text-muted .elided-node-sub{color:var(--muted)}.\[\&_\.error\]\:basis-full .error{flex-basis:100%}.\[\&_\.error\]\:text-md .error{font-size:var(--fs-md)}.\[\&_\.error\]\:text-sm .error{font-size:var(--fs-sm)}.\[\&_\.error\]\:whitespace-pre-wrap .error{white-space:pre-wrap}.\[\&_\.error\]\:text-accent-red .error{color:var(--accent-red)}.\[\&_\.file-chip\]\:mx-px .file-chip{margin-inline:1px}.\[\&_\.file-chip\]\:my-0 .file-chip{margin-block:0}.\[\&_\.file-chip\]\:inline-flex .file-chip{display:inline-flex}.\[\&_\.file-chip\]\:max-w-full .file-chip{max-width:100%}.\[\&_\.file-chip\]\:cursor-pointer .file-chip{cursor:pointer}.\[\&_\.file-chip\]\:items-center .file-chip{align-items:center}.\[\&_\.file-chip\]\:gap-1 .file-chip{gap:var(--spacing)}.\[\&_\.file-chip\]\:rounded-xs .file-chip{border-radius:4px}.\[\&_\.file-chip\]\:border .file-chip{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.file-chip\]\:border-border-variant .file-chip{border-color:var(--border-variant)}.\[\&_\.file-chip\]\:bg-panel .file-chip{background-color:var(--panel)}.\[\&_\.file-chip\]\:px-1\.5 .file-chip{padding-inline:calc(var(--spacing) * 1.5)}.\[\&_\.file-chip\]\:py-0 .file-chip{padding-block:0}.\[\&_\.file-chip\]\:align-baseline .file-chip{vertical-align:baseline}.\[\&_\.file-chip\]\:font-mono .file-chip{font-family:var(--mono)}.\[\&_\.file-chip\]\:text-\[0\.9em\] .file-chip{font-size:.9em}.\[\&_\.file-chip\]\:font-medium .file-chip{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.file-chip\]\:text-text .file-chip{color:var(--text)}.\[\&_\.file-chip_svg\]\:flex-none .file-chip svg{flex:none}.\[\&_\.file-chip_svg\]\:opacity-60 .file-chip svg{opacity:.6}.\[\&_\.file-chip-label\]\:max-w-65 .file-chip-label{max-width:calc(var(--spacing) * 65)}.\[\&_\.file-chip-label\]\:overflow-hidden .file-chip-label{overflow:hidden}.\[\&_\.file-chip-label\]\:text-ellipsis .file-chip-label{text-overflow:ellipsis}.\[\&_\.file-chip-label\]\:whitespace-nowrap .file-chip-label{white-space:nowrap}.\[\&_\.file-chip\:hover\:not\(\:disabled\)\]\:bg-surface .file-chip:hover:not(:disabled){background-color:var(--surface)}.\[\&_\.file-chip\:hover\:not\(\:disabled\)\]\:text-primary .file-chip:hover:not(:disabled){color:var(--primary)}.\[\&_\.files-pill\]\:rounded-sm .files-pill{border-radius:6px}.\[\&_\.files-pill\]\:px-2 .files-pill{padding-inline:calc(var(--spacing) * 2)}.\[\&_\.files-pill\]\:py-\[5px\] .files-pill{padding-block:5px}.\[\&_\.files-pill_code\]\:text-xs .files-pill code{font-size:var(--fs-xs)}.\[\&_\.folder-picker-chevron\]\:flex-none .folder-picker-chevron{flex:none}.\[\&_\.folder-picker-chevron\]\:text-muted .folder-picker-chevron{color:var(--muted)}.\[\&_\.folder-picker-control\]\:flex .folder-picker-control{display:flex}.\[\&_\.folder-picker-control\]\:w-full .folder-picker-control{width:100%}.\[\&_\.folder-picker-control\]\:min-w-0 .folder-picker-control{min-width:0}.\[\&_\.folder-picker-control\]\:cursor-pointer .folder-picker-control{cursor:pointer}.\[\&_\.folder-picker-control\]\:items-center .folder-picker-control{align-items:center}.\[\&_\.folder-picker-control\]\:gap-\[9px\] .folder-picker-control{gap:9px}.\[\&_\.folder-picker-control\]\:overflow-hidden .folder-picker-control{overflow:hidden}.\[\&_\.folder-picker-control\]\:rounded-md .folder-picker-control{border-radius:8px}.\[\&_\.folder-picker-control\]\:border .folder-picker-control{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.folder-picker-control\]\:border-border .folder-picker-control{border-color:var(--border)}.\[\&_\.folder-picker-control\]\:bg-background .folder-picker-control{background-color:var(--base)}.\[\&_\.folder-picker-control\]\:px-2\.5 .folder-picker-control{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_\.folder-picker-control\]\:py-2 .folder-picker-control{padding-block:calc(var(--spacing) * 2)}.\[\&_\.folder-picker-control\]\:text-left .folder-picker-control{text-align:left}.\[\&_\.folder-picker-control\]\:transition-\[border-color\,box-shadow\] .folder-picker-control{transition-property:border-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_\.folder-picker-control\]\:duration-120 .folder-picker-control{--tw-duration:.12s;transition-duration:.12s}.\[\&_\.folder-picker-control\]\:ease-standard .folder-picker-control{--tw-ease:ease;transition-timing-function:ease}.\[\&_\.folder-picker-control_\.placeholder\]\:text-muted .folder-picker-control .placeholder{color:var(--muted)}.\[\&_\.folder-picker-control_span\]\:min-w-0 .folder-picker-control span{min-width:0}.\[\&_\.folder-picker-control_span\]\:flex-1 .folder-picker-control span{flex:1}.\[\&_\.folder-picker-control_span\]\:overflow-hidden .folder-picker-control span{overflow:hidden}.\[\&_\.folder-picker-control_span\]\:text-ellipsis .folder-picker-control span{text-overflow:ellipsis}.\[\&_\.folder-picker-control_span\]\:whitespace-nowrap .folder-picker-control span{white-space:nowrap}.\[\&_\.folder-picker-control\:disabled\]\:cursor-default .folder-picker-control:disabled{cursor:default}.\[\&_\.folder-picker-control\:disabled\]\:opacity-65 .folder-picker-control:disabled{opacity:.65}.\[\&_\.folder-picker-control\:focus-visible\]\:outline-2 .folder-picker-control:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.\[\&_\.folder-picker-control\:focus-visible\]\:outline-offset-2 .folder-picker-control:focus-visible{outline-offset:2px}.\[\&_\.folder-picker-control\:focus-visible\]\:outline-text .folder-picker-control:focus-visible{outline-color:var(--text)}.\[\&_\.folder-picker-control\:focus-visible\]\:outline-solid .folder-picker-control:focus-visible{--tw-outline-style:solid;outline-style:solid}.\[\&_\.folder-picker-control\:hover\:not\(\:disabled\)\]\:border-muted .folder-picker-control:hover:not(:disabled){border-color:var(--muted)}.\[\&_\.folder-picker-control\:hover\:not\(\:disabled\)\]\:shadow-\[0_2px_8px_rgb\(0_0_0_\/_5\%\)\] .folder-picker-control:hover:not(:disabled){--tw-shadow:0 2px 8px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&_\.folder-picker-control\:hover\:not\(\:disabled\)_\.folder-picker-chevron\]\:text-subtext .folder-picker-control:hover:not(:disabled) .folder-picker-chevron{color:var(--subtext)}.\[\&_\.folder-picker-hint\]\:text-sm .folder-picker-hint{font-size:var(--fs-sm)}.\[\&_\.folder-picker-hint\]\:leading-\[1\.4\] .folder-picker-hint{--tw-leading:1.4;line-height:1.4}.\[\&_\.folder-picker-hint\]\:font-normal .folder-picker-hint{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_\.folder-picker-hint\]\:text-subtext .folder-picker-hint{color:var(--subtext)}.\[\&_\.folder-picker-icon\]\:flex-none .folder-picker-icon{flex:none}.\[\&_\.folder-picker-icon\]\:text-current .folder-picker-icon{color:currentColor}.\[\&_\.form-seg\]\:mb-0\.5 .form-seg{margin-bottom:calc(var(--spacing) * .5)}.\[\&_\.form-seg\]\:self-start .form-seg{align-self:flex-start}.\[\&_\.form-seg_button\]\:px-3 .form-seg button{padding-inline:calc(var(--spacing) * 3)}.\[\&_\.form-seg_button\]\:py-\[5px\] .form-seg button{padding-block:5px}.\[\&_\.ftree-footer\]\:mt-2\.5 .ftree-footer{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.ftree-footer\]\:max-w-full .ftree-footer{max-width:100%}.\[\&_\.ftree-footer\]\:rounded-md .ftree-footer{border-radius:8px}.\[\&_\.ftree-footer\]\:border .ftree-footer{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.ftree-footer\]\:border-border .ftree-footer{border-color:var(--border)}.\[\&_\.ftree-footer\]\:bg-background .ftree-footer{background-color:var(--base)}.\[\&_\.ftree-footer\]\:px-2\.5 .ftree-footer{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_\.ftree-footer\]\:py-1\.5 .ftree-footer{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\.ftree-footer_code\]\:max-w-95 .ftree-footer code{max-width:calc(var(--spacing) * 95)}.\[\&_\.hc-actions\]\:mt-2\.5 .hc-actions{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-actions\]\:flex .hc-actions{display:flex}.\[\&_\.hc-actions\]\:items-center .hc-actions{align-items:center}.\[\&_\.hc-actions\]\:gap-1\.5 .hc-actions{gap:calc(var(--spacing) * 1.5)}.\[\&_\.hc-actions_button\]\:inline-flex .hc-actions button{display:inline-flex}.\[\&_\.hc-actions_button\]\:min-w-21 .hc-actions button{min-width:calc(var(--spacing) * 21)}.\[\&_\.hc-actions_button\]\:items-center .hc-actions button{align-items:center}.\[\&_\.hc-actions_button\]\:justify-center .hc-actions button{justify-content:center}.\[\&_\.hc-actions_button\]\:gap-\[5px\] .hc-actions button{gap:5px}.\[\&_\.hc-actions_button\]\:rounded-md .hc-actions button{border-radius:8px}.\[\&_\.hc-actions_button\]\:border .hc-actions button{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.hc-actions_button\]\:border-border .hc-actions button{border-color:var(--border)}.\[\&_\.hc-actions_button\]\:bg-background .hc-actions button{background-color:var(--base)}.\[\&_\.hc-actions_button\]\:px-2\.5 .hc-actions button{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_\.hc-actions_button\]\:py-1\.5 .hc-actions button{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\.hc-actions_button\]\:text-sm .hc-actions button{font-size:var(--fs-sm)}.\[\&_\.hc-actions_button\]\:font-medium .hc-actions button{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.hc-actions_button\]\:text-text .hc-actions button{color:var(--text)}.\[\&_\.hc-actions_button\:hover\]\:border-\[color-mix\(in_oklab\,_var\(--border\)_55\%\,_var\(--text\)\)\] .hc-actions button:hover{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.hc-actions_button\:hover\]\:border-\[color-mix\(in_oklab\,_var\(--border\)_55\%\,_var\(--text\)\)\] .hc-actions button:hover{border-color:color-mix(in oklab,var(--border) 55%,var(--text))}}.\[\&_\.hc-actions_button\:hover\]\:bg-canvas .hc-actions button:hover{background-color:var(--canvas)}.\[\&_\.hc-body\]\:mt-2\.5 .hc-body{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-body\]\:line-clamp-10 .hc-body{-webkit-line-clamp:10;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&_\.hc-body\]\:border-t .hc-body{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.hc-body\]\:border-t-border-variant .hc-body{border-top-color:var(--border-variant)}.\[\&_\.hc-body\]\:pt-2\.5 .hc-body{padding-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-body\]\:leading-\[1\.6\] .hc-body{--tw-leading:1.6;line-height:1.6}.\[\&_\.hc-body\]\:whitespace-pre-line .hc-body{white-space:pre-line}.\[\&_\.hc-body\.expanded\]\:line-clamp-none .hc-body.expanded{-webkit-line-clamp:unset;-webkit-box-orient:horizontal;display:block;overflow:visible}.\[\&_\.hc-body\.expanded\]\:block .hc-body.expanded{display:block}.\[\&_\.hc-body\.expanded\]\:max-h-\[45vh\] .hc-body.expanded{max-height:45vh}.\[\&_\.hc-body\.expanded\]\:overflow-x-hidden .hc-body.expanded{overflow-x:hidden}.\[\&_\.hc-body\.expanded\]\:overflow-y-auto .hc-body.expanded{overflow-y:auto}.\[\&_\.hc-body\.expanded\]\:pb-1 .hc-body.expanded{padding-bottom:var(--spacing)}.\[\&_\.hc-branch\]\:inline-flex .hc-branch{display:inline-flex}.\[\&_\.hc-branch\]\:min-w-0 .hc-branch{min-width:0}.\[\&_\.hc-branch\]\:items-center .hc-branch{align-items:center}.\[\&_\.hc-branch\]\:gap-1 .hc-branch{gap:var(--spacing)}.\[\&_\.hc-branch\]\:overflow-hidden .hc-branch{overflow:hidden}.\[\&_\.hc-branch\]\:font-mono .hc-branch{font-family:var(--mono)}.\[\&_\.hc-branch\]\:text-ellipsis .hc-branch{text-overflow:ellipsis}.\[\&_\.hc-branch\]\:whitespace-nowrap .hc-branch{white-space:nowrap}.\[\&_\.hc-failure\]\:mt-2 .hc-failure{margin-top:calc(var(--spacing) * 2)}.\[\&_\.hc-failure\]\:line-clamp-3 .hc-failure{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&_\.hc-failure\]\:text-accent-red .hc-failure{color:var(--accent-red)}.\[\&_\.hc-foot\]\:mt-2 .hc-foot{margin-top:calc(var(--spacing) * 2)}.\[\&_\.hc-foot\]\:flex .hc-foot{display:flex}.\[\&_\.hc-foot\]\:items-center .hc-foot{align-items:center}.\[\&_\.hc-foot\]\:justify-between .hc-foot{justify-content:space-between}.\[\&_\.hc-foot\]\:gap-2\.5 .hc-foot{gap:calc(var(--spacing) * 2.5)}.\[\&_\.hc-foot\]\:text-2xs .hc-foot{font-size:var(--fs-2xs)}.\[\&_\.hc-foot\]\:text-muted .hc-foot{color:var(--muted)}.\[\&_\.hc-foot_\.hc-mono\]\:min-w-0 .hc-foot .hc-mono{min-width:0}.\[\&_\.hc-foot_\.hc-mono\]\:overflow-hidden .hc-foot .hc-mono{overflow:hidden}.\[\&_\.hc-foot_\.hc-mono\]\:text-ellipsis .hc-foot .hc-mono{text-overflow:ellipsis}.\[\&_\.hc-foot_\.hc-mono\]\:whitespace-nowrap .hc-foot .hc-mono{white-space:nowrap}.\[\&_\.hc-git\]\:mt-2\.5 .hc-git{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-git\]\:flex .hc-git{display:flex}.\[\&_\.hc-git\]\:flex-col .hc-git{flex-direction:column}.\[\&_\.hc-git\]\:gap-1 .hc-git{gap:var(--spacing)}.\[\&_\.hc-git\]\:border-t .hc-git{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.hc-git\]\:border-t-border-variant .hc-git{border-top-color:var(--border-variant)}.\[\&_\.hc-git\]\:pt-2 .hc-git{padding-top:calc(var(--spacing) * 2)}.\[\&_\.hc-git\]\:text-xs .hc-git{font-size:var(--fs-xs)}.\[\&_\.hc-git\]\:text-text .hc-git{color:var(--text)}.\[\&_\.hc-git-row\]\:flex .hc-git-row{display:flex}.\[\&_\.hc-git-row\]\:min-w-0 .hc-git-row{min-width:0}.\[\&_\.hc-git-row\]\:flex-wrap .hc-git-row{flex-wrap:wrap}.\[\&_\.hc-git-row\]\:items-center .hc-git-row{align-items:center}.\[\&_\.hc-git-row\]\:gap-2\.5 .hc-git-row{gap:calc(var(--spacing) * 2.5)}.\[\&_\.hc-head\]\:flex .hc-head{display:flex}.\[\&_\.hc-head\]\:items-baseline .hc-head{align-items:baseline}.\[\&_\.hc-head\]\:justify-between .hc-head{justify-content:space-between}.\[\&_\.hc-head\]\:gap-2\.5 .hc-head{gap:calc(var(--spacing) * 2.5)}.\[\&_\.hc-mono\]\:font-mono .hc-mono{font-family:var(--mono)}.\[\&_\.hc-slug\]\:min-w-0 .hc-slug{min-width:0}.\[\&_\.hc-slug\]\:overflow-hidden .hc-slug{overflow:hidden}.\[\&_\.hc-slug\]\:font-mono .hc-slug{font-family:var(--mono)}.\[\&_\.hc-slug\]\:text-md .hc-slug{font-size:var(--fs-md)}.\[\&_\.hc-slug\]\:font-semibold .hc-slug{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.hc-slug\]\:text-ellipsis .hc-slug{text-overflow:ellipsis}.\[\&_\.hc-slug\]\:whitespace-nowrap .hc-slug{white-space:nowrap}.\[\&_\.hc-stats\]\:mt-2\.5 .hc-stats{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-stats\]\:flex .hc-stats{display:flex}.\[\&_\.hc-stats\]\:flex-wrap .hc-stats{flex-wrap:wrap}.\[\&_\.hc-stats\]\:items-center .hc-stats{align-items:center}.\[\&_\.hc-stats\]\:gap-3 .hc-stats{gap:calc(var(--spacing) * 3)}.\[\&_\.hc-stats\]\:border-t .hc-stats{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.hc-stats\]\:border-t-border-variant .hc-stats{border-top-color:var(--border-variant)}.\[\&_\.hc-stats\]\:pt-2\.5 .hc-stats{padding-top:calc(var(--spacing) * 2.5)}.\[\&_\.hc-stats\]\:text-xs .hc-stats{font-size:var(--fs-xs)}.\[\&_\.hc-stats\]\:text-text .hc-stats{color:var(--text)}.\[\&_\.hc-title\]\:mt-\[3px\] .hc-title{margin-top:3px}.\[\&_\.hc-title\]\:text-text .hc-title{color:var(--text)}.\[\&_\.hc-toggle\]\:mt-1 .hc-toggle{margin-top:var(--spacing)}.\[\&_\.hc-toggle\]\:text-xs .hc-toggle{font-size:var(--fs-xs)}.\[\&_\.hc-toggle\]\:font-medium .hc-toggle{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.hc-toggle\]\:text-muted .hc-toggle{color:var(--muted)}.\[\&_\.hc-toggle\:hover\]\:text-text .hc-toggle:hover{color:var(--text)}.\[\&_\.home-inner\]\:max-w-140 .home-inner{max-width:calc(var(--spacing) * 140)}.\[\&_\.home-inner\]\:max-w-300 .home-inner{max-width:calc(var(--spacing) * 300)}.\[\&_\.home-inner\]\:pt-0 .home-inner{padding-top:0}.\[\&_\.home-inner\]\:pt-24 .home-inner{padding-top:calc(var(--spacing) * 24)}.\[\&_\.home-inner\]\:pb-0 .home-inner{padding-bottom:0}.\[\&_\.icon-btn\]\:ml-2 .icon-btn{margin-left:calc(var(--spacing) * 2)}.\[\&_\.icon-btn\]\:h-5\.5 .icon-btn{height:calc(var(--spacing) * 5.5)}.\[\&_\.icon-btn\]\:w-5\.5 .icon-btn{width:calc(var(--spacing) * 5.5)}.\[\&_\.icon-btn\]\:align-middle .icon-btn{vertical-align:middle}.\[\&_\.icon-btn\:hover\]\:text-accent-red .icon-btn:hover{color:var(--accent-red)}.\[\&_\.id\]\:font-mono .id{font-family:var(--mono)}.\[\&_\.id\]\:text-xs .id{font-size:var(--fs-xs)}.\[\&_\.id\]\:text-muted .id{color:var(--muted)}.\[\&_\.k\]\:text-subtext .k{color:var(--subtext)}.\[\&_\.katex\]\:text-\[1\.05em\] .katex{font-size:1.05em}.\[\&_\.katex-display\]\:mx-0 .katex-display{margin-inline:0}.\[\&_\.katex-display\]\:my-3 .katex-display{margin-block:calc(var(--spacing) * 3)}.\[\&_\.katex-display\]\:overflow-x-auto .katex-display{overflow-x:auto}.\[\&_\.katex-display\]\:overflow-y-hidden .katex-display{overflow-y:hidden}.\[\&_\.katex-display\]\:px-0 .katex-display{padding-inline:0}.\[\&_\.katex-display\]\:py-0\.5 .katex-display{padding-block:calc(var(--spacing) * .5)}.\[\&_\.kv\]\:grid-cols-\[132px_minmax\(0\,_1fr\)\] .kv{grid-template-columns:132px minmax(0,1fr)}.\[\&_\.kv\]\:items-center .kv{align-items:center}.\[\&_\.kv\]\:gap-x-4\.5 .kv{column-gap:calc(var(--spacing) * 4.5)}.\[\&_\.kv\]\:gap-y-1\.5 .kv{row-gap:calc(var(--spacing) * 1.5)}.\[\&_\.kv\]\:gap-y-\[9px\] .kv{row-gap:9px}.\[\&_\.kv_\.k\]\:text-sm .kv .k{font-size:var(--fs-sm)}.\[\&_\.kv_\.k\.mono\]\:font-mono .kv .k.mono{font-family:var(--mono)}.\[\&_\.kv_\.k\.mono\]\:text-sm .kv .k.mono{font-size:var(--fs-sm)}.\[\&_\.kv_\.v\]\:flex .kv .v{display:flex}.\[\&_\.kv_\.v\]\:min-w-0 .kv .v{min-width:0}.\[\&_\.kv_\.v\]\:flex-wrap .kv .v{flex-wrap:wrap}.\[\&_\.kv_\.v\]\:items-center .kv .v{align-items:center}.\[\&_\.kv_\.v\]\:gap-\[7px\] .kv .v{gap:7px}.\[\&_\.kv_\.v\]\:font-sans .kv .v{font-family:var(--sans)}.\[\&_\.kv_\.v\]\:text-md .kv .v{font-size:var(--fs-md)}.\[\&_\.kv_\.v\]\:break-normal .kv .v{overflow-wrap:normal;word-break:normal}.\[\&_\.kv_\.v_\.mono\]\:font-mono .kv .v .mono{font-family:var(--mono)}.\[\&_\.kv_\.v_\.mono\]\:text-sm .kv .v .mono{font-size:var(--fs-sm)}.\[\&_\.kv_\.v\.mono\]\:font-mono .kv .v.mono{font-family:var(--mono)}.\[\&_\.kv_\.v\.mono\]\:text-sm .kv .v.mono{font-size:var(--fs-sm)}.\[\&_\.md\]\:max-w-readable .md{max-width:var(--readable-col)}.\[\&_\.md\]\:text-base .md{font-size:var(--fs-base)}.\[\&_\.md\]\:leading-\[1\.65\] .md{--tw-leading:1.65;line-height:1.65}.\[\&_\.md\]\:text-text .md{color:var(--text)}.\[\&_\.md_h1\]\:mx-0 .md h1{margin-inline:0}.\[\&_\.md_h1\]\:mt-4\.5 .md h1{margin-top:calc(var(--spacing) * 4.5)}.\[\&_\.md_h1\]\:mb-2 .md h1{margin-bottom:calc(var(--spacing) * 2)}.\[\&_\.md_h1\]\:text-\[1\.5em\] .md h1{font-size:1.5em}.\[\&_\.md_h2\]\:mx-0 .md h2{margin-inline:0}.\[\&_\.md_h2\]\:mt-4 .md h2{margin-top:calc(var(--spacing) * 4)}.\[\&_\.md_h2\]\:mb-2 .md h2{margin-bottom:calc(var(--spacing) * 2)}.\[\&_\.md_h2\]\:text-\[1\.25em\] .md h2{font-size:1.25em}.\[\&_\.md_h3\]\:text-\[1\.1em\] .md h3{font-size:1.1em}.\[\&_\.model-id\]\:block .model-id{display:block}.\[\&_\.model-id\]\:font-mono .model-id{font-family:var(--mono)}.\[\&_\.model-id\]\:text-2xs .model-id{font-size:var(--fs-2xs)}.\[\&_\.model-id\]\:text-muted .model-id{color:var(--muted)}.\[\&_\.model-item\]\:pl-6 .model-item{padding-left:calc(var(--spacing) * 6)}.\[\&_\.model-item\]\:whitespace-nowrap .model-item{white-space:nowrap}.\[\&_\.model-item\:disabled\]\:cursor-default .model-item:disabled{cursor:default}.\[\&_\.model-item\:disabled\]\:text-muted .model-item:disabled{color:var(--muted)}.\[\&_\.model-item\:disabled\:hover\]\:bg-transparent .model-item:disabled:hover{background-color:#0000}.\[\&_\.name\]\:text-base .name{font-size:var(--fs-base)}.\[\&_\.name\]\:font-semibold .name{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.new-project-actions\]\:mt-2\.5 .new-project-actions{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.new-project-actions\]\:justify-start .new-project-actions{justify-content:flex-start}.\[\&_\.new-project-actions_\.primary\]\:ml-auto .new-project-actions .primary{margin-left:auto}.\[\&_\.node-action\]\:inline-flex .node-action{display:inline-flex}.\[\&_\.node-action\]\:items-center .node-action{align-items:center}.\[\&_\.node-action\]\:gap-\[5px\] .node-action{gap:5px}.\[\&_\.node-action\]\:rounded-sm .node-action{border-radius:6px}.\[\&_\.node-action\]\:px-1\.5 .node-action{padding-inline:calc(var(--spacing) * 1.5)}.\[\&_\.node-action\]\:py-\[3px\] .node-action{padding-block:3px}.\[\&_\.node-action\]\:text-xs .node-action{font-size:var(--fs-xs)}.\[\&_\.node-action\]\:font-medium .node-action{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.node-action\]\:text-text .node-action{color:var(--text)}.\[\&_\.node-action\]\:no-underline .node-action{text-decoration-line:none}.\[\&_\.node-action-ext\]\:ml-auto .node-action-ext{margin-left:auto}.\[\&_\.node-action-ext\]\:px-\[5px\] .node-action-ext{padding-inline:5px}.\[\&_\.node-action-ext\]\:py-\[3px\] .node-action-ext{padding-block:3px}.\[\&_\.node-action\:hover\]\:bg-surface .node-action:hover{background-color:var(--surface)}.\[\&_\.node-action\:hover\]\:text-text .node-action:hover{color:var(--text)}.\[\&_\.node-actions\]\:mt-2 .node-actions{margin-top:calc(var(--spacing) * 2)}.\[\&_\.node-actions\]\:flex .node-actions{display:flex}.\[\&_\.node-actions\]\:items-center .node-actions{align-items:center}.\[\&_\.node-actions\]\:gap-\[3px\] .node-actions{gap:3px}.\[\&_\.node-actions\]\:border-t .node-actions{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.node-actions\]\:border-t-border-variant .node-actions{border-top-color:var(--border-variant)}.\[\&_\.node-actions\]\:pt-1\.5 .node-actions{padding-top:calc(var(--spacing) * 1.5)}.\[\&_\.node-eyebrow\]\:mb-1\.5 .node-eyebrow{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_\.node-eyebrow\]\:flex .node-eyebrow{display:flex}.\[\&_\.node-eyebrow\]\:items-center .node-eyebrow{align-items:center}.\[\&_\.node-eyebrow\]\:justify-between .node-eyebrow{justify-content:space-between}.\[\&_\.node-eyebrow\]\:gap-2 .node-eyebrow{gap:calc(var(--spacing) * 2)}.\[\&_\.node-eyebrow\]\:text-2xs .node-eyebrow{font-size:var(--fs-2xs)}.\[\&_\.node-eyebrow\]\:font-medium .node-eyebrow{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.node-eyebrow\]\:text-muted .node-eyebrow{color:var(--muted)}.\[\&_\.node-head\]\:flex .node-head{display:flex}.\[\&_\.node-head\]\:min-w-0 .node-head{min-width:0}.\[\&_\.node-head\]\:items-center .node-head{align-items:center}.\[\&_\.node-head\]\:gap-\[7px\] .node-head{gap:7px}.\[\&_\.node-meta\]\:mt-2 .node-meta{margin-top:calc(var(--spacing) * 2)}.\[\&_\.node-meta\]\:flex .node-meta{display:flex}.\[\&_\.node-meta\]\:items-center .node-meta{align-items:center}.\[\&_\.node-meta\]\:gap-2 .node-meta{gap:calc(var(--spacing) * 2)}.\[\&_\.node-meta\]\:text-2xs .node-meta{font-size:var(--fs-2xs)}.\[\&_\.node-meta\]\:text-muted .node-meta{color:var(--muted)}.\[\&_\.node-overview-link\]\:block .node-overview-link{display:block}.\[\&_\.node-overview-link\]\:w-full .node-overview-link{width:100%}.\[\&_\.node-overview-link\]\:cursor-pointer .node-overview-link{cursor:pointer}.\[\&_\.node-overview-link\]\:border-0 .node-overview-link{border-style:var(--tw-border-style);border-width:0}.\[\&_\.node-overview-link\]\:bg-transparent .node-overview-link{background-color:#0000}.\[\&_\.node-overview-link\]\:p-0 .node-overview-link{padding:0}.\[\&_\.node-overview-link\]\:text-left .node-overview-link{text-align:left}.\[\&_\.node-overview-link\]\:text-inherit .node-overview-link{color:inherit}.\[\&_\.node-overview-link\]\:\[font\:inherit\] .node-overview-link{font:inherit}.\[\&_\.node-overview-link\:focus-visible\]\:rounded-xs .node-overview-link:focus-visible{border-radius:4px}.\[\&_\.node-overview-link\:focus-visible\]\:outline-2 .node-overview-link:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.\[\&_\.node-overview-link\:focus-visible\]\:outline-offset-4 .node-overview-link:focus-visible{outline-offset:4px}.\[\&_\.node-overview-link\:focus-visible\]\:outline-accent .node-overview-link:focus-visible{outline-color:var(--accent)}.\[\&_\.node-overview-link\:focus-visible\]\:outline-solid .node-overview-link:focus-visible{--tw-outline-style:solid;outline-style:solid}.\[\&_\.node-overview-link\:hover_\.node-slug\]\:underline .node-overview-link:hover .node-slug{text-decoration-line:underline}.\[\&_\.node-overview-link\:hover_\.node-slug\]\:underline-offset-\[3px\] .node-overview-link:hover .node-slug{text-underline-offset:3px}.\[\&_\.node-slug\]\:min-w-0 .node-slug{min-width:0}.\[\&_\.node-slug\]\:flex-1 .node-slug{flex:1}.\[\&_\.node-slug\]\:overflow-hidden .node-slug{overflow:hidden}.\[\&_\.node-slug\]\:font-mono .node-slug{font-family:var(--mono)}.\[\&_\.node-slug\]\:text-sm .node-slug{font-size:var(--fs-sm)}.\[\&_\.node-slug\]\:font-semibold .node-slug{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.node-slug\]\:text-ellipsis .node-slug{text-overflow:ellipsis}.\[\&_\.node-slug\]\:whitespace-nowrap .node-slug{white-space:nowrap}.\[\&_\.node-slug\]\:text-text .node-slug{color:var(--text)}.\[\&_\.node-status\]\:h-2 .node-status{height:calc(var(--spacing) * 2)}.\[\&_\.node-status\]\:w-2 .node-status{width:calc(var(--spacing) * 2)}.\[\&_\.node-status\]\:shrink-0 .node-status{flex-shrink:0}.\[\&_\.node-status\]\:rounded-full .node-status{border-radius:999px}.\[\&_\.node-title\]\:mt-1 .node-title{margin-top:var(--spacing)}.\[\&_\.node-title\]\:line-clamp-2 .node-title{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&_\.node-title\]\:text-sm .node-title{font-size:var(--fs-sm)}.\[\&_\.node-title\]\:text-text .node-title{color:var(--text)}.\[\&_\.onb-token-form\]\:mt-2\.5 .onb-token-form{margin-top:calc(var(--spacing) * 2.5)}.\[\&_\.openresearch-diff-file\]\:w-full .openresearch-diff-file{width:100%}.\[\&_\.openresearch-diff-file\]\:text-sm .openresearch-diff-file{font-size:var(--fs-sm)}.\[\&_\.openresearch-diff-file\]\:leading-\[1\.55\] .openresearch-diff-file{--tw-leading:1.55;line-height:1.55}.\[\&_\.openresearch-diff-file\]\:\[--diff-background-color\:var\(--base\)\] .openresearch-diff-file{--diff-background-color:var(--base)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-background-color\:var\(--openresearch-diff-delete-code-background-color\)\] .openresearch-diff-file{--diff-code-delete-background-color:var(--openresearch-diff-delete-code-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-edit-background-color\:var\(--openresearch-diff-delete-edit-background-color\)\] .openresearch-diff-file{--diff-code-delete-edit-background-color:var(--openresearch-diff-delete-edit-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-edit-text-color\:var\(--diff-text-color\)\] .openresearch-diff-file{--diff-code-delete-edit-text-color:var(--diff-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-text-color\:var\(--diff-text-color\)\] .openresearch-diff-file{--diff-code-delete-text-color:var(--diff-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-background-color\:var\(--openresearch-diff-insert-code-background-color\)\] .openresearch-diff-file{--diff-code-insert-background-color:var(--openresearch-diff-insert-code-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-edit-background-color\:var\(--openresearch-diff-insert-edit-background-color\)\] .openresearch-diff-file{--diff-code-insert-edit-background-color:var(--openresearch-diff-insert-edit-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-edit-text-color\:var\(--diff-text-color\)\] .openresearch-diff-file{--diff-code-insert-edit-text-color:var(--diff-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-text-color\:var\(--diff-text-color\)\] .openresearch-diff-file{--diff-code-insert-text-color:var(--diff-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-selected-background-color\:var\(--diff-selection-background-color\)\] .openresearch-diff-file{--diff-code-selected-background-color:var(--diff-selection-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-selected-text-color\:var\(--diff-selection-text-color\)\] .openresearch-diff-file{--diff-code-selected-text-color:var(--diff-selection-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-font-family\:var\(--mono\)\] .openresearch-diff-file{--diff-font-family:var(--mono)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-delete-background-color\:var\(--openresearch-diff-delete-gutter-background-color\)\] .openresearch-diff-file{--diff-gutter-delete-background-color:var(--openresearch-diff-delete-gutter-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-delete-text-color\:var\(--accent-red\)\] .openresearch-diff-file{--diff-gutter-delete-text-color:var(--accent-red)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-insert-background-color\:var\(--openresearch-diff-insert-gutter-background-color\)\] .openresearch-diff-file{--diff-gutter-insert-background-color:var(--openresearch-diff-insert-gutter-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-insert-text-color\:var\(--accent-green\)\] .openresearch-diff-file{--diff-gutter-insert-text-color:var(--accent-green)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-selected-background-color\:var\(--openresearch-diff-gutter-selection-background-color\)\] .openresearch-diff-file{--diff-gutter-selected-background-color:var(--openresearch-diff-gutter-selection-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-gutter-selected-text-color\:var\(--diff-selection-text-color\)\] .openresearch-diff-file{--diff-gutter-selected-text-color:var(--diff-selection-text-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-omit-gutter-line-color\:var\(--openresearch-diff-omit-gutter-line-color\)\] .openresearch-diff-file{--diff-omit-gutter-line-color:var(--openresearch-diff-omit-gutter-line-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-selection-background-color\:var\(--openresearch-diff-selection-background-color\)\] .openresearch-diff-file{--diff-selection-background-color:var(--openresearch-diff-selection-background-color)}.\[\&_\.openresearch-diff-file\]\:\[--diff-selection-text-color\:var\(--primary\)\] .openresearch-diff-file{--diff-selection-text-color:var(--primary)}.\[\&_\.openresearch-diff-file\]\:\[--diff-text-color\:var\(--text\)\] .openresearch-diff-file{--diff-text-color:var(--text)}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-code-background-color\:color-mix\(_in_oklab\,_var\(--base\)_92\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-code-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-code-background-color\:color-mix\(_in_oklab\,_var\(--base\)_92\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-code-background-color:color-mix(in oklab, var(--base) 92%, var(--accent-red))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-edit-background-color\:color-mix\(_in_oklab\,_var\(--base\)_78\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-edit-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-edit-background-color\:color-mix\(_in_oklab\,_var\(--base\)_78\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-edit-background-color:color-mix(in oklab, var(--base) 78%, var(--accent-red))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-gutter-background-color\:color-mix\(_in_oklab\,_var\(--base\)_86\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-gutter-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-delete-gutter-background-color\:color-mix\(_in_oklab\,_var\(--base\)_86\%\,_var\(--accent-red\)_\)\] .openresearch-diff-file{--openresearch-diff-delete-gutter-background-color:color-mix(in oklab, var(--base) 86%, var(--accent-red))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-divider-color\:var\(--border\)\] .openresearch-diff-file{--openresearch-diff-divider-color:var(--border)}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-gutter-selection-background-color\:color-mix\(_in_oklab\,_var\(--surface\)_68\%\,_var\(--primary\)_\)\] .openresearch-diff-file{--openresearch-diff-gutter-selection-background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-gutter-selection-background-color\:color-mix\(_in_oklab\,_var\(--surface\)_68\%\,_var\(--primary\)_\)\] .openresearch-diff-file{--openresearch-diff-gutter-selection-background-color:color-mix(in oklab, var(--surface) 68%, var(--primary))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-code-background-color\:color-mix\(_in_oklab\,_var\(--base\)_91\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-code-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-code-background-color\:color-mix\(_in_oklab\,_var\(--base\)_91\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-code-background-color:color-mix(in oklab, var(--base) 91%, var(--accent-green))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-edit-background-color\:color-mix\(_in_oklab\,_var\(--base\)_72\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-edit-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-edit-background-color\:color-mix\(_in_oklab\,_var\(--base\)_72\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-edit-background-color:color-mix(in oklab, var(--base) 72%, var(--accent-green))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-gutter-background-color\:color-mix\(_in_oklab\,_var\(--base\)_84\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-gutter-background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-insert-gutter-background-color\:color-mix\(_in_oklab\,_var\(--base\)_84\%\,_var\(--accent-green\)_\)\] .openresearch-diff-file{--openresearch-diff-insert-gutter-background-color:color-mix(in oklab, var(--base) 84%, var(--accent-green))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-omit-gutter-line-color\:color-mix\(in_oklab\,_var\(--base\)_86\%\,_var\(--text\)\)\] .openresearch-diff-file{--openresearch-diff-omit-gutter-line-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-omit-gutter-line-color\:color-mix\(in_oklab\,_var\(--base\)_86\%\,_var\(--text\)\)\] .openresearch-diff-file{--openresearch-diff-omit-gutter-line-color:color-mix(in oklab, var(--base) 86%, var(--text))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-selection-background-color\:color-mix\(_in_oklab\,_var\(--surface\)_76\%\,_var\(--primary\)_\)\] .openresearch-diff-file{--openresearch-diff-selection-background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-selection-background-color\:color-mix\(_in_oklab\,_var\(--surface\)_76\%\,_var\(--primary\)_\)\] .openresearch-diff-file{--openresearch-diff-selection-background-color:color-mix(in oklab, var(--surface) 76%, var(--primary))}}.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-unified-gutter-text-color\:color-mix\(in_oklab\,_var\(--text\)_45\%\,_var\(--base\)\)\] .openresearch-diff-file{--openresearch-diff-unified-gutter-text-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\]\:\[--openresearch-diff-unified-gutter-text-color\:color-mix\(in_oklab\,_var\(--text\)_45\%\,_var\(--base\)\)\] .openresearch-diff-file{--openresearch-diff-unified-gutter-text-color:color-mix(in oklab, var(--text) 45%, var(--base))}}.\[\&_\.openresearch-diff-file_\.diff-code\]\:px-4 .openresearch-diff-file .diff-code{padding-inline:calc(var(--spacing) * 4)}.\[\&_\.openresearch-diff-file_\.diff-code\]\:py-0 .openresearch-diff-file .diff-code{padding-block:0}.\[\&_\.openresearch-diff-file_\.diff-code\]\:break-normal .openresearch-diff-file .diff-code{overflow-wrap:normal;word-break:normal}.\[\&_\.openresearch-diff-file_\.diff-code\]\:wrap-normal .openresearch-diff-file .diff-code{overflow-wrap:normal}.\[\&_\.openresearch-diff-file_\.diff-code\]\:whitespace-pre .openresearch-diff-file .diff-code{white-space:pre}.\[\&_\.openresearch-diff-file_\.diff-hunk_\+_\.diff-hunk_\.diff-line\:first-child_\>_td\]\:border-t .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_\.openresearch-diff-file_\.diff-hunk_\+_\.diff-hunk_\.diff-line\:first-child_\>_td\]\:border-t-\[var\(--openresearch-diff-divider-color\)\] .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top-color:var(--openresearch-diff-divider-color)}.\[\&_\.openresearch-diff-file_\.diff-line\]\:leading-\[1\.55\] .openresearch-diff-file .diff-line{--tw-leading:1.55;line-height:1.55}.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-delete\)\]\:bg-\[var\(--openresearch-diff-delete-code-background-color\)\] .openresearch-diff-file .diff-line:has(.diff-code-delete){background-color:var(--openresearch-diff-delete-code-background-color)}.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-insert\)\]\:bg-\[var\(--openresearch-diff-insert-code-background-color\)\] .openresearch-diff-file .diff-line:has(.diff-code-insert){background-color:var(--openresearch-diff-insert-code-background-color)}.\[\&_\.openresearch-diff-file\.diff-unified\]\:table-auto .openresearch-diff-file.diff-unified{table-layout:auto}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:first-child\]\:hidden .openresearch-diff-file.diff-unified .diff-line>td:first-child{display:none}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:sticky .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){position:sticky}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:left-0 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){left:0}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:z-1 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){z-index:1}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:w-\[1\%\] .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){width:1%}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:cursor-default .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){cursor:default}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:border-r .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){border-right-style:var(--tw-border-style);border-right-width:1px}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:border-r-\[var\(--openresearch-diff-divider-color\)\] .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){border-right-color:var(--openresearch-diff-divider-color)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pt-0 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-top:0}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pr-2\.5 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-right:calc(var(--spacing) * 2.5)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pb-0 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-bottom:0}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pl-3\.5 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-left:calc(var(--spacing) * 3.5)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:text-right .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){text-align:right}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:whitespace-nowrap .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){white-space:nowrap}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:text-\[var\(--openresearch-diff-unified-gutter-text-color\)\] .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){color:var(--openresearch-diff-unified-gutter-text-color)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:select-none .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){-webkit-user-select:none;user-select:none}.\[\&_\.openresearch-diff-file\.diff-unified_col\.diff-gutter-col\:first-child\]\:collapse .openresearch-diff-file.diff-unified col.diff-gutter-col:first-child{visibility:collapse}.\[\&_\.openresearch-diff-file\.diff-unified_col\.diff-gutter-col\:first-child\]\:w-0 .openresearch-diff-file.diff-unified col.diff-gutter-col:first-child{width:0}.\[\&_\.openresearch-diff-file\.diff-unified_col\.diff-gutter-col\:nth-child\(2\)\]\:w-\[1\%\] .openresearch-diff-file.diff-unified col.diff-gutter-col:nth-child(2){width:1%}.\[\&_\.paper\]\:text-xs .paper{font-size:var(--fs-xs)}.\[\&_\.paper\]\:text-muted .paper{color:var(--muted)}.\[\&_\.paper-destination\]\:flex .paper-destination{display:flex}.\[\&_\.paper-destination\]\:items-center .paper-destination{align-items:center}.\[\&_\.paper-destination\]\:gap-2\.5 .paper-destination{gap:calc(var(--spacing) * 2.5)}.\[\&_\.paper-destination\]\:rounded-md .paper-destination{border-radius:8px}.\[\&_\.paper-destination\]\:border .paper-destination{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.paper-destination\]\:border-border .paper-destination{border-color:var(--border)}.\[\&_\.paper-destination\]\:bg-background .paper-destination{background-color:var(--base)}.\[\&_\.paper-destination\]\:pt-2 .paper-destination{padding-top:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pr-2 .paper-destination{padding-right:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pb-2 .paper-destination{padding-bottom:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pl-3 .paper-destination{padding-left:calc(var(--spacing) * 3)}.\[\&_\.paper-destination_\.btn\]\:flex-none .paper-destination .btn{flex:none}.\[\&_\.paper-destination_code\]\:min-w-0 .paper-destination code{min-width:0}.\[\&_\.paper-destination_code\]\:flex-1 .paper-destination code{flex:1}.\[\&_\.paper-destination_code\]\:overflow-hidden .paper-destination code{overflow:hidden}.\[\&_\.paper-destination_code\]\:text-sm .paper-destination code{font-size:var(--fs-sm)}.\[\&_\.paper-destination_code\]\:font-normal .paper-destination code{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_\.paper-destination_code\]\:text-ellipsis .paper-destination code{text-overflow:ellipsis}.\[\&_\.paper-destination_code\]\:whitespace-nowrap .paper-destination code{white-space:nowrap}.\[\&_\.paper-destination_code\]\:text-text .paper-destination code{color:var(--text)}.\[\&_\.paper-pick\]\:flex .paper-pick{display:flex}.\[\&_\.paper-pick\]\:items-center .paper-pick{align-items:center}.\[\&_\.paper-pick\]\:justify-between .paper-pick{justify-content:space-between}.\[\&_\.paper-pick\]\:gap-2\.5 .paper-pick{gap:calc(var(--spacing) * 2.5)}.\[\&_\.paper-pick\]\:rounded-md .paper-pick{border-radius:8px}.\[\&_\.paper-pick\]\:border .paper-pick{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.paper-pick\]\:border-border .paper-pick{border-color:var(--border)}.\[\&_\.paper-pick\]\:bg-surface .paper-pick{background-color:var(--surface)}.\[\&_\.paper-pick\]\:px-3 .paper-pick{padding-inline:calc(var(--spacing) * 3)}.\[\&_\.paper-pick\]\:py-2\.5 .paper-pick{padding-block:calc(var(--spacing) * 2.5)}.\[\&_\.paper-pick_\.id\]\:font-mono .paper-pick .id{font-family:var(--mono)}.\[\&_\.paper-pick_\.id\]\:text-xs .paper-pick .id{font-size:var(--fs-xs)}.\[\&_\.paper-pick_\.id\]\:text-muted .paper-pick .id{color:var(--muted)}.\[\&_\.paper-pick_\.meta\]\:min-w-0 .paper-pick .meta{min-width:0}.\[\&_\.paper-pick_\.title\]\:text-md .paper-pick .title{font-size:var(--fs-md)}.\[\&_\.paper-pick_\.title\]\:font-semibold .paper-pick .title{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.paper-results\]\:flex .paper-results{display:flex}.\[\&_\.paper-results\]\:max-h-60 .paper-results{max-height:calc(var(--spacing) * 60)}.\[\&_\.paper-results\]\:flex-col .paper-results{flex-direction:column}.\[\&_\.paper-results\]\:overflow-y-auto .paper-results{overflow-y:auto}.\[\&_\.paper-results\]\:rounded-md .paper-results{border-radius:8px}.\[\&_\.paper-results\]\:border .paper-results{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.paper-results\]\:border-border .paper-results{border-color:var(--border)}.\[\&_\.paper-results_\.id\]\:font-mono .paper-results .id{font-family:var(--mono)}.\[\&_\.paper-results_\.id\]\:text-xs .paper-results .id{font-size:var(--fs-xs)}.\[\&_\.paper-results_\.id\]\:text-muted .paper-results .id{color:var(--muted)}.\[\&_\.paper-results_\.title\]\:text-md .paper-results .title{font-size:var(--fs-md)}.\[\&_\.paper-results_\.title\]\:font-medium .paper-results .title{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.paper-results_button\]\:flex .paper-results button{display:flex}.\[\&_\.paper-results_button\]\:cursor-pointer .paper-results button{cursor:pointer}.\[\&_\.paper-results_button\]\:flex-col .paper-results button{flex-direction:column}.\[\&_\.paper-results_button\]\:items-start .paper-results button{align-items:flex-start}.\[\&_\.paper-results_button\]\:gap-0\.5 .paper-results button{gap:calc(var(--spacing) * .5)}.\[\&_\.paper-results_button\]\:border-0 .paper-results button{border-style:var(--tw-border-style);border-width:0}.\[\&_\.paper-results_button\]\:border-b .paper-results button{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_\.paper-results_button\]\:border-b-border-variant .paper-results button{border-bottom-color:var(--border-variant)}.\[\&_\.paper-results_button\]\:bg-transparent .paper-results button{background-color:#0000}.\[\&_\.paper-results_button\]\:bg-none .paper-results button{background-image:none}.\[\&_\.paper-results_button\]\:px-2\.5 .paper-results button{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_\.paper-results_button\]\:py-2 .paper-results button{padding-block:calc(var(--spacing) * 2)}.\[\&_\.paper-results_button\]\:text-left .paper-results button{text-align:left}.\[\&_\.paper-results_button\]\:text-text .paper-results button{color:var(--text)}.\[\&_\.paper-results_button\]\:\[font\:inherit\] .paper-results button{font:inherit}.\[\&_\.paper-results_button\:hover\]\:bg-surface .paper-results button:hover{background-color:var(--surface)}.\[\&_\.paper-results_button\:last-child\]\:border-b-0 .paper-results button:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&_\.path\]\:flex .path{display:flex}.\[\&_\.path\]\:min-w-0 .path{min-width:0}.\[\&_\.path\]\:flex-1 .path{flex:1}.\[\&_\.path\]\:items-center .path{align-items:center}.\[\&_\.path\]\:gap-2 .path{gap:calc(var(--spacing) * 2)}.\[\&_\.path_code\]\:min-w-0 .path code{min-width:0}.\[\&_\.path_code\]\:flex-1 .path code{flex:1}.\[\&_\.path_code\]\:overflow-hidden .path code{overflow:hidden}.\[\&_\.path_code\]\:font-mono .path code{font-family:var(--mono)}.\[\&_\.path_code\]\:text-xs .path code{font-size:var(--fs-xs)}.\[\&_\.path_code\]\:font-semibold .path code{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.path_code\]\:text-ellipsis .path code{text-overflow:ellipsis}.\[\&_\.path_code\]\:whitespace-nowrap .path code{white-space:nowrap}.\[\&_\.path_code\]\:text-text .path code{color:var(--text)}.\[\&_\.plan-strip-caret\]\:flex .plan-strip-caret{display:flex}.\[\&_\.plan-strip-caret\]\:items-center .plan-strip-caret{align-items:center}.\[\&_\.plan-strip-caret\]\:rounded-tl-none .plan-strip-caret{border-top-left-radius:0}.\[\&_\.plan-strip-caret\]\:rounded-bl-none .plan-strip-caret{border-bottom-left-radius:0}.\[\&_\.plan-strip-caret\]\:border-l .plan-strip-caret{border-left-style:var(--tw-border-style);border-left-width:1px}.\[\&_\.plan-strip-caret\]\:border-l-\[color-mix\(in_oklab\,_var\(--base\)_35\%\,_var\(--text\)\)\] .plan-strip-caret{border-left-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.plan-strip-caret\]\:border-l-\[color-mix\(in_oklab\,_var\(--base\)_35\%\,_var\(--text\)\)\] .plan-strip-caret{border-left-color:color-mix(in oklab,var(--base) 35%,var(--text))}}.\[\&_\.plan-strip-caret\]\:px-1\.5 .plan-strip-caret{padding-inline:calc(var(--spacing) * 1.5)}.\[\&_\.plan-strip-caret\]\:py-0 .plan-strip-caret{padding-block:0}.\[\&_\.plan-strip-primary\]\:border-text .plan-strip-primary{border-color:var(--text)}.\[\&_\.plan-strip-primary\]\:bg-text .plan-strip-primary{background-color:var(--text)}.\[\&_\.plan-strip-primary\]\:text-background .plan-strip-primary{color:var(--base)}.\[\&_\.plan-strip-primary\:hover\:not\(\:disabled\)\]\:border-text .plan-strip-primary:hover:not(:disabled){border-color:var(--text)}.\[\&_\.plan-strip-primary\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_85\%\,_var\(--base\)\)\] .plan-strip-primary:hover:not(:disabled){background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.plan-strip-primary\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_85\%\,_var\(--base\)\)\] .plan-strip-primary:hover:not(:disabled){background-color:color-mix(in oklab,var(--text) 85%,var(--base))}}.\[\&_\.plan-strip-primary\:hover\:not\(\:disabled\)\]\:text-background .plan-strip-primary:hover:not(:disabled){color:var(--base)}.\[\&_\.progress\]\:mx-0 .progress{margin-inline:0}.\[\&_\.progress\]\:mt-2 .progress{margin-top:calc(var(--spacing) * 2)}.\[\&_\.progress\]\:mb-0 .progress{margin-bottom:0}.\[\&_\.progress-track\]\:h-\[5px\] .progress-track{height:5px}.\[\&_\.progress-track\]\:border-0 .progress-track{border-style:var(--tw-border-style);border-width:0}.\[\&_\.progress-track\]\:bg-border .progress-track{background-color:var(--border)}.\[\&_\.project-back\]\:shrink-0 .project-back{flex-shrink:0}.\[\&_\.project-chevron\]\:text-muted .project-chevron{color:var(--muted)}.\[\&_\.project-chevron\]\:opacity-0 .project-chevron{opacity:0}.\[\&_\.project-chevron\]\:transition-transform .project-chevron{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_\.project-chevron\]\:duration-120 .project-chevron{--tw-duration:.12s;transition-duration:.12s}.\[\&_\.project-chevron\]\:ease-standard .project-chevron{--tw-ease:ease;transition-timing-function:ease}.\[\&_\.project-delete\]\:absolute .project-delete{position:absolute}.\[\&_\.project-delete\]\:top-2\.5 .project-delete{top:calc(var(--spacing) * 2.5)}.\[\&_\.project-delete\]\:right-2\.5 .project-delete{right:calc(var(--spacing) * 2.5)}.\[\&_\.project-delete\]\:z-2 .project-delete{z-index:2}.\[\&_\.project-delete\]\:hidden .project-delete{display:none}.\[\&_\.project-delete\]\:rounded-sm .project-delete{border-radius:6px}.\[\&_\.project-delete\]\:p-\[5px\] .project-delete{padding:5px}.\[\&_\.project-delete\]\:leading-\[0\] .project-delete{--tw-leading:0;line-height:0}.\[\&_\.project-delete\]\:text-muted .project-delete{color:var(--muted)}.\[\&_\.project-field-label\]\:text-base .project-field-label{font-size:var(--fs-base)}.\[\&_\.project-field-label\]\:font-semibold .project-field-label{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.project-field-label\]\:text-text .project-field-label{color:var(--text)}.\[\&_\.project-location-field\]\:flex .project-location-field{display:flex}.\[\&_\.project-location-field\]\:flex-col .project-location-field{flex-direction:column}.\[\&_\.project-location-field\]\:gap-2 .project-location-field{gap:calc(var(--spacing) * 2)}.\[\&_\.project-location-label\]\:text-base .project-location-label{font-size:var(--fs-base)}.\[\&_\.project-location-label\]\:font-semibold .project-location-label{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.project-location-label\]\:text-text .project-location-label{color:var(--text)}.\[\&_\.project-menu\]\:left-0 .project-menu{left:0}.\[\&_\.project-menu\]\:z-70 .project-menu{z-index:70}.\[\&_\.project-menu\]\:w-52\.5 .project-menu{width:calc(var(--spacing) * 52.5)}.\[\&_\.project-path-notice\]\:rounded-sm .project-path-notice{border-radius:6px}.\[\&_\.project-path-notice\]\:border .project-path-notice{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.project-path-notice\]\:border-border-variant .project-path-notice{border-color:var(--border-variant)}.\[\&_\.project-path-notice\]\:bg-surface .project-path-notice{background-color:var(--surface)}.\[\&_\.project-path-notice\]\:px-\[11px\] .project-path-notice{padding-inline:11px}.\[\&_\.project-path-notice\]\:py-\[9px\] .project-path-notice{padding-block:9px}.\[\&_\.project-path-notice\]\:text-sm .project-path-notice{font-size:var(--fs-sm)}.\[\&_\.project-path-notice\]\:leading-\[1\.4\] .project-path-notice{--tw-leading:1.4;line-height:1.4}.\[\&_\.project-path-notice\]\:text-subtext .project-path-notice{color:var(--subtext)}.\[\&_\.project-path-notice\.error\]\:border-\[color-mix\(in_srgb\,_var\(--accent-red\)_35\%\,_var\(--border-variant\)\)\] .project-path-notice.error{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.project-path-notice\.error\]\:border-\[color-mix\(in_srgb\,_var\(--accent-red\)_35\%\,_var\(--border-variant\)\)\] .project-path-notice.error{border-color:color-mix(in srgb,var(--accent-red) 35%,var(--border-variant))}}.\[\&_\.project-switcher\]\:relative .project-switcher{position:relative}.\[\&_\.project-switcher\]\:min-w-0 .project-switcher{min-width:0}.\[\&_\.project-switcher\]\:flex-1 .project-switcher{flex:1}.\[\&_\.project-switcher\]\:self-stretch .project-switcher{align-self:stretch}.\[\&_\.rail-body\]\:min-h-0 .rail-body{min-height:0}.\[\&_\.rail-body\]\:flex-1 .rail-body{flex:1}.\[\&_\.rail-body\]\:overflow-y-auto .rail-body{overflow-y:auto}.\[\&_\.rail-body\]\:px-2 .rail-body{padding-inline:calc(var(--spacing) * 2)}.\[\&_\.rail-body\]\:py-1 .rail-body{padding-block:var(--spacing)}.\[\&_\.react-flow\\_\\_attribution\]\:hidden\! .react-flow__attribution{display:none!important}.\[\&_\.react-flow\\_\\_handle\]\:pointer-events-none .react-flow__handle{pointer-events:none}.\[\&_\.react-flow\\_\\_handle\]\:opacity-0 .react-flow__handle{opacity:0}.\[\&_\.react-flow\\_\\_node\.react-flow\\_\\_node-elided\.selectable\]\:cursor-pointer .react-flow__node.react-flow__node-elided.selectable{cursor:pointer}.\[\&_\.react-flow\\_\\_node\.react-flow\\_\\_node-exp\.selectable\]\:cursor-default .react-flow__node.react-flow__node-exp.selectable{cursor:default}.\[\&_\.repo-hint\]\:font-mono .repo-hint{font-family:var(--mono)}.\[\&_\.repo-hint\]\:text-xs .repo-hint{font-size:var(--fs-xs)}.\[\&_\.repo-hint\]\:font-normal .repo-hint{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_\.repo-hint\]\:text-muted .repo-hint{color:var(--muted)}.\[\&_\.repo-hint\.ok\]\:text-accent-teal .repo-hint.ok{color:var(--accent-teal)}.\[\&_\.row2\]\:grid .row2{display:grid}.\[\&_\.row2\]\:grid-cols-2 .row2{grid-template-columns:repeat(2,minmax(0,1fr))}.\[\&_\.row2\]\:gap-2\.5 .row2{gap:calc(var(--spacing) * 2.5)}.\[\&_\.run-chip_svg\]\:text-primary .run-chip svg{color:var(--primary)}.\[\&_\.run-chip_svg\]\:opacity-100 .run-chip svg{opacity:1}.\[\&_\.run-label\]\:text-sm .run-label{font-size:var(--fs-sm)}.\[\&_\.run-label\]\:font-semibold .run-label,.\[\&_\.sel\]\:font-semibold .sel{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_\.sel\]\:text-text .sel{color:var(--text)}.\[\&_\.session-dot\]\:inline-flex .session-dot{display:inline-flex}.\[\&_\.session-dot\]\:w-3\.5 .session-dot{width:calc(var(--spacing) * 3.5)}.\[\&_\.session-dot\]\:shrink-0 .session-dot{flex-shrink:0}.\[\&_\.session-dot\]\:items-center .session-dot{align-items:center}.\[\&_\.session-dot\]\:justify-center .session-dot{justify-content:center}.\[\&_\.session-menu-btn\]\:mx-0 .session-menu-btn{margin-inline:0}.\[\&_\.session-menu-btn\]\:-my-0\.5 .session-menu-btn{margin-block:calc(var(--spacing) * -.5)}.\[\&_\.session-menu-btn\]\:hidden .session-menu-btn{display:none}.\[\&_\.session-menu-btn\]\:h-4 .session-menu-btn{height:calc(var(--spacing) * 4)}.\[\&_\.session-menu-btn\]\:w-4 .session-menu-btn{width:calc(var(--spacing) * 4)}.\[\&_\.session-menu-btn\]\:shrink-0 .session-menu-btn{flex-shrink:0}.\[\&_\.session-menu-btn\]\:items-center .session-menu-btn{align-items:center}.\[\&_\.session-menu-btn\]\:justify-center .session-menu-btn{justify-content:center}.\[\&_\.session-menu-btn\]\:rounded-sm .session-menu-btn{border-radius:6px}.\[\&_\.session-menu-btn\]\:text-muted .session-menu-btn{color:var(--muted)}.\[\&_\.session-menu-btn\:hover\]\:bg-panel .session-menu-btn:hover{background-color:var(--panel)}.\[\&_\.session-menu-btn\:hover\]\:text-text .session-menu-btn:hover{color:var(--text)}.\[\&_\.session-time\]\:shrink-0 .session-time{flex-shrink:0}.\[\&_\.session-time\]\:text-2xs .session-time{font-size:var(--fs-2xs)}.\[\&_\.session-time\]\:text-muted .session-time{color:var(--muted)}.\[\&_\.session-title\]\:min-w-0 .session-title{min-width:0}.\[\&_\.session-title\]\:flex-1 .session-title{flex:1}.\[\&_\.session-title\]\:overflow-hidden .session-title{overflow:hidden}.\[\&_\.session-title\]\:text-ellipsis .session-title{text-overflow:ellipsis}.\[\&_\.session-title\]\:whitespace-nowrap .session-title{white-space:nowrap}.\[\&_\.session-title-input\]\:mx-0 .session-title-input{margin-inline:0}.\[\&_\.session-title-input\]\:-my-0\.5 .session-title-input{margin-block:calc(var(--spacing) * -.5)}.\[\&_\.session-title-input\]\:min-w-0 .session-title-input{min-width:0}.\[\&_\.session-title-input\]\:flex-1 .session-title-input{flex:1}.\[\&_\.session-title-input\]\:rounded-sm .session-title-input{border-radius:6px}.\[\&_\.session-title-input\]\:border .session-title-input{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.session-title-input\]\:border-primary .session-title-input{border-color:var(--primary)}.\[\&_\.session-title-input\]\:bg-background .session-title-input{background-color:var(--base)}.\[\&_\.session-title-input\]\:px-\[5px\] .session-title-input{padding-inline:5px}.\[\&_\.session-title-input\]\:py-px .session-title-input{padding-block:1px}.\[\&_\.session-title-input\]\:text-text .session-title-input{color:var(--text)}.\[\&_\.session-title-input\]\:outline-none .session-title-input{--tw-outline-style:none;outline-style:none}.\[\&_\.session-title-input\]\:\[font\:inherit\] .session-title-input{font:inherit}.\[\&_\.settings-card\]\:mt-3\.5 .settings-card{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\.settings-card\]\:mb-0 .settings-card,.\[\&_\.settings-card-head\]\:mb-0 .settings-card-head{margin-bottom:0}.\[\&_\.settings-card-head\]\:justify-between .settings-card-head{justify-content:space-between}.\[\&_\.settings-card-head\]\:pb-3 .settings-card-head{padding-bottom:calc(var(--spacing) * 3)}.\[\&_\.settings-card-head_h3\]\:m-0 .settings-card-head h3{margin:0}.\[\&_\.settings-sub\]\:mb-3 .settings-sub{margin-bottom:calc(var(--spacing) * 3)}.\[\&_\.skill-chip\]\:mr-0\.5 .skill-chip{margin-right:calc(var(--spacing) * .5)}.\[\&_\.skill-chip\]\:align-baseline .skill-chip{vertical-align:baseline}.\[\&_\.skill-desc\]\:text-sm .skill-desc{font-size:var(--fs-sm)}.\[\&_\.skill-desc\]\:text-subtext .skill-desc{color:var(--subtext)}.\[\&_\.skill-hint\]\:text-muted .skill-hint{color:var(--muted)}.\[\&_\.skill-name\]\:text-md .skill-name{font-size:var(--fs-md)}.\[\&_\.spinner\]\:h-5\.5 .spinner{height:calc(var(--spacing) * 5.5)}.\[\&_\.spinner\]\:w-5\.5 .spinner{width:calc(var(--spacing) * 5.5)}.\[\&_\.spinner\]\:border-\[3px\] .spinner{border-style:var(--tw-border-style);border-width:3px}.\[\&_\.stats\]\:flex .stats{display:flex}.\[\&_\.stats\]\:shrink-0 .stats{flex-shrink:0}.\[\&_\.stats\]\:items-center .stats{align-items:center}.\[\&_\.stats\]\:gap-2 .stats{gap:calc(var(--spacing) * 2)}.\[\&_\.stats\]\:font-mono .stats{font-family:var(--mono)}.\[\&_\.stats\]\:text-2xs .stats{font-size:var(--fs-2xs)}.\[\&_\.stats\]\:font-medium .stats{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.stats\]\:tabular-nums .stats{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.\[\&_\.status-badge\]\:text-text .status-badge{color:var(--text)}.\[\&_\.tab-close\]\:inline-flex .tab-close{display:inline-flex}.\[\&_\.tab-close\]\:h-3\.5 .tab-close{height:calc(var(--spacing) * 3.5)}.\[\&_\.tab-close\]\:w-3\.5 .tab-close{width:calc(var(--spacing) * 3.5)}.\[\&_\.tab-close\]\:shrink-0 .tab-close{flex-shrink:0}.\[\&_\.tab-close\]\:items-center .tab-close{align-items:center}.\[\&_\.tab-close\]\:justify-center .tab-close{justify-content:center}.\[\&_\.tab-close\]\:rounded-xs .tab-close{border-radius:4px}.\[\&_\.tab-close\]\:text-muted .tab-close{color:var(--muted)}.\[\&_\.tab-close\:hover\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_15\%\,_transparent\)\] .tab-close:hover{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.tab-close\:hover\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_15\%\,_transparent\)\] .tab-close:hover{background-color:color-mix(in oklab,var(--text) 15%,transparent)}}.\[\&_\.tab-close\:hover\]\:text-text .tab-close:hover{color:var(--text)}.\[\&_\.tab-label\]\:grid .tab-label{display:grid}.\[\&_\.tab-label\]\:min-w-0 .tab-label{min-width:0}.\[\&_\.tab-label\]\:grid-cols-\[minmax\(0\,_1fr\)\] .tab-label{grid-template-columns:minmax(0,1fr)}.\[\&_\.tab-label\]\:overflow-hidden .tab-label,.\[\&_\.tab-label_\>_span\]\:overflow-hidden .tab-label>span{overflow:hidden}.\[\&_\.tab-label_\>_span\]\:pr-1 .tab-label>span{padding-right:var(--spacing)}.\[\&_\.tab-label_\>_span\]\:text-ellipsis .tab-label>span{text-overflow:ellipsis}.\[\&_\.tab-label_\>_span\]\:whitespace-nowrap .tab-label>span{white-space:nowrap}.\[\&_\.tab-label_\>_span\]\:\[grid-area\:1_\/_1\] .tab-label>span{grid-area:1/1}.\[\&_\.tab-label\:\:after\]\:invisible .tab-label:after{visibility:hidden}.\[\&_\.tab-label\:\:after\]\:overflow-hidden .tab-label:after{overflow:hidden}.\[\&_\.tab-label\:\:after\]\:pr-1 .tab-label:after{padding-right:var(--spacing)}.\[\&_\.tab-label\:\:after\]\:font-medium .tab-label:after{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.tab-label\:\:after\]\:text-ellipsis .tab-label:after{text-overflow:ellipsis}.\[\&_\.tab-label\:\:after\]\:whitespace-nowrap .tab-label:after{white-space:nowrap}.\[\&_\.tab-label\:\:after\]\:content-\[attr\(data-label\)\] .tab-label:after{--tw-content:attr(data-label);content:var(--tw-content)}.\[\&_\.tab-label\:\:after\]\:\[grid-area\:1_\/_1\] .tab-label:after{grid-area:1/1}.\[\&_\.time\]\:text-xs .time{font-size:var(--fs-xs)}.\[\&_\.time\]\:text-muted .time{color:var(--muted)}.\[\&_\.title\]\:max-w-60 .title{max-width:calc(var(--spacing) * 60)}.\[\&_\.title\]\:overflow-hidden .title{overflow:hidden}.\[\&_\.title\]\:text-md .title{font-size:var(--fs-md)}.\[\&_\.title\]\:font-medium .title{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\.title\]\:text-ellipsis .title{text-overflow:ellipsis}.\[\&_\.title\]\:whitespace-nowrap .title{white-space:nowrap}.\[\&_\.tool-line\]\:text-lg .tool-line{font-size:var(--fs-lg)}.\[\&_\.unread-dot\]\:h-\[7px\] .unread-dot{height:7px}.\[\&_\.unread-dot\]\:w-\[7px\] .unread-dot{width:7px}.\[\&_\.unread-dot\]\:shrink-0 .unread-dot{flex-shrink:0}.\[\&_\.unread-dot\]\:rounded-full .unread-dot{border-radius:999px}.\[\&_\.unread-dot\]\:bg-primary .unread-dot{background-color:var(--primary)}.\[\&_\.v\]\:font-mono .v{font-family:var(--mono)}.\[\&_\.v\]\:text-sm .v{font-size:var(--fs-sm)}.\[\&_\.v\]\:break-all .v{word-break:break-all}.\[\&_\.when\]\:ml-auto .when{margin-left:auto}.\[\&_\.when\]\:text-xs .when{font-size:var(--fs-xs)}.\[\&_\.when\]\:text-muted .when{color:var(--muted)}.\[\&_\:where\(\[data-tip-align\=\'end\'\]\)\:\:after\]\:right-0 :where([data-tip-align=end]):after{right:0}.\[\&_\:where\(\[data-tip-align\=\'end\'\]\)\:\:after\]\:left-auto :where([data-tip-align=end]):after{left:auto}.\[\&_\:where\(\[data-tip-align\=\'end\'\]\)\:\:after\]\:translate-none :where([data-tip-align=end]):after{translate:none}.\[\&_\:where\(\[data-tip-align\=\'start\'\]\)\:\:after\]\:left-0 :where([data-tip-align=start]):after{left:0}.\[\&_\:where\(\[data-tip-align\=\'start\'\]\)\:\:after\]\:translate-none :where([data-tip-align=start]):after{translate:none}.\[\&_\:where\(\[data-tip\]\)\]\:relative :where([data-tip]){position:relative}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:pointer-events-none :where([data-tip]):after{pointer-events:none}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:invisible :where([data-tip]):after{visibility:hidden}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:absolute :where([data-tip]):after{position:absolute}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:top-\[calc\(100\%_\+_6px\)\] :where([data-tip]):after{top:calc(100% + 6px)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:left-1\/2 :where([data-tip]):after{left:50%}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:z-\[9999\] :where([data-tip]):after{z-index:9999}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:w-max :where([data-tip]):after{width:max-content}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:max-w-none :where([data-tip]):after{max-width:none}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:-translate-x-1\/2 :where([data-tip]):after{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:rounded-sm :where([data-tip]):after{border-radius:6px}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:bg-text :where([data-tip]):after{background-color:var(--text)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:px-2 :where([data-tip]):after{padding-inline:calc(var(--spacing) * 2)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:py-\[5px\] :where([data-tip]):after{padding-block:5px}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:text-xs :where([data-tip]):after{font-size:var(--fs-xs)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:leading-none :where([data-tip]):after{--tw-leading:1;line-height:1}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:font-medium :where([data-tip]):after{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:whitespace-nowrap :where([data-tip]):after{white-space:nowrap}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:text-background :where([data-tip]):after{color:var(--base)}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:opacity-0 :where([data-tip]):after{opacity:0}.\[\&_\:where\(\[data-tip\]\)\:\:after\]\:content-\[attr\(data-tip\)\] :where([data-tip]):after{--tw-content:attr(data-tip);content:var(--tw-content)}.\[\&_\:where\(\[data-tip\]\)\:is\(\:hover\,\:focus-visible\)\:\:after\]\:visible :where([data-tip]):is(:hover,:focus-visible):after{visibility:visible}.\[\&_\:where\(\[data-tip\]\)\:is\(\:hover\,\:focus-visible\)\:\:after\]\:opacity-100 :where([data-tip]):is(:hover,:focus-visible):after{opacity:1}.\[\&_\>_\*\:first-child\]\:mt-0>:first-child{margin-top:0}.\[\&_\>_\*\:last-child\]\:mb-0>:last-child{margin-bottom:0}.\[\&_\>_\.changes-note\]\:mx-4>.changes-note{margin-inline:calc(var(--spacing) * 4)}.\[\&_\>_\.changes-note\]\:my-3\.5>.changes-note{margin-block:calc(var(--spacing) * 3.5)}.\[\&_\>_\.diff-explorer\]\:mx-4>.diff-explorer{margin-inline:calc(var(--spacing) * 4)}.\[\&_\>_\.diff-explorer\]\:mt-3\.5>.diff-explorer{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\.diff-explorer\]\:mb-0>.diff-explorer{margin-bottom:0}.\[\&_\>_\.error\]\:mx-0>.error{margin-inline:0}.\[\&_\>_\.error\]\:mt-0>.error{margin-top:0}.\[\&_\>_\.error\]\:mt-3\.5>.error{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\.error\]\:mb-3>.error{margin-bottom:calc(var(--spacing) * 3)}.\[\&_\>_\.error\]\:text-md>.error{font-size:var(--fs-md)}.\[\&_\>_\.error\]\:whitespace-pre-wrap>.error{white-space:pre-wrap}.\[\&_\>_\.error\]\:text-accent-red>.error{color:var(--accent-red)}.\[\&_\>_\.openresearch-diff\]\:mx-4>.openresearch-diff{margin-inline:calc(var(--spacing) * 4)}.\[\&_\>_\.openresearch-diff\]\:mt-3\.5>.openresearch-diff{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\.openresearch-diff\]\:mb-0>.openresearch-diff{margin-bottom:0}.\[\&_\>_\.project-default-row\:first-child\]\:border-t-0>.project-default-row:first-child{border-top-style:var(--tw-border-style);border-top-width:0}.\[\&_\>_\.project-default-row\:first-child\]\:pt-0>.project-default-row:first-child{padding-top:0}.\[\&_\>_\.seg\]\:rounded-sm>.seg{border-radius:6px}.\[\&_\>_\.seg\]\:p-0\.5>.seg{padding:calc(var(--spacing) * .5)}.\[\&_\>_\.seg_button\]\:px-2>.seg button{padding-inline:calc(var(--spacing) * 2)}.\[\&_\>_\.seg_button\]\:py-0\.5>.seg button{padding-block:calc(var(--spacing) * .5)}.\[\&_\>_\.seg_button\]\:text-sm>.seg button{font-size:var(--fs-sm)}.\[\&_\>_\.seg_button\]\:font-medium>.seg button{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_\>_\.truncated-notice\]\:mx-4>.truncated-notice{margin-inline:calc(var(--spacing) * 4)}.\[\&_\>_\.truncated-notice\]\:mt-3\.5>.truncated-notice{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\.truncated-notice\]\:mb-0>.truncated-notice{margin-bottom:0}.\[\&_\>_\:first-child\]\:mt-3\.5>:first-child{margin-top:calc(var(--spacing) * 3.5)}.\[\&_\>_\:last-child\]\:mb-0>:last-child{margin-bottom:0}.\[\&_\>_\:not\(\.project-card-open\,_\.project-delete\)\]\:pointer-events-none>:not(.project-card-open,.project-delete){pointer-events:none}.\[\&_\>_\:not\(\.project-card-open\,_\.project-delete\)\]\:relative>:not(.project-card-open,.project-delete){position:relative}.\[\&_\>_\:not\(\.project-card-open\,_\.project-delete\)\]\:z-1>:not(.project-card-open,.project-delete){z-index:1}.\[\&_\>_h2\]\:mx-0>h2{margin-inline:0}.\[\&_\>_h2\]\:mt-0>h2{margin-top:0}.\[\&_\>_h2\]\:mb-1\.5>h2{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_\>_h2\]\:text-xl>h2{font-size:var(--fs-xl)}.\[\&_\>_label\]\:gap-2>label{gap:calc(var(--spacing) * 2)}.\[\&_\>_p\]\:m-0>p{margin:0}.\[\&_\>_p\]\:text-md>p{font-size:var(--fs-md)}.\[\&_\>_p\]\:leading-normal>p{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.\[\&_\>_p\]\:text-muted>p{color:var(--muted)}.\[\&_\>_span\]\:inline-flex>span{display:inline-flex}.\[\&_\>_span\]\:items-center>span{align-items:center}.\[\&_\>_span\]\:gap-\[5px\]>span{gap:5px}.\[\&_\>_svg\]\:shrink-0>svg{flex-shrink:0}.\[\&_\>_svg\]\:text-muted>svg{color:var(--muted)}.\[\&_\>_svg\]\:text-subtext>svg{color:var(--subtext)}.\[\&_\>_svg\.file-tree-chevron\]\:text-muted>svg.file-tree-chevron{color:var(--muted)}.\[\&_a\]\:pointer-events-auto a{pointer-events:auto}.\[\&_a\]\:inline-flex a{display:inline-flex}.\[\&_a\]\:text-sm a{font-size:var(--fs-sm)}.\[\&_a\]\:whitespace-nowrap a{white-space:nowrap}.\[\&_a\]\:text-primary a{color:var(--primary)}.\[\&_a\]\:text-subtext a{color:var(--subtext)}.\[\&_a\:hover\]\:text-text a:hover{color:var(--text)}.\[\&_blockquote\]\:mx-0 blockquote{margin-inline:0}.\[\&_blockquote\]\:my-1\.5 blockquote{margin-block:calc(var(--spacing) * 1.5)}.\[\&_blockquote\]\:border-l-\[3px\] blockquote{border-left-style:var(--tw-border-style);border-left-width:3px}.\[\&_blockquote\]\:border-l-border blockquote{border-left-color:var(--border)}.\[\&_blockquote\]\:pt-0\.5 blockquote{padding-top:calc(var(--spacing) * .5)}.\[\&_blockquote\]\:pr-0 blockquote{padding-right:0}.\[\&_blockquote\]\:pb-0\.5 blockquote{padding-bottom:calc(var(--spacing) * .5)}.\[\&_blockquote\]\:pl-2\.5 blockquote{padding-left:calc(var(--spacing) * 2.5)}.\[\&_blockquote\]\:text-subtext blockquote{color:var(--subtext)}.\[\&_button\]\:absolute button{position:absolute}.\[\&_button\]\:-top-\[5px\] button{top:-5px}.\[\&_button\]\:-right-\[5px\] button{right:-5px}.\[\&_button\]\:-mb-px button{margin-bottom:-1px}.\[\&_button\]\:flex button{display:flex}.\[\&_button\]\:grid button{display:grid}.\[\&_button\]\:inline-flex button{display:inline-flex}.\[\&_button\]\:h-4 button{height:calc(var(--spacing) * 4)}.\[\&_button\]\:w-4 button{width:calc(var(--spacing) * 4)}.\[\&_button\]\:w-full button{width:100%}.\[\&_button\]\:cursor-pointer button{cursor:pointer}.\[\&_button\]\:grid-cols-\[18px_minmax\(0\,_1fr\)_auto_auto\] button{grid-template-columns:18px minmax(0,1fr) auto auto}.\[\&_button\]\:grid-cols-\[minmax\(72px\,_0\.7fr\)_minmax\(100px\,_1fr\)_minmax\(70px\,_0\.7fr\)_60px_16px\] button{grid-template-columns:minmax(72px,.7fr) minmax(100px,1fr) minmax(70px,.7fr) 60px 16px}.\[\&_button\]\:flex-col button{flex-direction:column}.\[\&_button\]\:items-center button{align-items:center}.\[\&_button\]\:items-start button{align-items:flex-start}.\[\&_button\]\:justify-center button{justify-content:center}.\[\&_button\]\:gap-0\.5 button{gap:calc(var(--spacing) * .5)}.\[\&_button\]\:gap-3\.5 button{gap:calc(var(--spacing) * 3.5)}.\[\&_button\]\:gap-\[7px\] button{gap:7px}.\[\&_button\]\:rounded-full button{border-radius:999px}.\[\&_button\]\:rounded-sm button{border-radius:6px}.\[\&_button\]\:rounded-xs button{border-radius:4px}.\[\&_button\]\:border button{border-style:var(--tw-border-style);border-width:1px}.\[\&_button\]\:border-0 button{border-style:var(--tw-border-style);border-width:0}.\[\&_button\]\:border-b button{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_button\]\:border-b-2 button{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.\[\&_button\]\:border-border button{border-color:var(--border)}.\[\&_button\]\:border-b-border-variant button{border-bottom-color:var(--border-variant)}.\[\&_button\]\:border-b-transparent button{border-bottom-color:#0000}.\[\&_button\]\:bg-surface button{background-color:var(--surface)}.\[\&_button\]\:bg-transparent button{background-color:#0000}.\[\&_button\]\:bg-none button{background-image:none}.\[\&_button\]\:p-0 button{padding:0}.\[\&_button\]\:p-0\.5 button{padding:calc(var(--spacing) * .5)}.\[\&_button\]\:px-0 button{padding-inline:0}.\[\&_button\]\:px-0\.5 button{padding-inline:calc(var(--spacing) * .5)}.\[\&_button\]\:px-2 button{padding-inline:calc(var(--spacing) * 2)}.\[\&_button\]\:px-2\.5 button{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_button\]\:px-3 button{padding-inline:calc(var(--spacing) * 3)}.\[\&_button\]\:px-\[9px\] button{padding-inline:9px}.\[\&_button\]\:py-0\.5 button{padding-block:calc(var(--spacing) * .5)}.\[\&_button\]\:py-2 button{padding-block:calc(var(--spacing) * 2)}.\[\&_button\]\:py-\[3px\] button{padding-block:3px}.\[\&_button\]\:py-\[7px\] button{padding-block:7px}.\[\&_button\]\:py-\[11px\] button{padding-block:11px}.\[\&_button\]\:text-left button{text-align:left}.\[\&_button\]\:text-md button{font-size:var(--fs-md)}.\[\&_button\]\:text-sm button{font-size:var(--fs-sm)}.\[\&_button\]\:text-xs button{font-size:var(--fs-xs)}.\[\&_button\]\:font-medium button{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_button\]\:font-semibold button{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_button\]\:text-muted button{color:var(--muted)}.\[\&_button\]\:text-text button{color:var(--text)}.\[\&_button\]\:\[font\:inherit\] button{font:inherit}.\[\&_button\.active\]\:border-b-primary button.active{border-bottom-color:var(--primary)}.\[\&_button\.active\]\:bg-background button.active{background-color:var(--base)}.\[\&_button\.active\]\:bg-surface button.active{background-color:var(--surface)}.\[\&_button\.active\]\:shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_25\%\,_transparent\)\] button.active{--tw-shadow:0 1px 3px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.\[\&_button\.active\]\:shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_25\%\,_transparent\)\] button.active{--tw-shadow:0 1px 3px var(--tw-shadow-color,color-mix(in oklab, var(--text) 25%, transparent))}}.\[\&_button\.active\]\:shadow-\[0_1px_3px_color-mix\(in_oklab\,_var\(--text\)_25\%\,_transparent\)\] button.active{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&_button\.active\]\:shadow-\[inset_2px_0_0_var\(--text\)\] button.active{--tw-shadow:inset 2px 0 0 var(--tw-shadow-color,var(--text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&_button\:disabled\]\:cursor-default button:disabled{cursor:default}.\[\&_button\:disabled\]\:text-muted button:disabled{color:var(--muted)}.\[\&_button\:disabled\]\:opacity-50 button:disabled{opacity:.5}.\[\&_button\:hover\]\:bg-\[var\(--surface-2\,_rgb\(0_0_0_\/_5\%\)\)\] button:hover{background-color:var(--surface-2,#0000000d)}.\[\&_button\:hover\]\:bg-panel button:hover{background-color:var(--panel)}.\[\&_button\:hover\]\:bg-surface button:hover{background-color:var(--surface)}.\[\&_button\:hover\]\:bg-text button:hover{background-color:var(--text)}.\[\&_button\:hover\]\:text-background button:hover{color:var(--base)}.\[\&_button\:hover\]\:text-text button:hover{color:var(--text)}.\[\&_button\:hover\]\:underline button:hover{text-decoration-line:underline}.\[\&_button\:hover\]\:underline-offset-2 button:hover{text-underline-offset:2px}.\[\&_button\:last-child\]\:border-b-0 button:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&_button\:not\(\:disabled\)\:hover\]\:text-text button:not(:disabled):hover{color:var(--text)}.\[\&_code\]\:min-w-0 code{min-width:0}.\[\&_code\]\:flex-1 code{flex:1}.\[\&_code\]\:overflow-hidden code{overflow:hidden}.\[\&_code\]\:rounded-xs code{border-radius:4px}.\[\&_code\]\:border code{border-style:var(--tw-border-style);border-width:1px}.\[\&_code\]\:border-border-variant code{border-color:var(--border-variant)}.\[\&_code\]\:bg-panel code{background-color:var(--panel)}.\[\&_code\]\:px-\[5px\] code{padding-inline:5px}.\[\&_code\]\:py-px code{padding-block:1px}.\[\&_code\]\:text-left code{text-align:left}.\[\&_code\]\:font-mono code{font-family:var(--mono)}.\[\&_code\]\:text-\[0\.9em\] code{font-size:.9em}.\[\&_code\]\:text-\[0\.92em\] code{font-size:.92em}.\[\&_code\]\:text-sm code{font-size:var(--fs-sm)}.\[\&_code\]\:text-xs code{font-size:var(--fs-xs)}.\[\&_code\]\:font-medium code{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_code\]\:text-ellipsis code{text-overflow:ellipsis}.\[\&_code\]\:whitespace-nowrap code{white-space:nowrap}.\[\&_code\]\:text-inherit code{color:inherit}.\[\&_code\]\:text-muted code{color:var(--muted)}.\[\&_code\]\:text-primary code{color:var(--primary)}.\[\&_code\]\:text-text code{color:var(--text)}.\[\&_code\]\:\[direction\:rtl\] code{direction:rtl}.\[\&_h1\]\:m-0 h1{margin:0}.\[\&_h1\]\:mx-0 h1{margin-inline:0}.\[\&_h1\]\:mt-0 h1{margin-top:0}.\[\&_h1\]\:mt-3 h1{margin-top:calc(var(--spacing) * 3)}.\[\&_h1\]\:mt-7 h1{margin-top:calc(var(--spacing) * 7)}.\[\&_h1\]\:mb-1\.5 h1{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_h1\]\:mb-3\.5 h1{margin-bottom:calc(var(--spacing) * 3.5)}.\[\&_h1\]\:text-3xl h1{font-size:var(--fs-3xl)}.\[\&_h1\]\:text-\[1\.05em\] h1{font-size:1.05em}.\[\&_h1\]\:text-\[2em\] h1{font-size:2em}.\[\&_h1\]\:text-\[22px\] h1{font-size:22px}.\[\&_h1\]\:leading-\[1\.18\] h1{--tw-leading:1.18;line-height:1.18}.\[\&_h1\]\:leading-tight h1{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.\[\&_h1\]\:font-semibold h1{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_h1\]\:text-text h1{color:var(--text)}.\[\&_h2\]\:m-0 h2{margin:0}.\[\&_h2\]\:mx-0 h2{margin-inline:0}.\[\&_h2\]\:mt-0 h2{margin-top:0}.\[\&_h2\]\:mt-3 h2{margin-top:calc(var(--spacing) * 3)}.\[\&_h2\]\:mt-7 h2{margin-top:calc(var(--spacing) * 7)}.\[\&_h2\]\:mb-1\.5 h2{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_h2\]\:mb-2\.5 h2{margin-bottom:calc(var(--spacing) * 2.5)}.\[\&_h2\]\:mb-3\.5 h2{margin-bottom:calc(var(--spacing) * 3.5)}.\[\&_h2\]\:flex h2{display:flex}.\[\&_h2\]\:items-center h2{align-items:center}.\[\&_h2\]\:gap-2 h2{gap:calc(var(--spacing) * 2)}.\[\&_h2\]\:text-2xl h2{font-size:var(--fs-2xl)}.\[\&_h2\]\:text-5xl h2{font-size:var(--fs-5xl)}.\[\&_h2\]\:text-\[1\.05em\] h2{font-size:1.05em}.\[\&_h2\]\:text-\[1\.5em\] h2{font-size:1.5em}.\[\&_h2\]\:text-lg h2{font-size:var(--fs-lg)}.\[\&_h2\]\:text-md h2{font-size:var(--fs-md)}.\[\&_h2\]\:text-xl h2{font-size:var(--fs-xl)}.\[\&_h2\]\:leading-tight h2{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.\[\&_h2\]\:font-medium h2{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_h2\]\:font-semibold h2{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_h2\]\:tracking-\[-0\.01em\] h2{--tw-tracking:-.01em;letter-spacing:-.01em}.\[\&_h2\]\:tracking-\[-0\.015em\] h2{--tw-tracking:-.015em;letter-spacing:-.015em}.\[\&_h2\]\:text-text h2{color:var(--text)}.\[\&_h3\]\:mx-0 h3{margin-inline:0}.\[\&_h3\]\:mt-0 h3{margin-top:0}.\[\&_h3\]\:mt-1\.5 h3{margin-top:calc(var(--spacing) * 1.5)}.\[\&_h3\]\:mt-3 h3{margin-top:calc(var(--spacing) * 3)}.\[\&_h3\]\:mt-5\.5 h3{margin-top:calc(var(--spacing) * 5.5)}.\[\&_h3\]\:mb-0 h3{margin-bottom:0}.\[\&_h3\]\:mb-1\.5 h3{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_h3\]\:mb-2 h3{margin-bottom:calc(var(--spacing) * 2)}.\[\&_h3\]\:mb-2\.5 h3{margin-bottom:calc(var(--spacing) * 2.5)}.\[\&_h3\]\:mb-3 h3{margin-bottom:calc(var(--spacing) * 3)}.\[\&_h3\]\:text-\[1\.2em\] h3{font-size:1.2em}.\[\&_h3\]\:text-\[1\.05em\] h3{font-size:1.05em}.\[\&_h3\]\:text-base h3{font-size:var(--fs-base)}.\[\&_h3\]\:text-sm h3{font-size:var(--fs-sm)}.\[\&_h3\]\:leading-\[1\.35\] h3{--tw-leading:1.35;line-height:1.35}.\[\&_h3\]\:font-semibold h3{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_h3\]\:text-text h3{color:var(--text)}.\[\&_h4\]\:mx-0 h4{margin-inline:0}.\[\&_h4\]\:mt-0 h4{margin-top:0}.\[\&_h4\]\:mt-3 h4{margin-top:calc(var(--spacing) * 3)}.\[\&_h4\]\:mt-4\.5 h4{margin-top:calc(var(--spacing) * 4.5)}.\[\&_h4\]\:mb-1 h4{margin-bottom:var(--spacing)}.\[\&_h4\]\:mb-1\.5 h4{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_h4\]\:text-\[1\.05em\] h4{font-size:1.05em}.\[\&_h4\]\:text-\[1em\] h4{font-size:1em}.\[\&_h4\]\:text-md h4{font-size:var(--fs-md)}.\[\&_h4\]\:leading-\[1\.4\] h4{--tw-leading:1.4;line-height:1.4}.\[\&_h4\]\:font-semibold h4{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_h4\]\:text-accent-amber h4{color:var(--accent-amber)}.\[\&_h4\]\:text-text h4{color:var(--text)}.\[\&_img\]\:block img{display:block}.\[\&_img\]\:h-13 img{height:calc(var(--spacing) * 13)}.\[\&_img\]\:h-auto img{height:auto}.\[\&_img\]\:max-h-40 img{max-height:calc(var(--spacing) * 40)}.\[\&_img\]\:w-13 img{width:calc(var(--spacing) * 13)}.\[\&_img\]\:max-w-55 img{max-width:calc(var(--spacing) * 55)}.\[\&_img\]\:max-w-full img{max-width:100%}.\[\&_img\]\:rounded-sm img{border-radius:6px}.\[\&_img\]\:rounded-xs img{border-radius:4px}.\[\&_img\]\:border img{border-style:var(--tw-border-style);border-width:1px}.\[\&_img\]\:border-border img{border-color:var(--border)}.\[\&_img\]\:border-border-variant img{border-color:var(--border-variant)}.\[\&_img\]\:object-cover img{object-fit:cover}.\[\&_input\]\:m-0 input{margin:0}.\[\&_input\]\:w-full input{width:100%}.\[\&_input\]\:min-w-55 input{min-width:calc(var(--spacing) * 55)}.\[\&_input\]\:flex-1 input{flex:1}.\[\&_input\]\:rounded-none input{border-radius:0}.\[\&_input\]\:border-0 input{border-style:var(--tw-border-style);border-width:0}.\[\&_input\]\:border-b input{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_input\]\:border-b-border-variant input{border-bottom-color:var(--border-variant)}.\[\&_input\]\:bg-transparent input{background-color:#0000}.\[\&_input\]\:bg-none input{background-image:none}.\[\&_input\]\:p-0 input{padding:0}.\[\&_input\]\:px-2\.5 input{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_input\]\:py-2 input{padding-block:calc(var(--spacing) * 2)}.\[\&_input\]\:font-mono input{font-family:var(--mono)}.\[\&_input\]\:text-sm input{font-size:var(--fs-sm)}.\[\&_input\]\:outline-none input{--tw-outline-style:none;outline-style:none}.\[\&_input\:focus\]\:shadow-\[0_1px_0_0_var\(--text\)\] input:focus{--tw-shadow:0 1px 0 0 var(--tw-shadow-color,var(--text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&_label\]\:flex label{display:flex}.\[\&_label\]\:max-w-80 label{max-width:calc(var(--spacing) * 80)}.\[\&_label\]\:flex-col label{flex-direction:column}.\[\&_label\]\:gap-1 label{gap:var(--spacing)}.\[\&_label\]\:text-xs label{font-size:var(--fs-xs)}.\[\&_label\]\:font-medium label{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_label\]\:text-text label{color:var(--text)}.\[\&_legend\]\:mb-1\.5 legend{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_legend\]\:text-base legend{font-size:var(--fs-base)}.\[\&_legend\]\:font-semibold legend{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_li\:\:marker\]\:text-primary li::marker{color:var(--primary)}.\[\&_ol\]\:mx-0 ol{margin-inline:0}.\[\&_ol\]\:my-1\.5 ol{margin-block:calc(var(--spacing) * 1.5)}.\[\&_ol\]\:pl-5\.5 ol{padding-left:calc(var(--spacing) * 5.5)}.\[\&_p\]\:m-0 p{margin:0}.\[\&_p\]\:mx-0 p{margin-inline:0}.\[\&_p\]\:my-2\.5 p{margin-block:calc(var(--spacing) * 2.5)}.\[\&_p\]\:mt-\[3px\] p{margin-top:3px}.\[\&_p\]\:mb-0 p{margin-bottom:0}.\[\&_p\]\:max-w-80 p{max-width:calc(var(--spacing) * 80)}.\[\&_p\]\:max-w-105 p{max-width:calc(var(--spacing) * 105)}.\[\&_p\]\:max-w-\[46ch\] p{max-width:46ch}.\[\&_p\]\:text-2xl p{font-size:var(--fs-2xl)}.\[\&_p\]\:text-md p{font-size:var(--fs-md)}.\[\&_p\]\:text-sm p{font-size:var(--fs-sm)}.\[\&_p\]\:leading-\[1\.55\] p{--tw-leading:1.55;line-height:1.55}.\[\&_p\]\:leading-normal p{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.\[\&_p\]\:text-balance p{text-wrap:balance}.\[\&_p\]\:text-muted p{color:var(--muted)}.\[\&_p\]\:text-subtext p{color:var(--subtext)}.\[\&_p_\+_p\]\:mt-3 p+p{margin-top:calc(var(--spacing) * 3)}.\[\&_p\.empty-state-hint\]\:text-lg p.empty-state-hint{font-size:var(--fs-lg)}.\[\&_p\.empty-state-hint\]\:text-subtext p.empty-state-hint{color:var(--subtext)}.\[\&_p\.empty-state-title\]\:text-2xl p.empty-state-title{font-size:var(--fs-2xl)}.\[\&_p\.empty-state-title\]\:font-normal p.empty-state-title{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_p\.empty-state-title\]\:text-text p.empty-state-title{color:var(--text)}.\[\&_pre\]\:m-0 pre{margin:0}.\[\&_pre\]\:overflow-x-auto pre{overflow-x:auto}.\[\&_pre\]\:rounded-md pre{border-radius:8px}.\[\&_pre\]\:border pre{border-style:var(--tw-border-style);border-width:1px}.\[\&_pre\]\:border-\[color-mix\(in_oklab\,_var\(--border\)_50\%\,_transparent\)\] pre{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.\[\&_pre\]\:border-\[color-mix\(in_oklab\,_var\(--border\)_50\%\,_transparent\)\] pre{border-color:color-mix(in oklab,var(--border) 50%,transparent)}}.\[\&_pre\]\:bg-surface pre{background-color:var(--surface)}.\[\&_pre\]\:px-3 pre{padding-inline:calc(var(--spacing) * 3)}.\[\&_pre\]\:py-2 pre{padding-block:calc(var(--spacing) * 2)}.\[\&_pre\]\:text-sm pre{font-size:var(--fs-sm)}.\[\&_pre\]\:text-text pre{color:var(--text)}.\[\&_pre_code\]\:border-0 pre code{border-style:var(--tw-border-style);border-width:0}.\[\&_pre_code\]\:bg-transparent pre code{background-color:#0000}.\[\&_pre_code\]\:bg-none pre code{background-image:none}.\[\&_pre_code\]\:p-0 pre code{padding:0}.\[\&_pre_code\]\:font-normal pre code{--tw-font-weight:var(--fw-regular);font-weight:var(--fw-regular)}.\[\&_pre_code\]\:text-inherit pre code{color:inherit}.\[\&_span\]\:absolute span{position:absolute}.\[\&_span\]\:top-\[3px\] span{top:3px}.\[\&_span\]\:left-\[3px\] span{left:3px}.\[\&_span\]\:h-3\.5 span{height:calc(var(--spacing) * 3.5)}.\[\&_span\]\:w-3\.5 span{width:calc(var(--spacing) * 3.5)}.\[\&_span\]\:overflow-hidden span{overflow:hidden}.\[\&_span\]\:rounded-full span{border-radius:999px}.\[\&_span\]\:bg-muted span{background-color:var(--muted)}.\[\&_span\]\:text-ellipsis span{text-overflow:ellipsis}.\[\&_span\]\:whitespace-nowrap span{white-space:nowrap}.\[\&_span\]\:transition-\[translate\,background\] span{transition-property:translate,background;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_span\]\:duration-120 span{--tw-duration:.12s;transition-duration:.12s}.\[\&_span\]\:ease-standard span{--tw-ease:ease;transition-timing-function:ease}.\[\&_strong\]\:font-medium strong{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_strong\]\:font-semibold strong{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_strong\]\:text-accent-amber strong{color:var(--accent-amber)}.\[\&_strong\]\:text-text strong{color:var(--text)}.\[\&_summary\]\:flex summary{display:flex}.\[\&_summary\]\:w-fit summary{width:fit-content}.\[\&_summary\]\:max-w-full summary{max-width:100%}.\[\&_summary\]\:cursor-pointer summary{cursor:pointer}.\[\&_summary\]\:list-none summary{list-style-type:none}.\[\&_summary\]\:items-center summary{align-items:center}.\[\&_summary\]\:gap-2 summary{gap:calc(var(--spacing) * 2)}.\[\&_summary\]\:rounded-sm summary{border-radius:6px}.\[\&_summary\]\:px-1 summary{padding-inline:var(--spacing)}.\[\&_summary\]\:py-\[3px\] summary{padding-block:3px}.\[\&_summary\]\:select-none summary{-webkit-user-select:none;user-select:none}.\[\&_summary_\.plan-chevron\]\:transition-transform summary .plan-chevron{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_summary_\.plan-chevron\]\:duration-120 summary .plan-chevron{--tw-duration:.12s;transition-duration:.12s}.\[\&_summary_\.plan-chevron\]\:ease-standard summary .plan-chevron{--tw-ease:ease;transition-timing-function:ease}.\[\&_summary\:\:-webkit-details-marker\]\:hidden summary::-webkit-details-marker{display:none}.\[\&_summary\:\:after\]\:text-muted summary:after{color:var(--muted)}.\[\&_summary\:\:after\]\:transition-transform summary:after{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\[\&_summary\:\:after\]\:duration-80 summary:after{--tw-duration:80ms;transition-duration:80ms}.\[\&_summary\:\:after\]\:ease-standard summary:after{--tw-ease:ease;transition-timing-function:ease}.\[\&_summary\:\:after\]\:content-\[\'›\'\] summary:after{--tw-content:"›";content:var(--tw-content)}.\[\&_summary\:hover\]\:bg-surface summary:hover{background-color:var(--surface)}.\[\&_svg\]\:mt-px svg{margin-top:1px}.\[\&_svg\]\:block svg{display:block}.\[\&_svg\]\:h-\[1em\] svg{height:1em}.\[\&_svg\]\:h-full svg{height:100%}.\[\&_svg\]\:w-\[1em\] svg{width:1em}.\[\&_svg\]\:w-full svg{width:100%}.\[\&_svg\]\:flex-none svg{flex:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\]\:text-muted svg{color:var(--muted)}.\[\&_table\]\:mx-0 table{margin-inline:0}.\[\&_table\]\:my-2\.5 table{margin-block:calc(var(--spacing) * 2.5)}.\[\&_table\]\:block table{display:block}.\[\&_table\]\:w-max table{width:max-content}.\[\&_table\]\:max-w-full table{max-width:100%}.\[\&_table\]\:border-collapse table{border-collapse:collapse}.\[\&_table\]\:overflow-x-auto table{overflow-x:auto}.\[\&_table\]\:rounded-md table{border-radius:8px}.\[\&_table\]\:border table{border-style:var(--tw-border-style);border-width:1px}.\[\&_table\]\:border-border table{border-color:var(--border)}.\[\&_table\]\:text-md table{font-size:var(--fs-md)}.\[\&_tbody_tr\:hover_td\]\:bg-surface-bright tbody tr:hover td{background-color:var(--surface-bright)}.\[\&_td\]\:h-9 td{height:calc(var(--spacing) * 9)}.\[\&_td\]\:border-b td{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_td\]\:border-b-\[color-mix\(in_oklab\,_var\(--text\)_6\%\,_transparent\)\] td{border-bottom-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_td\]\:border-b-\[color-mix\(in_oklab\,_var\(--text\)_6\%\,_transparent\)\] td{border-bottom-color:color-mix(in oklab,var(--text) 6%,transparent)}}.\[\&_td\]\:border-b-border-variant td{border-bottom-color:var(--border-variant)}.\[\&_td\]\:px-3 td{padding-inline:calc(var(--spacing) * 3)}.\[\&_td\]\:px-3\.5 td{padding-inline:calc(var(--spacing) * 3.5)}.\[\&_td\]\:py-2 td{padding-block:calc(var(--spacing) * 2)}.\[\&_td\]\:pt-0 td{padding-top:0}.\[\&_td\]\:pt-\[5px\] td{padding-top:5px}.\[\&_td\]\:pr-2\.5 td{padding-right:calc(var(--spacing) * 2.5)}.\[\&_td\]\:pb-0 td{padding-bottom:0}.\[\&_td\]\:pb-\[5px\] td{padding-bottom:5px}.\[\&_td\]\:pl-0 td{padding-left:0}.\[\&_td\]\:text-left td{text-align:left}.\[\&_td\]\:align-middle td{vertical-align:middle}.\[\&_td\]\:break-normal td{overflow-wrap:normal;word-break:normal}.\[\&_td\]\:break-words td{overflow-wrap:break-word}.\[\&_td\]\:wrap-anywhere td{overflow-wrap:anywhere}.\[\&_td\]\:whitespace-nowrap td{white-space:nowrap}.\[\&_td\]\:text-text td{color:var(--text)}.\[\&_td\:first-child\]\:w-\[32\%\] td:first-child{width:32%}.\[\&_td\:first-child\]\:wrap-anywhere td:first-child{overflow-wrap:anywhere}.\[\&_td\:last-child\]\:w-29 td:last-child{width:calc(var(--spacing) * 29)}.\[\&_td\:last-child\]\:pr-0 td:last-child{padding-right:0}.\[\&_td\:last-child\]\:text-right td:last-child{text-align:right}.\[\&_td\:last-child\]\:whitespace-nowrap td:last-child{white-space:nowrap}.\[\&_td\[colspan\]\]\:text-left td[colspan]{text-align:left}.\[\&_td\[colspan\]\]\:whitespace-normal td[colspan]{white-space:normal}.\[\&_textarea\]\:field-sizing-content textarea{field-sizing:content}.\[\&_textarea\]\:max-h-45 textarea{max-height:calc(var(--spacing) * 45)}.\[\&_textarea\]\:min-h-18 textarea{min-height:calc(var(--spacing) * 18)}.\[\&_textarea\]\:flex-1 textarea{flex:1}.\[\&_textarea\]\:resize-none textarea{resize:none}.\[\&_textarea\]\:border-0 textarea{border-style:var(--tw-border-style);border-width:0}.\[\&_textarea\]\:bg-transparent textarea{background-color:#0000}.\[\&_textarea\]\:bg-none textarea{background-image:none}.\[\&_textarea\]\:px-3 textarea{padding-inline:calc(var(--spacing) * 3)}.\[\&_textarea\]\:pt-2\.5 textarea{padding-top:calc(var(--spacing) * 2.5)}.\[\&_textarea\]\:pb-1 textarea{padding-bottom:var(--spacing)}.\[\&_textarea\]\:text-base textarea{font-size:var(--fs-base)}.\[\&_th\]\:sticky th{position:sticky}.\[\&_th\]\:top-0 th{top:0}.\[\&_th\]\:z-1 th{z-index:1}.\[\&_th\]\:border-b th{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_th\]\:border-b-border th{border-bottom-color:var(--border)}.\[\&_th\]\:border-b-border-variant th{border-bottom-color:var(--border-variant)}.\[\&_th\]\:bg-background th{background-color:var(--base)}.\[\&_th\]\:px-3 th{padding-inline:calc(var(--spacing) * 3)}.\[\&_th\]\:px-3\.5 th{padding-inline:calc(var(--spacing) * 3.5)}.\[\&_th\]\:py-2 th{padding-block:calc(var(--spacing) * 2)}.\[\&_th\]\:pt-\[5px\] th{padding-top:5px}.\[\&_th\]\:pr-2\.5 th{padding-right:calc(var(--spacing) * 2.5)}.\[\&_th\]\:pb-\[5px\] th{padding-bottom:5px}.\[\&_th\]\:pl-0 th{padding-left:0}.\[\&_th\]\:text-left th{text-align:left}.\[\&_th\]\:text-xs th{font-size:var(--fs-xs)}.\[\&_th\]\:font-medium th{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_th\]\:font-semibold th{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&_th\]\:break-normal th{overflow-wrap:normal;word-break:normal}.\[\&_th\]\:break-words th{overflow-wrap:break-word}.\[\&_th\]\:text-text th{color:var(--text)}.\[\&_th\:nth-child\(1\)\]\:w-\[20\%\] th:first-child{width:20%}.\[\&_th\:nth-child\(2\)\]\:w-\[26\%\] th:nth-child(2){width:26%}.\[\&_th\:nth-child\(4\)\]\:w-27 th:nth-child(4){width:calc(var(--spacing) * 27)}.\[\&_th\:nth-child\(5\)\]\:w-13 th:nth-child(5){width:calc(var(--spacing) * 13)}.\[\&_thead_th\]\:border-b thead th{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_thead_th\]\:border-b-border thead th{border-bottom-color:var(--border)}.\[\&_thead_th\]\:bg-surface thead th{background-color:var(--surface)}.\[\&_thead_th\]\:font-medium thead th{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&_thead_th\]\:text-text thead th{color:var(--text)}.\[\&_tr\.clickable\]\:cursor-pointer tr.clickable{cursor:pointer}.\[\&_tr\.clickable\:hover_td\]\:bg-canvas tr.clickable:hover td{background-color:var(--canvas)}.\[\&_tr\:last-child_td\]\:border-b-0 tr:last-child td{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&_ul\]\:mx-0 ul{margin-inline:0}.\[\&_ul\]\:my-1\.5 ul{margin-block:calc(var(--spacing) * 1.5)}.\[\&_ul\]\:pl-5\.5 ul{padding-left:calc(var(--spacing) * 5.5)}.\[\&\+\&\]\:border-t+.\[\&\+\&\]\:border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&\+\&\]\:border-border-variant+.\[\&\+\&\]\:border-border-variant{border-color:var(--border-variant)}.\[\&\.active\]\:border-border.active{border-color:var(--border)}.\[\&\.active\]\:bg-background.active{background-color:var(--base)}.\[\&\.active\]\:bg-panel.active{background-color:var(--panel)}.\[\&\.active\]\:bg-surface.active{background-color:var(--surface)}.\[\&\.active\]\:font-medium.active{--tw-font-weight:var(--fw-medium);font-weight:var(--fw-medium)}.\[\&\.active\]\:font-semibold.active{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&\.active\]\:text-primary.active{color:var(--primary)}.\[\&\.active\]\:text-text.active{color:var(--text)}.\[\&\.active\:\:after\]\:absolute.active:after{position:absolute}.\[\&\.active\:\:after\]\:right-0.active:after{right:0}.\[\&\.active\:\:after\]\:-bottom-px.active:after{bottom:-1px}.\[\&\.active\:\:after\]\:left-0.active:after{left:0}.\[\&\.active\:\:after\]\:h-px.active:after{height:1px}.\[\&\.active\:\:after\]\:bg-background.active:after{background-color:var(--base)}.\[\&\.active\:\:after\]\:content-\[\'\'\].active:after{--tw-content:"";content:var(--tw-content)}.\[\&\.align-right\]\:right-0.align-right{right:0}.\[\&\.align-right\]\:left-auto.align-right{left:auto}.\[\&\.approved\]\:text-accent-green.approved{color:var(--accent-green)}.\[\&\.approved\:\:before\]\:content-\[\'✓_\'\].approved:before{--tw-content:"✓ ";content:var(--tw-content)}.\[\&\.archive\]\:text-accent-amber.archive{color:var(--accent-amber)}.\[\&\.awaiting\]\:italic.awaiting{font-style:italic}.\[\&\.blue_svg\]\:text-accent-blue.blue svg{color:var(--accent-blue)}.\[\&\.chosen\]\:text-accent-green.chosen{color:var(--accent-green)}.\[\&\.chosen\:\:before\]\:content-\[\'✓_\'\].chosen:before{--tw-content:"✓ ";content:var(--tw-content)}.\[\&\.clamped\]\:relative.clamped{position:relative}.\[\&\.clamped\]\:max-h-\[9\.5em\].clamped{max-height:9.5em}.\[\&\.clamped\]\:overflow-hidden.clamped{overflow:hidden}.\[\&\.clamped\:\:after\]\:pointer-events-none.clamped:after{pointer-events:none}.\[\&\.clamped\:\:after\]\:absolute.clamped:after{position:absolute}.\[\&\.clamped\:\:after\]\:inset-x-0.clamped:after{inset-inline:0}.\[\&\.clamped\:\:after\]\:top-auto.clamped:after{top:auto}.\[\&\.clamped\:\:after\]\:bottom-0.clamped:after{bottom:0}.\[\&\.clamped\:\:after\]\:h-8\.5.clamped:after{height:calc(var(--spacing) * 8.5)}.\[\&\.clamped\:\:after\]\:bg-\[linear-gradient\(to_bottom\,_transparent\,_var\(--surface\)\)\].clamped:after{background-image:linear-gradient(to bottom,transparent,var(--surface))}.\[\&\.clamped\:\:after\]\:content-\[\'\'\].clamped:after{--tw-content:"";content:var(--tw-content)}.\[\&\.closable\]\:max-w-60.closable{max-width:calc(var(--spacing) * 60)}.\[\&\.closable\]\:pr-0\.5.closable{padding-right:calc(var(--spacing) * .5)}.\[\&\.code\]\:text-accent-orange.code{color:var(--accent-orange)}.\[\&\.context-ring\]\:mr-2.context-ring{margin-right:calc(var(--spacing) * 2)}.\[\&\.context-ring\]\:inline-flex.context-ring{display:inline-flex}.\[\&\.context-ring\]\:items-center.context-ring{align-items:center}.\[\&\.danger\]\:border-\[color-mix\(in_oklab\,_var\(--accent-red\)_42\%\,_var\(--border\)\)\].danger{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.danger\]\:border-\[color-mix\(in_oklab\,_var\(--accent-red\)_42\%\,_var\(--border\)\)\].danger{border-color:color-mix(in oklab,var(--accent-red) 42%,var(--border))}}.\[\&\.danger\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_6\%\,_var\(--base\)\)\].danger{background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.danger\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_6\%\,_var\(--base\)\)\].danger{background-color:color-mix(in oklab,var(--accent-red) 6%,var(--base))}}.\[\&\.danger\]\:text-accent-red.danger{color:var(--accent-red)}.\[\&\.danger\:active\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_14\%\,_transparent\)\].danger:active:not(:disabled){background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.danger\:active\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_14\%\,_transparent\)\].danger:active:not(:disabled){background-color:color-mix(in oklab,var(--accent-red) 14%,transparent)}}.\[\&\.danger\:hover\]\:text-accent-red.danger:hover{color:var(--accent-red)}.\[\&\.danger\:hover\:not\(\:disabled\)\]\:border-accent-red.danger:hover:not(:disabled){border-color:var(--accent-red)}.\[\&\.danger\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_8\%\,_transparent\)\].danger:hover:not(:disabled){background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.danger\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_8\%\,_transparent\)\].danger:hover:not(:disabled){background-color:color-mix(in oklab,var(--accent-red) 8%,transparent)}}.\[\&\.danger\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_10\%\,_var\(--base\)\)\].danger:hover:not(:disabled){background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.danger\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--accent-red\)_10\%\,_var\(--base\)\)\].danger:hover:not(:disabled){background-color:color-mix(in oklab,var(--accent-red) 10%,var(--base))}}.\[\&\.disabled\]\:opacity-52.disabled{opacity:.52}.\[\&\.disabled_\.compute-row-head\]\:cursor-default.disabled .compute-row-head{cursor:default}.\[\&\.doc\]\:px-7.doc{padding-inline:calc(var(--spacing) * 7)}.\[\&\.doc\]\:pt-4\.5.doc{padding-top:calc(var(--spacing) * 4.5)}.\[\&\.doc\]\:pb-12.doc{padding-bottom:calc(var(--spacing) * 12)}.\[\&\.doc_\.artifact-md\]\:mx-auto.doc .artifact-md{margin-inline:auto}.\[\&\.doc_\.artifact-md\]\:my-0.doc .artifact-md{margin-block:0}.\[\&\.doc_\.artifact-md\]\:max-w-readable.doc .artifact-md{max-width:var(--readable-col)}.\[\&\.document\]\:text-subtext.document{color:var(--subtext)}.\[\&\.drop-down\]\:top-\[calc\(100\%_\+_4px\)\].drop-down{top:calc(100% + 4px)}.\[\&\.drop-down\]\:bottom-auto.drop-down{bottom:auto}.\[\&\.editing\]\:cursor-default.editing{cursor:default}.\[\&\.editing\]\:bg-surface.editing{background-color:var(--surface)}.\[\&\.editing_\.session-menu-btn\]\:hidden.editing .session-menu-btn,.\[\&\.editing_\.session-time\]\:hidden.editing .session-time{display:none}.\[\&\.err\]\:border-accent-red.err{border-color:var(--accent-red)}.\[\&\.err\]\:bg-accent-red.err{background-color:var(--accent-red)}.\[\&\.err\]\:bg-accent-red-subtle.err{background-color:var(--accent-red-subtle)}.\[\&\.err\]\:text-accent-red.err{color:var(--accent-red)}.\[\&\.expanded_\.diff-file-header\]\:border-b.expanded .diff-file-header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&\.expanded_\.diff-file-header\]\:border-b-border.expanded .diff-file-header{border-bottom-color:var(--border)}.\[\&\.fail\]\:border-\[1\.5px\].fail{border-style:var(--tw-border-style);border-width:1.5px}.\[\&\.fail\]\:border-\[color-mix\(in_oklab\,_var\(--accent-red\)_55\%\,_transparent\)\].fail{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.fail\]\:border-\[color-mix\(in_oklab\,_var\(--accent-red\)_55\%\,_transparent\)\].fail{border-color:color-mix(in oklab,var(--accent-red) 55%,transparent)}}.\[\&\.failed\]\:text-accent-red.failed{color:var(--accent-red)}.\[\&\.ghost\]\:border-transparent.ghost{border-color:#0000}.\[\&\.ghost\]\:text-text.ghost{color:var(--text)}.\[\&\.ghost\:hover\:not\(\:disabled\)\]\:bg-surface.ghost:hover:not(:disabled){background-color:var(--surface)}.\[\&\.ghost\:hover\:not\(\:disabled\)\]\:text-text.ghost:hover:not(:disabled){color:var(--text)}.\[\&\.green_svg\]\:text-accent-green.green svg{color:var(--accent-green)}.\[\&\.image\]\:text-accent-purple.image{color:var(--accent-purple)}.\[\&\.live\]\:animate-\[or-pulse_1\.2s_ease-in-out_infinite\].live{animation:1.2s ease-in-out infinite or-pulse}.\[\&\.live\]\:border-accent-teal.live{border-color:var(--accent-teal)}.\[\&\.live\]\:bg-accent-teal.live{background-color:var(--accent-teal)}.\[\&\.live\]\:shadow-\[0_2px_12px_rgba\(32\,_154\,_132\,_0\.2\)\].live{--tw-shadow:0 2px 12px var(--tw-shadow-color,#209a8433);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&\.live_\.dot\]\:animate-\[or-pulse_1\.2s_ease-in-out_infinite\].live .dot{animation:1.2s ease-in-out infinite or-pulse}.\[\&\.markdown\]\:text-accent-blue.markdown{color:var(--accent-blue)}.\[\&\.max\]\:fixed.max{position:fixed}.\[\&\.max\]\:inset-2\.5.max{inset:calc(var(--spacing) * 2.5)}.\[\&\.max\]\:z-60.max{z-index:60}.\[\&\.max\]\:m-0.max{margin:0}.\[\&\.max\]\:shadow-\[0_12px_40px_color-mix\(in_oklab\,_var\(--text\)_22\%\,_transparent\)\].max{--tw-shadow:0 12px 40px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.\[\&\.max\]\:shadow-\[0_12px_40px_color-mix\(in_oklab\,_var\(--text\)_22\%\,_transparent\)\].max{--tw-shadow:0 12px 40px var(--tw-shadow-color,color-mix(in oklab, var(--text) 22%, transparent))}}.\[\&\.max\]\:shadow-\[0_12px_40px_color-mix\(in_oklab\,_var\(--text\)_22\%\,_transparent\)\].max{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&\.menu-open_\.session-menu-btn\]\:inline-flex.menu-open .session-menu-btn{display:inline-flex}.\[\&\.menu-open_\.session-time\]\:hidden.menu-open .session-time{display:none}.\[\&\.muted\]\:text-muted.muted{color:var(--muted)}.\[\&\.ok\]\:border-accent-green.ok{border-color:var(--accent-green)}.\[\&\.ok\]\:bg-accent-green.ok{background-color:var(--accent-green)}.\[\&\.ok\]\:bg-accent-green-subtle.ok{background-color:var(--accent-green-subtle)}.\[\&\.ok\]\:text-accent-green.ok{color:var(--accent-green)}.\[\&\.on\]\:border-primary.on{border-color:var(--primary)}.\[\&\.on\]\:bg-primary.on{background-color:var(--primary)}.\[\&\.on\]\:text-background.on{color:var(--base)}.\[\&\.on_span\]\:translate-x-4.on span{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\.on_span\]\:bg-background.on span{background-color:var(--base)}.\[\&\.open\]\:rotate-90.open{rotate:90deg}.\[\&\.open_\.compute-row-head\:hover\]\:rounded-\[var\(--radius-lg\)_var\(--radius-lg\)_0_0\].open .compute-row-head:hover{border-radius:var(--radius-lg) var(--radius-lg) 0 0}.\[\&\.orange_svg\]\:text-accent-orange.orange svg{color:var(--accent-orange)}.\[\&\.other\]\:border-\[1\.5px\].other{border-style:var(--tw-border-style);border-width:1.5px}.\[\&\.other\]\:border-border.other{border-color:var(--border)}.\[\&\.pass\]\:bg-accent-green.pass{background-color:var(--accent-green)}.\[\&\.pdf\]\:text-accent-red.pdf{color:var(--accent-red)}.\[\&\.permission\]\:border-l-accent-amber.permission{border-left-color:var(--accent-amber)}.\[\&\.plan\]\:border-l-accent-blue.plan{border-left-color:var(--accent-blue)}.\[\&\.primary\]\:border-primary.primary{border-color:var(--primary)}.\[\&\.primary\]\:bg-primary.primary{background-color:var(--primary)}.\[\&\.primary\]\:text-background.primary{color:var(--base)}.\[\&\.primary\:active\:not\(\:disabled\)\]\:border-\[color-mix\(in_oklab\,_var\(--primary\)_80\%\,_var\(--text\)\)\].primary:active:not(:disabled){border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\.primary\:active\:not\(\:disabled\)\]\:border-\[color-mix\(in_oklab\,_var\(--primary\)_80\%\,_var\(--text\)\)\].primary:active:not(:disabled){border-color:color-mix(in oklab,var(--primary) 80%,var(--text))}}.\[\&\.primary\:active\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_80\%\,_var\(--text\)\)\].primary:active:not(:disabled){background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\.primary\:active\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_80\%\,_var\(--text\)\)\].primary:active:not(:disabled){background-color:color-mix(in oklab,var(--primary) 80%,var(--text))}}.\[\&\.primary\:hover\:not\(\:disabled\)\]\:border-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\].primary:hover:not(:disabled){border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\.primary\:hover\:not\(\:disabled\)\]\:border-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\].primary:hover:not(:disabled){border-color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.\[\&\.primary\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\].primary:hover:not(:disabled){background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\.primary\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\].primary:hover:not(:disabled){background-color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.\[\&\.purple_svg\]\:text-accent-purple.purple svg{color:var(--accent-purple)}.\[\&\.question\]\:border-l-accent-purple.question{border-left-color:var(--accent-purple)}.\[\&\.rail-hidden\]\:max-w-none.rail-hidden{max-width:none}.\[\&\.rail-hidden\]\:px-0\.5.rail-hidden{padding-inline:calc(var(--spacing) * .5)}.\[\&\.rail-hidden\]\:py-0.rail-hidden{padding-block:0}.\[\&\.readonly\]\:opacity-60.readonly{opacity:.6}.\[\&\.rejected\]\:text-accent-amber.rejected,.\[\&\.revised\]\:text-accent-amber.revised{color:var(--accent-amber)}.\[\&\.sel\]\:border-primary.sel{border-color:var(--primary)}.\[\&\.sel\]\:bg-primary-subtle.sel{background-color:var(--primary-subtle)}.\[\&\.selected\]\:border-accent.selected{border-color:var(--accent)}.\[\&\.selected\]\:bg-panel.selected{background-color:var(--panel)}.\[\&\.selected\]\:shadow-\[0_0_0_1px_var\(--accent\)\].selected{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--accent));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&\.selected\:hover\]\:bg-panel.selected:hover{background-color:var(--panel)}.\[\&\.session-menu\]\:top-\[calc\(100\%_-_2px\)\].session-menu{top:calc(100% - 2px)}.\[\&\.session-menu\]\:right-1\.5.session-menu{right:calc(var(--spacing) * 1.5)}.\[\&\.session-menu\]\:left-auto.session-menu{left:auto}.\[\&\.session-menu\]\:min-w-35.session-menu{min-width:calc(var(--spacing) * 35)}.\[\&\.sm\]\:rounded-sm.sm{border-radius:6px}.\[\&\.sm\]\:px-\[9px\].sm{padding-inline:9px}.\[\&\.sm\]\:py-\[3px\].sm{padding-block:3px}.\[\&\.sm\]\:text-xs.sm{font-size:var(--fs-xs)}.\[\&\.spreadsheet\]\:text-accent-green.spreadsheet{color:var(--accent-green)}.\[\&\.st-cancelled_\.dot\]\:text-accent-orange.st-cancelled .dot,.\[\&\.st-cancelling_\.dot\]\:text-accent-orange.st-cancelling .dot{color:var(--accent-orange)}.\[\&\.st-done_\.dot\]\:text-accent-green.st-done .dot,.\[\&\.st-done_\>_svg\]\:text-accent-green.st-done>svg{color:var(--accent-green)}.\[\&\.st-editing_\.dot\]\:text-accent-purple.st-editing .dot{color:var(--accent-purple)}.\[\&\.st-failed_\.dot\]\:text-accent-red.st-failed .dot{color:var(--accent-red)}.\[\&\.st-idle_\.dot\]\:text-muted.st-idle .dot{color:var(--muted)}.\[\&\.st-running_\.dot\]\:text-accent-teal.st-running .dot{color:var(--accent-teal)}.\[\&\.st-starting_\.dot\]\:text-accent-amber.st-starting .dot{color:var(--accent-amber)}.\[\&\.status-add\]\:text-accent-green.status-add{color:var(--accent-green)}.\[\&\.status-copy\]\:text-accent-blue.status-copy{color:var(--accent-blue)}.\[\&\.status-delete\]\:text-accent-red.status-delete{color:var(--accent-red)}.\[\&\.status-rename\]\:text-accent-blue.status-rename{color:var(--accent-blue)}.\[\&\.stop\]\:bg-surface.stop{background-color:var(--surface)}.\[\&\.stop\]\:text-text.stop{color:var(--text)}.\[\&\.stop\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--surface\)_88\%\,_var\(--text\)\)\].stop:hover:not(:disabled){background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.\[\&\.stop\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--surface\)_88\%\,_var\(--text\)\)\].stop:hover:not(:disabled){background-color:color-mix(in oklab,var(--surface) 88%,var(--text))}}.\[\&\.unread_\.session-title\]\:font-semibold.unread .session-title{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.\[\&\.warn\]\:border-accent-amber.warn{border-color:var(--accent-amber)}.\[\&\.warn\]\:bg-accent-amber.warn{background-color:var(--accent-amber)}.\[\&\.warn\]\:bg-accent-amber-subtle.warn{background-color:var(--accent-amber-subtle)}.\[\&\.warn\]\:text-accent-amber.warn{color:var(--accent-amber)}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}.\[\&\:\:after\]\:absolute:after{position:absolute}.\[\&\:\:after\]\:top-full:after{top:100%}.\[\&\:\:after\]\:right-0:after{right:0}.\[\&\:\:after\]\:left-0:after{left:0}.\[\&\:\:after\]\:h-6:after{height:calc(var(--spacing) * 6)}.\[\&\:\:after\]\:bg-\[linear-gradient\(to_bottom\,_var\(--base\)\,_transparent\)\]:after{background-image:linear-gradient(to bottom,var(--base),transparent)}.\[\&\:\:after\]\:content-\[\'\'\]:after{--tw-content:"";content:var(--tw-content)}.\[\&\:\:before\]\:pointer-events-none:before{pointer-events:none}.\[\&\:\:before\]\:absolute:before{position:absolute}.\[\&\:\:before\]\:right-0:before{right:0}.\[\&\:\:before\]\:bottom-full:before{bottom:100%}.\[\&\:\:before\]\:left-0:before{left:0}.\[\&\:\:before\]\:h-6:before{height:calc(var(--spacing) * 6)}.\[\&\:\:before\]\:bg-\[linear-gradient\(to_top\,_var\(--base\)\,_transparent\)\]:before{background-image:linear-gradient(to top,var(--base),transparent)}.\[\&\:\:before\]\:content-\[\'\'\]:before{--tw-content:"";content:var(--tw-content)}.\[\&\:active\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_12\%\,_transparent\)\]:active{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\:active\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_12\%\,_transparent\)\]:active{background-color:color-mix(in oklab,var(--text) 12%,transparent)}}.\[\&\:active\:not\(\:disabled\)\]\:bg-highlight:active:not(:disabled){background-color:var(--highlight)}.\[\&\:disabled\]\:cursor-default:disabled{cursor:default}.\[\&\:disabled\]\:text-muted:disabled{color:var(--muted)}.\[\&\:disabled\]\:opacity-40:disabled{opacity:.4}.\[\&\:disabled\]\:opacity-45:disabled{opacity:.45}.\[\&\:disabled\]\:opacity-50:disabled{opacity:.5}.\[\&\:disabled\:hover\]\:bg-transparent:disabled:hover{background-color:#0000}.\[\&\:disabled\:hover\]\:text-subtext:disabled:hover{color:var(--subtext)}.\[\&\:focus\]\:border-accent-blue:focus{border-color:var(--accent-blue)}.\[\&\:focus-visible\]\:opacity-100:focus-visible{opacity:1}.\[\&\:focus-visible\]\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.\[\&\:focus-visible\]\:outline-offset-2:focus-visible{outline-offset:2px}.\[\&\:focus-visible\]\:outline-text:focus-visible{outline-color:var(--text)}.\[\&\:focus-visible\]\:outline-solid:focus-visible{--tw-outline-style:solid;outline-style:solid}.\[\&\:focus-within_\.session-menu-btn\]\:inline-flex:focus-within .session-menu-btn{display:inline-flex}.\[\&\:focus-within_\.session-time\]\:hidden:focus-within .session-time{display:none}.\[\&\:has\(input\:checked\)\]\:border-accent:has(input:checked){border-color:var(--accent)}.\[\&\:has\(input\:checked\)\]\:bg-primary-subtle:has(input:checked){background-color:var(--primary-subtle)}.\[\&\:hover\]\:-translate-y-px:hover{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\:hover\]\:rounded-lg:hover{border-radius:10px}.\[\&\:hover\]\:border-\[color-mix\(in_oklab\,_var\(--text\)_34\%\,_var\(--border\)\)\]:hover{border-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\]\:border-\[color-mix\(in_oklab\,_var\(--text\)_34\%\,_var\(--border\)\)\]:hover{border-color:color-mix(in oklab,var(--text) 34%,var(--border))}}.\[\&\:hover\]\:border-muted:hover{border-color:var(--muted)}.\[\&\:hover\]\:border-primary:hover{border-color:var(--primary)}.\[\&\:hover\]\:border-text:hover{border-color:var(--text)}.\[\&\:hover\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_12\%\,_transparent\)\]:hover{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\]\:bg-\[color-mix\(in_oklab\,_var\(--text\)_12\%\,_transparent\)\]:hover{background-color:color-mix(in oklab,var(--text) 12%,transparent)}}.\[\&\:hover\]\:bg-\[var\(--overlay\,_rgba\(0\,_0\,_0\,_0\.05\)\)\]:hover{background-color:var(--overlay,#0000000d)}.\[\&\:hover\]\:bg-canvas:hover{background-color:var(--canvas)}.\[\&\:hover\]\:bg-panel:hover{background-color:var(--panel)}.\[\&\:hover\]\:bg-surface:hover{background-color:var(--surface)}.\[\&\:hover\]\:bg-text:hover{background-color:var(--text)}.\[\&\:hover\]\:text-\[var\(--danger\,_\#d33\)\]:hover{color:var(--danger,#d33)}.\[\&\:hover\]\:text-background:hover{color:var(--base)}.\[\&\:hover\]\:text-text:hover{color:var(--text)}.\[\&\:hover\]\:underline:hover{text-decoration-line:underline}.\[\&\:hover\]\:shadow-\[0_2px_8px_rgba\(0\,_0\,_0\,_0\.08\)\]:hover{--tw-shadow:0 2px 8px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&\:hover\]\:shadow-\[0_3px_12px_color-mix\(in_srgb\,_var\(--text\)_8\%\,_transparent\)\]:hover{--tw-shadow:0 3px 12px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\]\:shadow-\[0_3px_12px_color-mix\(in_srgb\,_var\(--text\)_8\%\,_transparent\)\]:hover{--tw-shadow:0 3px 12px var(--tw-shadow-color,color-mix(in srgb, var(--text) 8%, transparent))}}.\[\&\:hover\]\:shadow-\[0_3px_12px_color-mix\(in_srgb\,_var\(--text\)_8\%\,_transparent\)\]:hover{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&\:hover_\.ft-row-delete\]\:opacity-100:hover .ft-row-delete,.\[\&\:hover_\.md-code-copy\]\:opacity-100:hover .md-code-copy{opacity:1}.\[\&\:hover_\.session-menu-btn\]\:inline-flex:hover .session-menu-btn{display:inline-flex}.\[\&\:hover_\.session-time\]\:hidden:hover .session-time{display:none}.\[\&\:hover\:not\(\.on\)\]\:bg-highlight:hover:not(.on){background-color:var(--highlight)}.\[\&\:hover\:not\(\.on\)\]\:text-text:hover:not(.on){color:var(--text)}.\[\&\:hover\:not\(\:disabled\)\]\:border-border-strong:hover:not(:disabled){border-color:var(--border-strong)}.\[\&\:hover\:not\(\:disabled\)\]\:border-border-variant:hover:not(:disabled){border-color:var(--border-variant)}.\[\&\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\]:hover:not(:disabled){background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:bg-\[color-mix\(in_oklab\,_var\(--primary\)_88\%\,_var\(--text\)\)\]:hover:not(:disabled){background-color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.\[\&\:hover\:not\(\:disabled\)\]\:bg-surface:hover:not(:disabled){background-color:var(--surface)}.\[\&\:is\(\:hover\,_\:focus-within\)_\.project-delete\]\:block:is(:hover,:focus-within) .project-delete{display:block}.\[\&\:last-child\]\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:absolute:not(.active)+.tab:not(.active):before{position:absolute}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:top-2\.5:not(.active)+.tab:not(.active):before{top:calc(var(--spacing) * 2.5)}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:bottom-2\.5:not(.active)+.tab:not(.active):before{bottom:calc(var(--spacing) * 2.5)}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:-left-px:not(.active)+.tab:not(.active):before{left:-1px}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:w-px:not(.active)+.tab:not(.active):before{width:1px}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:bg-border:not(.active)+.tab:not(.active):before{background-color:var(--border)}.\[\&\:not\(\.active\)_\+_\.tab\:not\(\.active\)\:\:before\]\:content-\[\'\'\]:not(.active)+.tab:not(.active):before{--tw-content:"";content:var(--tw-content)}.\[\&\[data-tip\]\:\:after\]\:top-auto[data-tip]:after{top:auto}.\[\&\[data-tip\]\:\:after\]\:bottom-\[calc\(100\%_\+_6px\)\][data-tip]:after{bottom:calc(100% + 6px)}.\[\&\[open\]_summary_\.plan-chevron\]\:rotate-90[open] summary .plan-chevron,.\[\&\[open\]_summary\:\:after\]\:rotate-90[open] summary:after{rotate:90deg}.chat-header .\[\.chat-header_\&\]\:min-w-0{min-width:0}.chat-header .\[\.chat-header_\&\]\:flex-1{flex:1}.chat-header .\[\.chat-header_\&\]\:overflow-hidden{overflow:hidden}.chat-header .\[\.chat-header_\&\]\:text-base{font-size:var(--fs-base)}.chat-header .\[\.chat-header_\&\]\:font-semibold{--tw-font-weight:var(--fw-semibold);font-weight:var(--fw-semibold)}.chat-header .\[\.chat-header_\&\]\:text-ellipsis{text-overflow:ellipsis}.chat-header .\[\.chat-header_\&\]\:whitespace-nowrap{white-space:nowrap}.chat-header .\[\.chat-header_\&\]\:text-text{color:var(--text)}.chat-header.rail-hidden>.\[\.chat-header\.rail-hidden_\>_\&\:first-child\]\:mr-3:first-child{margin-right:calc(var(--spacing) * 3)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.atrule\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.atrule{color:var(--syntax-orange)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.attr-name\]\:text-syntax-green,.openresearch-diff,.file-view) .token.attr-name{color:var(--syntax-green)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.attr-value\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.attr-value,:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.boolean\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.boolean{color:var(--syntax-orange)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.builtin\]\:text-syntax-yellow,.openresearch-diff,.file-view) .token.builtin{color:var(--syntax-yellow)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.cdata\]\:text-syntax-comment,.openresearch-diff,.file-view) .token.cdata{color:var(--syntax-comment)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.cdata\]\:italic,.openresearch-diff,.file-view) .token.cdata{font-style:italic}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.char\]\:text-syntax-green,.openresearch-diff,.file-view) .token.char{color:var(--syntax-green)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.class-name\]\:text-syntax-yellow,.openresearch-diff,.file-view) .token.class-name{color:var(--syntax-yellow)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.comment\]\:text-syntax-comment,.openresearch-diff,.file-view) .token.comment{color:var(--syntax-comment)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.comment\]\:italic,.openresearch-diff,.file-view) .token.comment{font-style:italic}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.constant\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.constant{color:var(--syntax-orange)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.decorator\]\:text-syntax-blue,.openresearch-diff,.file-view) .token.decorator,:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.def\]\:text-syntax-blue,.openresearch-diff,.file-view) .token.def{color:var(--syntax-blue)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.deleted\]\:text-syntax-red,.openresearch-diff,.file-view) .token.deleted{color:var(--syntax-red)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.entity\]\:text-syntax-cyan,.openresearch-diff,.file-view) .token.entity{color:var(--syntax-cyan)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.function\]\:text-syntax-blue,.openresearch-diff,.file-view) .token.function{color:var(--syntax-blue)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.important\]\:text-syntax-red,.openresearch-diff,.file-view) .token.important{color:var(--syntax-red)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.inserted\]\:text-syntax-green,.openresearch-diff,.file-view) .token.inserted{color:var(--syntax-green)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.keyword\]\:text-syntax-purple,.openresearch-diff,.file-view) .token.keyword{color:var(--syntax-purple)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.namespace\]\:text-syntax-yellow,.openresearch-diff,.file-view) .token.namespace{color:var(--syntax-yellow)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.number\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.number{color:var(--syntax-orange)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.operator\]\:text-syntax-cyan,.openresearch-diff,.file-view) .token.operator{color:var(--syntax-cyan)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.parameter\]\:text-syntax-text,.openresearch-diff,.file-view) .token.parameter{color:var(--syntax-text)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.prolog\]\:text-syntax-comment,.openresearch-diff,.file-view) .token.prolog{color:var(--syntax-comment)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.prolog\]\:italic,.openresearch-diff,.file-view) .token.prolog{font-style:italic}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.property\]\:text-syntax-red,.openresearch-diff,.file-view) .token.property{color:var(--syntax-red)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.punctuation\]\:text-syntax-text,.openresearch-diff,.file-view) .token.punctuation{color:var(--syntax-text)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.regex\]\:text-syntax-green,.openresearch-diff,.file-view) .token.regex,:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.selector\]\:text-syntax-green,.openresearch-diff,.file-view) .token.selector,:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.string\]\:text-syntax-green,.openresearch-diff,.file-view) .token.string{color:var(--syntax-green)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.symbol\]\:text-syntax-orange,.openresearch-diff,.file-view) .token.symbol{color:var(--syntax-orange)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.tag\]\:text-syntax-red,.openresearch-diff,.file-view) .token.tag{color:var(--syntax-red)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.url\]\:text-syntax-cyan,.openresearch-diff,.file-view) .token.url{color:var(--syntax-cyan)}:is(.\[\:is\(\&\,_\.openresearch-diff\,_\.file-view\)_\.token\.variable\]\:text-syntax-red,.openresearch-diff,.file-view) .token.variable{color:var(--syntax-red)}@container (max-width:400px){.\[\@container\(\(max-width\:_400px\)\)\]\:grid-cols-\[minmax\(0\,_1fr\)\]{grid-template-columns:minmax(0,1fr)}.\[\@container\(\(max-width\:_400px\)\)\]\:\!flex-row{flex-direction:row!important}.\[\@container\(\(max-width\:_400px\)\)\]\:flex-wrap{flex-wrap:wrap}.\[\@container\(\(max-width\:_400px\)\)\]\:\!items-center{align-items:center!important}.\[\@container\(\(max-width\:_400px\)\)\]\:justify-start{justify-content:flex-start}.\[\@container\(\(max-width\:_400px\)\)\]\:gap-3{gap:calc(var(--spacing) * 3)}.\[\@container\(\(max-width\:_400px\)\)\]\:\[grid-template-areas\:\'name\'_\'meta\'_\'actions\'\]{grid-template-areas:"name""meta""actions"}}@container (max-width:560px){.\[\@container\(\(max-width\:_560px\)\)\]\:grid-cols-\[minmax\(0\,_1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.\[\@container\(\(max-width\:_560px\)\)\]\:flex-col{flex-direction:column}.\[\@container\(\(max-width\:_560px\)\)\]\:items-end{align-items:flex-end}.\[\@container\(\(max-width\:_560px\)\)\]\:gap-1\.5{gap:calc(var(--spacing) * 1.5)}.\[\@container\(\(max-width\:_560px\)\)\]\:gap-x-3\.5{column-gap:calc(var(--spacing) * 3.5)}.\[\@container\(\(max-width\:_560px\)\)\]\:gap-y-\[9px\]{row-gap:9px}.\[\@container\(\(max-width\:_560px\)\)\]\:\[\&\.danger\]\:ml-auto.danger{margin-left:auto}}@container (max-width:960px){.\[\@container\(\(max-width\:_960px\)\)\]\:static{position:static}.\[\@container\(\(max-width\:_960px\)\)\]\:max-h-55{max-height:calc(var(--spacing) * 55)}.\[\@container\(\(max-width\:_960px\)\)\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@container (min-width:500px){.\[\@container\(\(min-width\:_500px\)\)\]\:w-\[min\(100\%\,_720px\)\]{width:min(100%,720px)}.\[\@container\(\(min-width\:_500px\)\)\]\:grid-cols-\[repeat\(4\,_minmax\(0\,_1fr\)\)\]{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(max-width:640px){.\[\@media\(\(max-width\:_640px\)\)\]\:flex-col{flex-direction:column}.\[\@media\(\(max-width\:_640px\)\)\]\:items-stretch{align-items:stretch}.\[\@media\(\(max-width\:_640px\)\)\]\:justify-start{justify-content:flex-start}.\[\@media\(\(max-width\:_640px\)\)\]\:\[\&_\.kv\]\:grid-cols-1 .kv{grid-template-columns:repeat(1,minmax(0,1fr))}.\[\@media\(\(max-width\:_640px\)\)\]\:\[\&_\.kv\]\:gap-\[3px\] .kv{gap:3px}.\[\@media\(\(max-width\:_640px\)\)\]\:\[\&_\.kv_\.v_\+_\.k\]\:mt-\[7px\] .kv .v+.k{margin-top:7px}}@media(max-width:720px){.\[\@media\(\(max-width\:_720px\)\)\]\:flex-wrap{flex-wrap:wrap}.\[\@media\(\(max-width\:_720px\)\)\]\:px-4\.5{padding-inline:calc(var(--spacing) * 4.5)}.\[\@media\(\(max-width\:_720px\)\)\]\:pt-5{padding-top:calc(var(--spacing) * 5)}.\[\@media\(\(max-width\:_720px\)\)\]\:pb-8{padding-bottom:calc(var(--spacing) * 8)}.\[\@media\(\(max-width\:_720px\)\)\]\:\[\&_button\]\:grid-cols-\[65px_1fr_60px_16px\] button{grid-template-columns:65px 1fr 60px 16px}.\[\@media\(\(max-width\:_720px\)\)\]\:\[\&_button_\>_\:nth-child\(3\)\]\:hidden button>:nth-child(3){display:none}}@media(prefers-reduced-motion:reduce){.\[\@media\(\(prefers-reduced-motion\:_reduce\)\)\]\:animate-none{animation:none}}a.\[a\&\:hover\]\:border-muted:hover{border-color:var(--muted)}button.\[button\&\]\:inline-flex{display:inline-flex}button.\[button\&\]\:h-\[13px\]{height:13px}button.\[button\&\]\:w-\[13px\]{width:13px}button.\[button\&\]\:cursor-pointer{cursor:pointer}button.\[button\&\]\:items-center{align-items:center}button.\[button\&\]\:justify-center{justify-content:center}button.\[button\&\]\:border-0{border-style:var(--tw-border-style);border-width:0}button.\[button\&\]\:bg-transparent{background-color:#0000}button.\[button\&\]\:p-0{padding:0}button.\[button\&_\>_svg\]\:transition-transform>svg{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}button.\[button\&_\>_svg\]\:duration-120>svg{--tw-duration:.12s;transition-duration:.12s}button.\[button\&_\>_svg\]\:ease-standard>svg{--tw-ease:ease;transition-timing-function:ease}button.\[button\&_\>_svg\.open\]\:rotate-90>svg.open{rotate:90deg}button.\[button\&\:hover\]\:border-muted:hover{border-color:var(--muted)}}:root{--base:#fff;--canvas:#faf8f4;--panel:#f3f0ea;--surface:#faf7f2;--surface-bright:#fdfbfb;--highlight:#fdf3f1;--chat-annotation-highlight:#b8d4ff;--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;--fs-2xs:10px;--fs-xs:11px;--fs-sm:13px;--fs-md:14px;--fs-base:15px;--fs-lg:16px;--fs-xl:16px;--fs-2xl:18px;--fs-3xl:22px;--fs-4xl:28px;--fs-5xl:34px;--fw-regular:400;--fw-medium:500;--fw-semibold:600;--fw-display:700;--modal-top:min(30vh, 260px);--term-bg:#1a1a1a;--readable-col:840px;--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);--syntax-comment:#a0a1a7;--syntax-text:#383a42;--syntax-red:#e45649;--syntax-orange:#986801;--syntax-green:#50a14f;--syntax-yellow:#c18401;--syntax-cyan:#56b6c2;--syntax-purple:#a626a4;--syntax-blue:#4078f2;color-scheme:light}:root[data-theme=dark]{--base:#0e0c0c;--canvas:#141110;--panel:#221f1e;--surface:#1d1b1a;--surface-bright:#130f0f;--highlight:#393433;--chat-annotation-highlight:#244e7a;--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:#555;--syntax-comment:#7f848e;--syntax-text:#abb2bf;--syntax-red:#e06c75;--syntax-orange:#d19a66;--syntax-green:#98c379;--syntax-yellow:#e5c07b;--syntax-purple:#c678dd;--syntax-blue:#61afef;color-scheme:dark}@keyframes or-pulse{50%{opacity:.35}}@keyframes tool-target-reveal{0%{opacity:0;filter:blur(1.5px)}to{opacity:1;filter:blur()}}@keyframes tool-running-shimmer{0%{background-position:200% 0}to{background-position:-100% 0}}@keyframes tool-running-shimmer-icon{0%,to{color:var(--muted);opacity:.35}50%{color:color-mix(in srgb,var(--text) 58%,var(--subtext));opacity:1}}.tool-running-shimmer{color:#0000;background:linear-gradient(100deg,var(--muted) 12%,var(--subtext) 34%,var(--text) 50%,var(--subtext) 66%,var(--muted) 88%)}@supports (color:color-mix(in lab,red,red)){.tool-running-shimmer{background:linear-gradient(100deg,var(--muted) 12%,var(--subtext) 34%,color-mix(in srgb,var(--text) 58%,var(--subtext)) 50%,var(--subtext) 66%,var(--muted) 88%)}}.tool-running-shimmer{-webkit-text-fill-color:transparent;background-size:300% 100%;-webkit-background-clip:text;background-clip:text;animation:1.75s linear infinite tool-running-shimmer}.tool-running-shimmer::selection{color:var(--text);-webkit-text-fill-color:var(--text)}.tool-running-shimmer-icon{color:var(--muted);animation:1.75s ease-in-out infinite tool-running-shimmer-icon}.tool-active-label{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.tool-group-summary .tool-group-label{transition:color .12s;transform:translateY(-1px)}.tool-group-summary:hover .tool-group-label,.tool-group-summary:hover .tool-chevron{color:var(--text)}.tool-group-disclosure{grid-template-rows:0fr;transition:grid-template-rows .22s cubic-bezier(.2,.75,.25,1);display:grid}.tool-group-disclosure.open{grid-template-rows:1fr}.tool-group-disclosure-inner{min-height:0;position:relative;overflow:hidden}.tool-target-reveal{animation:.18s cubic-bezier(.2,.75,.25,1) tool-target-reveal}.tool-target,.tool-target-more{color:inherit;font-weight:inherit;text-underline-offset:3px;-webkit-text-decoration-skip-ink:auto;text-decoration-skip-ink:auto;text-decoration-line:underline;text-decoration-thickness:.6px;transition:color .14s,text-decoration-color .14s}.tool-line,.tool-group-summary{font-weight:375}.tool-group-rows .tool-line{font-size:var(--fs-md)}.msg-assistant .md table{margin-block:14px;margin-inline:auto}.msg-assistant .md th,.msg-assistant .md td{padding-block:10px}.msg-assistant .md figure{width:fit-content;max-width:100%;margin-inline:auto}.msg-assistant .md img{max-width:100%;height:auto;margin-inline:auto;display:block}.md[data-streaming=true] .katex-error{visibility:hidden}.tool-target{-webkit-text-decoration-color:var(--border-strong);text-decoration-color:var(--border-strong)}.tool-target-more{text-decoration-color:#0000}.tool-target:hover,.tool-target-more:hover{color:var(--primary);-webkit-text-decoration-color:var(--border-strong);text-decoration-color:var(--border-strong)}.tool-target:focus-visible,.tool-target-more:focus-visible{color:var(--primary);-webkit-text-decoration-color:var(--border-strong);text-decoration-color:var(--border-strong);outline:1px solid var(--border-strong);outline-offset:2px}@media(prefers-reduced-motion:reduce){.tool-group-disclosure{transition:none}.tool-target-reveal{animation:none}.tool-running-shimmer{color:var(--subtext);-webkit-text-fill-color:currentColor;background:0 0;animation:none}.tool-running-shimmer-icon{animation:none}}@media(forced-colors:active){.tool-running-shimmer{color:canvastext;-webkit-text-fill-color:currentColor;background:0 0;animation:none}.tool-running-shimmer::selection{color:highlighttext;-webkit-text-fill-color:HighlightText}.tool-running-shimmer-icon{color:canvastext;animation:none}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes title-char-in{0%{opacity:0;filter:blur(4px);transform:translateY(.15em)}}@keyframes settings-spin{to{transform:rotate(360deg)}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0} diff --git a/ui/dist/index.html b/ui/dist/index.html index ef098930..55a26374 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -26,8 +26,8 @@ html { background: #ffffff; } html[data-theme="dark"] { background: #0e0c0c; } - - + +